Sie sind auf Seite 1von 108

Cover.

qxd 12/7/2006 2:12 PM Page 108

Vol. 28 No. 1
NUTS & VOLTS
RING FLASH • CHARGER SWITCH • RS-232 • PICAXE
Propeller Chip Specifications
Power Requirements 500 µA/MIPS @ 3.3 volts DC
External Clock Speed DC to 80 MHz (4 MHz to 8 MHz
with clock PLL running)
Internal RC Oscillator 12 MHz or 20 kHz
System Clock Speed DC to 80 MHz
Cogs 8
Performance 20 MIPS per cog @ 80 MHz
Global RAM/ROM 32 KB RAM / 32 KB ROM
Processor RAM 512 x 32 per cog
I/O Pins 32
Current Source/Sink per I/O 30 mA

January 2007
CoverInside.qxd 12/6/2006 1:07 PM Page 2

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


ESD Safe CPU Controlled
Controlled SMD Hot Air Rework Station
Station Stepper Motors
The heater and air control system are Part #: Motor Frame Holding Torque: Price:
built-in and adjusted by the simple touch Size:
of the front keypad for precise settings. 42BYGH404 NEMA 17 3.4kg.cm/47oz.in $17.95
Temperature range is from 100°C to 57BYGH207 NEMA 23 8kg.cm/111oz.in $24.95
480°C / 212°F to 896°F, and the entire
57BYGH303 NEMA 23 15kg.cm/208oz.in $29.95
unit will enter a temperature drop state
57BYGH405 NEMA 23 20kg.cm/277oz.in $34.95
after 15 minutes of non-use for safety and
85BYGH350B-03 NEMA 34 48kg.in/665oz.in $79.95
to eliminate excessive wear.
Item# CSI825A++ Sale 85BYGH350C-03 NEMA 34 63kg.cm/874oz.in $119.95
•CPU Controlled $149.00!
•Built-in Vacuum System
•Temperature Range:100°C to 480°C / 212°F to 896°F Stepper Motor Contr ollers 2 Phase Microstepping
Microstepping
•15-Minute Stand-By temperature "sleep" mode Stepper Motor Driver (Bi-polar & Unipolar Motors)
•Power:110/120 VAC, 320 W maximum
Part #: Dimensions: MicroStep: Price:
Details at Web Site > Soldering Equipment & Supplies XCW220 100mm x 61mm 1(200), 1/2(400), 1/4(800), $39.95
x 19mm 1/8(1600)
CW220 99mm x 65mm 1/2(400), 1/8(1600) $49.95
Br eadboard / Power Supply / x 30mm
MultiFunction DMM Bundle CW230 115mm x 72mm
x 32mm
1(200), 1/2(400), 1/4(800),
1/8(1600), 1/16(3200),
$59.95
Provides the user with a quick and efficient 1/32(6400), 1/64(12800)
system for breadboarding electronic circuits. CW250 140mm x 94mm 1(200), 1/2(400), 1/8(1600) $69.95
Comes with three built-in regulated power x 45mm
supplies along with a deluxe, easy-to-use CW860 147mm x 97mm 1(200), 1/2(400), 1/4(800), $119.95
breadboard. Included is a multifunction DMM x 30mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800),
with 100VDC, 750VAC, frequency, resist- 128(25600), 1/5(1000),
ance, diode test, audible continuity, transistor 1/10(2000), 1/25(5000),
check,temperature, and capacitance. 1/50(10000), 1/125(25000),
A Super Deal! 1/250(50000)
Details at Web Site
> Breadboards & Prototyping Boards
Only
Powered
Powered Breadboard
Breadboard w/out DMM: $69.00 $69.99! Protek
Protek 2.0 & 2.9GHz Field Str
Strength
ength Analyzers
Item#: PBB272-DMM: $69.99! •Frequency Range : 100KHz ~ 2900MHz 3290N

Powered Breadboard w/Multifunction DMM (CSIMS8264) (2060MHz for 3201N)


•WFM/NFM/AM/SSB modulated signals
You Get The DMM for an Extra $.99 may be measured.
•Sweep Trigger Mode: Free Run, Single
Digital Storage Oscilloscope Module Run, Continuous Wave, Squelch Run
•Sweep Speed: 500 to 2000msec
Convert any PC with USB interface to a high •PLL tuning system for precise frequency
measurement and tuning New
performance Digital Storage Oscilloscope. This
•Built-in Frequency Counter Rev.
Rev. Now
is a sophisticated PC basedscope adaptor pro-
•RS232 interface Available
viding performance compatible to mid/high
level stand alone products costing much more!
Comes with two probes. Item#’s 3290N & 3201N Special
Details at Web Site $1899.00 (for 3290N)
Details & Software Price > Test Equipment > RF Test Equipment $1374.00 (for 3201N)
Download at Web Site Breakthrough!
> Test Equipment > Oscilloscopes/Outstanding Prices
PC based Digital Storage Oscilloscope,
200MHz 5GS/s equiv. sampling USB
interface
Item# 200DSO Only$819.00 Handheld Spectrum Analyzer 2.9GHz
•100kHz to 2.9GHz measurement range
•Measures and demodulates
W-FM/N-FM/AM/SSB signals
SONY Super HAD CCD Color SONY •Sweep mode(Free Run, Single Run, Squelch Run)
Weatherproof
eatherproof IR Cameras Super HAD •PLL tuning system for precise frequencing tuning
•Day & Night Auto Switch CCD™ equipped •100 Saves and loads for waveforms and settings
•Signal System: NTSC camera’s feature dra-
•Image Sensor:1/3" SONY Super HAD CCD •Enhanced Accuracy for Signal Level
•Horizontal Resolution: 480TV lines matically improved Item# PROTEK 7830
•Min. Illumination: 0Lux light sensitivity Special
Details at Web Site
4 8 0n e s Item# VC-827D: $132.00 $2988.00
i > Test Equipment > RF Test Equipment
T V oLl u t i o n
Res
SONY Super HAD CCD B/W SONY Super HAD SONY Super HAD CCD Color
Weatherproof
eatherproof IR Camera CCD Color Camera Weatherproof
eatherproof IR Camera
•Day & Night Auto Switch •Weather Proof •Day & Night Auto Switch
•Signal System: EIA •Signal System: NTSC •Signal System: NTSC
•Image Sensor: 1/3" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super
•Horizontal Resolution: 420TV lines •Horizontal Resolution: 420TV lines HAD CCD
•Min. Illumination: 0Lux •Min. Illumination: 1Lux/F1.2 •Horizontal Resolution: 420TV lines
Item# VC-317D: $59.50 Item# VC-805: $53.95 •Min. Illumination: 0Lux

Details at Web Site > Miniature Cameras(Board,Bullet,Mini’s, B/W, Color) Item# VC-819D: $62.50

Visit our website for a complete listing of our offers. We have over 8,000 electronic items on line @ www.CircuitSpecialists.com. PC based data acquisition,
industrial computers, loads of test equipment, optics, I.C s, transistors, diodes, resistors, potentiometers, motion control products, capacitors,miniature observation
cameras, panel meters, chemicals for electronics, do it yourself printed circuit supplies for PCB fabrication, educational D.I.Y. kits, cooling fans, heat shrink, cable
ties & other wire handleing items, hand tools for electronics, breadboards, trainers, programmers & much much more! Some Deals you won’t believe!
C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
Full Page.qxd 11/8/2006 11:34 AM Page 3

RabbitFLEX A New Way To Customize

• Click-to-ship in 5 days!
• Pay only for what you need
• Revision friendly
• Perfect for prototype and production

RabbitFLEX™ is an unique build system that gives you the Start developing now by ordering the
power to develop custom boards without the hassle and RabbitFLEX Tool Kit and your own
the cost. The RabbitFLEX simple-to-use web interface allows custom RabbitFLEX board. Take your
you to choose from numerous options such as digital I/O, solution to the next level.
analog I/O, serial ports, and Ethernet connections on your
custom board. Just configure and buy online and our patent Configure and Buy Online
pending manufacturing process will deliver your solution www.myrabbitflex.com
Quick-Turn Boards Range From RabbitFLEX Tool Kit
in a matter of days. With RabbitFLEX you will reduce design
risk, manufacturing cost, and development time.
$
149- 279 $ $
199

Test Drive RabbitFLEX $49


Value
Build your custom RabbitFLEX board online. Free
Add a tool kit to your order for a complete Book
development system including Dynamic C®. 2900 Spafford Street, Davis, CA 95616 Tel 530.757.8400
For a limited time
Solutions That Work
www.myrabbitflex.com with kit purchase.
TOC - Jan07.qxd 12/7/2006 7:44 PM Page 4

J A N UA RY 2 0 0 7

08
72 87 40

ON THE COVER ...


Build a Ring Flash for
34 Macro Photography
Page 46
PROJECTS and
FEATURES
34 CONTROL YOUR WORLD
Part 4: Build a gaming exercise
bicycle.
■ By Michael Simpson COLUMNS DEPARTMENTS
40 CHARGE ALL BATTERY 08 TECHKNOWLEDGEY 2006
Events, advances, and news 06 READER FEEDBACK
CHARGER SWITCHER
from the electronics world.
Keep all your batteries charged
and ready for action. 12 STAMP APPLICATIONS 28 NEW PRODUCTS
■ By Kenton Chun Ready ... Set ... Code!
18 Q&A 32 SHOWCASE
46 BUILD A RING FLASH FOR Bypass caps demystified, “B”
MACRO PHOTOGRAPHY battery eliminator, power supply
Get the smallest of details in your ripple meter, plus more. 33 NEWS BYTES
photos with this “flashy“ device.
72 NEAR SPACE
■ By Fernando Garcia BalloonSats, PongSats, and 67 ELECTRO-NET
the Idaho Cluster Bomb.
54 GETTING STARTED WITH
80 THE DESIGN CYCLE 98 CLASSIFIEDS
PICAXE MICROCONTROLLERS Core Networking Development:
Part 1: Are you new to the world Zigbee.
of programmable microcontrollers 100 NV BOOKSTORE
and looking for an inexpensive 87 PERSONAL ROBOTICS
Motor Test Lab — Part 1.
place to start? 102 TECH FORUM
■ By Ron Hackett
94 GETTING STARTED WITH PICs
60 INTERFACING STANDARDS: PIC12F675 Replaces the 555 Timer. 105 ADVERTISERS INDEX
RS-232
There are various common 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
interfaces available and choosing CORONA, CA AND AT ADDITIONAL MAILING OFFICES. POSTMASTER: Send address changes
the best one is not always trivial. 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
■ By Gerard Fonte
4 January 2007
Full Page.qxd 12/6/2006 9:51 AM Page 5

Link Instruments
PC-Based Test Equipment

Digital Oscilloscopes • 2 Channel Digital Oscilloscope


• 500 MSa/s max single shot rate

NEW! • 1Mpt sample memory


250 MSa/S (Dual channel) 512 Kpts
500 MSa/S (Single channel) 1 Mpts
• Advanced Triggering
• Only 9 oz and 7” x 3.5” x 1.5”
• Portable and Battery powered
• USB 2.0
• Advanced Math
• FFT Spectrum Analyzer
• Priced at only $950

Sa/s
500M 1Mpts

Windows
Screenshot

Logic Analyzers
• 40 to 160 channels
• up to 500 MSa/s
• Variable Threshold
• 8 External Clocks
• 16 Level Triggering
• up to 512K samples/ch
• USB 2.0 and Parallel Interface
• Pattern Generator option
LA5240 (200MHz, 40CH) $1700
LA5280 (200MHz, 80CH) $2350
LA5540 (500MHz, 40CH) $2500
Windows Screenshot
LA5580 (500MHz, 80CH) $3500
LA55160 (500MHz, 160CH) $7500

Link Instruments (973) 808-8990


17A Daniel Road East · Fairfield, NJ 07004 · Fax (973) 808-8786

www.Link-instruments.com
January 2007 5
ReadFeed Jan07.qxd 12/7/2006 8:56 PM Page 6

READER FEEDBACK ground and power common (white


EVERYTHING FOR ELECTRONICS

Published Monthly By
wire). Only the hot lead (black wire) is T & L Publications, Inc.
switched from the utility power to the 430 Princeland Ct.
secondary power source. The Nation- Corona, CA 92879-1300
BREAKING THE CODE
al Electric Code allows you a fair (951) 371-8497
In the article "Furnace Backup" amount of design flexibility with your FAX (951) 371-3052
December 2006, the author states secondary power source (ex: genera- Product Order Line 1-800-783-4624
that "Most furnaces require dedicated tor or UPS) as the current they provide www.nutsvolts.com
electrical branch circuits by code." He is limited. Secondly, a UPS can be the Subscriptions
then goes on to show your readers secondary power source. The ground Inside US 1-877-525-2539
how to circumvent the National wire (green) and common wire (white) Outside US 1-818-487-4545
Electric Code and wire their home are still connected at the breaker P.O. Box 15277
furnace in violation of the code. If a panel. The correct kind of UPS can North Hollywood, CA 91615
reader does this, and has a house fire, then be plugged into the generator
FOUNDER/ASSOCIATE PUBLISHER
their insurance company may not transfer switch instead of a generator Jack Lemieux
pay for the fire damages. I hope your as a secondary power source.
readers do not do this. There is still one more big prob- PUBLISHER
There is a way to connect a sec- lem to overcome when connecting a Larry Lemieux
publisher@nutsvolts.com
ondary power source to your furnace. UPS to your house: Make sure you
First, install a UL approved generator know if the UPS can have its charging ASSOCIATE PUBLISHER/
transfer switch to your breaker panel. circuit tied to the same power VP OF SALES/MARKETING
This switch is designed to keep all common as one of its output leads. Robin Lemieux
branch circuits connected to power It may short out. Most UPSs need display@nutsvolts.com
to float both
CONTRIBUTING EDITORS
output wires. Chuck Hellebuyck TJ Byers
Vincent Jeff Eckert Jon Williams
Saladino, Peter Best Phil Davis
Kenton Chun Ron Hackett
PE Gerard Fonte Fernando Garcia
Michael Simpson Paul Verhage
Writer Response:
Thanks for CIRCULATION DIRECTOR
Tracy Kerley
your feedback! subscribe@nutsvolts.com
It is not out
of code to place SHOW COORDINATOR
any appliance on Audrey Lemieux
a UL approved
WEB CONTENT/NV STORE
UPS provided it is Michael Kaudze
isolated in its own sales@nutsvolts.com
dedicated circuit.
There is no PRODUCTION/GRAPHICS
Shannon Lemieux
possible way to
backfeed the util- ADMINISTRATIVE ASSISTANT
ity or significantly Debbie Stauffacher
increase the risk
Copyright © 2007 by T & L Publications, Inc.
of fire by doing
All Rights Reserved
this. It is no dif-
ferent than put- All advertising is subject to publisher’s approval. We are not
ting your televi- responsible for mistakes, misprints, or typographical errors.
Nuts & Volts Magazine assumes no responsibility for the
sion set on a UPS. availability or condition of advertised items or for the honesty
Yes, it is true of the advertiser. The publisher makes no claims for the legal-
ity of any item advertised in Nuts & Volts. This is the sole
that insurance
responsibility of the advertiser. Advertisers and their agencies
companies will agree to indemnify and protect the publisher from any and all
look for any claims, action, or expense arising from advertising placed in
Nuts & Volts. Please send all editorial correspondence, UPS,
reason not to pay overnight mail, and artwork to: 430 Princeland Court, Corona,
claims. Any elec- CA 92879.
6 January 2007 Continued on
Page 68
Full Page.qxd 12/6/2006 1:57 PM Page 7

MICROCONTROLLERS

Ultra-Low Power.
Ultra-Cool Designs.
Hundreds of engineers from more than
100 countries entered TI’s MSP430 eZ
Design Contest. Check out the winning
designs at www.ti.com/designmsp430 and
see how they took advantage of the MSP430’s
ultra-low-power technology and high integration.
Plus be sure to visit the MSP430 VirtuaLab at
www.ti.com/designmsp430, where we make
it free and easy for you to experiment with the
world’s lowest power microcontroller and
develop your own winning designs. And don’t
forget to check out the new eZ430 compatible
MSP430T2012 target board.

NEW!
MSP430T2012 Target Board
3-Pack for $10

T2012: Easy to Use T2012: Easy to Order


• Compatible with eZ430-F2013 • Three T2012 target boards for only $10
• All F20xx devices pin compatible • www.ti.com/t2012
• 10-bit, 200-ksps ADC • Designing with the lowest-power MCU
• Great way to start using the MSP430 just got easier!

Name Contents Includes Devices Supported Price

eZ430-F2013 USB interface and target board MSP430F20xx $20

NEW eZ430-T2012 eZ430 Target Board MSP430F2012 $10 / 3-pack

Technology for Innovators and the red/black banner are trademarks of Texas Instruments. © 2006 TI

August 2006 7
TM
Technology for Innovators
Tech2007.qxd 12/7/2006 7:29 PM Page 8

TECH

2007
KNOWLEDGEY
EVENTS, ADVANCES, AND NEWS
■ BY JEFF ECKERT
ADVANCED TECHNOLOGY
LASER DEFENSE PASSES expected to satisfy the remaining ones avoid collisions with birds. In the US
GROUND TESTS in coming months. The next step will be alone, such clashes have actually
to fire the illuminators in flight at a caused more than $2 billion worth of
PHOTO COURTESY OF BOEING.
missile-shaped image painted on a test damage, destroyed 163 aircraft, and
aircraft as a test of the ABL’s tracking killed 194 people over the last couple
and atmospheric compensation capa- decades, so this is not a trivial matter.
bilities. The complete system — operat- The audio telescope, still in the
ing from a nose-mounted turret — will prototype stage, is based on NIST’s
be able to destroy all classes of ballistic Mark-III microphone array, which is a
missiles in their boost phase of flight. high-performance directional audio
Also under development is the Ad- signal processing system designed for
vanced Tactical Laser (ATL) system, speech-recognition computing sys-
which employs a belly-mounted turret tems in complex sound environments.
in a C-130H gunship to destroy, dam- The bird version will be a 1 m dia.
■ Artist’s concept of the ABL destroying age, or disable targets with little to no concentric array of 192 mikes
Scud-type missiles in launch phase. collateral damage, supporting missions mounted parallel to the ground and

I f you have been wondering what hap-


pened to the concept of a laser
defense system, be advised that the Air
on the battlefield and in urban opera-
tions. ATL will produce scalable effects,
meaning that the operator will be able
aimed upward. By comparing the
arrival time of sounds at different
microphones, the array can get a
Force’s Airborne Laser (ABL) program to select the degree and nature of the directional fix on the sound and even
(affectionately referred to as “reach out damage done to a target by choosing pick up simultaneous sounds coming
and fry someone”) is still under devel- a specific aim point and laser shot from different directions.
opment by Boeing, TRW, Northrop duration. For example, hitting the fuel Using mathematical algorithms
Grumman, and Lockheed Martin. At its tank of a vehicle could result in its to- designed to allow speech recognition
Wichita facility, Boeing (www.boeing. tal destruction, whereas targeting a tire systems to identify different speakers,
com) recently conducted grounds tests might simply stop the vehicle without the system can even distinguish
of the modified 747-400F freighter that injuring the driver. Apparently, the age between bird species by their calls.
will carry a high-energy laser to provide of directed-energy weapons is upon us. For example, it can tell a Canada
early interception of unfriendly missiles. goose from a gull or a hawk. Because
Details are scarce, but the device is AUDIO TELESCOPE TO different species pose different risks,
described as a “megawatt chemical PROTECT AIRCRAFT this can be a useful feature. The
oxygen iodine laser” operating at a device should provide better perform-
wavelength of 1.315 microns.
Although the tests employed a
surrogate laser rather than the real
O n a somewhat less dramatic
scale, researchers at the National
Institute of Standards and Technology
ance than existing X-band radars and
infrared cameras, which cannot make
such distinctions and also are degrad-
thing, the aircraft was fitted with the (NIST, www.nist.gov), Intelligent ed by bad weather.
actual Lockheed Martin beam con- Automation, Inc. (www.i-a-i.com), and
trol/fire control system, which the University of Missouri-Columbia COMPUTERS AND
includes two solid-state illuminator
lasers: one to track the target and the
(www.missouri.edu) have modified
an NIST-designed microphone array NETWORKING
other to measure atmospheric so that it may be used to help pilots WIDESCREEN DISPLAYS
turbulence between the high-energy INTRODUCED
laser and the target. During the tests, ■ The garden variety Mark-III array.
PHOTO COURTESY OF NIST.
results from the illuminator firings
were fed back to ABL, allowing the
surrogate high-energy laser to shoot
down a simulated target.
According to Boeing, the program
achieved most of its objectives and is
8 January 2007
Tech2007.qxd 12/7/2006 9:01 PM Page 9

TECHKNOWLEDGEY 20 07

C onsistent with the trend towards


bigger and more elaborate LCD
displays for less money are two new
as write checks, track expenses, and
reconcile online bank accounts; (3)
track employee time and manage
It was reported elsewhere
(www.messagelabs.com) that spam
constituted 72.9% of worldwide email
models from Gateway (www.gateway. payroll and taxes through integrated in October (an increase of 8.5% over
com): the 24 inch services from ADP®; September); one in every 100.3 emails
FPD2485W (1920 and (4) centralize contained a virus, and one in 190
x 1200 resolution) customer information were phishing attacks. It’s still a jungle
and the 22 inch ■ The FPD2485W and simplify sales and out there.
FPD2285W (1680 x widescreen display. marketing through inte-
1050). Both models
are “universal,”
PHOTO COURTESY OF GATEWAY.
gration with Microsoft
Office Outlook® 2007.
CIRCUITS AND
meaning that they The company isn’t DEVICES
feature multiple being entirely magnani- GADGET OF THE MONTH
analog and digital mous, however, because
video inputs to
provide connectivi-
ty for a wide range of
it also offers premium
online services that
involve additional fees.
A pologies for
running
across this one
PCs and other consumer Plus, it hopes to lure you into too late for
electronic devices, and they employ the $149 upgrade to Microsoft Office the holidays,
Faroudja directional correlation Accounting Professional. But initial but if you’re
deinterlacing (DCDi) to avoid jaggies reviews of the freeware version have stumped for
caused by interpolation (www.meridi been positive. To download it, just a great
an-audio.com/faroudja.) visit www.ideawins.com. Note that birthday or
You also get the new EzTouch™ you need to be running Windows® other pres-
touch-sensitive control system, auto- XP, 2003 Server, or Vista. ent, consider ■ The Bar
rotation capabilities, and a high- the Bar Master Master Deluxe.
fidelity speaker option (for the 24 inch SPAM CHAMPIONS PHOTO COURTESY OF
Deluxe from EXCALIBUR ELECTRONICS.
one only; $69.99 extra). Both ANNOUNCED Excalibur Electronics (www.excalibur
displays offer picture-in-picture (PIP) electronics.net). Yes, it can provide
functionality, allowing users to work
on computer applications while
simultaneously viewing programming
T he IT security company Sophos
Plc. (www.sophos.com) recently
announced that we have met the
you with recipes for more than 1,000
of the most popular mixed drinks, but
it also provides images of the proper
from cable, satellite, or other video enemy, and he is us. Topping the latest glass to use, sound effects (clinking
sources. The list prices are $679.99 “Dirty Dozen” list of spam-producing ice, blender whirring), bar jokes, toasts,
and $399.99, but they have been seen countries is the good old USA, from blood alcohol level calculations, and
lurking on the Internet for a little less. which emanates 21.6% of the world’s other bar-related information. Not bad
supply. In second place, with 13.4% for $29.95. For $49.95, the company
FREE ACCOUNTING is China (including Hong Kong), also offers a radio-controlled drink
SOFTWARE followed by France and South Korea, float that delivers up to five drinks and
with 6.3% each. However, we don’t a bowl of chips to people who are

O ther than the usual flow of patch-


es and bug fixes, you don’t often
get useful software for free. However,
necessarily need to feel all that guilty
about it. According to a senior
security consultant at Sophos, “Most
lounging around in your pool.

SMALL FAN, LARGE FLOW


a couple months ago, Microsoft unsolicited emails are now sent from
(www.microsoft.com) announced the
availability of Office Accounting
Express 2007, a financial management
zombie PCs — computers infected
with Trojans, worms, and viruses that
turn them into spam-spewing bots.
I f you find yourself in need of a very
small source of cooling air, check
out the Super-Flow Micro series of
package designed for early startups In the past, hackers were very high-flowing micro-sized fans from
and home-based businesses that reliant on operating system vulnerabil- Jaro Thermal (www.jarothermal.com).
currently use pen and calculator or ities to convert an innocent computer Designed primarily for PDA, cell
spreadsheets to run their operations. into a zombie. Now they are turning phone, and other limited-space appli-
The package consists of desktop soft- back to malware to trick users into cations, the fans measure only 15 x 15
ware available as a free download plus running their malicious code, and x 6 mm and weigh 1.4 g but, spinning
seven integrated online services. opening the back door to hackers ... at up to 15,000 rpm, move 0.22 cfm.
Features include: (1) online service Hundreds of new versions of the Designed for a 50,000-hour operating
integration with eBay, PayPal® and Stratio worm have helped steadily life, you get a choice of 5V or 12V
Equifax®; (2) the ability to create increase the volume of spam seen models. The price is $5.25 each in
quotes, invoices, and receipts, as well travelling across the net.” manufacturing quantities.
January 2007 9
Tech2007.qxd 12/7/2006 7:29 PM Page 10

INDUSTRY AND THE can help them out; and (3) Nano Venture Showcase, a
venture capital forum showcasing the most promising
PROFESSION nanotechnology start-up companies. Participating
partners include the University of Tennessee, Duke
NANOTECH COMPETITION SCHEDULED University, Florida State University, Georgia Institute of

I f you are involved in nanotechnology, either profession- Technology, and Vanderbilt University. For details, see
ally or as a student, note that a nanotechnology- www.nanonexus.org.
oriented forum, bringing together academia, industry,
and budding entrepreneurs, will be held April 2-4, 2007, BATTERY STANDARDS REVISED
at Oak Ridge National Laboratory (www.ornl.gov). Nano
Nexus 2007 is designed to foster innovation and increase
collaboration between universities, government, industry,
I n the wake of Sony recalling (as of this writing) some
eight million laptop batteries, the Institute of Electrical
and Electronics Engineers (IEEE, www.ieee.org) will be
and the investment community and will also serve as a revising its related standard, IEEE 1625?, “IEEE Standard
component of the Innovation Valley Nano Initiative, an for Rechargeable Batteries for Portable Computing,”
effort to cultivate nanotechnology business in the region. which was approved in 2004. This update “targets an
It will feature three main events: (1) Idea to Product® or improvement in the overall performance of laptop battery
I2P®, a nanotechnology business competition for systems and seeks to address recent calls to make these
university graduate students that involves a $25,000 systems more reliable and robust.” The project, which is
prize; (2) Nano Industry Forum, where representatives expected to include participation by Apple, Dell, Gateway,
from top corporations will present their toughest Hewlett-Packard, IBM, Intel, Lenovo, Panasonic, Sanyo, and
research problems and connect with researchers who Sony, is set for completion in 18 months.

POSSIBLE DVD SOLUTION favor the Blue-ray format (Sony and vs. Betamax battle. But riding in on a
friends) and those who back HD DVD white horse (or possibly a white

A s you probably are aware, there is


a war in the next-generation DVD
market between manufacturers who
(Toshiba et al.). Consumers, as usual,
are caught in the middle, which brings
back tortured memories of the VHS
elephant) is Broadcom Corp.
(www.broadcom.com), which has
developed a system-on-a-chip (SoC)
solution that combines both formats.
The recently-announced BCM7440
Blu-ray/HD DVD SoC offers OEMs a
WWW.POWERWERX.COM
POWER CONNECTOR SUPERSTORE
single-chip media player design that
integrates a multiple-core MIPS®
Standardize Your Power Connectors architecture, a multi-stream HD video
Best choice for New Hams decoder, dedicated graphics engines,
Share Emergency Power • Reusable • Easy to Use DSP-based audio processors, a
Anderson Powerpoles®, Adapters & Accessories security processor, DDR2 interfaces,
integrated video and audio outputs,
and an array of system and network
connectivity interfaces.
It incorporates the decoding,
processing, and memory functions for
both Blue-ray and HD DVD media
players, eliminating the need for
manufacturers to build two different
Build your own
hardware platforms. The chip sup-
or buy assembled
ports audio and video compression
standards required for both formats,
Easy secure including H.264/AVC, VC-1, MPEG-2,
online ordering
Dolby® Digital Plus, Dolby Tru-HD,
and DTS-HD.
The BCM7440 also provides full
backward compatibility for current
Authorized RIGblaster & RIGrunner Dealer
DVD video titles as well as DVD-R,
DVD-VR, and audio CDs. The chip is
Huge savings • lowest prices
currently available in sample volumes
Over 1500 products in stock • Satisfaction guaranteed! as a 761-ball BGA. Pricing is available
on request. NV
10 January 2007
Full Page.qxd 11/8/2006 11:46 AM Page 11
Stamp.qxd 12/6/2006 11:18 AM Page 12

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

READY ... SET ... CODE!


HAVING BEEN A PART OF THE BASIC STAMP COMMUNITY since 1994, I’ve had
the wonderfully-good fortune to meet a lot of experimenters, and — due to my
exposure through Nuts & Volts and six years with Parallax — I’ve been asked
to create a wide variety of projects. One of the most frequently requested, but
that is not really practical with a BASIC Stamp, is a Pinewood Derby racing
timer. Well, now that programming the SX is nearly as easy as programming
the BASIC Stamp, the race timer can finally be realized — and even provide
one-millisecond resolution using nothing but Basic.

I f you’ve read my past articles on


SX/B, you may remember that I’ve
always taken a bit of a cautionary posi-
Still, interrupts should be approached
carefully. With a bit of thought and
planning, we can have interrupts
to monitor the finish line photo-
transistor and Clear and Start inputs.
Note that power and control inputs
tion when it comes to using interrupts. without headaches running on the SX come in and go back out on four-pin
We must always keep in mind in SX/B. In fact, we’ll see that with the connectors. The idea is that this will
that interrupts steal time from the improvements since SX/B 1.51, this make construction of multi-track
foreground program, and we must be project becomes nearly trivial. setups simpler. Since the power con-
particularly mindful when using time- First thing’s first: What does the nection provides 12 volts, the Clear
sensitive instructions like PAUSE, race timer need to do? For starters (no and Start signals are also 12 volts. A
SEROUT, etc. That said, there are times pun intended), the timer should two-resistor divider brings the signal
when using interrupt-driven code is accept a remote start signal so that it voltage down to about 3.8 volts; this is
actually the better choice over linear can be used in single- or multi-track well above the TTL switching threshold
programming. Our race timer is one of setups. We’ll also need a remote clear of 1.4 volts for the SX. Note, too, that
those kinds of projects; especially since signal so that we can reset the time to we’re using the SX comparator input
we want to create a timer with a zero before a race. When running, we to detect finish. By using the compara-
one-millisecond resolution while multi- need to keep track of the time and, tor, we can adjust the input set-point
plexing a multi-digit LED display. most importantly, display it on a five- (with R16) and accommodate a wide
For a compiler that’s absolutely digit, seven-segment display. variety of ambient lighting conditions.
free, SX/B does a fantastic job with Figure 1 (A and B) shows the From the firmware standpoint, the
interrupts — better than most Basic schematic for the timer using an SX28. two most critical elements of the
compilers that cost hundreds of dollars. Much of the I/O is devoted to the program are the event timing and
seven-segment displays, with a few bits display multiplexing — this is where an
■ FIGURE 1A. Lane Timer (display).

12 January 2007
Stamp.qxd 12/6/2006 11:17 AM Page 13

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

■ FIGURE 1B. Lane Timer (main).

interrupt will come in handy. How about if we interrupt the the OPTION register setting. If you change the FREQ value
program every millisecond to update the timer and the dis- or interrupt rate, you can check back to see that the
play — that’s easy, right? Yes, it absolutely is. OPTION register value has, in fact, changed.
Periodic interrupts in the SX are controlled by the Okay, now let’s write the code that runs in the inter-
OPTION register, and when using assembly or SX/B ver- rupt. Before we do that, though, I want to remind you that
sions prior to 1.51, we would have to set this register man- in SX/B we must define subroutines and functions before
ually. This is not a huge hassle, but if we decided to change they’re called. This creates a bit of a problem if we want to
the clock frequency or interrupt rate, we’d have to do it call a subroutine from the interrupt section as the interrupt
again. Well, not any more. Since we want to interrupt the entry must be the first thing in the program. The solution is
program every millisecond — or 1,000 times per second — actually quite simple: we move the actual code to another
we simply tell the SX/B compiler that’s what we want to do: location that comes after the subroutine and function
declarations. Getting to it is as simple as GOTO. So, the
INTERRUPT 1000 interrupt section of the program ultimately looks like this:
INTERRUPT 1000
Yes, that’s it. As of SX/B version 1.51, the compiler will
GOTO INT_HANDLER
calculate the proper value for the OPTION register and will
put it into the startup section. If you want to see this, press Now it’s just a matter of putting the code that runs in
Ctrl-L to see the list file, and then scroll down to the label the interrupt at a label called INT_HANDLER. In case you’re
RESET __PROGSTART; at the end of this section you’ll see wondering, this section does need to use RETURNINT
January 2007 13
Stamp.qxd 12/5/2006 3:20 PM Page 14

instead of RETURN; this is necessary to make sure the clock was running it will halt at that point, allowing us to view
RTCC value is reloaded properly and interrupts re-enabled. the duration of the race until the Clear button is pressed.
Let’s have a look at the interrupt handler: Let’s back up — we haven’t talked about updating the
clock when it’s supposed to be running. I used to work for
INT_HANDLER: a guy who told me that there are no compromises in prod-
IF ops <> M_RUN THEN Next_Digit uct development, but there are choices to be made. Case in
Update_Clock: point: We could store the timer milliseconds as a word and
INC ms the timer seconds as a byte, but then we’d have to use divi-
IF ms = 10 THEN sion to extract the individual digit values for each position
ms = 0
INC hs
and, as you know, division can be computationally heavy.
IF hs = 10 THEN So, I chose to use discrete variables for each clock digit; this
hs = 0 means using five bytes for the timer instead of three, but I
INC ts think the benefits far outweigh the use of two additional
IF ts = 10 THEN
ts = 0 byte variables. By using this approach, we’re able to update
INC sec01 the display segments much more easily (we’ll see that in just
IF sec01 = 10 THEN a bit) and if we chose to modify the program to send the dig-
sec01 = 0 its out serially to a terminal, we’d already have the individual
INC sec10
IF sec10 = 6 THEN digit values in place — again, no division required.
ops = M_STOP Updating the clock in the interrupt handler is easy; we
ENDIF start with the milliseconds digit, ms. It gets incremented and
ENDIF
ENDIF
when it reaches 10, we reset it to zero and increment the hun-
ENDIF dredths digit, hs. You can see that this process ripples through
ENDIF each of the five variables, the difference being that we don’t
clear the tens digit when it reaches its limit, we simply stop the
Next_Digit:
INC digPntr clock at one minute (60 seconds). The choice of using indi-
IF digPntr = NumDigits THEN vidual variables to the timer digits does make the code a little
digPntr = 0 longer in this section, but if you look at the assembly output,
ENDIF you’ll see that there is nearly a 1-for-1 ratio of SX/B to assem-
Update_Segs: bly so the clock update process is happening pretty quickly.
Segments = %00000000 Now that we have a timer that can update and display
READ Dig_Map + digPntr, DigCtrl its value, we need to build the control code for starting,
Segments = display(digPntr)
stopping, and clearing it, and we’ll also need a routine to
Check_Finish: convert the timer digit values to segment patterns for the
IF AtFinish = Yes THEN LED display. Let’s get the program started:
ops = M_STOP
ENDIF Start:
TRIS_B = %00000111
RETURNINT PLP_A = %00000011

Yes, it looks a little long, but as you’ll soon see, this section COMPARE 1, __PARAM1
of code does most of the work for the race timer. In practice,
the timer has three modes: 0) stopped and clear, 1) running, There’s just a couple things going on here — we set the
and 2) stopped. The current mode is held in the variable called cathode control pins to outputs and pull-up the unused pins
ops (mode and status are SX keywords, so they can’t be used). on RA. Next, we start the comparator in mode 1. This mode
If the timer is not supposed to be running then we skip past its activates the comparator with the result bit output on RB.0.
update and move to the next digit of the multiplexed display. An interesting note here is that we do not need to make RB.0
The display update routine points to the next digit (right an output for this pin to operate the LED connected to it; the
to left) and then checks if we need to wrap back to digit comparator output bit is connected directly to the pin. The
zero. Then the segments (anodes) are cleared before read- program will monitor the state of RB.0 to determine if the
ing the current digit pattern from the display array. Clearing opto-transistor is blocked; when it is, the clock will be stopped.
the segments before writing a new value to them creates a Note, too, that we don’t care about the initial output
crisper display to my eye, but you may want to experiment of the COMPARE instruction so we can use one of the
with this. The cathode control value for the current digit is internal variables to receive the result. Since the comparator
read from a DATA table. While we could have generated will continue to run and put its result on RB.0 until disabled,
the proper active-low cathode control value with code, we only need to run this instruction one time.
using a table approach just seemed more elegant. Finally, some may be wondering why we didn’t set
With the display updated, the last thing the interrupt the TRIS_C register for the segment pins (RC). Well, the
section does is check to see if the finish-line opto-transistor is PIN definition takes care of that for us when we use the
blocked. If it is, the mode will be set to M_STOP and if the optional OUTPUT directive like this:
14 January 2007
Stamp.qxd 12/5/2006 3:21 PM Page 15

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

Segments PIN RC OUTPUT variable to M_RUN (1). Remember, the interrupt is always
running (1,000 times each second) so as soon as we update
We couldn’t do this on RB because we have a mixed ops, the display will start changing. Once the car crosses
I/O structure. And now we get to the main program loop — over the finish line and blocks the opto-transistor (which
which really doesn’t have a lot to do. causes the comparator output to go high), the timer will be
stopped by changing its mode to M_STOP (2). In this mode,
Main:
DO we can monitor the Clear input on RA.0 to reset everything.
UPDATE_DISPLAY One of the little-used yet convenient keywords in SX/B is
IF Go = Yes THEN PUT. This command takes a RAM address and a list of one or
IF ops = M_CLEAR THEN more values. The first value is written to the address. If there
ops = M_RUN
ENDIF are more values, the address is incremented and subsequent
ENDIF values written. This makes it really easy to move a set of values
IF Clear = Yes THEN into a section of contiguous RAM that is not part of an array.
IF ops = M_STOP THEN
PUT @ms, 0, 0, 0, 0, 0 Note that we used the @ (address of) indicator with the
ops = M_CLEAR ms variable after PUT. We have to do this because PUT is
ENDIF expecting an address as the first parameter. If, however, we
ENDIF
LOOP use PUT with an array, we don’t need the @ indicator. The
reason for this is that arrays are always treated [internally] as
The first thing that happens is call UPDATE_DISPLAY con- address pointers and offsets.
verts the timer digit values to segment patterns for the LEDs.
Even though we only call this once, I still think it’s a good idea
to encapsulate it into a subroutine so that the program can be
PUTTING IT TOGETHER
somewhat modular. Let’s have a look at UPDATE_DISPLAY. Last month, I used point-to-point wiring on the Menorah
board because most of the hard work was done by Parallax
UPDATE_DISPLAY:
READ Seg_Map + ms, display(0) with the Super Carrier. And while this project could be wired
READ Seg_Map + hs, display(1) point-to-point, I certainly don’t have the patience to do it.
READ Seg_Map + ts, display(2) Enter ExpressPCB. Since I don’t create a lot of printed circuit
READ DP_Map + sec01, display(3) boards, I find the ease-of-use and ordering via
IF sec10 = 0 THEN
display(4) = Blank ExpressPCB.com to be right up my alley. I particularly like that
ELSE the companion program — ExpressSCH (schematic capture) —
READ Seg_Map + sec10, display(4) can be linked to the board file to assist in making connections
ENDIF
RETURN — this was especially useful for the seven-segment displays.
I’ll never be accused of being a PCB layout expert, so I’m
As you can see, this is actually quite simple. READ is not going to spend a great deal of time here. What I want to
used to transfer segment maps from a DATA table into each share with you was my solution for dealing with the displays.
element of the display array. Since we know where the deci- I started by selecting display modules that have rows of
mal point is going to be, simply hard code that into the pro- horizontal pins. Once I had created a custom component in
gram, in this case it will follow the ones digit, and we’ll use a ExpressPCB and dropped five of them onto the board, I found
separate table with digit patterns plus a decimal point — this the easiest way to tie all of the segment signals together was to
saves us the step of adding the decimal point a bit later. If lay down a horizontal buss of eight lines on the top side (red)
you decide to modify the timer to have a variable-position
decimal point, you could always do something like this: ◗ PINEWOOD DERBY TIMER BILL OF MATERIALS
UPDATE_DISPLAY: Designator Value Source
IF DPDigit = 0 THEN ◗ C1 0.47 µF Mouser 80-C320C474M5U
READ DP_Map + ms, display(0) ◗ C2 47 µF Mouser 647-UVR1C470MDD
ELSE ◗ C3-C5 0.1 µF Mouser 80-C315C104M5U5TA
READ Seg_Map + ms, display(0) ◗ D0-D4 Seven-segment, Mouser 859-LTS-5603AG
ENDIF CC
. . .
◗ D5 Red LED Mouser 638-204HT
◗ J1, J2 Mouser 571-6404544
The one slightly-fancy thing we’ll do here is blank the ◗ J4 Mouser 571-6404542
leading zero in the tens digit position; it just makes the ◗ Q1 IR Detector RadioShack 276-142
output more professional looking in my opinion. From a ◗ R1, R3, R5, R14 10K Mouser 291-10K-RC
code standpoint, it’s a simple matter of clearing the ◗ R2, R4 4.7K Mouser 291-4.7K-RC
◗ R6-R14 470Ω Mouser 299-470-RC
segments when the tens digit is zero, or reading the new ◗ R16 100K Mouser 652-3352T-1-104LF
segment pattern when it isn’t. ◗ U1 5V, LDO Mouser 511-LF50CP
To get the timer started, it needs to be in mode zero ◗ U2 SX28AC/DP Parallax SX28AC/DP-G
(defined as M_CLEAR). When we get a high input on RA.1 ◗ X4 Mouser 538-22-01-2027
when in this mode the timer is started by updating the ops ◗ XR1 20 MHz Parallax 250-02060

January 2007 15
Stamp.qxd 12/6/2006 11:18 AM Page 16

■ FIGURE 2. PCB Layout. encourage you to do


is learn to use
ExpressSCH to create
your schematics
before moving on to
ExpressPCB to lay out
the board. I know,
we’re all in a time
crunch but believe
■ FIGURE 3. Race Timer (front).
me, putting your proj-
ect into ExpressSCH first will save you a lot of headaches.
First, it will check all your connections and warn you of
possible problems. Second, you can connect ExpressPCB
to the ExpressSCH so that making connections on the
board is much easier. You can see in Figure 2 that the
pads in blue are supposed to be connected — I promise
that this feature will save you lots of trouble and you’ll be
of the PCB. Each segment is happy you spent the extra time with ExpressSCH.
connected to its respective Construction was straightforward. Like most, I start with
buss lines from the bottom the low-profile components first (resistors) and work my
side (green) of the board way up to the taller components. The connectors are
with a via. A via looks like a soldered on the back, and I didn’t actually put a connector
pad, but it’s smaller and its into J3 (SX-Key/SX-Blitz); I simply used pads with small holes
purpose is to route a signal to make holding the Key/Blitz (equipped with a male-male
between layers. After the header) against the board a little easier. Figures 3 and 4
segments were connected show the front and back of my prototype PCB.
■ FIGURE 4. Race Timer (rear). to the buss, the segment
resistors were connected.
This was the only tricky part of the board layout as traces pass
LET’S RACE!
between pads — no worries, though, there is plenty of room To put this project to work in a Pinewood Derby race track,
and unless one is very clumsy with a soldering iron, there is you’ll need to mount an LED source in the track at the finish line
little possibility of solder bridges. Figure 2 shows the timer and the photo-transistor receiver above it (I used a source/
layout using the standard Mini-Board form factor. detector pair from RadioShack). In my experiments with the
If you haven’t used ExpressSCH and ExpressPCB, do give timer, I found it works best when the photo-transistor is shielded
them a try — the design programs are free, and if you can fit with a plastic tube. With everything in place and powered,
your project into their Mini-Board format (as we did here), you adjust R16 until the finish LED comes on, then back off until it
can get three PCBs for $62 and have them back in three goes off. Make sure that the LED goes full off — if it looks a bit
business days after you place the order. One thing I want to dim then the comparator threshold has been very near the
opto/10K junction voltage and the output is oscillating between
on and off. Back R16 off a bit more until the LED is full off.
Figure 5 shows a suggested master controller for single-
or multi-track setups. There’s not much to this so it could be
wired point-to-point, as I mentioned previously. Don’t leave
out the diodes if you’re going to control a start solenoid
from the power source used for the timer(s). The diodes will
protect the power supply and control inputs to the timer(s)
from any inductive kickback produced by the solenoid.
Okay, it’s time to
get your Pinewood rac-
JON WILLIAMS ers out and get racing.
jwilliams@efx-tek.com With one millisecond
resolution, you hard-
EXPRESSSCH/
RESOURCES
EXPRESSPCB
www.expresspcb.com which car changes
core racers will have
no trouble determining

work and which don’t.


PARALLAX, INC. Until next time,
■ FIGURE 5. Derby Master Controller. www.parallax.com Happy Stamping. NV
16 January 2007
Page17.qxd 12/7/2006 1:13 PM Page 17

(&5"3&"--*'&
3FBEZ TFU HPy
HFUZPVSESFBNKPC
.BLF BZFBS
XJUI/0DPMMFHFEFHSFF

January 2007 17
Q&A.qxd 12/5/2006 2:09 PM Page 18

■ WITH TJ BYERS
QA & WHAT’S UP:
No matter what the project, they
all need a power supply. But there
are so many different kinds, it’s
hard to find the one suited for you.
Here’s a power supply overview.
In this column, I answer questions about all
aspects of electronics, including computer
✓ Bypass caps demystified.

hardware, software, circuits, electronic theory,
troubleshooting, and anything else of interest ✓ ATX makes benchtop supply.

✓ “B” battery eliminator.
to the hobbyist.
Feel free to participate with your questions, ●
✓ Power supply ripple meter.
comments, or suggestions.
You can reach me at: TJBYERS@aol.com ●

circuits on a common line, and charge to smooth out the bump. The
BYPASS CAPS normally consists of an LC low-pass trick is to match the capacitance of
DEMYSTIFIED filter. Decoupling is used to prevent the capacitor to the energy needed to
transmission of noise from one fill the voltage droop while at the
Have you considered doing circuit to another. When used for same time not introduce problems of

Q a column on power supply


bypass capacitors for ICs? All
the datasheets mention
them but it is never clear how to
choose the values or exactly what they
bypassing, decoupling circuits
will often give disappointing, if not
disastrous, results. For this discussion,
I will focus on bypass capacitors.
It all starts with the power supply.
its own. There are two factors in
conflict. For minimum voltage drop,
you need a large capacitance. But the
larger the cap, the more internal
resistance and inductance it comes
do and how they do it. I know they Before voltage ever reaches the IC, it with — another venue for possible
bypass line noise but how do you must run a gauntlet of PC board signal delay. What you need is a
determine the t ype of noise and track resistance, stray inductance, capacitor that’s a compromise
values of the caps? and capacative loading. Taken between the warring factions.
— Al Sanowskis together, these elements represent Calculating the value of the
Ocala, FL time delays. Let’s take the case of a capacitor can be daunting. For those
logic gate driving a capacitive load. readers who like numbers, here are
No, I haven’t given it much When the output of the gate goes the equations. The first calculates

A thought because its akin to


walking into quicksand. Once
you step into the quagmire,
you’re in over your head. But I’ve been
there before, so why not again? First,
high, it draws a surge of current as
the load capacitor charges. Enter the
stray inductance in the track.
Inductors hate a change in current,
and this inductor is no different,
the voltage droop of the power sup-
ply line using the trace inductance
and dI/dt, where dt is the duration of
the power surge. This value can
often be found from the datasheet.
let me define the difference between trying with all its might to prevent the For example, a microprocessor’s
bypass and decouple. The two current from rising to meet the current transients are on the order
terms are used loosely and often demands of the new logic state. As a of one to 20 ns, while a typical
interchangeably. However, they’re not result, there is a dip in the line volt- voltage converter has a reaction
one and the same. age — a dip that can and does affect time of one to 100 µs.
Bypass is the reduction of the performance of the IC and the
high-frequency current flow in a circuit. It is the responsibility of the dI
high-impedance path — typically the bypass capacitor to compensate for dV = L
power input of an op-amp, logic this voltage glitch. dt
gate, or switching device — by It does this by using its stored
shunting the current to ground via a charge. As much as an inductor hates For the sake of argument, let’s say dt is
capacitor. It’s normally used to a change in current, the capacitor 50 ns, the current change is 500 mA,
reduce noise on power supply lines. hates a change in voltage. And to and the stray inductance is 20 nH.
Decoupling is the isolation of two prevent a change, it will give up its Plugging in the values, we get:
18 January 2007
Q&A.qxd 12/5/2006 2:09 PM Page 19

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

0.5 using three different


dV = 2 x 10-8 = 200 mV bypass capacitors in
5 x 10-8 parallel on a single IC
power pin. The 4.7 µF cap
The formula for calculating the bypass is used to catch larger
capacitance is: voltage dips that are at
relatively low frequencies,
dI dt like 120 Hz ripple from
C= the power supply. The 0.1
dV µF cap soothes the funda-
mental frequency, while
(0.5)(5 x 10-8) the .01 µF cap tackles the
C= = 0.125 µF harmonics. ■ FIGURE 1
0.2 When specifying
capacitors for bypass, you also need ■ FIGURE 2
Vcc
Although it’s not spot on, a 0.1 to consider the equivalent series
µF bypass capacitor should fit the bill. resistance (ESR). This is resistance
However, switched current pulses that’s internal to the capacitor and in
Trace
never travel alone. They come with a series with the cap — resistance that Inductance
family — a family of harmonics, or can limit the amount of discharge
overtones. A rise time of 50 ns is current. The lower the ESR, the faster
equivalent to a fundamental frequen- the cap will respond to voltage

+
4.7uF 0.1 .01 Vcc
cy of 20 MHz, which contains third droop. As a rule, larger value capaci-
and fifth harmonics of 60 and 100 tors have more ESR than smaller IC
MHz, respectively. Doing the math, ones. Therefore, it is common to par-
Gnd
we see that 60 MHz and 100 MHz allel two smaller caps than to use one
have bypass capacitor requirements large one for lower overall ESR. But Bypass Example
of .014 and .005 µF, respectively. bypass capacitors have inductance of
Rule of thumb: the higher the their own. Like ESR, this inductance
frequency, the smaller the bypass further limits discharge current. published in magazines (my column
capacitor. For those readers who deal However, parallel resistance is sub- included) and books leave the bypass
better with pictures than numbers, tractive whereas parallel inductance capacitors out. It’s assumed you
the graph in Figure 1 shows examples is additive. So, while ESR decreases know to put them in. Other times,
of capacitance versus switching with additional parallel capacitors, you will find a little row of capacitors
frequency. the inductance increases, thus forc- stuck off in the corner of the
Like overtones, bypass capaci- ing a practical limit on the number of schematic with no apparent function.
tors often cluster together. It’s not parallel capacitors. The ideal bypass These, too, are bypass capacitors, just
uncommon to see more than one capacitor has both zero ESR and collectively bunched for schematic
bypass capacitor hanging off the Vcc zero inductance. See Table 1 for a clarity. When working with any digital
lead of a single IC — with each cap comparison of bypass capacitor circuit, don’t forget the bypass capac-
targeting a slightly different frequen- types. itors even if they aren’t specifically
cy. The circuit in Figure 2 shows me Many schematics that you find expressed.

Tantalum Aluminum Ceramic Polyester Polyethylene Polystyrene Polypropylene Polyphenylene

ESR Low Good Medium Low Low Very Low Very Low Very Low

Inductance Medium Medium-High Low High High Low Medium Medium

Capacitance 0.1-1500 µF 0.1-43,000 µF 0.1 pF-100 µF .0001-160 µF .001-4.7 µF 22 pF-2.0 µF 68 pF-22 µF .0001-1.0 µF

Voltage 2V-125V 6.3V-450V 6.3V-50kV 50V-1kV 16V-400V 50V-630V 50V-3kV 10V-100V

Polarized Yes Yes No No No No No No

Failure Short Open Short Open Open Open Open Open

Size Small Medium Small Medium-Large Large Large Large Medium-Large

Cost High Low High Low Medium Low Medium High

■TABLE 1. Bypass Capacitor Comparison.


January 2007 19
Q&A.qxd 12/5/2006 2:10 PM Page 23

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

when in operation? I would like to make voltage from rising above 11 volts and operating time of four to five hours. This
an AC-powered supply and need destroying the supercaps. The wall-wart is an application just begging for a 21st
to know how much current capacity and supercaps are available from century upgrade.
is required. All Electronics (888-826-5432; www. The 67-1/2 volt battery was just
— Paul allelec tronics.com): 10 VDC 1.2A one of many that were popular in the
wall-wart, CAT# DCTX-1113; 1F, 5.5 heyday of the vacuum tube. Other
The battery is a NiMH pack VDC supercap, CAT# CBC-17. voltages included 22-1/2, 45, and 90

A rated at 2.2 Ah, which means


it can provide up to 6.6 amps
of peak current under heavy
use. But this is not the norm, which is
more likely to be between 0.5 and 2.2
DRY CELL BATTERY
ELIMINATOR
volts. The battery eliminator in Figure
11 supplies all these voltages at
currents up to 15 mA. The circuit
should look familiar — it’s your typical
three-lead linear voltage regulator,
amps. What I would do, instead of over- I have an old Geiger counter with a twist. The twist being the 450
sizing the power supply, is to build a
wall-wart substitute using a supercap.
The wall-wart is sized to accommodate
the steady current, while the supercap
will provide the punch needed for the
Q which used two 67-1/2 volt
batteries for the 135 volts DC
needed to fire the Geiger
tube. What is the cheapest way to
get the 135 volts from the household
volt upper voltage limit of the LR8
linear voltage regulator (available from
Mouser Electronics; 800-346-6873;
www.mouser.com) — which is a far
cry from the 36 volts commonly asso-
surges. I know, you think I’m gonna receptacle? ciated with these devices. Because of
go into a lot of math — that you’ll skip — Bob the high voltages and low currents
anyway — before I get to the bottom involved, certain design elements
line of how to build it. So let’s play this These batteries are very hard can be exploited that aren’t viable for
by the seat of our pants.
Let’s assume one amp will cover
most drilling operations. Let’s also
assume that the only time you need
three amps is when you’re leaning into
A to find — and very expensive
when you do. Moreover, they
were very short-lived, with an
low-voltage, high-current regulators.
Specifically, the 220 ohm resistor in
the filter section. This was common

the bit for, let’s say, five seconds. Skip- MAILBAG


ping the math, that comes to about 0.5 Dear TJ, shown on the schematic. But I
farads. This is easily done by putting In Figure 1 (page 24) of the really like your suggestion of a
two 1F, 5.5 volt supercaps in series November ‘06 issue, how are you voltage doubler because it lets the
across the wall-wart, as shown in Figure getting 10 volts out of an op-amp entire circuit run off a single +5-volt
9. The 1K resistors help to equalize the supplied with five volts and GND? Is source. Here’s your idea in ink
voltage across the caps, which may oth- there some kind of internal voltage (Figure 10).
erwise not be equal due to differences doubler?
in leakage currents. While the adapter — Paul
doesn’t need to be regulated, an LDO Dear TJ,
(low dropout output) linear regulator Response: Good question! Pin 8 With reference to trailer light
(Vcc) of the LMC662 is supposed to monitoring in the June ‘06 issue,
is included to prevent the wall-wart
go to +12 volts, not the +5 volts as here is a simple and non-invasive
way to monitor vehicle lights
■ FIGURE 10 which I installed to check the
+5V 10uF
MAX brake lights in a Mini about 40
+

+ 660 10uF years ago. Find the wire supply-


ing the lights and wrap it two or
three times round a reed relay.
10K AD5220 Connect the relay from the bat-
4093 Vcc tery to a lamp on the dash. When
5V/10V
A current flows, the relay closes
CLK
LMC662 and the tell-tale lamp lights.
w 10K + 5V/10V Changing the number of turns
U/D Out adjusts the sensitivity. In my
case, the tell-tale came on when-
R Up/ B
ever the brake pedal was down. If
+

C Down CS GND 1K a bulb failed, there was sufficient


t = RC x 128 in-rush current through the other
10K 1K lamps to flash the tell-tale light
on braking, but it didn’t stay on.
Trapezoidal Wave Generator — Tom Napier

January 2007 23
Q&A.qxd 12/5/2006 2:11 PM Page 24

■ FIGURE 11 LR8
equipment. Many
220 tubes didn’t have a
IN OUT B+
separate cathode,

+
22uF 22uF ADJ
160V 160V 1uF which forced the
270 Gnd
"B" Battery Eliminator filaments to float
above ground —
22.5V 45V 67.5V 90V 135V so don’t be tempt-
4.7K 10K 15k 20K 30K
ed to tie them
1A together.
200V
12.6V CT Also take note
that this battery
115VAC Battery eliminator has two
Voltage
input transformers,
1N4001 back to back. This
arrangement pro-
1 8 + vides the six volts
4 MAX604 5
AC for the 1.5 volt
1N4001 _ 1.5V source while, at
3 1.2K
the same time,
+

+
2200uF 2200uF
10uF provides isolation
0.1 from the AC line.
4.7K Any 12 volt trans-
former at 0.5A or
better will do,
practice in the old days, and behaves uses a voltage across a fixed resistor to including the RadioShack 273-1365,
like an RC pi network, which permits set the output voltage — the MAX604 if you limit the 1.5 volt “A” battery
smaller filter capacitors with no has a feedback path that defines the current to 300 mA. NV
increase in ripple. output voltage by comparing it to a
Since most tube-operated equip- voltage tapped from an external
ment also used an “A” battery that resistance divider. This arrangement COOL WEBSITES
powered the tube filaments, I proves very stable when regulating Google DOCs is here. So is Google
included a 1.5-volt output at 500 mA. voltages below three volts. Notice that spreadsheet. And Google Desktop.
The best chip for this purpose turns the 1.5-volt source doesn’t share a In fact, Google is becoming a
out to be the MAX604 from Maxim. common ground with the B+ supply. full-fledged PC apps solution.
Unlike the three-lead LR8 — which This is typical of battery-operated tube Check it out.

Sketchup

www.sketchup.com

Writely and spreadsheet

www.google.com/accounts/
ServiceLogin?service=writely&
passive=true&continue=http%3A%
2F%2Fdocs.google.com%2F&ltmpl
=WR_tmp_2_lfty&nui=1

Navigator — search engine

www.google.com/options/
defaults.html

Google Desktop — fun gadgets,


world clock, Reversi, etc.

http://desktop.google.com/

Maps and location navigation

http://maps.google.com/

24 January 2007
Page25.qxd 12/6/2006 11:00 AM Page 25

MODEL 6800 MODEL 6500


80,000 Count 50,000 Count

• +/- 0.05% Basic • 50 Segment Back


DC Accuracy Lit Bar Graph
• Pulse Output • +/- 0.03% DC
with Variable Accuracy
Duty Cycle • RS232 Interface
• Frequency, • dB measurement
mS Pulse Width • AC and AC + DC
and Duty Cycle True RMS
• AC and AC + DC • Frequency,
True RMS Duty Cycle and
• RS 232 Interface Capacitance

$194 User Price $173 User Price

Protek Products are Distributed Nationally. Visit www.protektest.com


for the name and location of your local distributor. Ask for our latest catalog.
45 Smith St., Englewood, N.J. 07631
Tel: 201-227-1161 • Fax: 201-227-1169
Test and Measurement e-mail: sales@protektest.com
January 2007 25
NutNVolt200612.qxd 12/5/2006 3:52 PM Page 26

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 44.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 $9.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 Stereo Super Ear
The stereo Super Ear features an
ultra high gain audio amp with
two sensitive microphones!
Boosts audio 50 times! Includes vol-
ume control. Runs on 3 AAA batteries.
MK136 Stereo Super Ear Kit $9.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, 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 $7.95

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

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!
you do? You don’t live in the base-
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
all those don’t fit here! contacts in the area you want to
detect. The sensor section can even
be remotely located from the alarm!

The Solution! Visit www.ramseykits.com


Free Giveaways and ALL the
Runs on a standard 9V battery (not
included.
MK108 Water Sensor Alarm Kit $7.95
information you ever needed!
NutNVolt200612.qxd 12/5/2006 3:55 PM Page 27

It’s A Great New Year... And Time To Have Fun With Electronics!

Build It, Learn It, Achieve It, Enjoy It!


Electronic Learning Labs 200 in 1 Integrated Circuit Radio Labs
✔ Learn and build! ✔ Larn all about AM and FM
✔ 130, 200, 300, and 500 in one! radio theory and curcuits!!
✔ Super comprehensive training ✔ Build an IC based radio with
manuals! 130 in 1 great reception!
✔ Step-by-step assembly & test
Whether you want to learn the basics procedures!
of electricity, the theory of electronics, ✔ Great to learn about IC’s!
or advanced digital technology, our lab AM/FM
kits are for you! Starting with our PL130, These Superhet AM and AM/FM radio kits
we give you 130 different electronic proj- give you a great introduction to how AM
ects, together with a comprehensive 162 and FM radios actually work! Plus, they are
page learning manual. A great start for the 300 in 1 designed using integrated circuits rather
kids...young and old! than standard discrete components. These
are the perfect kits to learn all about IC
New for 2007, check out the PL200! Its unique design has an design, theory, and troubleshooting! And
integral front panel that includes controls, meter, display and more when you’re done you have an AM or an AM/FM radio AM
500 in 1
for full control of your projects! that has really great reception...that you made yourself!
Not enough? Next is our PL300, which gives you 300 separate electronic projects IC’s, transistors, resistors, capacitors, coils and other parts are easily identified, and
along with a 165 page learning and theory manual. The PL300 walks you through described in theory. The comprehensive manual includes step-by-step assembly
the learning phase of digital electronics. and test procedures, and complete theory. The final alignment section is also pro-
vided to make sure you have a great sounding receiver! 9V battery required.
If you’re looking for the ultimate lab kit check out our PL500. Includes a whopping
500 separate projects, a 152 page starter course manual, a 78 page advanced AMFM108K AM/FM Integrated Circuit Radio Learning Kit $34.95
course manual, a hinged easy to carry case, and a 140 page programming course AM550K AM Integrated Circuit Radio Learning Kit $22.95
manual! The PL500 covers everything from the basics to digital programming!
Learn about electronics and digital technology the fun way and build some neat Surface Mount Soldering Course & Kit
projects! Whichever one you choose, you will have hours of enjoyment!
PL130 130 In One Learning Lab Kit $42.95 ✔ Learn SMT soldering the easy way!
PL200 200 In Super Fun Learning Lab Kit $54.95 ✔ Learn all about those tiny parts!
PL300 300 In One Complete Learning Lab Kit $69.95 ✔ Includes SMT training sessions
PL500 500 In One Advanced Learning Lab Kit $169.95 ✔ End up with a neat “Decision Maker”!
You’re going to have to go there some day, so it might as
well be now! Virtually all electronic designs have gone to Surface Mount
Passive Air Band Aircraft Monitor Technology. SMT components are small, at time the size of a pin head, and require
✔ Monitors the entire aircraft band without very special skills to assemble and solder. Besides good eyes, a magnifying glass,
tuning! and a fine tip soldering iron, you will need to learn exactly how they are attached to
✔ Passive design, can be used on aircraft, no PC boards, how they work, and how to do it!
local oscillator, generates and creates no
interference! This kit takes you through all that, including soldering, desoldering, removing, and
✔ Great for air shows component placement. When you’re done, you have a neat electronic Decision
✔ Patented circuit and design! Maker you can use! Even includes flashing SMT LEDs! Requires a 9V battery.
SM200K SMT Practical Soldering Course & Kit $20.95
This broadband radio monitors transmissions over the entire
aircraft band of 118-136 MHz. The way it works is simple. 3-In-1 Multifunction Soldering Lab
Strongest man wins! The strongest signal within the pass
band of the radio will be heard. And unlike the FM capture ✔ RoHS compatible soldering station!
effect, multiple aircraft signals will be heard simultaneously ✔ Digital multimeter!
with the strongest one the loudest! And that means the ✔ Regulated lab power supply
aircraft closest to you, and the towers closest to you! All ✔ Everything all in one unit!
without any tuning or looking up frequencies! So, where Anyone who has worked with elec-
would this come in handy? tronics knows the hassle of dealing
with various bulky devices needed to get
1. At an air show! Just imagine listening to all the traffic as the job done. This brand new 3-in-1 lab kit gives you the most commonly
it happens required tools in one amazing compact package!
2. Onboard aircraft to listen to that aircraft and associated control towers
3. Private pilots to monitor ATIS and other field traffic during preflight Take a close look! On your left is a multi-function 3½ digit digital multimeter. Its
activities (saves Hobbs time!) large backlit LCD display can be seen from anywhere on your bench while you’re
4. Commercial pilots to monitor ATIS and other field traffic as needed at working. The DMM also features built-in transistor, diode, and continuity testing,
their convenience data hold, and audible alarm.
5. General aircraft monitoring enthusiasts
Next up, the regulated lab DC power supply. Switch selectable ranges of 3V, 4.5V,
Wait, you can't use a radio receiver onboard aircraft because they contain a local 6V, 7.5V, 9V, and 12V provide a continuous duty current of 1.5 amps with a 2 amp
oscillator that could generate interfering signals. We have you covered on that peak! Features both overload protection and overload indication.
one. The ABM1 has no local oscillator, it doesn't, can't, and won't generate any RF
whatsoever! That's why our patent abstract is titled "Aircraft band radio receiver To the right we have a high quality temperature regulated soldering station. One
which does not radiate interfering signals". It doesn't get any plainer than that! would think there’s not much to say about as soldering station but not the case
Available as a through-hole hobby kit for easy do-it-yourself assembly or a factory here. The 24V low voltage iron features an isolated ceramic 48 watt temperature
assembled & tested SMT version to operate right out of the box! Join in the excite- controlled element. Front panel control gives you variable tip temperature control
ment of monitoring your local aircraft the easy way, with our patented tune-free from 150°C to 450°C (300°F to 840°F) and LED indication of power-on and heating-
receiver! Operates on a standard 9V battery, not included. on. It gets even better...it is designed to maintain the temperature required for lead
free soldering! If you’re looking for the latest and the greatest...this is it! 120VAC.
ABM1 Passive Air Band Monitor Kit $89.95
ABM1WT Passive Air Band Monitor, Factory Assembled & Tested $159.95 LAB1U 3-In-1 Multifunction Soldering Lab $119.95

800-446-2295
www.ramseykits.com
590 Fishers Station Drive
MORE than just friendly on-line ordering!
Victor, NY 14564 Clearance Specials, User Forums, Dealer Information, FAQ’s, Kit Building Guides, Downloads, Live
Weather, Live Webcams, and much more!
(800) 446-2295 Get The New 2007
Prices, availability, and specifications are subject to change. We’re not responsible for typos, mistakes, and stupids!
(585) 924-4560 Visit www.ramseykits.com for the latest pricing, specials, terms and conditions. Copyright 2006 Ramsey Electronics, LLC...so there! Catalog Today!
NewProductsJan07.qxd 12/7/2006 2:23 PM Page 28

NEW
■ HARDWARE
■ SOFTWARE
■ GADGETS
■ TOOLS

P R O D U C T S
BECOME A which run at module allows the WPAN-GW1 to be
3.3V up to used as an 802.15.4 network controller
VIDEO GAME 80 MHz. The or router, as well as an Ethernet LAN
DEVELOPER Propeller is and 802.15.4 WPAN Gateway.
programmed in Several 802.15.4 RF modules

I f you have ever thought


about becoming a video
game developer, now is
both a high-level
language, called
Spin™, and low-
based on the TI/Chipcon CC2420
2.4GHz transceiver are available for
evaluating different antenna topolo-
your chance. Parallax, Inc. — a level (assembly) gies. The WPAN-RF1 module uses a
privately held company located in language. PCB inverted-F antenna for minimum
Rocklin, CA — has partnered with The HYDRA Game Console is cost and size. The WPAN-RF2 module
Nurve Networks LLC and Andre’ available on the Parallax website or by uses a PCB folded dipole antenna
LaMothe, best-selling game develop- calling the phone number listed which provides the lowest cost
ment author, to release a new below. solution, but a larger PCB antenna
Propeller powered gaming product, geometry. The WPAN-RF3 module
the HYDRA Game Console! With the For more information, contact: uses an external antenna adding
HYDRA you can develop games, Parallax, Inc. more cost but providing higher anten-
graphics, and media applications. Tel: 888-512-1024 na gain options.
For beginner to intermediate Web: www.parallax.com Open source, real-time operating
coders, you need only basic system software solutions available
programming experience in any with the WPAN-GW1 are FreeRTOS,
BASIC or C-like language. All of the as well as the OSEK/VDX based
hardware and software you need is EMBEDDED PICOS18. For embedded Internet-
included. Additionally, the HYDRA
hardware is covered in detail with
WEB SERVER working, the board also supports the
open source Microchip TCP/IP stack
schematics, descriptions, dozens of
AND 802.15.4 and web server with AJAX support.
games, demos, and tips allowing you NETWORKING Support for the optional WPAN-RF
to take full advantage of its resources, modules is available with the
including its expansion port and 128K
game card.
The HYDRA kit also comes
T he WPAN-GW1 from Micro-
Automata Corporation is an
embedded web server designed for
Microchip Zigbee Stack which
includes the 802.15.4 driver for the
CC2420 transceiver, and the
with Game Programming for prototyping, OEM, educational, and Microchip boot-loader.
the Propeller Powered HYDRA, hobby use, particularly for IP home and Free software development tools
Andre’ LaMothe’s latest work. This building automation networks. The provided by Microchip are the
comprehensive book covers circuit board hardware includes a MPLAB IDE and MPLAB C18 student
everything you need to know about 40 MHz Microchip PIC18F6722 with edition C compiler. Also supported is
game programming for the Propeller 128 Kbytes of program Flash, an the low-cost MPLAB ICD 2 In-Circuit
in Spin and assembly language. RS-232 port, a Microchip ENC28J60 Debugger/Programmer.
All aspects of the Propeller chip Ethernet controller, a 2 Mbyte Atmel For custom hardware design,
are introduced, from its architecture AT45DB161D Data Flash, a protected engineering design packages
to using the Propeller Tool for 5V main DC regulator, a 3.3V are available for the WPAN-
programming. regulator for onboard low GW1 and WPAN-RF circuit
The Propeller chip was released voltage circuits, and boards. Each engineering
by Parallax in April 2006. The chip — an additional 3.3V design package includes
designed at the transistor level — ultra-low noise LDO the CadSoft Eagle
uses a new custom-silicon design for regulator and connector project with schemat-
simultaneous multi-processing. The for an optional WPAN-RF ic file, PCB file,
Propeller is a 32-bit architecture 802.15.4 module. Adding manufacturing files,
consisting of eight processors an optional WPAN-RF parts library, and a

28 January 2007
NewProductsJan07.qxd 12/7/2006 2:23 PM Page 29

■ 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

hardware design and theory of opera- magnification in horizontal sweep, Trigger for stable displays, X10
tion manual. Designs are compatible trigger signal output and TV synch horizontal magnification, Z axis
with the low-cost CadSoft Eagle filter are also standard. modulation, along with a high bright-
standard and academic versions. The Model 6030C is priced at ness 8x10 cm CRT with internal
The WPAN-GW1 is available as a $484 MSRP, complete with probes, graticule.
stand-alone circuit board for $89 or test leads, line cord, and operating The Model 6020 is offered
as a complete kit with enclosure, manual. complete with all test probes and
universal power supply, and The 20 MHz bandwidth Model manual for $449 MSRP.
communication cables for $119. The 6020 features Alt-Mag sweep for the
WPAN-GW1 engineering design simultaneous display of the main and For more information, contact:
package will be available for $49. X10 magnified waveform. This light- Protek Test &
The WPAN-RF1 and WPAN-RF2 weight, low power (40W) entry also Measurement
modules will be available for $29. The provides Alternate Trigger and Auto Web: www.protektest.com
WPAN-RF3 module will be available
for $39. Each WPAN-RF module
engineering design package will be
available for $39.

For more information, contact:


MicroAutomata
The Mouser Advantage:
Corporation
Tel: 256-513-4775
Faster Time to Market for
Email: sales@microauto
mata.com
YOUR New Designs!
Web: www.microautomata.com

NEW DUAL TRACE


ANALOG SCOPES

T wo new value-added, 20 MHz and


30 MHz dual trace analog scopes
— one featuring a component tester and
the other alternate magnification — are
now available from Protek Test &
Measurement, a division of Intelient Experience Mouser’s time-to-market
Technologies, Inc. advantage! Our vast selection of the
Equipped with a high brightness NEWEST products, NEWEST technologies,
CRT, the 30 MHz bandwidth Model new catalog every 90 days, no minimums,
and same-day shipping on most orders,
6030C has a built-in component tester
gets you to market faster. We make it easy The Newest Products
which tests inductors, capacitors, and
to do business with Mouser! For Your Newest Designs
diodes via a characteristics waveform
displayed on the screen. This capabili- mouser.com (800) 346-6873
ty is push-button activated. In
addition, the instrument features
Alternate Trigger for display stability, 1
mV sensitivity vertical input, and X10 The NEWEST Semiconductors | Passives | Interconnects | Power | Electromechanical | Test, Tools & Supplies from Mouser Electronics

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

January 2007 29
NewProductsJan07.qxd 12/7/2006 2:23 PM Page 30

■ 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

Milliohm Tester’s, 4136mO & 4137mO. four terminal measurements, three test
SEW DIGITAL The 4136mO has a power source of current with over-temperature protec-
MILLIOHM TESTER 110 VAC or 230 VAC and the 4137mO tion, protection against inadvertent
of 12 VDC. These testers are for connection to over-voltage, large LCD,
measuring low ohms to detect any high potential lead resistance, current lead
potential lead junction resistance in resistance checks, a future optional
compression or solder joints. It can be rechargeable battery, and an O-Ring
used by manufacturers, maintenance, sealed case. Both include full-featured
engineers and anyone else trying to EnerSave™ inside with EnerSave
analyze if there is resistance where there AUTO-HOLD and AUTO-OFF. They
shouldn’t be. measure down to 100 uΩ, five ranges

H oyt Electrical Instrument Works


now offers the SEW Digital
Both of these lightweight, robust,
and compact Milliohm Testers feature
from 200.0 mΩ to 2000 Ω, and have a
minimum resolution of 100 uΩ.
Price is $455; in stock now.
For more information, contact:
Hoyt Electrical
Instrument Works, Inc.
23 Meter St.
Penacook, NH 03303
Tel: 603-753-6321
Fax: 603-753-9592
Email: info@hoytmeter.com
Web: www.hoytmeter.com

CIRCUIT WIZARD
NOW INCLUDES
BREADBOARD
SIMULATION!

N ew Wave
Concepts
of Cambridge,
UK, announces
the release of Circuit
Wizard v1.1. This
improved version adds
a whole host of new features
including PCB current flow animation,
quality checking for identifying PCB
faults, and subsystem modelling. Circuit
Wizard v1.1 also includes breadboard
simulation, which allows users to
select from a wide range of different
breadboards and then add components
and hook-up test instruments. Circuit
Wizard’s breadboards are ideal
for learning about the real things and
make it quick and easy to prototype
project ideas.

For more information, contact:


New Wave Concepts
Tel: 800-535-8469
Email: armand@kelvin.com
Web: www.kelvin.com

30 January 2007
Full Page.qxd 12/5/2006 4:06 PM Page 31
ShowcaseJan07.qxd 12/6/2006 10:45 AM Page 32

SHOWCASE

PP:KLWH
ZDWHUFOHDU
/('9
PFG
$% 

VHFRQGYRLFHUHFRUGHUSOD\EDFNPRGXOH
SUHDVVHPEOHG  $ 
7KH9HOOHPDQ3HUVRQDO6FRSH
LVDFRPSOHWH06VSRUWDEOH

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

PRINTED CIRCUIT BOARDS


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

■ NEWS ■ I N N O VAT I O N S ■ IDEAS

GADGET GEEKS GET


NEWS BYTES dardize 100G Ethernet over distances
THEIR OWN SEARCH
as far as six miles over single-mode
ENGINE
fiber optic cabling and 328 feet over

R etrevo (www.retrevo.com) is the first


dedicated search engine specifical-
ly for gadget geeks to research consumer
multimode fiber.
With the approval to move to
100G Ethernet, the next step is to form
electronics, check community buzz, find a 100G Ethernet Task Force to study
pre-purchase information, and get prod- how to achieve a standard that is tech-
uct documentation for technical support nically feasible and economically
and troubleshooting. viable, says John D’Ambrosia, chair of
Using Retrevo, gadget lovers will find the IEEE HSSG, and scientist of compo-
complete coverage for 12 categories, in- nents technology at Force10 Networks.
cluding cell phones, smartphones, cam- “There is still a lot of work to be
eras, camcorders, home audio and home done to finalize our objectives, and
video, portable audio and portable video, where this thing will go,” D’Ambrosia
What’s New printers, and wireless networking (WiFi). says, adding that a formal task force
“We all hear about the latest and could be approved by July 2007. A
In The Forums? greatest gadgets, but with so many cool completed 100G Ethernet standard
If you haven’t been to the Nuts & Volts new toys, it’s impossible to get good in- might appear by 2009 or 2010. “The
forums lately, you’ve likely missed out formation to buy the right product and next step is getting the project into the
on a lot of great discussions.There are make it work with the ones we already 802 process,” he adds, referring to the
over 4,000 registered users and have,” said Vipin Jain, CEO, Retrevo. IEEE’s umbrella of Working Groups for
over 40,000 posts covering every “And when it comes to product docu- networking standards, which govern
electronics topic imaginable. mentation — forget it.” “Retrevo has al- everything from wired Ethernet and
Here are some recent topics that ready searched all the manufacturers’ Token Ring to wireless LANs and
have been in discussion. sites so you don’t have to.” WiMAX.
➥ Car Tachometer Interface Retrevo uses proprietary algorithms The need for 100G Ethernet is
➥ Using A Light Dimmer On LEDs to crawl, collect, analyze, and classify all growing as IP video and transaction-
➥ Testing Car Battery Draw known information for consumer elec- intensive Web 2.0 applications are
➥ Reversing Motors tronics products. The company’s ma- exploding across the Internet.
➥ Drill Bit Sharpening chine learning technology performs deep Companies such as YouTube regularly
➥ 4050 Non Inverting Hex Buffer content analysis, classification and re- add 10 Gbps service pipes to meet
➥ Monitoring Specific Gravity trieval, so you get the right answers right growing demand, and carriers will need
away. a better way to aggregate such links,
➥ Christmas Light Fun
“Every geek knows information is industry watchers say.
Current forums include: king,” said Charles Wilson, VP Market- The challenge for 100G will be to
ing, Retrevo. “As gadget geeks ourselves, push Ethernet to a megabits-per-second
General Electronics we set out to create a comprehensive speed that does not currently exist
Discussion consumer electronics research site that under any standard. Examples of past
Computers would address the full lifecycle of the leaps in Ethernet speeds, which fol-
Robotics products we buy, install, connect to oth- lowed the lead of other technologies
Programming er devices, and ultimately fix or replace.” include: Fast Ethernet, followed the 100
New ➥ Up For Grabs Mbps FDDI standard; and 10G
IEEE SETS NEW Ethernet, which used the 9.9 Gbps OC-
Check out the new forum Up For
ETHERNET SPEED 192 SONET as its base. In each case,

T
Grabs. It’s the place to post any elec-
tronics items for sale, trade, or to
he next Ethernet speed will be 100 resulting Ethernet standards borrowed
give away to a good home. It’s for pri- Gbps, the IEEE (Institute of Electrical components and encoding techniques
vate party (personal) items only. No com- and Electronics Engineers) voted recently. used in the existing non-Ethernet stan-
mercial vendors allowed. Oh yeah, and it’s Now the standards body just has to go dards.
FREE. build something never done before. While a comparable 100 Mbps
So, don’t throw out that junk you’re The IEEE’s High Speed Study standard does not exist now for
not using — it may be just what a Group (HSSG), tasked with exploring Ethernet to emulate, D’Ambrosia antic-
budding electronics hobbyist needs to get what Ethernet’s next speed might be, ipates this will not be too great a chal-
that project finished! voted to pursue 100G Ethernet over lenge for work on 100G. A 100G stan-
other considerations, such as 40 Gbps dard will probably use parallel data
Check it out for yourself today!
Ethernet. The IEEE will work to stan- Continued on Page 71
www.nutsvolts.com January 2007 33
Simpson.qxd 12/5/2006 2:01 PM Page 34

PROJECTS ●●●●
■ THIS MONTH’S PROJECTS
Control Your World — Part 4 . . .34

Battery Charger Switcher . . . . .40

Macro Photography Ring Flash . .46

■ LEVEL RATING SYSTEM


CONTROL
YOUR WORLD
To find out the level of difficulty PART 4 — Build a Gaming
Exercise Bicycle
for each of these projects, turn
to our ratings for the answers.

●●●● . . . . Beginner Level


I n this installment of Control Your
World, I am going to show you
how simple it is to use a microcon-
use another wheel and pedal set.

Encoder
●●●● . . . . Intermediate Level
troller in this quest for control. In order to gather speed and
While the project may look very direction information from the exer-
●●●● . . . . Advanced Level
complicated, it has been presented cise bike, we need to use a rotary
in such a way that anyone with even encoder, sometimes called a quadra-
●●●● . . . . Professional Level the slightest soldering skills should ture encoder. We will be using the
be able to complete the project. CT3002 shown in Figure 2. These are
available for under $3 from Digi-Key.
I am always on the Components Needed
for the Project Microcontroller Interface
lookout for ways to In order to read the encoder and
Steering Wheel send the data to the steering wheel, we
make exercising The first and most important item need to use a microcontroller. For this
more fun. you will need is a steering wheel con-
troller used to connect to your PC.
project, we will be using the DiosPro
microcontroller available from Kronos
I started digging through my Robotics (www.kronosrobotics.com).
A while back, I was attic and found a Microsoft We will be using a 40-pin version of
searching for an Sidewinder steering wheel shown in
Figure 1. I don’t think Microsoft man-
the DiosPro shown in Figure 3.

exercise bike that had ufactures these any more, but you Digital Potentiometer
a steering wheel and can pick one up online new or used.
Please note before we move on
To interface to the steering
wheel, we need to simulate two
would let me hook it that just about any wheel and pedal pedals. The two pedals are actually
up to my PC so I set will work. You will have to make
adjustments accordingly, and I will
two potentiometers. We will be
using a Microchip MCP42010 to
could play my favorite show you the areas that will need replace the two potentiometers
racing games and special attention if you decide to used by these pedals.
The 010 in the
exercise at the same ■ FIGURE 1 ■ FIGURE 2
part number indi-
time. There are a few cates that the digi-
tal potentiometers
systems on the Net, but are 10K. If you are
they are outrageously using some other
steering wheel, you
expensive and only will need to deter-
work on console mine the values of
the potentiometers
systems. in the pedals.

34 January 2007
Simpson.qxd 12/5/2006 2:01 PM Page 35

BY MICHAEL SIMPSON

Microchip makes 10K, 50K, and 100K


digital pots. You will need to purchase
the chip that best matches your pedals.

Other Components
We will be using a Dios Workboard
Basic shown in Figure 5 as our elec-
■ FIGURE 3 ■ FIGURE 4
tronic building platform. It has every-
thing we need to program the DiosPro
and power our circuit. It has a very large wards, you basically put on the brakes or rectifier and regulator on board so it will
prototype area that is indexed so I can go backwards, depending on the game. accept both AC and DC for input
give step-by-step instructions for all the power. The MCP is connected to the
connections necessary to build this Construction Dios via an SPI interface. The MCP digi-
project. If you use this board, the level tal potentiometers are then connected
of difficulty for this project is 1. Without Let’s start by taking a look at to the steering wheel using an RJ11 jack.
the board, it is a 3 or 4. Schematic 1. The main component The encoder is connected to
labeled DiosWB is the Dios Workboard. ports 0 and 2. Port 1 is set as an
10,000 Foot Overview All the connections indicated are output and driven low to provide Vss
labeled on the board. The Workboard to the center terminal of the encoder.
Before I jump into construction, has a built-in RS-232 driver that only Normally, we would need to hold
let me give you a high-level overview requires a nine pin cable in order to ports 0 and 2 high with pull-up
of the project. program the Dios. It also has a bridge resistors, but the Dios has the ability
An encoder is mounted on your
exercise bike. This encoder is connect-
ed to a Dios microcontroller. The Dios
determines the speed and direction
the encoder is going and sets the val-
ues of the two digital potentiometers
in the MCP chip via an SPI interface.
The digital potentiometers are
then connected to the pedal interface
on your steering wheel. The steering
wheel is connected to your PC just as
it normally would be.
As you play your favorite game,
pedaling forward is the same as hitting
the accelerator. The faster you pedal, the
faster you go. When you pedal back-

■ FIGURE 5

■ SCHEMATIC 1

January 2007 35
Simpson.qxd 12/5/2006 2:02 PM Page 36

■ SCHEMATIC 2

■ FIGURE 7

Workboard are the markings P0-P25.


These are connected directly to the Dios
chips I/O ports. In this step, we are going
to insert the three-pin header section
value of the potentiometers used. into the ports marked 0-2 as shown in
■ FIGURE 6 Figure 6. Hold the header in place and
By the Numbers solder on the underside of the board.
to apply internal pull-ups to ports 0-7.
Notice that we have added poten- If the main schematic looks • Step 3: The Workboard prototype
tiometer R1. The wiper is connected complicated, don’t worry; these area has pad markings A-Q along the
to port 21 which we will configure as step-by-step instructions will walk you sides and R-Y along the top. These
a 10-bit A/D input port. By connecting through the construction. markings are explained in the
the two other leads to Vss and Vdd, Let’s start with the main board. Workboard manual.
we can monitor the setting of the pot As you place the jumpers, solder
and use it to create a multiplier. Think • Step 1: You need to assemble the each one on the underside of the board.
of this as a turbo boost. When set to Workboard now. It comes with its own Using the pad markings, place a
minimum, the multiplier is set to 1. step-by-step assembly instructions. jumper from XO2 to VDD as shown
When set to max, the speed you are When completed, it should like the by the red jumper in Figure 7. Make
pedaling will be multiplied by 32. board in Figure 5. Notice the large pro- the following connections: YL4 to
The Sidewinder pedals are wired totype area at the bottom of the board. P22, YM4 to P23, YN4 to P24, and
as shown in Schematic 2. The MCP This is where we will do the remainder YO4 to P25 as shown in Figure 7.
must be wired the same way. If you are of the assembly as we proceed. Take your 14-pin socket and solder
using a game controller other than the it into the position shown in Figure 7.
Sidewinder, you will need to determine • Step 2: Break off a three-pin section Note that pin 1 of the socket (marked
the wiring hookup. In most cases, you from the 40-pin header. You can use by the arrow) is located on pad YO2.
have to open up the pedal section to wire cutters to make the job easier. You These connections connect the
determine this. Once you determine will notice on the right and left side of MCP chip to the Dios chip. We are
the wiring, you can also determine the the prototype area on the Dios supplying Vss to the MCP via port 22
of the Dios when we pull the port low.
■ FIGURE 8 ■ FIGURE 9
• Step 4: We need to connect two

■ FIGURE 10

36 January 2007
Simpson.qxd 12/5/2006 2:03 PM Page 37

Control Your World — Part 4

■ FIGURE 13

■ FIGURE 11 ■ FIGURE 12

jumpers: one from XI2 to YI3 and the on the RJ11 jack. Use some double-stick ter pins are used. Use some needle
other from XK2 to YK3 as shown in tape to attach the jack to the board nose pliers to remove the unused pins.
Figure 8. The easiest way to do this is as shown. The jack I used came with a Take a strip of Plexiglas, com-
from the underside of the board (see self-stick pad, shown in Figure 13. pressed PVC, or wood about 1” x 4” x
Figure 9). Note that these jumpers are Make sure you situate the jack so 1/8” and attach the encoder as shown
specific to the Sidewinder joystick. that it can be accessed once attached. in Figure 16. Take the wheel and drill a
1/4” hole through the center and slip it
• Step 5: For the turbo potentiometer, • Step 8: Connect the four wires as over the shaft of the encoder as shown.
you need to make the following con- follows: Red = YK4, Green = XJ1, Black = If it’s not a tight fit, you can take a pair
nections: HD3 to P21, HA4 to Vss, and YJ4, and Yellow = YI4. Slip the RJ11 jack of pliers and indent the shaft.
HG4 to Vdd as shown in Figure 10. cover in place as shown in Figure 14. I list a wheel in the Parts List, but
Insert the Dios chip into the 40-pin sock- you may find that another wheel
• Step 6: In order to connect the turbo et. The notch should be facing left. Insert works better. I have used R/C aircraft
potentiometer, you need to solder a the MCP chip into the 14-pin socket. The wheels with success.
header to the potentiometer leads. The notch should be facing down.
turbo potentiometer is a 10K linear-taper. The board is now complete. If you • Step 10: Each and every exercise
Break off a seven-pin header. Insert the wish, you can attach a knob to the bike is different, but I have three and
short end into the potentiometer leads turbo potentiometer. the attachment is similar on all of
and solder in place as shown in Figure them. Using double stick tape, attach
11. Note that only the ends and center • Step 9: We need to attach a header the encoder assembly to the bike in
pins on the header are used. to the encoder. This header will allow such a way that the main drive wheel
Insert the header into the pads us to create a removable cable. Cut a or pulley causes the wheel on the
shown in Figure 12. The end pins are five-pin header from your header stock encoder to rotate. If your bike has a
inserted into pad HA1 and HG1. The and attach it to the encoder as shown clutch that allows the fly wheel to spin
center pin is inserted into pad HD1. in Figure 15. Only the outside and cen- when the pedals are stopped, you will
Solder the pins on
the underside of the ■ FIGURE 15 ■ FIGURE 16
■ FIGURE 14
board and cut off
the excess.

• Step 7: You will


need about 5” of
four conductor
telephone wire.
Remove the wires
and strip about 1/4”
off each end. Attach
one end of each
colored wire to the
corresponding color

January 2007 37
Simpson.qxd 12/5/2006 2:03 PM Page 38

■ FIGURE 17 ■ FIGURE 18 ■ FIGURE 19

need to attach it to the encoder so ping a small piece of heat shrink over that I got off eBay for $50.
that it comes in contact with the drive the wires before attaching. While this is Steering wheel controllers were
side connected to the pedals. not necessary, it will make the connec- designed to mount on a table, so the
Notice that I used a machine tions stronger and less prone to failure. best system for mounting one on an
screw to attach my encoder. This Run the cable along the frame of exercise bike is to mount a small board
involves a bit more work, but the the bike until you get to a location where on the handle bar, then mount the wheel
connection is more permanent. you want to mount the Workboard and on that board. On my first bike, I mount-
cut the excess cable. Strip the ends of ed a single 2’ x 1’ board on the handles.
• Step 11: Take about 7’ of the the three wires corresponding to the I had enough room to sit a laptop on it
telephone cable and strip 1/4” off the other end of the cable. Attach these to a and had a completely contained system.
ends of three of the wires. Cut a five- three-pin female header. Make sure the Sears sells a couple of bikes by
pin section from the female header center lead is the same as the center WESLO. The recumbent version
and attach the three stripped leads to lead attached to the center lead on the would be a perfect candidate. At
the two outside pins and center pin as encoder. Again, I recommend using heat $149, it is probably the best value,
shown in Figure 18. I recommend slip- shrink on the three connections. and it has a handle bar configuration
Slip this end that would be very easy to mount a
of the cable on the steering wheel to. I prefer the recum-
ITEM PART NO. SUPPLIER
❑ 10K Linear-Taper 271-1715 RadioShack
three-pin header bent bikes for a project like this as
Potentiometer attached to ports they are much more comfortable.
❑ One-Inch Control Knob 274-433 RadioShack 0-3 back in Step 2. Note that with most bikes you will
❑ Four-Conductor 278-0872 RadioShack need to remove or relocate the built-in
Telephone Cable 50’
• Step 12: computer. I no longer use the original
❑ Quadrature Encoder CT3002-ND Digi-Key
❑ 10K Digital MCP42010-I/P-ND Digi-Key Probably the computer on the WESLO bikes, but
Potentiometer largest challenge in it was great for getting an idea on
❑ DiosPro 16429 Kronos Robotics this project is how how far or what kind of calories I was
❑ Dios Workboard Basic 16453 Kronos Robotics to mount the steer- burning for each race.
❑ 40-pin Male Header 16290 Kronos Robotics
❑ 14-pin Socket 16279 Kronos Robotics ing wheel to your
❑ 36-pin Female Header 16291 Kronos Robotics bike. Again, every Testing the System
❑ Plastic Wheel 16512 Kronos Robotics bike is different.
❑ Heat Shrink 16287 Kronos Robotics The bike shown in First Test: I have included a program
❑ AC Adapter 16500 Kronos Robotics
❑ Nine-pin Cable 16259 Kronos Robotics Figure 19 is a com- called EBikeTest.txt. Use the Free Dios
❑ Dios Compiler (Free): www.kronosrobotics.com/ plete rebuild of an Compiler (refer to the parts list) and this
downloads/DiosSetup.exe upright bike that I code to program the DiosPro chip. The
converted to a program will start to spit out two num-
OTHER
❑ Surface Mount RJ100 Jack — This can be found at most recumbent bike. I bers. The first is the number of units the
home centers. The smaller, the better.The one I used was a RCA removed the origi- pedals have moved in the last 200 ms.
#TP266WH purchased at Home Depot. nal handle bars When you move the pedals for-
❑ Tie Wraps —These can be purchased from various sources. and replaced them ward, the value will be negative. When
Many home centers, as well as RadioShack sell them. with a table, where moving backwards, the value is posi-
I mounted a com- tive. If this doesn’t happen, simply pull
❑ Double-Stick Tape — This can be purchased at just about
any department store.
plete dedicated the encoder cable off the three-pin
computer system header and flip it over. This will reverse

38 January 2007
Simpson.qxd 12/6/2006 11:08 AM Page 39

Control Your World — Part 4


the direction. Notice that the faster also add a sensor that detects the If you have figured out the pedal
you pedal, the higher the number. amount of resistance set and adjust connections for other steering wheels,
The second number is the multipli- the turbo accordingly. Try networking let me know and I will try and add
er which is controlled by the turbo two computers! Most PC games allow them to the project. Be sure to visit
adjust. These two numbers are used to network play. This would allow you to the Control Your World Forum at
set the MCP chip. If you are not getting race your friends and family. www.kronosrobotics.com/forums/.
the indicated readings, you will need to I want to build a PlayStation and Also, updates and source file
go back and check your connections. Xbox version of the controller. The downloads can be found on the
concept is identical to the one shown Kronos Robotics website at www.
Final Test: Program the DiosPro chip here and it’s just a matter of figuring kronosrobotics.com/Projec ts/Joy
with the program called EBike.txt. Make out how the pedals are connected. bike.shtml. Now, hit the trail! NV
sure the Workboard is powered up,
then plug in the RJ11 cable connecting
the Workboard to the steering wheel.
In Windows XP, the Sidewinder
driver is built in, but in older operating
HobbyEngineering
The technology builder's source for kits, components, supplies, tools, books and education.
systems, such as WindowsME, you
will have to install the drivers and test
the software. You can download these Robot Kits For All Skill Levels ICs, Transistors, Project Kits
from Microsoft. I recommend getting
the latest drivers. Motors, Frame Components
The driver has a test program that and Scratch Builder Supplies.
allows you to test your controller. When
Order by Internet, phone, fax or mail.
you run the program, you can see the
effects of the steering wheel, as well as www.HobbyEngineering.com
the pedals. If you don’t see these effects,
Books and 1-866-ROBOT-50
connect the original pedals and test 1-866-762-6850
Educational K 1-650-552-9925
those. If they work and your Workboard
1-650-259-9590 (fax)
does not, you need to go back and sales@HobbyEngineering.com
check your wiring. Pay particular atten- 180 El Camino Real
tion to the MCP and RJ11 connections. BEAM Kits and Components Millbrae, CA 94030
Visit our store near SFO!
Go Have Fun: Warning!!! You will
have so much fun that you may not Most orders ship the day received! World-wide shipping. Convenient payment options.
want to stop a race. Just keep in mind
that you can overdo it. This is where
the turbo control comes in handy. You
can set it where you are comfortable,
and by adjusting the resistance of the
bike as well, you can work your way
up to a great workout.
My favorite games are NASCAR
Heat and Need for Speed. In a single
10-lap race, I can burn over 500 calo-
ries. So far, the best I can do is fourth
place. Need for Speed is cool because
I can remove all the cars and just cycle
through the various maps at my leisure.

Going Farther
We are barely tapping the power
of the DiosPro chip. There are several
pins that you could add special func-
tions. How about a switch that turns
on an automatic brake? You could

January 2007 39
Chun.qxd 12/5/2006 1:40 PM Page 40

During certain times


of the year, many of us
think about reviving our
gasoline-powered
monsters who have
been quietly sleeping in
our garages and/or
backyards. Maybe it’s a
CBATTERY
HARGCHARGER
E ALL
bass boat, jet ski, riding
lawnmower, RV, or
motorbike. Whatever it
SWITCHER
is, there is only one
thing worse than hopping E ven the cheapest lead-acid bat-
tery will cost between $20-$30 to
replace, not to mention the hassle of
er will run $50 or more. The second
choice is too high-maintenance if you
are a busy person. If you forget to
aboard, turning the key, yanking it out, installing the new one, move the charger to the next battery,
and discovering that and then explaining all of the battery- you may end up with another dead
the starting battery is acid holes in your clothing to the wife. battery, anyway. Some municipal
Sometimes this happens and you utilities, who depend on many diesel
completely dead. think back and realize the dead engines, actually hire a full-time
battery is not very old — maybe only employee whose sole responsibility
That is, putting the one or two seasons. If you have many is to make sure all starting batteries in
expensive automatic of these in your collection of gas-
engine devices, this sort of thing can
the system are charged, conditioned,
and up to snuff. It is very likely we
battery charger on get expensive quickly — two or three would not be able to hire somebody
it and then finding batteries a year is more than $100
down the drain. You know you can
to perform this service for us.
Wouldn’t it be great if you
out that the battery get longer life out of them by keeping could take the one decent battery
will no longer them properly charged, so the two
alternatives are to either buy an auto-
charger you do own, and have it
automatically switch its output
accept a charge. matic charger for every single battery between all of the batteries in your
or, remember to change the charger collection at regular intervals?
The battery is totally over to another battery at regular
trashed. intervals. The first choice is expen- Lead Acid Battery
sive; a good, truly “automatic” charg- Chemistry
A 12 volt lead-acid battery is
basically a box containing six water-
tight compartments or cells. Each
cell has one plate assembly made of
lead (Pb) and another of lead diox-
ide (PbO2), immersed in a strong sul-
furic acid electrolyte (H2SO4). Lead
combines with SO4 to create PbSO4
(lead sulfate) plus one electron. Lead
dioxide, hydrogen ions and SO4
ions, plus electrons from the lead
plate, create PbSO4 and water on
the lead dioxide plate. As the battery
is discharged, both plates build up
PbSO4, and water builds up in the
acid. Conversely, as the battery is

40 January 2007
Chun.qxd 12/5/2006 1:41 PM Page 41

BY KENTON CHUN

charged, lead and lead dioxide form trolyte just as surely as a bulk charger One Solution
again on the plates and the electrolyte will. Boiling out the electrolyte is anoth-
reverts back to sulfuric acid. er great way to ruin a lead-acid battery. The solution I decided on was to
Although the chemical process is As an experiment and, partially build a charge distribution switcher
normally reversible, when a battery is out of desperation from losing another that would allow me to use a single,
completely discharged, some of the two batteries over the winter, I went high-quality automatic charger to
lead sulfate becomes bonded to the down to the local freight tool store and charge all of my batteries, in turn. The
lead in such a fashion that it is difficult purchased four new identical float switcher had to be simple, reliable,
or impossible to dislodge it through a chargers for under $10 each. When I and cheap. To accomplish this, I went
normal charging procedure. If one got them home, I measured the output back to 20th century technology and
carefully applies an equalization of each with a voltmeter and, between employed an old-fashioned stepper
charge (a very vigorous charge at the four, the output float voltages var- relay at the heart of the project.
C/20), it may be possible to reverse ied from 12.83 to a whopping 19.87 Stepper relays are a peculiar piece
this effect. But eventually, after volts. The packages stated the chargers of technology originally employed in a
enough repeated deep discharges, the were supposed to be set to 13.5 volts variety of applications from elevators,
battery will no longer accept a full — reasonable for a float charger — but telephone switches, jukeboxes, and
charge at all. Since there are six cells, these were not even close. pinball machines. Solid-state technology
there are six chances that an acciden- Even worse, they were not stable — has since made them obsolete, but they
tal deep discharge will damage one of after placing them on new gell cells for a are still amazingly effective for switch-
the cells to the point where the few hours, their outputs drifted to an ing moderate currents and voltages
battery will no longer come up to full even larger spread of 12.24 to 21.2 volts. with high reliability. A basic stepping
charge voltage. Forty dollars worth of chargers were switch has a single input terminal (the
This problem is even more inherent essentially worthless and required a stepping terminal) and multiple output
in starting batteries (versus deep-cycle tedious argument with the store manag- terminals. Connection from the input
types) because starting batteries are er to return them — after all, how could terminal to the outputs is controlled by
optimized to provide huge output cur- four “new” float chargers be defective? an internal rotary contact, or wiper,
rents for a short duration and have more The best route is to invest in a sin- which rotates like the hand on an
fragile plate geometries to accomplish gle, high-quality fully-automatic bulk analog clock, so as to connect the input
this. One estimate says that less than rate charger. This will allow you to terminal to whichever output terminal it
30% of all lead-acid batteries sold actu- bring the battery up to charge quickly is currently pointing at (Figure 1).
ally make it to a 48 month life. The death after it has been discharged at a high The position of the wiper is
rate of batteries that are not charged up rate, and then provide a properly cali- advanced with an integral electromag-
in regularly-used vehicles (like the bass brated tapered charge and shut-off net. Each time an electric pulse is
boat) is much, much higher. when the battery reaches full charge. applied to the electromagnet, the rotary
But what if you have only one decent contact is advanced one position, and
All Chargers Are charger and many batteries to charge? connects the input terminal to the next
Not Equal output. Some stepping switches rotate
Why Not Charge All continuously around to the “home”
There are many ways to build Batteries in Parallel? position after they reach the last
battery chargers, and the general rule- position, while others have a separate
of-thumb is you get what you pay for. All of the batteries in your collec-
There are three classes of lead-acid bat- tion will not be exactly the same —
tery charger: one is a bulk or heavy they will have different capacities;
duty charger; a trickle charger; and a some will be older than others; some
“float” charger. If your battery is in will charge at different rates. If you put
good shape, a well-designed trickle or a number of batteries in parallel the
float charger is sufficient to keep it “weak sister” will pull all of the others
healthy. The problem is that because down to its level. Eventually, you could
they supply only small amounts of even ruin all of your batteries trying to
charge, they are often very inexpen- charge them together in parallel. It is
sively constructed and poorly designed. always best to charge a lead-acid bat-
A trickle charger that does not shut off tery individually, and let the charger’s
properly when the battery reaches full “intelligence” bring it up to an optimal ■ FIGURE 1
charge will eventually boil out the elec- level for that particular battery.

January 2007 41
Chun.qxd 12/5/2006 1:41 PM Page 42

ty to use your home


■ FIGURE 2 controller to set the
charge intervals at will.

Putting it
Together
Begin by deter-
mining your stepper
relay actuator voltage
and building a power
supply. For an AC-
powered actuator, use
a step-down or isola-
tion transformer; for a
DC-powered actuator,
build a simple brute-
force DC converter
supply (Figure 2), or
use a DC wall
wart supply of the
appropriate voltage. It
would be wise to
mount your stepper
relay in an exterior-
grade weatherproof
electrical box to keep
moisture away from
the relay, and to
“reset” coil and a return spring. If you tioned, we do not expect to be passing minimize the explosion hazard present-
don’t already have one of these in your exceptionally high current through our ed by arcing relay contacts.
junk box, they can be found at popular stepper relay contacts. In any case, our I used two bolts mounted through
online auction and hardware surplus circuit will provide protection against the side of my box to serve as the
sites for only a few dollars apiece. I have contact overloads. power input posts. You can simply use
also seen versions of these using In order to trigger our stepper relay, the battery clamps on your battery
“motorized switch” as a search phrase. we are employing an interesting variant charger to connect to your charge dis-
The only two critical specifications of the standard X-10 appliance module, tribution unit. It would be a good idea
to note in selecting a stepper relay is called a “universal module.” This module to put a 10 amp fuse in series with
the actuator voltage (usually a choice accepts standard X-10 commands, but one of the input legs to protect your
between 24V or 110V; AC or DC), and will provide a momentary three-second relay contacts against a shorted
the current switching limitation of the relay contact closure, perfect for advanc- output or excessive load. If you have a
unit. Since we are only trying to keep ing our stepper relay. The beauty of this spare circuit breaker in your junkbox,
our bank of batteries properly condi- setup is in its simplicity, and in the abili- you can use this instead of the fuse.
I ran individual charger clip leads
■ FIGURE 3a ■ FIGURE 3b from my box long enough to reach all
of the batteries in our barn. One
important point here is to try and keep
these distances to a minimum. You
will experience a significant voltage
drop through any great length of wire,
so in order to keep the cost of the
project to a minimum, I used 12
gauge appliance zip cord and kept the
lengths to under 20 feet for any leg.
The easiest way to deal with all of
these leads is to drill holes for each in

42 January 2007
Chun.qxd 12/5/2006 1:41 PM Page 43

Battery Charger Switcher


the side of the box and, after passing Finally, program your X-10 home
them through, simply tie an overhand controller to send out an “On” to your Now Available from
knot inside as a strain relief. Solder all universal module’s address to test MCM Electronics...
of the ground ends together and solder your charge distribution unit. Each
Ph
each of the positive leads to one of the “On” command should sequence the Accesilips
relay outputs. If your relay is a “make charger output to the next contact sories
before break“ type, you may wish to and corresponding charging clip lead.
use every other contact to avoid tying
your two consecutive batteries togeth- Results
er in parallel while a switching event
occurs. There is no inherent danger in I set my controller to send out a
allowing two batteries to temporarily new “On” command once each day.
be connected in parallel unless they After six batteries are charged, the
are at greatly differing states of charge, next day the relay resets itself and the
or one of them is completely shorted cycle begins over again. Each week, a
through. You will need to remember to different battery goes through a one-
program two “On” signal pulses to day charge cycle on the automatic
advance the charge, however. battery charger; more than enough to
Tie in your relay power supply keep it in top shape. I’m quite pleased Philips’s line of innovative
in series with the X-10 universal that we can take the RV, riding lawn- accessories includes:
controller module contact closures mower, go-cart, dad’s old muscle car, • Remotes
and the relay actuator coil. If your and the bass boat out at any time • MP3 and iPod®
accessories
relay is a 110 VAC type, observe AC knowing the battery is properly • Headphones
wiring safety. Try to use an isolation charged and ready to go — even after • A/V switchers
transformer, if possible. If you are a long sleep. • Care and cleaning products
operating your stepper relay from a • Webcams
low-voltage DC or AC wall wart, you One Last Word • And much more!
are working with a good margin of For more info visit
www.mcmionone.com
safety already. Fuse this circuit to I know that some of you may look
protect the actuator coil from burnout at this project and say, “I can’t find a
should it somehow be stuck in an sequential stepping relay,” but do not • Over 40,000
energized state. A slow-blow 0.5 amp despair. I realize that some of us do Products
Stocked
fuse should be sufficient here. not have the time to enjoy the hunt for
• Access to over
Since my stepper relay came out unusual anachronistic components. 1.5 million
of a telephone switching system and So, if you happen to have a box of electronic parts
and related
needed to be reset, I wired the next similar individual relays, you can products
available output contact to provide a actually accomplish the same thing • Installer/Dealer
reset pulse when it had cycled through with the application of a bit of logic. pricing program
all of the batteries I wanted to charge. Remember to be safe, and have • Quotation team,
send us your
If your reset relay coil needs 110 VAC, fun whatever you do! NV quotes for quick
you can either add a sepa- response
rate 12 VDC relay as a
switch to energize the PARTS LIST FFRREEEE !
logg!
talo
CCaata
reset coil with your stepper QTY DESCRIPTION
coil power supply, or use a call toll free
❑1 Automatic bulk rate charger
separate X-10 appliance ❑1 Stepper relay (see text) 1-800-543-4330
module and command to ❑ 1 X-10 Universal module refer to or visit

trigger the reset function.


❑1 PVC outdoor electrical junction box www.mcminone.com/magazine
❑2 3/8” x 2” bolts and nuts
Some stepper relays can ❑1 1/2 amp slow-blow fuse
also be mechanically ❑ 100’ 12-gauge appliance cord
reconfigured to disable the ❑ 12 Battery clips or heavy-duty alligator clips
❑1 110 VAC isolation transformer or DC
need to reset them entirely. relay coil power supply (see text)
When you are done,
your project should look SOURCES OF STEPPER RELAYS
❑ www.ebay.com
something like Figures 3a ❑ www.surplussales.com
and 3b.
Source Code: NVM45

January 2007 43
Page44.qxd 12/7/2006 10:10 PM Page 44

44 January 2007
Full Page.qxd 12/6/2006 10:26 AM Page 45

2,5 00 NE W 2,5 00 NEW


NATIONAL SEMI 5,000 NEW MAXIM
PA RT S AM P PAR TS
PART S

Wow! Jameco just added 65,000


new major-brand products!
7,20 0 NEW 19, 00 0 NE W
2, 80 0 NE W
TE XA S
FR EE SC AL E 2,90 0 NEW IN ST RU M EN TS M IC RO CH IP
PAR TS PA RT S
V I S H AY PA RT S
PAR TS
The industry’s fastest Check out these new
growing product offering! 6,200 NEW 3,000 NEW and expanded lines:
You know that Jameco’s catalog
always offers over 99% in-stock FAIR CHI LD AVX Aavid Thermalloy •
Alcoswitch • AMP •
availability— the best of any elec- PARTS Amphenol Connex •
tronic components distributor... PART S Atmel • Augat • AVX •
And now, they have the Bourns • Buchanan • Comair Rotron •
fastest growing product offering Condor Power Supplies • CTS •
in the industry! Cypress • Dallas Semiconductor •
They’ve just added another Fairchild • Freescale Semiconductor •
65,000 new parts to their online Grayhill • Intel • Intersil • ITT •
catalog; and it’s everything C&K Switches • Lattice
from ICs to passives, optos to Semiconductor • Lite-On •
Maxim • Microchip • Micron
interconnects, power supplies
Technology • Molex • National
to electromechanical.
Semiconductor • Panasonic •
Service & Availability! Philips • Power-One •
As Design Engineers Raychem • Renesas
know, Jameco offers great Technology • Sandisk • ST
service, selection and Micro • Texas Instruments •
Toshiba • Tyco Electronics •
same-day shipping!
Vishay Intertechnology...
Now you can get those
same benefits for even Get it here. Right now:
more great brands...
Jameco.com/NVQ

Great Products.
Awesome Prices.

January 2007 45
Garcia.qxd 12/7/2006 2:05 PM Page 46

●●●●
I initially became
involved in macro — or
close-up photography BUILD A RING
— as part of my job,
which involves failure FLASH FOR
mode analysis of
electronic circuitry.
Be sure and read the
sidebar for a discussion
of why photographs of
small objects are called
M A C R O
PHOTOGRAPHY
macro photography.

With components I really became interested in macro


photography after realizing how
extensive my son’s coin collection
but these can be expensive.
Fortunately, with component
miniaturization and with the newer,
becoming smaller had grown. Loving photography, high brightness white LEDs, it is
and smaller, taking a I immediately though about docu-
menting his collection. I had faced
possible for the hobbyist to build
one. Figure 2 shows the assembled
decent photograph challenges at work, but capturing project on my old trusty Sony
has proven to be the exquisite detail found in many
coins, such as the example shown in
CyberShot. If your camera has a
threaded front lens and a non-
increasingly difficult. Figure 1 — a post-World War 2 dedicated flash hot shoe, you may
British penny — was a bit trickier. benefit from this project.
The main problem stems in that
■ FIGURE 1. A fine application for macro for macro photography, one has to Circuit Description
photography — documenting your coin come very close to the object being
collection. photographed, usually no White LEDs are a major improve-
more than a couple of inches ment over incandescent lamps for
from the lens. Although newer portable illumination, and in particu-
cameras and lenses can lar for photographic use. They
handle this extremely short are rugged, their color temperature
focusing distance, the chal- does not change dramatically with
lenge lies in how to illuminate weakening batteries, and they are far
the object, as the camera and more efficient in the electrons to
photographer project shad- photons conversion. Unfortunately,
ows into the object. Low light they cannot be connected directly to
conditions lead to uneven a voltage source; its current must be
contrast and require both slow regulated. This is traditionally accom-
shutter and wide apertures, plished with a ballasting resistor,
which result in blurry images which is very wasteful.
and a shallow depth-of-field. For the large number of LEDs —
The solution to this issue has 15 in total — required for this
been to employ lens-mounted project, a switchmode power supply
ring flashes and illuminators, is required. Since white LEDs each
have about 3.5 volts forward drop,
■ FIGURE 2. The completed and there are five of each in the
project mounted in a camera. On three series, a boost topology is
the camera’s top is the power mandatory.
pack; on its lens, the LED ring. Since white LEDs are becoming

46 January 2007
Garcia.qxd 12/7/2006 2:06 PM Page 47

BY FERNANDO GARCIA

■ FIGURE 3. Schematic.
Components located within
the printed wiring board are
in the shaded box.

January 2007 47
Garcia.qxd 12/7/2006 2:06 PM Page 48

popular, semiconductor vendors have the boost circuit. These are D1, L1, and reconnect later. This is accom-
designed many integrated circuit and C1a and C1b. C2 is an input plished with a six pin DIN plug and
solutions. The question is which one decoupling capacitor, indispensable receptacle pair J1 and P1. Although this
to use? All of them come almost for proper operation. adds flexibility to the project, an
exclusively in SMT packages. Some of Current feedback is taken from accidental disconnect while the circuit
those packages — like SOT and SOIC the voltage sample across R1, and fed is operational can permanently damage
— are manageable to the hobbyist. to U1’s feedback input. When the the circuit; in the absence of current
Others — like TSSOP and QFP — current across the series string LED1 feedback, the output voltage will
would be next to impossible to assem- through LED5 equals approximately increase until the device self-destructs.
ble correctly without the proper skill 20 milliamps, the developed voltage To prevent this, two features are built
and high-dollar specialized tools. will equal that of the internal reference in: the first is zener diode D2, which
Therefore this, and other features like and the current is in regulation. The will start conducting current when an
simplicity of use, narrowed the choice voltage drop across this resistor is only overvoltage condition occurs and con-
to National Semi’s LM2731Y, which is about 7% of the total voltage, resulting tinue providing feedback to the circuit.
the heart of the circuit. This is a fully in a small efficiency penalty. The other The second, and most important, is that
integrated boost converter with its two LED strings — LED6 through two pins of the connector are used to
own internal power FET and oscillator. LED10 and LED11 through LED15 break the current flow from the battery,
Two versions are available, depending (both having equal limiting resistors R2 effectively powering down the circuit.
on the internal oscillator frequency. In and R3) — will current-mirror the first Although the circuit could work
this project, the 600 kHz, Y-version is LED string to an acceptable degree. like this, further enhancements are
chosen, as it is more layout-forgiving Of course, since the main portion required to improve the battery’s
than the 1.6 MHz X-version. of the circuit and its battery are operating life. The total current
As shown in the schematic of attached to the camera via the flash consumption is about 140 milliamps,
Figure 3, this powerful IC is U1, mount — whereas the LED strings are in quite a chore for a continuous draw
and only a handful of additional a ring which is screwed to the lens — on a nine-volt battery. Therefore,
components are required to complete there must be a way to detach them further circuit refinements are neces-
sary. First, during normal operation
luminous power — and thus current
WHY THE NAME MACRO PHOTOGRAPHY? draw — is roughly halved. Second, the
A very valid question, especially since it involves taking images from small illuminator is triggered — via the
objects, so how is the term “macro photography” defined? camera’s hot shoe — to full
In traditional photography — which comprises the vast power during a short period, to
majority of images shot — the subject being photographed fully illuminate the object.
is many times larger than the photo sensor’s area. By photo The first function is com-
sensor I mean either film or an electronic device. Clearly,
the sunset at the top of Figure 4 matches that definition, as prised of an astable oscillator U2
would a person’s portrait or your pet’s photo. and its associated components
As the size of the object shrinks, and the object being R4, R5, C7, and C8. It produces
photographed starts to equal in size to that of the sensor, a 210 Hz square wave, at close
we enter the realm of macro photography. Of course, since to 50% duty cycle. The second
the photographic sensors are small, the object must be function is comprised of a mono-
small. There is no cut and dried definition for macro
stable U3 and its associated
photography, but I like the definition found in the now
defunct Konica-Minolta website, which defined a macro as components R6, R7, C5, and C6.
an image of an object ranging from ten times to one tenth It produces a positive pulse
the size of the sensor. The delicate water droplets hanging about 1/3 of a second long. The
from a spider web in the next image of Figure 4 match the circuits employ the ubiquitous
description, as would the image of an insect. 555 CMOS timer. Both their
Smaller images than one tenth the sensor’s size are outputs are Or’ed together with
now part of micro photography, and a microscope is
dual diode D4. The signal is
absolutely required. We have seen those ... an amoeba, a
fly’s multifaceted eyes ... however, we are in an electronics applied to U1’s shutdown input.
magazine, and the photo of an IC’s silicon guts in the next The circuit is enabled with a logic
image is a nice example of micro photography. high at the input. Therefore, in
Last but not least is astro photography. Here the objects normal operation, the circuit sees
are trillions and trillions of times larger than the sensor.
Astronomical objects ranging from the moon to galaxies. ■ FIGURE 4. Here are some
The starry sky image taken through a telescope at the examples of Normal, Macro,
bottom of Figure 4 is such an example. Micro, and Astro photography.

48 January 2007
Garcia.qxd 12/7/2006 2:07 PM Page 49

Build a Ring Flash for Macro Photography


roughly a 50% duty cycle square wave, ■ FIGURE 5. Detail of the
and total power is thus halved. When a LED ring.
picture is taken, the camera’s hot shoe
pulls low U3’s trigger input, and the These four wires will be
resulting positive output pulse will soldered to another
maintain full power for the duration, small section of the perf-
reverting to half power afterwards. board which has been
Most of the circuit is built on a glued to the ring’s back,
small board, shown as a shaded box and to which the wires
in the schematic. There are some from the DIN plug are
external components, like the LED attached. The DIN plug
array itself, but also a momentary has six wires, but the
“test” pushbutton to override the half other two serve the pur-
power option and set the circuit to full pose of forming a power
power. This is useful for adjusting the interlock which will dis-
exposure. Additionally, an external connect battery power
power jack J2 is employed to feed — from the circuit, in case the LED array red or green relatives; observe proper
via a wall-wart transformer — 6 to 10 is disconnected from the power pack handling and soldering procedures.
volts DC when prolonged use is as shown in the schematic and
required. U4 is a low power five-volt explained in the previous section. Building the Power
regulator which feeds the timers, and Figure 5 — showing an example of Pack
this completes the circuit. an assembled LED ring — should
clarify the description above. I strongly Before I start, let’s clarify a photo-
Building the LED Ring recommend using different color wires graphic term. The “PC” cord and
for all the wires, to avoid miswiring. adapter term mentioned below is not
This project consists of two parts: The white LEDs are the heart of related to a “printed circuit” board.
the power pack and the ring itself. the project, and they are a substantial Rather it is a special coaxial connector
Let’s discuss building the ring first, part of the cost. Therefore, I that has been used for a long time in
since your camera MUST have an understand that there will be a great photography to synchronize flashes to
essential attribute for this project: a temptation to purchase them from the cameras. To avoid confusion, the board
threaded front lens. The threaded lens cheapest stock one can find. This is where the components are mounted
will allow you to mount a step-up ring perfectly fine, but please watch out for will be called a “printed wiring” or PW
adapter, which is available from many two caveats: the first is that the LEDs board. For compact and high perform-
photographic shops. These adapters must be specified for a continuous ance circuits like the power pack,
allow you to thread larger diameter current of 20 mA. The second is sur- surface mount technology devices are
filters and accessories to the camera’s plus LEDs can vary in brightness and required in certain sections. To mount
lens. What you need to do is procure color. Therefore,
an adapter with an inner diameter buy a few extra
equal to that of your lens (in my case, than the amount
it was a 58 mm), and for the outer actually required
diameter, a larger one which will allow in case one of
the LEDs to be mounted on the rim them is dim.
(which again, in my case, was 77 mm). P l e a s e
Employing a protractor, start by remember that
marking the inside ring surface each white LEDs are
24 degrees (360 degrees divided by much more ESD
15 LEDs in the project). Then, at each sensitive that the
mark, glue small perfboard squares more common
that you have cut from a general-
purpose perfboard. Solder the white ■ FIGURE 6. Sug-
LEDs, observing their polarity, on gested PWB. Thru
hole components
each square. Then wire the LEDs to mounted on the
form three strings of five LEDs each. bottom (red) side;
Connect the first anode of all the SMT components
series together, and then wire the last mounted on the
anode of each series individually. top (green) side.

January 2007 49
Garcia.qxd 12/7/2006 2:07 PM Page 50

■ FIGURE 7. Photos of the wattage iron is a must, as it is fine


complete PWB prior to wiring. gauge solder. Tweezers are required
to hold the components being
employed; the lower side in soldered, and unless you have eagle
the drawing in Figure 6 to vision, a magnifying glass is very
mount the thru hole devices, useful to inspect your work. I also rec-
the upper side to mount the ommend getting at least an extra
SMT devices. Figure 7 shows device for all the smaller SMT compo-
a photo of the same board nents, since they are easily dropped
layout with components and lost. Take care with the ceramic
mounted. The board’s length chip caps, they are fragile and easily
is such that it fits nicely inside cracked if the board is flexed after
the specified plastic housing being soldered. The crack will not be
which also has a compart- immediately evident and could cause
ment for a nine-volt battery. a failure later.
Solder all of the SMT Please note the orientation of the
a SMT device, a PW board is a must. In components first, as the PW board SOIC8 circuits, a dot indicates pin 1.
this project, both sides of the board are must be level. A fine pointed, low Likewise, D1’s cathode end is
indicated by a dot. For D3 and U1
— which have a 2:1 pin and 3:2 pin
PARTS LIST configurations, respectively — they
will only fit properly one way. For
PART DESCRIPTION the thru hole components, D2’s
❑ U1 LM2731Y Boost Converter [SOT23-5] cathode is marked, and U4’s input
❑ U2, U3 LMC555 Timer [SOIC8]
is marked with a dot.
❑ U4 LM78L05 Regulator
❑ D1 MBR0520 Power Schottky Diode [SOD123] Don’t worry if the via holes
❑ D2 1N4747A Zener Diode (the holes that connect one side of
❑ D3 BAT54C Dual Schottky Diode [SOT23-3] the board to the other) which are
❑ LED1 through LED15 T1 3/4 White LED (see text) closest to the SMT devices get
filled with solder while you are
❑ R1 through R3 61.9 ohm, 1%, [0805] soldering the devices. This actually
❑ R4, R7 4.7K, 5%, [0805]
improves both electrical and
❑ R5, R6, R8 330K, 5%, [0805]
thermal conductivity.
❑ C1A, C1B, C2 2.2 µF, 25V, Y5V Ceramic, [1206[ After the board is completed,
❑ C3 1,000 µF, 10V Axial Electrolytic attach all the wires to it. There are
❑ C4 0.1 µF, 50V Ceramic, [0805] 11 wires going to the board from
❑ C5, C7, C8 0.01 µF, 50V Ceramic, [0805] the connectors, switch, and battery
❑ C6 1 µF, 16V Ceramic Preferred, Electrolytic okay to sub. holder. Once again, thin, color
❑ L1 27 µH, 0.97amp [CR54-270MC]
coded wires are a must.
❑ P1 6 pin DIN Plug Please note that C6 — a 1 µF
❑ J1 6 pin DIN Jack capacitor — may be either ceramic
❑ J2 Power Connector or electrolytic. The former is pre-
❑ SW1 N.O. Momentary Pushbutton ferred, as it usually has a tighter
❑ B1 9V Battery and Connector tolerance and there are no polarity
requirements. The schematic
❑ Hot Shoe to PC Adapter B&H Photo GBHSPCA
❑ Sync Extension Cord PC Male B&H Photo GBPCPCS1 shows the appropriate polarity, in
❑ Step-up Ring See text case an electrolytic one is fitted.
❑ Plastic Enclosure Pactec HM-9VB You’ll have to drill the enclo-
❑ Printed Wiring Board sure’s front panel to mount the
DIN connector and pushbutton
NOTES switch, and one side for the power
1) The information in square brackets [] indicates the exact SMT package size jack. Then drill the bottom of the
required to fit the suggested PW board.
2) No information indicates a thru-hole device. enclosure for the mounting holes
3) It is okay to employ tighter tolerance components. for the hot shoe adapter. Once
4) All ceramic caps ±10% tolerance. secured with screws, a little epoxy
glue will firmly bond both together.

50 January 2007
Garcia.qxd 12/7/2006 2:07 PM Page 51

Build a Ring Flash for Macro Photography


The hot shoe adaptor serves as a exposure while keeping the flash in
mounting platform for the enclosure, half power — would be to adjust the SOURCES
but also provides the timing for the exposure value at -1.0EV from the ■ All electronic components available
flash strobing. Connect the sync PC actual reading. Then as the flash from: www.digikey.com
cord’s male side to the hot shoe adap- fires at full power, the image will be ■ Hot shoe adaptor and PC sync cord
tor. After measuring the proper length, exposed properly. available from: www.bhphotovideo.com
cut away the connector at the other Even at half power the project
■ Step up rings available from:
end, and strip the wire that you’ll does consume substantial current www.2filter.com
attach to the PW board. Drill one final for a nine-volt battery. Stay away
hole on the enclosure’s bottom to from general-purpose batteries or ■ Plastic enclosure available from:
cross the cord. The connector is the cheaper rechargeables. NV www.pactecenclosures.com
polarized; with a multimeter,
determine which wire connects to the
camera’s ring, which is the camera’s
ground. This wire goes to the
“common” terminal in the board.

Using the Project


This is a photographic project after
all, so here are some associated tips.
The first is related to the white
balance of the LEDs. White balance, or
color temperature, is a measurement
of the light spectra of a white source.
White LEDs have a very high color
temperature, which means that their
spectra is highly skewed towards the
blue component. If uncorrected, your
images will be bluish. There are two
ways around this: the best is to adjust
your camera for this color temperature,
if the camera is equipped for manual
white balance adjustments. If it lacks
this feature, the other option is to pre-
set the camera white balance for
“cloudy” conditions, and then use your ProtoMat® S-Series
favorite photo editor software to fine- PCB Milling Machines
tune it from there. In any case, a white
or neutral gray background is required Electrical engineers agree: with a Protomat S-Series
to ensure the proper color is rendered. prototyping machine at your side, you’ll arrive at the
The other tip is about adjusting best solutions, fast. These highly accurate benchtop
exposure. In normal operation, the PCB milling machines eliminate bread-boarding and
unit is operating at half power, and allow you to create real, repeatable test circuits—
thus when it flashes at full power, the including plated vias—in minutes, not days.
actual exposure will not be correct. • Declare your independence from board houses
Push the test button to set the expo-
sure, and then lock that exposure. • Affordable, entry-level price tag
Another way — if no exposure lock is • The best milling speed, resolution, and accuracy
available and you have to set the in the industry

• Single-sided, double-sided, and multilayered


AUTHOR BIO machining without hazardous chemicals For complete details visit:
www.lpkfusa.com
■ If there is enough interest, I may • Optional vacuum table and autosearch camera or call:
offer PWBs for the project; contact for layer alignment 1-800-345-LPKF
me at fernando.v.garcia@netzero.com

January 2007 51
Page52.qxd 12/6/2006 10:53 AM Page 52

t o rs Dio
e s is des
R Order PCB
Get FREE parts
T r a Capacitors o r s
nsis e c t
tors
o nn
C
O nly $50 for 5pcs 4 " x4 " 2L
Free Solder mask and silkscreen !

FREE
With first order
Http :// EzPCB . COM
Sales @ EzPCB . COM

52 January 2007
Full Page.qxd 12/7/2006 11:15 PM Page 53

Updated Website Features: New Shopping Cart Features


www.goldmine–elec.com Improved Navigation
Create Personalized Accounts
Create your own Wish List
Sale Items & New Arrivals
Visit Us Online! Easy “Quick Ordering” Online Catalog
SCI-FI Sound Effects “THERIMIN” Kit Toll Free Order Line:
This kit utilizes two light sensors: one Amazing 1-800-445-0697
controls the frequency and the other Deals! Fax Line: (480) 661-8259
modulates the sound. Simple one We have over 4,000 electronic components and items online at discount prices!
IC circuit with built in speaker
and an RCA jack so you Small Van de Graaff Kit with Demonstrations
This small battery operated Van de Graaff Generator produces up to 3/4” long sparks and is perfect for
can send the sound to your
demonstrating many electrostatic phenomena. This unit is similar to larger machines but it won’t produce the
DPSOL¿HULIGHVLUHG6LPSO\
larger sparks and extremely high voltages. Has a 4 3/4” Dia. dome on top and produces about 25,000 Volts
use your hands to produce
at a very low current (for safety). The voltage is harmless and it feels like a common “static shock” you might
some of the strangest, spookiest sounds you’ll ever want
receive when you walk across a carpet on a dry day. Requires no soldering and can be assembled with just
to hear! Operates from one 9V battery (not included). Size
a screwdriver and pliers. The completed kit stands over 14” high and the base is 6” x 8”. Very attractive,
of PC board 3 1/2” x 1 1/4”. Complete with all parts, PC
useful, and safe – requires 4 “C” batteries (not included). Complete with all parts, full color manual with
board and instructions. Skill Level 1.
C6841 $8.95 ea. instructions, experiments and several accessories for demonstrations. Skill Level 1.
C6917 $69.95 ea. Visit us online for our complete line of interesting kits!
Blue Neon Lamp Bulb
Tiny neon bulb glows a bright blue instead Blinding Output Blue SMD LED 8MM Super Power U.V. LED
of the usual orange glow. Operates from This LED emits a brilliant blue light Clear lens UV LED 8mm is
120VAC and has a built in dropping resistor with a viewing angle of 120 de- our largest most powerful ultraviolet LED.
to allow for direct con- grees when 3V to 4.2VDC is ap- These are brand new made by Handy Get part#
nection to the AC plied. It features a water clear lens 8N3CUV. These are great for lighting up invisible UV
line. Brand new and rare. Size of bulb about .14”Dia. x and a .14” x .11” x .08”H white rectangular SMD case. inks, blacklight posters, scorpions, some minerals,
.36”L (excluding resistor and leads). Package of 2. Use a small tip low wattage soldering iron if you wish to checking for counterfeit currency, etc. NOTE: As with
G15710 2/$1.49 solder leads to it. This is one of the lowest prices available all UV LEDs do not look directly into the device during
anywhere for this high quality, high output blue SMD LED. operation.Brand new- Full length leads.
Space–Grade Silicon Solar Cell Makes a great tiny book light for night reading when you G15221 $1.99 ea.
7KLVLVDQHI¿FLHQWKLJKHVWTXDOLW\
space grade silicon solar cell with use a 36ohm resistor in series with a 9V battery. Brand Giant 10mm Rainbow Flashing LED
¿QH SUHFLVLRQ JULG OLQHV 7KLV FHOO new factory prime on tape and reel. Blue is 470nm. Giant 10mm crystal clear lens LED
G13706 $0.49 ea.
was made by Applied Solar Energy ÀDVKHVDEULOOLDQWDUUD\RIFRORUV
Co. for NASA. The cell produces 452mV open circuit Standard Size CDS Cell 5HG%OXHDQG*UHHQ)HDWXUHVDXQLTXHSDWWHUQRIÀDVK-
voltage and 300mA short circuit current. The size is only Small .29” x .24” x .07” CDS cell with ing. Each color lights up and dims and then the unit rapidly
2cm x 4cm x .24mm Thick. This wafer thin cell weighs long leads. The head of this CDS has been dipped in ÀDVKHVHDFKRIWKHFRORUVLQGLYLGXDOO\7KHVHWZRF\FOHV
only .47 grams and has solder pads on top and bottom clean epoxy to help block moisture. Dark resistance over repeat themselves for a fascinating visual effect. Operate on
to solder wires to. Brand new! 4M. Light resistance under 1K. 3VDC. This a beautiful attention getting display of colors!
G16205 $2.49 ea. G15177 2/$1.00 G16226 $3.00 ea.
All of the items below are currently on sale! Tremendous Savings on many popular items. All Sale Prices & Special Promotional Offers Expire 01/31/07
VISIT US
Electronic Goldmine As a special bonus for Nuts & Volts readers, ONLINE!

SALE Specials! go online to our search engine and enter: NVJAN for an exclusive offer!
Color Video Camera with Audio Beam Solar Panel 2.4VDC @ 20mA Super Sensitive Vibration/Shock Sensor
Compact CMOS color camera with au- Weather proof small encapsulated solar cell Vibration sensor de-
dio comes complete with small 12VDC is sturdy and easy to use. Produces 2.4VDC signed for car alarms
adapter. Features small 2.5” x 1.75” x open circuit voltage and 20mA short circuit cur- features a sensitive IC
1.25” case, NTSC 510 x 492 rent. Has pads on bottom side for easy solder circuit with an adjust-
picture element, electronic connection. This reliable easy to use panel is only 1 5/16” able sensitivity control
shutter, 1/60 – 1/15000 sec, x 15/16” and weighs only 2.5 grams -perfect for outdoor to allow for super sensi-
380TV lines, min illumination beam robotic designs! New from factory, part# RU2420. tive detection. At the highest setting
3LUX, auto backlight compensation and adjustable focus G16075 $3.49 SALE! $2.75 ea. the slightest tap sets it off. Has 2 built in LED indicator
lens. Has 3 female jacks. Brand new! lights and can operate from a 9V battery or higher
G16163 $59.95 SALE! $49.95 ea. 16VDC .120Amp 4” x 12” Glass Solar voltage up to 14VDC. Very simple to use - connect
Panel with Wire Tabs up power and connect output lead to relay, LED,
Low Light Black & White Compact yet powerful SCR, etc. We give you a simple hookup diagram that
Video Camera with Audio 4” x 12” solar panel has shows how to hookup to any 5VDC DPDT relay (not
This compact 2.5” x 1.75” x wire tabs to allow you to simply solder your hookup included) to “latch on” after detection. Sensor board
1.25” black and white video leads using standard rosin core solder. Output is 15 to has a removable protective cover. Size about 2.4”L x
camera has 6 built in IR LEDs 17VDC open circuit voltage and short circuit current is 1.8”W x 1.25”H. Brand new and very unique.
to illuminate objects up to 4 ft. away in a to- .110Amp to .140Amp. Great for battery charging and G15777 $2.49 SALE! $1.99 ea.
tally dark room. In normal lighting an adjustable focus powering hundreds of electronic devices. New but may
lens allows for closeups or distant operation. Has built in have slight cosmetic defects (edge chips, discoloration VICOR FlatPAC 5VDC
microphone for audio and comes with a 12VDC power etc) –that will not effect output. 40Amp Power Supply
adapter. Has 3 female jacks. Brand new! G16129 $12.95 SALE! $9.95 ea. Small footprint power supply
G16159 $34.95 SALE! $29.95 ea. by VICOR model VI-LU0-EU FlatPAC (LU Series) features
Tiny Inverter Transformer an input voltage range of 100 to 240VAC and an output
60x–100x Zoom Pocket Designed for tiny strobelights this small invert- voltage range of 5VDC (regulated) at up to 40Amps
Microscope with Light er transformer converts 3VDC into 200VAC (200Watts). Size only 9.25”L x 2.5”W x 1.37”High. In-
Handy pocket microscope has a zoom func- when used with a simple 2 transistor circuit. cludes booklet from Vicor that contains Application Notes.
tion and a built in white LED light. This powerful Size only .4” square x .35”H. Has 4 pins. Comes with Hookup info is printed on the top of the supply. Brand new
pocket microscope zooms from 60x to 100x. a schematic of a simple strobe using this transformer. and worth much more than our blowout price!
It features a switch to turn on the illumination, G13599 $3.99 SALE! $2.49 ea. G16217 $47.95 SALE! $39.95 ea.
a removable microscope slide holder, and a
focus knob. The size is only 5.75” x 1.8” x 1” Super Breadboard
(excluding microscope slide holder/stand). Compact breadboard for making prototype circuits features 60 groups of 5 connected ter-
Brand new in attractive retail box. Requires PLQDOSRLQWV(DFKWHUPLQDO¿UPO\JULSVWKHOHDGRU,&SLQLQVHUWHGLQWRLW5HXVDEOHRYHUDQG
two “AA” batteries (not included). Makes a great gift! over again. Size: 3 1/4”L x 1 3/8”W. White plastic with peel and stick foam tape on base.
G16179 $8.95 SALE! $7.95 ea. G9849 $3.98 SALE! $3.49 ea.
$10.00 Minimum Order + Shipping Electronic Goldmine • www.goldmine-elec.com • 1-800-445-0697 • P.O. Box 5408, Scottsdale, AZ 85261
January 2007 53
Hackett.qxd 12/7/2006 8:15 AM Page 54

Getting Started With


PICAXE MICROCONTROLLERS
b y R o n H a c k e t t
PA R T 1
The PICAXE-08M Chip

I
f you are relatively new to the world of programmable
microcontrollers, the PICAXE line of processors is the perfect place
to start, for three major reasons:

1) PICAXE chips are programmed in BASIC — no need to learn a


complicated assembly language.

2) PICAXE processors are surprisingly inexpensive — from less


than $4 (yes, $4!) for the amazingly small PICAXE-08M (with five I/O
pins) to $10 for the super-powerful PICAXE-40X (with 32 I/O pins).
The PICAXE-18X Chip
3) The PICAXE Programming Editor (the software you use
to write, develop and download your program to a PICAXE
processor) is free! What more could you ask for?

On the other hand, if you already nal can function in either of these sce-
have some experience with program- narios, and can be used with PICAXE,
mable microcontrollers (possibly with BASIC Stamp, and BasicX chips, or just
the BASIC Stamp from Parallax or the about any system which supports
BasicX from NetMedia), you still five-volt level serial communications.
should take a look at the PICAXE In this article, we will focus on the
chips. For example, let’s say you have PICAXE-18X chip, which (in terms of size
The PICAXE-28X Chip designed, breadboarded, and tested and power) is somewhere in the middle
this great little temperature monitor of the PICAXE line of processors, and
and controller project and you’re costs less than $8. It actually has many
ready to put it into action. Do you real- more features than we will need for our
ly want to tie up a processor that may project, but it will also provide significant
have cost you $50 or more, or would “room to grow” for future projects.
you rather make a couple of minor Part 1 of the article will provide a
changes to your software and actually brief introduction to PICAXE program-
construct it with a $4 PICAXE chip? ming by developing the simple, yet
As a means of introducing the classic, “Hello World” program.
PICAXE system, this three-part article Part 2 will focus on interfacing the
will describe the development of a PICAXE-18X chip with a Hitachi
complete I/O terminal consisting of a HD44780-based LCD display, and
The PICAXE-40X Chip matrix keyboard for input and an LCD providing a simple serial interface to
character display for output. Most the LCD. Of course, there are plenty
microcontrollers — including the of serial LCD displays you can pur-
PICAXE chips — have some form of I/O chase, but they tend to be an expen-
functionality using the serial connection sive item to dedicate to one project.
to your PC, but sometimes it’s helpful to On the other hand, Hitachi HD44780
be able to test and debug your program displays are very inexpensive and
in situations where a PC is not available. readily available from electronics sup-
Also, some programs require a fair pliers on eBay and elsewhere (see the
amount of interaction with the user dur- Resources List for some suggestions).
ing program execution. Our I/O termi- Their only drawback is that they
54 January 2007
Hackett.qxd 12/7/2006 8:16 AM Page 55

Getting Started With PICAXE Microcontrollers


consume a minimum of six I/O pins, PICAXE-08M PICAXE-18X PICAXE-24X PICAXE-40X
but with PICAXE chips also being so
Pins 8 18 28 40
inexpensive, it’s not a problem to
switch from an 18X (14 I/O pins) to I/O Pins 5 14 21 32
a 28A or 28X (21 I/O pins) when Input Pins 1-4 5 0-12 8-20
necessary, or even a 40X (32 I/O Output Pins 4-1 9 17-9 17-9
pins) if you want to control a signifi-
ADC Pins (10-bit) 3 3 4-0 7-3
cantly larger portion of your world!
In Part 3 of this series, we will PWM Pins 1 1 2 2
add a small (12 or 16 key) matrix key- Program Memory 80 Basic lines 600 Basic lines 600 Basic lines 600 Basic lines
board to complete our I/O terminal. Storage Variables 48 bytes 96 bytes 112 bytes 112 bytes

Introduction to Data Memory 256 bytes 256 bytes 128 bytes 128 bytes

PICAXE Chips FIGURE 1. Features Summary of Selected PICAXE Processors.

PICAXE microprocessors are pro- sented in Figure 1. As you can see, the chips are capable of running as fast as
duced by Revolution Education — a 18X can store a program of approxi- 20 MHz with an external resonator.
British company dedicated to promoting mately 600 lines of Basic code, which
the study of electronics and robotics in is more than enough for just about PICAXE Programming
primary and secondary education. The any project. The Programming Editor
PICAXE product line currently consists software — which is the PICAXE IDE — Figure 3 presents a complete
of eight Basic-programmable micro- is available free from the PICAXE schematic for the three-wire PICAXE
processors ranging in size from eight to website. It has a fairly full-featured programming interface, which only
40 pins. Each PICAXE processor is graphical user interface and runs on requires two resistors (R2 and R3). An
actually a Microchip PIC processor with Windows 95, 98, ME, NT, 2000, and optional third resistor (R1) on the serout
a built-in Basic interpreter. Complete XP. A Macintosh version of the soft- line helps by providing short-circuit pro-
documentation on the hardware and ware is not yet available, but the new tection on that line. A special program-
software specifications of the PICAXE Intel-based Macs can run Windows ming cable is available from Revolution
processors is available on the PICAXE XP, so it’s hopefully on the way! Education, but it is easy to wire a
website (www.picaxe.co.uk). The pin-out of the PICAXE-18X is standard RS-232 nine-pin connector
To get started, the most important presented in Figure 2; it has five input with the three required lines, as Figure 3
datasheets to download are the three pins and nine output pins, the majority demonstrates. Also, in order for the 18X
sections of the PICAXE manual: of which have multiple functions which to operate, the reset line (pin 4) must be
“Getting Started,” “Basic Commands,” are thoroughly discussed in the PICAXE tied high with a 4.7K resistor (R4).
and “Interfacing Circuits.” These three manual. As can be seen in Figure 2, the As you may have noticed back in
datasheets — as well as a wealth of PICAXE-18X does not include dedicat- Figure 2, the serial output programming
other useful documentation — are auto- ed crystal or resonator pins. Instead, it pin can also function as a serial output
matically included in the free download has a built-in 4 MHz resonator, which is line for your program to transmit data
of the PICAXE Programming Editor switchable to 8 MHz under program back to your PC. The Basic “sertxd”
software discussed below. All of the doc- control. Of course, this arrangement command can be used in your program
umentation is available under the “Help” frees up two of the 18X’s pins for to send text or data back to the
menu of the Programming Editor. general-purpose I/O. However, an Terminal Window of the Programming
PICAXE Basic is very similar to many internal resonator is not as accurate as Editor software. This functionality can
other implementations of Basic (includ- the external one found on the larger be very helpful when debugging a
ing Parallax’s version for the BASIC PICAXEs, but it is more than accurate program. For example, you can monitor
Stamp I), so it is a very easy language in enough for the types of tasks called for
which to program. You can download a in most applications. FIGURE 2. PICAXE-18X Pin-out.
copy of my PICAXE BASIC Summary for If your project does require more
In2/ADC2 1 18 In1/ADC1
Beginners from www.JRHackett.net to timing accuracy, there is a Basic
SerTxd 2 17 In0/ADC0/IR
get an idea of the range of powerful command (calibfreq) that allows you SerIn In7/Kbd data
3 16
commands available in PICAXE Basic. to fine-tune the 18X’s operating Reset 4 15 In6/Kbd clock
Section 2 of the PICAXE manual includes frequency. (Of course, you will need a Gnd 5 14 +V
complete descriptions and examples of frequency counter or oscilloscope to Out0 6 13 Out7
all the PICAXE Basic commands. determine when you have it right.) Out1/i2c sda data 7 12 Out6
Out2 8 11 Out5
A brief summary of the features of Also, if you need more speed (and
Out3/PWM3 9 10 Out4/i2c scicl
selected PICAXE processors is pre- who doesn’t?), the larger PICAXE
January 2007 55
Hackett.qxd 12/7/2006 8:16 AM Page 57

Getting Started With PICAXE Microcontrollers

;===== HelloWorld.bas ============================================


RESOURCES
; This program runs on a PICAXE-18X processor at 4 MHz.
PICAXE-18X ; It alternately blinks LEDs on outputs 6 & 7 (pins 12 & 13).
www.phanderson.com
www.picaxe.co.uk
;===== Constant Definitions ======================================
Character LCD
symbol LED6 = output6 ; LED on output6 (pin 12)
www.allelectronics.com
symbol LED7 = output7 ; LED on output7 (pin 13)
www.ebay.com
www.goldmine-elec.com
www.mouser.com ;===== Main Program ==============================================

Matrix Keypad main: high LED6 ; LED6 on


www.acroname.com low LED7 ; LED7 off
wait 1 ; wait 1 second
www.ebay.com
www.hvtech.com low LED6 ; LED6 off
high LED7 ; LED7 on
Five-volt Resistorized LED wait 1 ; wait 1 second
www.JRHackett.net
goto main ; do it again, forever

breadboards — their pins are usually FIGURE 6. “Hello World” Basic Program.
too short or too fat (and sometimes
incorrectly spaced) to fit properly in a from a “floating” input. You can set up you do it, but I prefer to hold the input
breadboard. One solution to this prob- your circuit so that the pin is high pin low (with a 4.7K resistor to
lem is to solder short pieces of wire to when the button is pressed and low ground) when the button is not
each button pin and plug it in that way, when it is not pressed, or vice versa. pressed and pull it high with the
but it can be difficult to press the but- Logically, it doesn’t matter which way button is pressed. That way, high (one)
ton without holding it in the fingers of
one hand and pressing with a finger of FIGURE 7. Push-Button FIGURE 8. Push-Button Adaptor Photo.
the other — a nuisance, to say the least. Adaptor Diagram.
Another solution is to solder the
button to a small stripboard (the kind
that has the holes connected by rows
of copper traces on the bottom of the
board), and then solder two small
headers placed so that the header
pins connect to the button pins.
Figure 7 presents a diagram of such a
board, and Figure 8 shows a photo-
graph of the required parts (left side of
photo), a right-side-up assembled
board (upper right of photo), and an FIGURE 9. “Hello World” Button Circuit.
upside-down assembled board (lower
right of photo) to demonstrate how
1 1 18
the parts go together. It is important to 6 R1 220
note that the strip board is used serout P
2 2 17
“upside-down,” i.e., when assembling 7 serin R2 22K I SW1
the board, the copper traces are on
3 3 C 16 R7
8
top and all soldering (including the 4 R3 4 A 15 4.7K
switch) is done on top of the board. If 9 X
+

5 10K
you want to, you can cut off the mid- 5 E

E 14
R5 220 D1
dle pin of each three-pin header since R4 6 13
they are not connected to the switch. 4.7K 18X R6 220 D2
7 12
A PICAXE input pin should always
be connected either to V+ (high) or 8 11
ground (low) in order to avoid possi- V+
9 10
ble excessive current drain resulting
January 2007 57
Hackett.qxd 12/7/2006 8:17 AM Page 58

Getting Started With PICAXE Microcontrollers


is on and low (zero) is off — it’s just across the switch — not a good thing!
easier for me to remember.
We will add our button to the LED-Toggle Challenge
“Hello World” circuit by connecting it
to Input 2 (PICAXE pin 1) as shown in Our goal in this second project is
Figure 9. The 4.7K resistor to ground to be able to control the blinking of the
holds the input low when the button is two LEDs with the input switch; each
not pressed, while a button-press pulls time the switch is pressed, the LED that
FIGURE 10. “Hello World” Button the input high. Without the resistor, is currently lit should turn off and the
Breadboard Photo. we would be creating a direct short other LED should turn on. Since we are
running out of space this month, we
will look at the actual program in Part 2
of this article. In the meantime, see if
The Standard for checking Locate shorted or leaky you can write a program that accom-
Capacitors in-circuit components or conditions plishes our goal. PICAXE Basic includes
Good enough to be the to the exact spot in-circuit a “button” command (see Part 2 of the
choice of Panasonic, Still cutting up the pcb, PICAXE manual), but we aren’t going to
Pioneer, NBC, ABC, Ford, and unsoldering every use it because it can’t be used with the
JVC, NASA and thousands part trying to guess at matrix keypad that will be introduced in
of independent service where the short is?
Part 3 of this series. Instead, see if you
technicians. $209 can accomplish the goal without using
Inexpensive enough to pay for itself in just Your DVM shows the same shorted reading all the button command. Hint: If you are
one day’s repairs. At $209, it’s affordable. along the pcb trace. LeakSeeker 82B has the not already familiar with the phenome-
resolution to find the defective component. non of “switch bounce,” read page 26
And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker in Part 3 (Interfacing Circuits) of the
guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now PICAXE manual before attempting to
thing you can lose is all the time you’re you can locate a shorted part only a quarter of write the program.
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
Conclusion
CapAnalyzer 88A LeakSeeker 82B
Available at your distributor, or call 561-487-6103 Next month, we will interface the
PICAXE-18X with a 20-character x
Electronic Design Specialists www.eds-inc.com
four-line HD44780-based LCD
display, but you can also use a display
of 16 characters by one, two, or four
lines, with or without back-lighting. Of
course, back-lighting greatly increases
the power consumption, so it is prob-
ably not suitable for battery-powered
projects. You may want to decide
which size display you want to use
and purchase one in advance (see the
Resources List). If you want to build
the entire I/O terminal, you should
also have a small matrix keyboard
(either 3 x 4 or 4 x 4) on hand, as well.
So, you have your work cut out
for you; a programming homework
assignment and a shopping list. See
you next time! NV

AUTHOR BIO
You can reach Ron via email at
Ron@JRHackett.net or visit his
website at www.JRHackett.net.
58 January 2007
Full Page.qxd 12/7/2006 7:48 AM Page 59

gh
y throu + page
our wa 10
Claw y opy of our 4 website
EE c our t
our FR g, log onto talog and ge
catalo car.com/ca s in US D.
y e
www.ja copy. All pric
your
DC Relay Switch
KC-5434 $8.75 + post & packing
An extremely useful and versatile kit that POST AND PACKING CHARGES:
enables you to use a tiny trigger current Radar Speed Gun Order Value Cost Order Value Cost
- as low as 400µA at 12V to switch KC-5429 $58.00 + post & packing
$25 - $49.99 $7.50 $200 - $499.99 $60
up to 30A at 50VDC. It has an This Doppler radar gun reads speed in km/h or
$50 - $99.99 $20 $500+ $75
isolated input, and is suitable mph up to 250 km/h or 155 mph. It has a
$100 - $199.99 $40
for a variety of triggering resolution of 1 km/h or 1 mph with an accuracy of
1%, and also has a hold switch so you can freeze the Max weight 12lb (5kg). Heavier
options. The kit parcels POA. Minimum order $25.
includes PCB with reading. There's a jiffy box to mount the electronics in,
and the enclosure for the radar gun assembly is made Note: Products are dispatched from Australia,
overlay and all local customs duty and taxes may apply.
electronic from 2 x coffee tins or similar. Details included. Kit
includes PCB and all specified components with clear
components with clear
English instructions.
Magnetic Cartridge Pre-amp
English instructions. KC-5433 $23.25 + post & packing
• Requires 12VDC power
This kit is used to amplify the 3-4mV signals
Galactic Voice Kit from a phono cartridge to line level, so you can use
KC-5431 $26.25 + post & packing your turntable with the CD or tuner inputs on your
Be the envy of everyone at the next Interplanetary Hi-Fi amplifier. The design is suitable for 12" LPs, and
Conference for Evil Beings with this galactic voice also allows for RIAA equalization of all the really old
simulator kit. Effect and depth controls allow you 78s. Please note that the input sensitivity of this
to vary the effect to simulate everything from the design means it's only suitable for moving-magnet,
metallically-challenged C-3PO, to the hysterical not moving-coil cartridges. Kit
ranting of Daleks hell-bent on exterminating includes PCB with overlay and all
anything not nailed down. The electronic components.
kit includes PCB with • Requires 12VAC power
overlay, enclosure, speaker Universal High Energy Ignition Kit
and all components. For KC-5419 $17.50 + post & packing
those who really need to A high energy 0.9ms spark burns fuel faster
get out of the house a lot and more efficiently to give
more. Take me to your you more power! This
leader. versatile kit can be
• Requires 9V battery connected to
conventional points,
twin points or reluctor
Speedo Corrector MkII ignition systems. Kit IR Romote Control Extender MKII
KC-5435 $29.00 + post & packing supplied with die-cast KC-5432 $14.50 + post & packing
When you modify your gearbox, diff ratio or change case, PCB and all electronic Operate your DVD player or digital decoder using its
to a large circumference tyre, it may result in an components. remote control from another room. It picks up the
inaccurate speedometer. This kit alters the signal from the remote control and sends it via a
speedometer signal up or down from 0% to 99% of 2-wire cable to an infrared LED located close to the
the original signal. With this improved model, the device. This improved model features fast data
input set-up selection can be automatically selected Powertool Battery transfer, capable of transmitting Foxtel digital remote
and it also features an LED indicator to show when Charger Controller control signals using the Pace 400 series
the input signal is being received. Kit KC-5436 $23.25 + post & packing decoder. Kit supplied with case,
supplied with PCB with overlay and Enhance the performance of the charger supplied screen printed front
all electronic components with with your power tool with this controller. It panel, PCB with overlay
clear English instructions. incorporates charge timeout, min and max and all electronic
temperature monitoring, components.
Delta V charge detection,
power and charge LED
indicator and more! Suits
both Ni-Cd and Ni-MH
Improv cells. Kit includes PCB Improv
e Requires 9VDC wall e
Model! d with overlay, case and all
adaptor (Jameco Model! d
electronic components.
#252751 $12.05)

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

INTERFACING STANDARDS:

RS-232
These days, there are various common interfaces available.
Choosing the best interface is not always trivial. Do you need
by Gerard Fonte

an interface to store data or to control your robot?

W
e will be concentrating on the (Small Computer System Interface), ISA The problem of two devices talking at
hardware aspects rather than (Industry Standard Architecture), and the same time is not always easy to
the software, since this is usu- HP-IB (Hewlett Packard Interface Bus solve. Some system interfaces are
ally the greatest problem for hobbyists. or IEEE-488) are parallel interfaces. extremely complex and require a seri-
The main goal of this article is to pro- The second characteristic is ous computer at the interface. Bluetooth
vide enough basic information to allow whether the interface is a hardware or is such an interface. Other system inter-
the reader to successfully interconnect system interface. These names are faces are easier to work with. USB is
their own designs to a computer via functional descriptions rather than much easier than Bluetooth but it is still
the interface. However, there is a sec- technical attributes, and some much more complicated that RS-232.
ondary goal as well, namely, to show interfaces can actually fit in both
how interfaces, in general, work. It will categories. A hardware interface is RS-232 History
be seen that while there are dozens of very straightforward. All that you need
interfaces, there are a few basic to do is provide the proper timing, and Knowing some of the history of
concepts that are repeated. Once the interface works. RS-232 and ISA RS-232 and how it developed helps in
these are understood, any interfacing are hardware interfaces. understanding some of its characteris-
design becomes a fairly straightforward System interfaces are different. tics. The first interface that enjoyed
process. What’s more, you will be able They require both a hardware interface widespread use was the Baudot code.
to design your own custom interfaces and a command interface, which usual- It was used by Western Union for their
that precisely suit your needs. ly means significant software (read teletypes, which were the most
computer) at the interface. A typical common method of sending data
Interface Classes system interface is the HP-IB. There are (telegrams) by wire until the mid 20th
only eight data lines and eight control century. This was a five-bit code that
There are four general classes of lines (which is less complex than a connected one teletype directly to
interfaces based on two characteristics, printer interface). But the HP-IB inter- another teletype. These machines
as shown in Table 1. The first character- face has to understand commands sent were not electronic, they were
istic is whether the data is transferred on those lines. At the least, you have to completely mechanical. The surprising
on a single line (serial interface) or mul- recognize when incoming signals are thing was that they actually worked
tiple lines (parallel interface). RS-232, commands. Otherwise, you will read fairly well, although slowly. They could
USB (Universal Serial Bus), Firewire, commands as data and will get really operate at about five characters per
and all wireless interfaces are serial. fouled up. Additionally, with system second (roughly 60 words per minute).
Centronics (printer interface), SCSI interfaces, there are often multiple This is slower than a good typist, but a
devices connected to a single inter- teletype could work 24 hours a day.
TABLE 1. Basic categories of interface face. This adds another level of com- Five bits (32 different combina-
types. There are many other features plexity because you will have to be tions) cannot directly incorporate all
and classes, but this breakdown is sure the interface is talking to you and the letters, numbers, and punctuation
arguably the most fundamental.
not someone else. of the English language. If they used 26
Hardware Interface System Interface Additionally, you codes for the letters, they would have
will have to have six codes left over. They created two
Serial RS-232, USB Firewire, Bluetooth, USB some means to different sets of 26 characters. One for
Parallel Centronics, ISA HP-IB, SCSI determine if the letters and another for numbers, punc-
interface is ready to tuation, and other miscellaneous
TABLE 1 listen when you talk. symbols. Then they used two of the
60 January 2007
Fonte.qxd 12/6/2006 2:59 PM Page 61

remaining six special “control” codes Carriage Return. This letter would idling or waiting or “marking” time).
to identify which set was being used. If appear (if it appeared at all) in the You turned the current off to send data.
one control code was sent, everything middle of the line and then get over- In this way, if the wire failed, the mark-
following that code was from the first written. Not a good thing. However, ing current went away and it was clear
set. That is, until the second control the convention of saying Carriage that there was a problem. This results in
code was found, then the other set Return/Line Feed, rather than Line the data being “inverted.” A logical “1”
was used. This is why there is a “con- Feed/Carriage Return, remains today. becomes zero current and a logical “0”
trol” key on present day keyboards. It’s The old teletypes used current (typ- becomes 20 mA of current. This
a holdover from teletype keyboards. ically 20 mA), rather than voltage, levels characteristic of data inversion is still
This also explains why the word for communicating. With lines thou- present in the modern RS-232 interface.
“stop” was often used instead of the sands of miles long, there was a lot of
period at the ends of sentences (as voltage noise present so this approach RS-232 Today
seen on many old movies). To create was appropriate. However, wires were
the period character, the operator had prone to failure. Naturally, it was The RS-232 interface was devel-
to press a control key, then press the important to know immediately if there oped to allow modem (MODulator/
period character, and then press anoth- was a line problem. The solution to this DEModulator) communications over
er control key to resume alphabetic problem was fairly simple. Instead of ordinary telephone “wires.” Being able
characters. This was awkward. And if turning on a current only when you to dial up a teletype or computer at
either of the control codes was forgot- wanted to send information, you did the will and without the need of dedicated
ten, the telegram data that followed reverse. You kept the current on when wires is very useful. Note that
would be nonsense. Typing “stop” took no information was being sent (when telephone “wires” are not exactly the
an extra character but was
easier and carried no risk. Pin 25 Pin Nine Pin
The remaining four control Name Full Name Direction
Spec. Computer Computer
codes were Space, Line Feed, 1 CGND Chassis Ground N/A 1
Carriage Return, and Null.
Space was obviously used to 2 TX Transmit Data (from CPU) to modem 2 3
separate words. Null was used 3 RX Receive Data (to CPU) from modem 3 2
mostly for testing. Line Feed 4 RTS Request to Send to modem 4 7
causes the teletype to move the
paper up one line. Carriage 5 CTS Clear to Send from modem 5 8
Return causes the teletype print 6 DSR Data Set Ready from modem 6 6
head to return to the extreme 7 SGND Signal Ground N/A 7 5
left. Note that a Carriage Return
8 DCD Data Carrier Detect from modem 8 1
without a Line Feed causes the
print head to return to the 9 TXCLP + Transmit Current Loop to modem 9
beginning of the same line. This 10 Not used/open N/A
caused type-over. The carriage
11 TXCLN - Transmit Current Loop to modem 11
return function also took longer
than printing a single character. 12 SSD Secondary Signal Detect from modem
So it was important to send a 13 SCTS Secondary Clear to Send from modem
Carriage Return before a Line
14 SDX Secondary Transmitted Data to modem
Feed if you wanted to start a
new line. If you sent Line Feed 15 DCEC DCE Clock (modem) from modem
and then Carriage Return, the 16 SRX Secondary Received Data from modem
paper would move up one
17 RXC Receive Clock from modem
space and then the carriage
would start to move to the 18 RXCLP + Receive Current Loop from modem 18
extreme left. But because it 19 SRTS Secondary Request to Send to modem
took more time, the first charac-
20 DTR Data Terminal Ready to modem 20 4
ter after the Carriage Return
would be “printed” during the 21 SQ Signal Quality from modem
22 RI Ring Indicator from modem 22 9
TABLE 2. Complete definition 23 DSRS Data Signal Rate Select either
of 25-pin RS-232 cable. Note
that many of these signals are 24 DTEC DTE Clock (computer) to modem
obsolete and no longer used.
The pin numbers in the right- 25 TXCLN - Receive Current Loop from modem 25
most columns refer to the stan-
dard PC serial port connectors. TABLE 2
January 2007 61
Fonte.qxd 12/6/2006 3:00 PM Page 62

FIGURE 1. Basic con-


version from RS-232
RS-232 Signal Voltages
to TTL. This is simple
and effective for Unlike most other digital inter-
most applications. faces, RS-232 uses positive and
negative voltages to define the
same as a simple twisted pair of wires. further on the nine-pin computer con- digital levels. A high voltage level is
The telephone company did (and still nector. In truth, even these nine sig- defined as being between +3 and +12
does) all sorts of things (such as nals are rarely fully used. The simplest volts. A low voltage level is between -3
inductive loading) to the wires (and RS-232 interface only requires three and -12 volts. Voltages between +3 and
signals) to enhance the performance of wires (and one of these is a ground). -3 volts are not allowed (in theory).
voice communications. This means So we will only examine these nine Converting from RS-232 to TTL
that the teletype or computer has to signals because it is extremely rare (standard logic levels) and vice versa is
use a modem to access the telephone that any other signals are necessary. most easily accomplished with an inter-
lines acoustically. Note that the signal direction can face chip. There are lots of these to
Passing 20 mA of current through be very confusing. Both the modem choose from. Maxim, Inc., has a whole
a telephone line doesn’t work. Nor do and computer receive and transmit series of widely available RS-232 inter-
digital signals. The modem converted data. The formal term DTE (Data face chips that incorporate an internal
these digital values into two different Terminal Equipment) refers to the com- charge pump to eliminate the need for
audio frequencies and sent them over puter while DCE (Data Communication a negative supply voltage. This is a very
the lines. A digital value of “0” had Equipment) refers to the modem. DTE nice feature. The prices start at about a
one frequency and the digital value and DCE are not all that clear in them- buck. There are also many RS-232
“1” had a different frequency. This selves. I use the term “modem” here to interface chips available that require a
technique was called FSK (Frequency mean the hardware that you want to negative supply voltage. Be sure of
Shift Keying). It was very slow. The connect to the computer. Usually, the what you are getting before you buy.
early modems were 110 baud or point of reference for the source of the Of course, you can always design
about 10 characters per second. signals is the computer. So, transmitted your own interface. In this case, many
Table 2 shows the original inter- data comes out of the computer and people “cheat” the specifications by
face of the full RS-232 protocol. The received data goes into the computer. assuming that any value that is not
leftmost column shows the pin specifi- RS-232 communicates asynchro- “high” is a low value. With modern
cation for each feature. Note the nously. That is, the transmitter and receiv- systems and short connections, this
presence of the current-loop wires for er operate entirely independently of assumption holds fairly well. This makes
interface to a teletype. Also note that each other. Secondly, RS-232 is a word- the receiver design (converting from
on the current 25-pin connector on oriented interface. It communicates one RS-232 to TTL) quite simple (see Figure
the modern computer many of these word at a time. Each word is treated as a 1). D1 blocks the negative parts. D2
signals are not used. This is carried separate transmission package. reduces the high voltage to a TTL value.
R1 is used for current limiting. R2
keeps the edges square by draining
any parasitic capacitance in D2.
The transmitter conversion
design (TTL to RS-232) is a bit
more complicated. Sometimes, a
TTL signal will work, so it’s worth
testing. But most often you
will have to create a negative
signal. This means that you will
have to have a negative supply
voltage available. (If you don’t, it’s
easier, faster, and cheaper to use
an interface chip.) Figure 2 shows
typical interfaces that convert TTL
to RS-232.

FIGURE 2. Basic conversion from


TTL to RS-232. You will need
one circuit for every RS-232
wire that you plan to incorporate
in your design. Conversion
chips are inexpensive and readily
available. Additionally, they
handle multiple wires.

62 January 2007
Fonte.qxd 12/6/2006 3:00 PM Page 63

RS-232 FIGURE 3. Basic format of RS-232


signal. Typically, there are eight data
Formats bits, a stop bit, and a start bit. If
parity is used, it generally takes the
The format place of the eighth data bit. There
of RS-232 data can be as few as five data bits and as
many as two stop bits, but changing
is quite variable these parameters requires changing
(see Figure 3). both the computer and modem inter-
There are four faces. They can’t be reset on the fly.
basic variables
that the transmitter and receiver must When you send and receive RS-232 can’t be sure of the alignment of the
agree on: word length, parity, stop- data, your interface software will have 16X clock with low-to-high transition.
bits, and baud rate. The word length to add or remove the start and stop Alignment could be off by as much as
can be anything from five to eight bits bits as appropriate. They are not data. ±0.5 cycles of the 16X clock. This
(remember five-bit baudot?). In nearly The baud rate is the speed at added error (worst case) reduces the
all applications nowadays, the word which data is sent. The baud rate maximum allowable clock error to
length is eight bits or one byte. applies to a single bit of the whole 0.47%. This means that a rate between
Sometimes, but not very often, word. The standard default rate is typi- 9555-9645 baud will work with a
parity is used. This is a simple error cally 9600, or 104.167 µs per bit. This standard 9600 baud UART and a 16X
detection technique. A bit is added rate inherently defines the clock speed clock. Note that your interface should
after the data to make the number of 1s of the data. But speeds from 110 to sample received data at 16X, as well.
in the data even or odd. If the receiver 921,600 are available. With the excep-
checks the data and finds that the num- tion of 110 baud, the standard rates are Handshaking
ber of 1s is not as specified, then there based on 150 baud, and rate doubles
was an error in transmission. Some old from there. For example, 150, 300, The last consideration is hand-
systems require that the parity bit be 600, 1200, 2400, 4800, 9600, and so shaking. Handshaking is used when
part of the data word, instead of an on. Not all computer systems support you need to be able to inform the
extra bit. In this case, you will be limit- all the rates. To determine what your other end of the interface that
ed to seven bits of data and a parity bit. computer supports and to set the transmission or reception can take
A computer generally has five values (for Microsoft Windows), go to: place. There are three basic forms:
options for setting parity: Even, Odd, Start >Settings >Control Panel >System none, XON/XOFF, and hardware.
Mark, Space, None. Even parity is >Device Manager >Ports >COM1 (or No handshaking means that there
when the parity bit is set to make the COM2) >Properties >Port Settings. is absolutely no way of knowing if the
number of 1s an even number. Odd A perpetual question is: How pre- receiver is ready to accept data. The
parity is when the parity bit is set to cise does your baud clock have to be? data is sent regardless. If the receiver is
create an odd number of 1s. Mark This is especially important when your not ready, or not even connected, the
indicates that the parity bit is set to a system operates with a typical micro- sent data is lost. However, this method
negative voltage. Space indicates that processor clock of 4.000 MHz. You (see Figure 4A) is by far the easiest. All
the parity bit is set to a positive volt- quickly find that 9600 into 4,000,000 you have to use is three wires:
age. None disables the use of parity won’t go. You can’t divide 4.00 MHz transmit, receive, and ground. If you
and is the typical choice/default. by any integer to get 9600. are only sending data in one direction,
Added to every data word is a start To answer the question about only that wire and ground are needed.
bit and a stop bit. The start bit comes clock precision, you first need to know Note that the transmit wire from the
before the first data bit and is always that standard UARTs (Universal computer goes to the receive wire of
high. The stop bit(s) are added to the Asynchronous Receiver/Transmitters) the modem and vice versa.
end of the data and are always low. In use an internal clock that is 16 times XON/XOFF is a software handshak-
this way, there will always be a low-to- the basic baud rate. Once the low-to- ing method. It also requires only three
high transition at the beginning of high transition is detected, they start wires: receive, transmit, and ground
every transmission. This is useful this 16X clock, wait eight clock cycles, (see Figure 4A). This approach takes
because the receiver will ignore the then read the data bits every 16 clock advantage of the full-duplex operation
data until a low-to-high is detected. So cycles thereafter. This places the “read” of the RS-232 interface. Full-duplex
if the receiver is turned on in the mid- function in the middle of each bit. means that data can be transmitted and
dle of a string of data words, it will There are eight data bits and a received simultaneously. With separate
eventually find the beginning of a word start and stop bit (typically) in each transmit and receive wires, this is clear-
and synchronize with the transmitter. word for a total of 10 bits. It would ly possible. If the receiver (at either end
The number of stop bits is vari- seem, therefore, that your clock preci- of the interface) cannot handle more
able. Old mechanical systems required sion need only be ±0.5 bits (or 5%) or data from the transmitter, the receiver
additional time to get ready for anoth- better for the last bit to properly sends the XOFF character (013 hex) to
er word. Modern systems don’t. synchronize with the UART clock. But the transmitter on the other line. The
Setting each stop bit to 1 is normal. there is another error source. You software recognizes this character and
January 2007 63
Fonte.qxd 12/6/2006 3:00 PM Page 64

FIGURE 4.The top drawing shows how to wire


the simplest RS-232 interface. XON/XOFF
requires all three wires to be connected. If
no handshaking is used and data is only
being transmitted or received but not both,
only the appropriate transmit line and
ground are needed. Full hardware hand-
shaking is shown in the bottom drawing.

before the transmitter stops. Therefore, the


receiver can’t wait until the receive buffer is
(A) completely full before sending the XOFF
character because it might lose a subse-
quent character due to transmitter delay.
The second point is that care must be taken
when you want to transmit data values that
are the same as XON or XOFF. For exam-
ple, if you are sending binary temperature
values, and one value just happens to be
013 hex, you’ve just turned off the transmit-
ter on the other end of the interface. And it
will stay off until it gets the 011 hex value.
The last handshake method is with
(B)
hardware (Figure 4B). Additional RS-232
lines are needed for this. The big problem
the transmitter stops. Once the receiver is ready, it sends the with RS-232 is that this “standard” has so many variations
XON character (011 hex), and the transmitter resumes. that it can seem as if there is no standard at all. We’ll only
There are two important points to remember. The first examine the nine-pin connector, because it is extremely
is that software takes more time than hardware. This means rare nowadays for any other type to be used. We’ve already
that it is possible for one more full character to be sent discussed the transmit, receive, and ground signals. There
are six more signals to consider.
DTR (Data Terminal Ready) and DSR (Data Set Ready)

EMBEDDED LINUX
indicate (by high levels) that the computer and modem,
respectively, are connected and ready to operate.
Generally, these are held permanently high. They are used

Starter Kit Baud Rate Versus Bits Per Second


FEATURES INCLUDE:
! Linux 2.6 Kernel Baud rate is often used interchangeably with bits-per-
second (bps), however they are not the same thing. Baud rate
! 486-133 MHz based SBC
refers to the physical ability of a medium to change state
! 10/100 Base-T Ethernet (transition rate) whereas bps refers to the amount of informa-
! Removable Flash Disk tion that can be transferred. Sometimes the baud rate and the
! 32MB RAM bps rate are the same, but most often they are not. The tech-
! Power Supply nically-correct way to specify RS-232 speed is as baud rate.
! Carrying Case It’s clear that one can choose by fiat to use any series of
! Starting at $399.00 signals to represent a binary value of one or zero. If the
! X-Windows (option) choice is to use “101010101” to represent a logical “1” and
! Eclipse Development Package “010101010” to represent a logical “0,” we see that it takes
nine transitions to represent a single bit (Biniary digIT). In
this case, the baud rate is nine times greater than the bit rate.
I magine running Embedded Linux on a Single Board Computer
(SBC) that is 4.0" x 5.7" and boots Linux from a Flash-Disk. No
hard drives, no fans, nothing to break. Now your hardware can be
It is also possible to have a bit rate in excess of the baud
rate. This can be accomplished by encoding the data using
as reliable as Linux! If your application requires video output, multiple signal parameters. The most obvious example of
the X-Windows upgrade option provides video output for a this is with high-speed modems that operate at 56 kbps
over ordinary telephone lines. Regular telephone lines are
standard VGA monitor or LCD. Everything is included;
typically limited to 3,000 Hz (or 3,000 baud). This provides a
Ready to Run Linux! For more information, please visit our possible bit rate of more than 18 times the baud rate.
website at: www.emacinc.com/trainers/linux_starter_kit.htm Since bps rate depends upon the encoding methods and
the arbitrary definition of what “information” is, it is usually
Since 1985 the improper term to use when describing interface speed.
OVER The term baud rate is more accurate because it actually
21 refers to the physical characteristics of the medium. Nearly
YEARS OF all non-RS-232 interface specifications are rated as bps (or
SINGLE BOARD bits/sec), which we see as being technically incorrect.
SOLUTIONS EQUIPMENT MONITOR AND CONTROL Unfortunately, it does not seem likely that interface specifica-
Phone: (618) 529-4525 Fax: (618) 457-0110 www.emacinc.com tions are going to change anytime soon.

64 January 2007
Fonte.qxd 12/6/2006 3:00 PM Page 65

more as hardware presence indicators when the target modem came online Recommended Books
rather than data-flow control. They by its carrier signal was also useful.
• The PC Handbook, by John Choisser
primarily indicate whether the cable is However, nowadays there is little use and John Foster, Annabooks, San Diego,
attached properly and whether power for these signals as separate lines. They CA (www.annabooks.com).
is available to the computer and are rarely used and not necessary. • PC Hardware Interfaces, A Developer’s
modem. If either of these lines fall to a Reference, by Michael Gook, A-List, LLC,
low level, data transfer stops. Conclusion Wayne, PA (www.alistpublishing.com).
RTS (Request to Send) and CTS
(Clear to Send) are the true handshak- RS-232 is the oldest true electronic very common data-exchange interface.
ing lines that control the data flow. Their interface standard that was, and still It is one of the few interfaces with
operation is very simple and straightfor- is, widely used. It has a number of which you can easily trade off speed for
ward. When the computer has data it features that are currently obsolete. distance. RS-232 allows communica-
wants to send to the modem, it sets the Nevertheless, it is still a very useful and tions of up to a kilometer or more. NV
RTS line high. Basically this is asking the
modem, “Are you ready?” If the modem
is ready and able to receive data, it will
set the CTS signal high to signal, “Yes,
I’m ready.” At this point, the computer
sends data to the modem. If, at any
time, the modem ceases to be able to
handle the data, it sets the CTS signal
low. The computer will then stop send-
ing data until the CTS signal goes high.
When the computer has finished
sending data, it sets RTS low. The
modem responds by setting CTS low.
Note that this data transfer is orient-
ed from computer to modem. This made
sense when it was initially developed
because there was no such thing as a
microprocessor at that time. The modem
had no “smarts” and was just an
analog/digital interface. Therefore, it was
assumed that the computer end of the
interface would control the interface.
Since the RS-232 interface is bidi-
rectional, there must be a means for
handshaking when the modem is send-
ing data to the computer, as well. In this
case, only one line is used — the RTS
line. If the computer cannot maintain
the data reception from the modem, it
pulls the RTS line low to tell the modem
to stop sending data. Thus, the RTS line
must be high to allow data to be trans-
mitted from the modem to the comput-
er. Since the “computer side” of the
interface is in control, the need for a
second handshaking line is eliminated.
The last two signals on the nine-
pin connector are status lines, rather
than handshaking lines. They are DCD
(Data Carrier Detect) and RI (Ring
Indicator). These are associated with
telephone signals and are not neces-
sary for data flow or data control. Way
back when, having a separate line to
indicate when the target telephone
was ringing was useful. Identifying
January 2007 65
Full Page.qxd 12/5/2006 4:16 PM Page 66

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.

15MM PIEZO CCD IMAGE SENSORS 12VDC 1000MA WALL


DISC In digital imaging and photography Charge
Coupled Devices (CCDs) capture light on
TRANSFORMER
AVX # KBS-15DA-9C-31. 2" pigtail leads. Input: 120V 60Hz 25W.
their surfaces which is converted into
CAT# PE-53 images. These CCDs are, in effect, digital Output 12 Vdc 1000 mA.

75 ¢ 10 for 65¢ each


100 for 50¢ each
cameras without lenses. We have two types,
both made by Sharp Electronics. We don’t
Screw Terminals. UL listed.
CAT# DCTX-121
each
12 VDC 97 MM CENTRIFUGAL
BLOWER
have documentation, but both are new and
should be functional. 6
$ 75
each 10 for $6.00 each

Sharp # YH9GB1. 30” USB EXTENSION CORD


AVC # F9733B12LT. 12 Vdc, Consists of two pc boards, USB-A male to
0.72 Amp, ball bearing blower. back-to-back. Overall size, USB-A female.
97 mm x 95mm x 33mm
(3.80" x 3.73" x 1.3"). Four
11" leads with 4-pin socket
connector, 0.1" centers. Two
0.84” x 1.55” x 0.7” thick.
CAT# CCD-1 $ 502 30” extension
each cord. Ideal
for use
Sharp # YH9TM1. with USB
of the leads are part of a Single pc board made memory sticks and other
trigger-terminal mechanism for 3Com Corp. direct-plug-in devices.
for switching the blower remotely. The remote
switch is easily bypassed by connecting the
1.2” x 0.65” x 0.34” thick.
CAT# CCD-2
$ 251
each
CAT# CB-393
red and yellow leads together and the black
and white leads together. See spec sheets on
our web site for more hook-up information. UL,
6 VOLT, 1.3 AH BATTERY
Maintenance-free, recharge-
$ 751
each
10 for $1.50 each
100 for $1.15 each

CSA, CE, TUV. CAT# CF-270


10 for $5.00 each $ 505
each
able sealed lead acid battery.
Can be used in any position and
can be trickle charged for
MINI-GEARHEAD MOTOR,
166:1 RATIO
Portescap
18 AMP SOLID-STATE RELAY, long periods of time.
(escap) Motor
3.85" x 2.10" x 0.98."
3-15VDC CONTROL 0.187" qc / solder term- 17 N 78 213E 1
Crydom # EZ240D18. inals. New batteries, Portescap (escap)
Control Voltage: prepped with easily removable Gearhead R16 6 166 Precision,
3-15 Vdc. Output:
18 Amps @ 240 Vac.
SCR output, low leakage solid
2.5" wire leads with qc
connectors. CAT# GC-613
$ 754 Swiss-made motor and gearhead. Quiet,
each smooth-running. Lots of torque for its size. 48
RPM @ 7.5 Vdc @ 21 mA. 17mm diameter x
state relay. 1.72" x 1.5" x 1.02" high including POWER SUPPLY, 5V/8A, 50mm long (excluding shaft). 3mm diameter x
0.25" QC/solder terminals. Mounting holes on 8mm long flatted shaft.
12V/2A, -12V/2A
2.2" centers. UL, CSA, CE.
CAT# SRLY-18
10 for $9.25 each
$ 10 50 Astec # RBT101.
each Input:
Solder lug terminals.
CAT# DCM-285
$ 1775 each
115/230 Vac. 2.1MM DC POWER JACK
Outputs:
FERRITE SPLIT BEAD 12Vdc @ 2.0A,
Normally closed shunt opens when
Self-locking plastic snap plug is inserted. Mates with coaxial
5Vdc @ 8.0A, -12Vdc
sleeve holds ferrite form power plugs with 2.1” diameter centers.
@ 2.0A. Switching power
in place. 0.43" I.D. Solder lugs.
supply on an aluminum L-bracket, 10 for 30¢ each
CAT# DCJ-1
1.33" long x 1.05" diameter.
CAT# FB-66
10 for $1.00 each • 100 for 75¢ each
$ 251 6.78" x 3.65" x 1.72".
each UL, CSA, TUV.
CAT# PS-105 7
$ 50
each 35 ¢ each
100 for 19¢ each
500 for 16¢ each
1000 for 12¢ 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.
66 January 2007
ElectronetJan07.qxd 12/7/2006 2:20 PM Page 67

> > > > g o t o w w w. n u t s vo l t s . c o m — c l i ck E l e c t ro - N e t < < < <

AM/FM Broadcasters • Hobby Kits


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

100+ Electronic Kits


and Modules
www.TechnologyKit.us

January 2007 67
ReadFeed Jan07.qxd 12/7/2006 8:56 PM Page 68

READER FEEDBACK Continued from Page 6

trical installation employing house current I would further suggest you do not enced making sure to not try using it on
carries a fire risk. The consumer must leave your furnace fan permanently a 220/240V well pump. I thankfully have
weigh the danger of having no heat in an connected to a UPS. Connect the UPS a heat-producing fireplace but I also have
emergency against their ability to install only if you are having a power-out a well. When my electricity goes out, I
a UPS safely. weather emergency, and life is threatened lose all water pressure. I have some
Yes, there are conventionally by low temperatures. water stored in two-liter pop bottles
approved ways to set up "entire-house" Kenton Chun which is not a good solution. I know that
power sources. I have one in my house. a lot of people have wells. I would sure
It does require a mains disconnect as Mr. like a follow-up of how to best do the
WELL, WELL, WELL ...
Saladino describes. This project does not same for 220/240V.
feed power back into the house mains so I really liked Kenton's article in the I really like your magazine.
it does not require this treatment. December issue. In the article, he refer- Mark

BIG “MISTEAK”?
Atmel AVR based Micro64/128 The November issue, page 8,
Embedded Controller Module reported the Earth's magnetic field at "a
mere 31T." Nothing mere about that! I
8-Channel Analog to Digital Convertor could believe 0.000031T (31uT), a
Real Time Clock/Calender million times less. If you make a
29 Digital I/O goof, make a big one I always say, it's
easier to find.
SPI & I2C Bus
Thomas S. Ely, MD
Two Serial Ports Bloomfield, NY
Serial Boot Loader
RS-232, 422 or 485 A LIGHT CHALLENGE
Selectable Baud
In regards to your TechKnowledgey
Rates up to 250 Kbps 2006 column of November ...
Only 1.5 Cubic Inches As much as I would like your
Supports Assembly, Starting at Only affirmation on LEDs being much more
BASIC and C Prog. Languages efficient light sources than fluorescent
Inexpensive CodeVision C Compiler $119 - Single Qty devices to be true, I believe it is greatly
misleading.
I urge you to read the document.
(http://www.netl.doe.gov/ssl/PDFs/LED-
Start Developing FAQ.df )
The Micro6/128 Development I put you to the challenge of conve-
Board takes the Micro64/128 I/O niently lighting a room with LEDs and use
pins and expands them out to less energy than fluorescent devices.
solder pads and headers for ease I am not even talking about price of
of connection when developing. acquisition or even deployment.
It also connects USART1 to RS-232 There are no secrets, a fluorescent
drivers or directly to screw still puts out more omnidirectional light,
terminals for RS-422 or RS-485 consumes less energy to do it, and costs
communication. USART0 is also much less than any LED on the market
connected to RS-232 drivers. The today.
RS-232 drivers are connected to Please convince me otherwise as I
two DB9 connectors. This board have been looking for a long time
includes a prototyping area so the user can add external and still have not found any practical
circuitry. There is an onboard voltage regulator for powering the omnidirectional LED lighting.
Micro64/128 and additional circuitry. The Micro64/64A/128/128A The only places the LED shines right
development system comes complete with a Micro64, Micro64A, now is in directional applications:
Micro128 or Micro128A, a Micro64/128 Development Board, and a flashlight, traffic lights, car back lights,
power supply.
and flashers.
VISIT WWW.MICROMINT.COM FOR MORE Michel Charest
L'Assomption, QC Canada
INFORMATION or Call 1-800-635-3355 Continued on Page 70
68 January 2007
Full Page.qxd 12/5/2006 4:19 PM Page 69

Logon to our website for secure shopping cart, powerful


search engine, and latest news! www.halted.com

Silicon Valley’s Electronics Marketplace


♦V
Got excess electronic inventory? Send us your list or give us a call, we’d be happy to make an offer!
Call 1-800-4-HALTED (1-800-442-5833) to order... ...or use our web search! Deals @ HSC! Search

Electro-Hobbyist Alert -- HSC is your source! Homeboxx for Modern


Even before there was a place called “Silicon Valley”, HSC was the favorite stop of hardware hackers,
Home-Wiring!
techno-tinkerers, entrepreneurs and engineers on a budget! We have been buying and selling the Valley’s
excess inventory for 40 years now, and our collection is second-to-none! We are also factory-authorized
distributors for many fine lines of parts, tools, equipment and accessories, so we feel we should be your first
stop when shopping for electronic basics. Give our ever-expanding website a try and see what we mean!
Fujitsu Laptop Power Supply ♦ Extensive line of modularized home
16VDC, 3.75 A, Fits many models data, telco & audio wiring hardware
HSC#21183 $24.95 ♦ Surface or built-in cabinets
♦ New product...search on “Homeboxx”

Solar Panel 4.7 - 5.0 VDC, .25W Wireless RF Transmitter See Website for Details!
60 x 60 mm, CuInSe for iPod
Vicor 48VDC 2.1A Flatpac Supply
HSC#80821 $4.95 HSC#80837 $12.95 Another Transceiver
HSC#80849 $27.50
Hacker Special!
USB 2.0 to IDE Drive Adaptor
HSC#80822 $14.95
5-port USB Host Card
“Backpack Bantam”
Parallel-port external CD ROM HSC#80834 $14.95
RF Transistor Engineering Kit
54 different devices
HSC#20972 $19.95
HSC#20999 $29.50
♦ S & C Electric “IntelliCAP Plus”
♦ Wireless Power Dist. Controller
♦ Dandy weatherproof enclosure
2.4 GHz Wireless Color Security ♦ 900 MHz Data Radio
Camera with Receiver Small DC Gearmotor
♦ Yagi Beam Antenna (weatherproof)
6 - 12 VDC, 3 - 6 RPM
HSC#80830 $37.50 ♦ Coaxial Cable with “N” connectors
Toroidal Transformer, 70VCT, 1A HSC#80812 $12.95 ♦ Sold for experimental purposes only!
Universal Laptop Power Supply HSC#20691 $14.95 ♦ Never used...no other info avail!
HSC#80844 $37.50 HSC#21177 $149.00
700MHz Transceiver
Hobbyist Special! Fujitsu PenCentra
PCMCIA DVD/MPEG Video Card
HSC#21067 $19.95 PCMCIA FireWire card
HSC# 20829 $12.50 Tablet Computer -
HSC# 20830 $12.50 Good to Go!
29.4 GHz Transceiver
with 12” dish -- Wow!
HSC#21154 $95.00

Tripplite Outlet Strip, 5 ft. long


USB External 2.5” Metal Drive Case Logitech QuickCam Express
HSC#20794 $39.95
HSC#80824 $14.95 HSC#21061 $19.50
2.5” 30GB Laptop IDE Hard Drive
for above case (not shown)
HSC#21248 $39.95
Pressure Transducer, 0-30 psi ♦ Fujitsu PenCentra 130 computer
Special! Buy both HSC#21066 $9.95 ♦ 131 MHz NEC VR4121 MIPS CPU
case and drive above Hands-free Cell-phone Headset ♦ 32MB DRAM, 24MB ROM, 8MB Flash
for $49.95! Step-down Toroid Transformer 2.5mm plug fits many phones ♦ Color DSTN Touch LCD 640 x 480
240 - 120 VAC 250VA
HSC#21118 $2.95 ♦ PCMCIA, VGA, PS2, USB, SIO ports
HSC#21058 $35.00 ♦ Win CE 2.11 Pro in PROM (no disks!)
♦ Microsoft Pocket Office, Outlook, IE
♦ “Radio Ready” for LAN/WAN PC Card
♦ Internal microphone, speaker & jacks
♦ Stylus, Mini Keyboard, Dock & PS
Plantronics LS1 Computer Headset
Slo-Syn Stepping Motor ♦ New, never used, 90-day warranty!
(Stereo & mic. plugs, not RJ-11) Embedded Wireless Transceiver!
Model SS-25, 120V, .3A
2.4GHz - 200mW, 5VDC Peltier Module - Electrocooler!
HSC#20725 $26.95 HSC#20948 $12.50 HSC# 80797 $159.00
HSC#21001 $65.00 HSC#80813 $24.95

Since 1964!...
Silicon Valley’s BEST place to shop for Electronics!
Three Retail Stores to serve you! Order Toll-Free: 1-800-4-HALTED (442-5833)
Look for us on...
Main Office - Mail Orders... or...ONLINE AT: www.halted.com
3500 Ryder St., Santa Clara, CA 95051 Terms: Some quantities limited; all items are subject to prior sale. Minimum order: $10.00
Santa Clara 1-408-732-1573 seller ID: plus shipping. Orders under $30.00 subject to $3.00 handling fee, in addition to shipping.
Sacramento 1-916-338-2545 hscelectronicsupply All orders shipped by UPS Surface unless otherwise specified. $7.50 UPS charge added
for COD. Visit our website for detailed information on domestic and international shipping.
Rohnert Park 1-707-585-7344

January 2007 69
ReadFeed Jan07.qxd 12/7/2006 8:57 PM Page 70

READER FEEDBACK Continued from Page 68

Writer Response: Inc., began marketing one that is said to PIC Hardware Interface article in the
It might have been better to omit produce up to 160 lm/W at 700 mA. As November issue. Keep more of these
the word "much" in the opening sen- to directionality and cost issues, sure, kinds of articles coming! As a rookie,
tence, at least with regard to fluorescents. LEDs are impractical for many applica- I'm also very interested in how I should
But there has been notable progress in tions. But the DoE's Solid-State Lighting power my PIC projects. One example
LED technology this year, and the refer- Program is aimed at fruition in 2025, and — I want to use a PIC-based system to
enced Department of Energy brochure a lot can happen in 18 years. switch a 110 VAC outlet. I'd prefer to
is somewhat behind the times in rating Jeff Eckert build my project so it plugs into the wall
white LED efficiency at 45 to 50 lm/W and uses that power for both the
maximum. Back in March, Japan's Nichia switched outlet and the PIC itself. I
PIC-ing A POWER SUPPLY
Corp. announced a white LED that know "power supply" is the answer, but
provides 100 lm/W, and last month Cree, I really enjoyed Chuck Hellebuyck's there are so many options and I know
so little.
Mark Abreu
Wilmington, NC

I'll keep that idea in mind for a


future article. Thanks for the feedback.
Chuck Hellebuyck

THE GRAVITY OF
THE SITUATION
The December 2006 edition of
N&V contains instructions for building
an east-west compass. The article states
that if you found yourself aboard the
International Space Station, you would
be in zero gravity. This is categorically
untrue. Gravity is what holds the space
station (or any satellite) in orbit around
the Earth. If you found yourself aboard
the International Space Station, you
would be in constant free fall.
Donald Smith

TUBE TIED
I really enjoyed your vacuum tube
articles in the November issue of N&V.
Although I manage a multidiscipline
engineering department in a high-tech
company making state-of-the-art optical
sensors with embedded digital systems,
my hobby is vacuum tube audio and
vintage radio restoration. I've done
several projects like the Philco PT-44 you
reported on, restored a couple of 1960's
AM/FM tube receivers, and also
designed and built tube-based audio
amplifiers.
Would it be possible for N&V
to host a permanent "tube section" for
people like me? We'll still read the
advertisements!
Roger Jones
P.Eng, SMIEEE
Toronto, Canada
70 January 2007
Showcase-News Bytes Jan07.qxd 12/7/2006 6:48 PM Page 71

NEWS BYTES
Continued from Page 33

transmission — multiple 10 Gbps-plus signals traveling over


multiple fibers or lanes, D’Ambrosia says. “There has been a
lot of maturing in 10G technology” around bonding together
multiple links, D’Ambrosia says. “Everyone [in the HSSG] has
a high comfort level that we can leverage existing technology”
to achieve a 100G standard.
A recent multi-vendor demonstration showed one possi-
ble implementation of this kind of parallel 100G Ethernet. The
test involved a pre-standard 100G Ethernet protocol stack,
which bonded together 10 10 Gbps links and transmited them
over separate optical wavelengths.
Compared to the current standard for link aggregation,
the 100G demo was “similar, but different,” says Serge Melle,
vice president of technical marketing for Infinera.
“Link aggregation groups allow you to group multiple 10G
channels together, but this has limitations on scaling,” because
a total of eight links can be bonded, Melle says. “What we
demonstrated is truly a 100G at the [media access control]
layer.”
The demonstration was conducted using a Xylinx field-
programmable gate array (a software-programmable chip),
which acted as the physical 100G Ethernet MAC layer. Traffic
from this layer was transmitted to Finisar short-reach optical
transceivers, which split the signals into 10 different 10Gbps
dense wavelength division multiplexing wavelengths, sent over
Infinera DWDM gear. At the other end of the link, the 10 sep-
arate wavelengths were reassembled so that that transmission
appeared as one logical data flow. Level 3’s optical network
was used in the demonstration, which transmitted 100 Gbps
between Houston and Tampa, FL. Copyright 1995-2006 Network
World, Inc. www.networkworld.com

MAKE YOUR EXISTING MOBILE


COMPUTERS “TALK” TO YOU
B arcoding, Inc. (www.barcoding.com/information/push-to-
talk.shtml), the nationally recognized leader in automated
data-capture solutions, announces a new Voice-Over-IP (VoIP)
technology for wireless mobile computers.
The technology allows multiple devices to communicate
with each other over an 802.11 wireless RF network. This elim-
inates the need for employees to carry voice-communication-
only devices, such as walkie-talkies or phones, because their ex-
isting data collection device can perform the voice
communication functions.
The software currently works on products from Symbol
Technologies and is Symbol +Plus Validated. Coming soon, Bar-
coding will be offering this solution on Intermec, PSC, Hand
Held Products (HHP), and LXE handheld devices. The software
is currently cross compatible with multiple operating systems,
including Pocket PC® 2003, Windows CE 4.2®, Windows Mo-
bile 5.0®, and Windows CE 5.0® devices.
Jay Steinmetz, CEO of Barcoding, Inc., says, “The ability for
a user to have an unimpaired experience with voice and data
on the same device makes this a truly unique application and
a ‘must have,’ next-generation solution for enterprises deploy-
ing Windows Mobile RF/wireless terminal devices.”
71 January 2007
NearSpace.qxd 12/5/2006 1:53 PM Page 72

SPACE
NEAR

APPROACHING THE FINAL FRONTIER


■ BY L. PAUL VERHAGE

BALLOONSATS, PONGSATS, AND


THE IDAHO CLUSTER
BOMB
THIS MONTH, I HAVE SEVERAL TOPICS to discuss.
The nice thing about them all is that they can be
expanded upon. So, expect to hear more about them
in the coming months.
■ FIGURE 1. Hobo Datalogger Controller.

I’ve used is a Hobo (see Table 1). lator and send its output through a
HOBO DATALOGGER When considered for their typicalvoltage divider. Figure 2 shows the
CONVERTER application, each data logger is very Hobo datalogger converter I’ve
capable. For instance, the Hobo is out-
designed to do just this (see Table 2).
I’ve used three forms of data log- standing for student BalloonSats. But it Since I like to use the Hobo with
gers in near space. The first two use does have a limited voltage range four external channels, I designed the
the MAX186 and ADC0834 and are (only 2.5 volts). There are many sen- converter to be used with four sensors.
components in the flight computers sors that require five volts to operate
The sensors plug into the input port of
I’ve designed. The third data logger and they produce an output voltage the converter and are powered with a
that can span five volts.
low drop-out regulator, the LM2940T-
How do you interface 5. I selected this regulator because it
a five volt sensor to a
can operate with as little as 5.3 volts.
2.5 volt Hobo? The The output voltage of each sensor is
easy answer is to divided in half with a high precision
power the sensor with voltage divider circuit. The sensor volt-
a five volt voltage regu-
ages are input to the Hobo with 3/32”
stereo jacks. The
Logger Voltage Bits of Voltage Hobo uses stereo
Name Range Resolution Resolution jacks because it
MAX186 4.096 12 1.0 mV also provides
power for the
ADC0834 5.0 8 19.6 mV
sensors plugged
Hobo 2.5 8 9.8 mV into it. The tip is
■TABLE 1 the input voltage

Part Amount
LM2940T-5 low drop-out voltage regulator 1
High precision resistors (1K or larger) 8
22 µF electrolytic capacitor 1
Three pin receptacles 4
3/32 inch (2.5 mm) stereo jacks 4
■ FIGURE 2 ■TABLE 2
72 January 2007
NearSpace.qxd 12/5/2006 1:53 PM Page 73

N E A R S PA C E

to the Hobo and the base is the asking $4 for each one to cover my
ground. So, solder the wires labeled 1, expenses. This offer is good for as
2, 3, and 4 in the output to the tips of long as I’m not swamped with orders
their respective stereo jacks. The wires (not very likely, I suspect).
labeled G are soldered to the base of
the jacks. This leaves the ring, which is
where the Hobo provides power for
PONGSATS: SMALL
sensors that need it. VOLUME, BIG POTENTIAL
I discovered while making this
circuit that the spacing between the Here’s a challenge for you. Design
Hobo input jacks is too narrow for the a near space experiment to fit inside of
diameter of RadioShack’s 2.5 mm a ping pong ball (see Figure 3). JP
stereo jacks and their housings. So, I Aerospace invented this concept sev-
used plastic and hot glue to make new eral years ago and calls it the PongSat. ■ FIGURE 3
housings for them. Begin by plugging For more information on their PongSat
all the jacks (that’s jacks without their program, go to the JP Aerospace 3/4 inch diameter opening in it.
housing) into a Hobo. Cut two pieces website (www.jpaerospace.com) and To close the ping pong ball, I
of thin plastic (I like to use the thin download their PongSat document. made a hatch from a second ping
Styrene sheeting sold at hobby shops) I’ve always felt their PongSat pong ball. I used the same plastic
to cover the top and bottom of all the documentation was too brief, so after circle template to draw the hatch, but
jacks. Give the jacks a good coating of my NearSys 06C mission, I decided to this time I drew a larger 1-3/8 inch
hot glue (don’t get glue on the Hobo) experiment a bit with them. One diameter circle. This simple PongSat
and stick one sheet of the plastic to reason I did this is because it’s a long can be filled with an experiment and
the bottom of all the jacks. After the drive from Grand Island, Nebraska to the hatch taped over the opening.
glue cools thoroughly, cover the top home. And I had to find something to I thought this would be a nice
face of the jacks and cover that with think about during my drive or I’d go beginning, but unfortunately, it would
the last piece of plastic. After the glue crazy. So here’s what I came up with. let small experiments bounce around
cools again, remove the jacks from the I’ll leave it up to the reader to decide if inside the ping pong ball.
Hobo and fill any remaining holes in mulling over PongSats worked or if I To further restrain an experiment
the housing with more hot glue. did indeed go crazy. inside the PongSat airframe, I glued a
When that glue cools, trim the hous- First, I wanted to find a good way tube into the ping pong ball. In this
ing and cover it with heat shrink. The to safely open a ping pong ball. I agree case, I used a 3/4 inch diameter card-
result is a unified housing for the jacks with JP Aerospace that trying to cut board rocket tube (this is why I cut the
in your Hobo converter. Figure 1 at one open with an Exacto knife is too hole 3/4 inches in diameter in the first
the beginning of this column shows dangerous. But I also believe that using place). The rocket tube was cut 1-1/4
what your housing should look like. a coping saw is not much safer. My inches long and super-glued inside the
There are three large holes drilled first attempt was to use a stationary opening in the ping pong ball (I’ve also
into the PCB and they’re marked as sander. I was hoping the sander would used epoxy). The 3/4 inch diameter
black circles in the parts placement smoothly sand a circular hole into the tube was used because it’s large
diagram that’s available on the Nuts & ping pong. Perhaps this will work with enough to hold a Thermochron. A
Volts website at www.nutsvolts.com a new sanding belt, but in my test, belt Thermochron for my new readers is a
These are for bolts: two to mount the friction merely created a soft spot in stainless steel can the size of five
PCB to a backing like Correplast and the ping pong ball. Next, I came up dimes that contains an entire tempera-
the third to bolt the voltage regulator with using cuticle scissors — tiny ture logger. You can read about the
to the PCB. Or, they can be used to scissors designed for very fine
zip-tie the PCB to a sheet of Correplast cutting. But scissors need a
as you can see in Figure 1. The gray line to cut along if the cut is to
colored holes in the placement dia- be accurate. So, I first drew a
gram are strain relief for the power and 3/4 inch diameter circle on a
output cables. Insulated wires pass ping pong ball by using a
through them before being soldered to plastic circle template. With a
the PCB. Their solder pads are the small drill bit (or Exacto knife),
small black dots at the end of the lines. I made a starting hole for the
The Hobo converter is a simple scissors in the ping pong ball.
enough PCB that I’ll shoot copies of Then I was able to cut a nice
the PCBs for Nuts & Volts readers who
■ FIGURE 4. The tools I used
want one. Since I can drop it in an to safely open a nice hatch
envelope with a 39 cent stamp, I’m opening in a ping pong ball.
January 2007 73
NearSpace.qxd 12/5/2006 1:54 PM Page 74

■ FIGURE 5. The exploded more change to my design. Instead of


PongSat. It’s pretty simple. taping the hatch on, I now use a rubber
PongSat. The raceways stack band. To prevent the rubber band from
each PongSat beneath the slipping off the spherical ping pong
bottom of the near spacecraft. ball, I drilled two holes in the back of
A folded piece of Dacron kite the ball that are 1/2 inch a part. The
line works very well to suspend two holes are placed so that they both
the PongSats (see the diagram fit inside the 3/4 inch tube. I passed the
in Figure 7). The ends of the rubber band through both holes. So far,
Thermochron and other iButtons at Dacron line are tied to the bottom of the rubber band has not slipped out of
the Dallas-Maxim website (www. the last module of the near spacecraft the holes, but I did tie two knots in it.
maxim-ic.com). A Thermochron isn’t after all the PongSats are added. Now the hatch needs a modifica-
1-1/4 inches tall, so to restrain it inside I finished each PongSat by paint- tion for the rubber band to hold it
the PongSat compartment, I cut two ing them and their hatches with plas- against the PongSat airframe. I drilled
disks of foam rubber to fill the remain- tic model spray paint. With a coat of a hole though the hatch’s center and
ing space inside the PongSat and to paint, the PongSats look more serious. bolted a #4 nylon bolt through it. The
cushion the Thermochron. The internal volume of my PongSat hatch is sandwiched between two
JP Aerospace loads PongSats into design is large enough that even with nuts on the bolt so that the bolt head
a hopper and launches the lot on a a Thermochron inside, there’s enough stands above the top of the hatch. The
near spacecraft. I wanted to try some- room for stuff like seeds or an insect. hatch is held in place by wrapping the
thing different, so next I designed a The Thermochron inside the PongSat ends of the rubber band around the
way to suspend each PongSat from the records how cold the samples inside bolt head. I found that the nylon bolt
near spacecraft. This gives each the PongSat get during their flight. The is a nifty handle for the hatch. This
PongSat full exposure to near space. I diagram below should clear up any design has worked well and I’ve flown
drilled two 3/16 inch diameter holes questions about my PongSat design. it on several missions in 2006.
vertically through the ping pong ball. My PongSats made their first near So far, I’m really happy with this
The holes are 3/4 inches a part and space mission in July ‘06. They were design, but I have a second one to
pass just outside the 3/4 inch diameter part of the University of Nebraska describe. I wanted to find a way to use
rocket tube inside the ping pong ball. payload that I flew on NearSys 06D. a screw-on cap in place of a hatch. So,
Two pieces of 3/16 inch OD plastic The experiment involved painting one I stopped at a hobby shop to purchase
tubing is glued through the holes to PongSat silver and the other one black plastic coin tubes. These are plastic
form two raceways through the and then looking for differences in tubes with screw-on caps that coin
their temperatures. collectors use to store their coins. It
■ FIGURE 6. Three PongSats on a loop Upon recovering my first PongSats turns out that the tube that dimes are
of kite string. The ends of the kite string
(I use a Dacron kite line) are tied in a in a corn field, I discovered that stored in has a diameter of 3/4 inches.
loop and the loops are attached to the the corn stalks snagged the PongSat So, I trimmed a coin tube to a length
bottom of a near spacecraft. During a hatches and yanked them open. I lost of 1-1/4 inches long (measured from
mission, they dangle below the near one Thermochron as a result. So, it was the end of the tube’s threads) and
spacecraft and are fully exposed to near back to the drawing board for one glued it into an opened ping pong ball.
space.
■ FIGURE 7

74 January 2007
NearSpace.qxd 12/5/2006 1:54 PM Page 75

N E A R S PAC E

■ FIGURE 8. The color of a PongSat


does affect its internal temperature, as
you can see in this chart. Note that
the Thermochrons have a minimum
temperature of -40 degrees. That’s
why the temperature data bottoms
out at -40.

As with the previous PongSat design, I


drilled holes for two vertical raceways
though the ping pong ball and glued
the plastic tubes in place. I have found
this design to be an ideal PongSat for
carrying plant seeds. Figure 10 is an
example of one of my PongSats with a
coin tube. (In the next Near Space
column, I’ll describe another variation
to the PongSat and the PongSat Flight
Computer I’ve designed.)

the bag. But if we can get the bottom seam straight. This way, there’s less
THE IDAHO seam to fail, gravity will empty the bag stress on the bag because it doesn’t
CLUSTER BOMB of its potato contents. And that is how sag under its own weight. Because of
the Idaho Cluster Bomb (ICB) works. the dowel and duct tape, the weakest
I have a different kind of experi- seam of the bag is now its bottom
ment that you can do in near space. No seam. In every flight that I have
doubt many readers have noticed that
MAKING THE ICB prepared a potato chip bag this way, it
bags of potato chips are sealed air tight For this experiment, you’ll need to has returned from near space empty.
to retain their freshness (with the addi- first purchase an inexpensive bag of Having bags of chips return
tives they add to chips, I’m surprised potato chips (Figure 12). from near space empty is nice, but I
this is necessary). So when you take a Then reinforce the top seam by wanted to know when and where they
bag of chips on a trip to the mountains, folding duct tape over it. Cut a 3/16 burst. I could get a good idea where
you’ve probably noticed that the bag inch diameter dowel a couple of the bags burst if I know what pressure
pressurizes as you climb higher. Have inches longer than the width of the is low enough to burst a bag. So, I
you ever wondered if it’s possible for chip bag. Further reinforce the seam looked around for a vacuum chamber.
the air pressure to drop so low that the by rolling it around the dowel and My plan was to pump down several
bag bursts open? Here’s how I found tape together with more duct tape. bags and average their bursting
the answer to that question. You gotta love duct tape — it can do pressure. I then quickly discovered
First, you need to know that pota- anything (Figure 13).
to chip bags are made by wrapping a Tie two nylon cords to the ends of
sheet of plastic into a tube and then the dowel extending beyond the sides
sealing the top and bottom of the of the bag, as shown in Figure 14. Use
tube. That means there are three the other ends of the nylon cords to
seams in each potato chip bag. At first tie the ICB to the bottom of a near
glance, it would seem that any one of spacecraft.
them could burst open with enough The dowel is used to keep the top
pressure. But if you squeeze a sealed
bag of chips, it’s one of the end seams
■ FIGURE 10
that invariably fails, and not the side
seam. This is good. For the most dra-
■ FIGURE 11
matic effect, we want to force the bot-
tom seam to fail before the top seam.
If the top seam bursts first, then the
product inside the bag remains inside

■ FIGURE 9. A PongSat with its hatch


closed and secured with a rubber band.
Rubber bands can make several flights
into near space before they degrade
from the cold, ozone, and ultraviolet.
January 2007 75
NearSpace.qxd 12/5/2006 1:55 PM Page 76

■ FIGURE 12 ■ FIGURE 13

■ FIGURE 14. Notice that all the


knots are wrapped in duct tape for
additional security.

half way. It took a couple of seconds


for the chips to fall out of the bag. Air
pressure inside the bag didn’t push the
that no one wanted a greasy bag of experiments along with the potato chip chips out; it was all gravity’s work. You
chips inside their vacuum chambers. bag, like balloons and marshmallows. can watch the video I made of the chip
So instead, I flew a prepared bag On the left end of the boom and well bag burst on www.youtube.com. The
along with a digital camera. The digital hidden in Figure 16 is a Fidelity DV video is called NearSys 06E and can be
camera recorded so many images that 5900 digital recorder. For two hours found by searching under the terms,
one of them captured evidence of the it recorded video of the chip bag, bal- NEAR SPACE.
bag burst (see Figure 16). loons, and marshmallows. It’s obvious
Better yet, I also sent a digital video in the video that the bag is pressurizing.
recorder with the bag of chips. In At an altitude of 15,000 feet, the
TWO ADDITIONAL
Figure 16, you’ll notice that the bag of bottom seam burst and the chips EXPERIMENTS
potato chips is attached to the right spilled out. Amazingly, when the seam
end of a boom. There are additional burst, it burst completely, there was no A part of mission NearSys 06G

DIGITAL CAMERA COMMENTS


Let me make two comments on remove the memory card and boring images to sort through than
digital cameras, both based on my download the images directly to a PC to have too few images that may
experiences. First, don’t use cameras or laptop. That way, there are no have missed something interesting.
that can only record images within camera-specific drivers to install. In My second comment concerns
built-in memory or cameras that addition, SD cards let you expand the combination digital video camera,
require constant battery power to the number of images you can still camera, and audio recorder. Not
retain images. Instead, use a digital record during a mission simply by only do these devices record, they
camera that uses SD cards. These replacing your current card with a also play back. The only problem with
cameras retain their images even larger card. When it comes to near this type of camera is that its selector
when the battery fails. Also, you can space, it’s better to have lots of switch is a rotary switch. So, it’s
possible to accidentally switch it
from record video to play back when
you insert the camera into a near
spacecraft.
I can testify that it’s really rotten to
discover that your camera tried to play
back a recorded file for two hours
instead of recording new video from
near space. Here’s where electrician’s
tape comes in handy. Tape the selector
switch to its proper setting before
loading it into the near spacecraft.
Now, it’s almost impossible to
accidentally switch it to play back and
miss that great video after recovery.

■ This video recorder is a fidelity DV


5900 camera. I get over two hours of
video with a 1 GB SD card.
76 January 2007
NearSpace.qxd 12/5/2006 1:55 PM Page 77

N E A R S PAC E

■ FIGURE 15. The camera has recorded


an image of the bag during descent,
just after the balloon has burst.

was a zip lock bag. Inside the bag,


Gene Harlan (the publisher of Amateur
Television Quarterly, www.hampubs.
com) placed a one dollar bill. The hope
was that the bag’s seam would burst
open, spilling the dollar bill. But at
recovery, we discovered the zip lock
bag remained sealed. Apparently, a zip
lock bag can retain internal pressure
better than a potato chip bag. That
means they can be used to safely send
insects into near space. So think of a
zip lock bag as an inexpensive space
suit. One precaution is in order here.
We didn’t inflate the bag fully before
sealing it shut. So a zip lock bag may
be able to fail, depending on
how much air it’s filled with before
launch. Gosh, if that doesn’t sound like
another near space experiments!
Lastly, in 2007 I want to launch a
bag of marshmallows. If the bag will
burst open, the marshmallows may
explosively expand at burst and then
fall to Earth. Won’t that make a great
video?
Until next time,
Onwards and Upwards NV

■ FIGURE 16. Look out farm! Here


comes potato chips from Idaho.
Page78.qxd 12/6/2006 10:52 AM Page 78

Turn Your PC into a Real-Time


Audio Spectrum Analyzer Interface a sharp LCD display to your BASIC Stamp® or other
micro-controller project with ease. No-solder wiring harnesses
Features and easy mounting kits available too. See www.seetron.com today.
FFT to 1048576 pts
24 bit, 192kHz • 3.2 x 1.4 in. supertwist LCD
BPI-216N
1/96 Octave • 2400/9600 baud serial
Dual Channel • Low (≈2mA) current draw
3-D Surface Plot • Great with BASIC Stamps®
Spectrogram Plot
Digital Filtering • 3.2 x 2 in. backlit LCD
ILM-216L
Signal Generation • 1200-9600 baud serial
RT-60, Leq, Delay • Advanced protocol, 4 switch inputs
THD, IMD, SNR • EEPROM for configuration settings
DDE, Logging • Favorite for OEM applications
Vibration Analysis
• 3.2 x 1.4 in. graphics LCD SGX-120L

SpectraPLUS 5.0 • 2400/9600 baud serial


• Font and 15 screens in EEPROM
• Easily draw points, lines, screens
FFT Spectral Analysis System
• 3 x 2 in. supertwist LCD
Download 30 day FREE trial! • 1200-9600 baud serial
TRM-425L

• ESD-protected, 4x4 keypad input


www.spectraplus.com • Store up to 95 screens in EEPROM

Starting at $295
1939 S. Frontage Rd. #F, Sierra Vista, AZ 85635
phone 520-459-4802 • fax 520-459-0623

PHS Pioneer Hill Software


24460 Mason Rd
Poulsbo WA 98370
360 697-3472 voice
360 697-7717 fax
pioneer@telebyte.com
www.seetron.com • sales@seetron.com

78 January 2007
Full Page.qxd 12/5/2006 4:21 PM Page 79

We search the world for time-saving,


easy-to-use state-of-the-art products!
PenScope Handheld Scope Best Scope Adapter Anywhere! EMI Tents LCD Scope

w- W
EW

!
st
Lo NE
Co
100 MHz Scope and Logic Analyzer

N
Te s t i n g

lets you do complex triggering to find


hard-to-get-at glitches, spikes, etc.
Huge 4 MB buffer for deep data
drilling and zooming. Optional built-in
swept signal generator. 2 x 10 bit EMI shielding tents made from Ni/Ag PDS5022 - 25MHz 2-ch + trig.
PP315 - High-perf. USB2.0-pwrd HDS1022M - 20MHz 2-ch
Analog channels with more than 60 dB
scope-in-a-probe! Up to standalone scope with USB dynamic range. 8 digital input lines for
fabric. -86dB 20MHz to 18GHz. Standalone bench scope with
100MS/s, 25MHz 24kS buffer. connection and 3.8” color LCD. mixed signal display and triggering. Portable - tabletop to room/lab size USB connection and 7.8”
+/-100mV to +/-20V. 20ns/div Built-in meter - great for your for on-site, on-demand pre-compliance color LCD. Built-in meter -
– 50s/div C/VB/Delphi/LabView/ tool kit. CS328 $999 testing. External PVC or aluminum great for your service kit.
CS700 (signal generator) $199
VEE drivers. $199 HDS1022M $599 frame. from $3500 PDS5022S $399
USB to I2C Ethernet to I2C Ethernet to I2C I2C for PCs I2C Monitor FREE COFFEE
I2C

Call 1-888-7SAELIG
USB I2C/IO - Provides a simple NM7010A-LF - Complete, hardwired FMod-TCP - TCP/IP server with I2C, PCI93LV: industry-standard I2C card I2C Bus Monitor - AvitProf Mention Offer# SBW
“drop-in” solution for connecting TCP/IP-I2C module. Offloads stack 19 x digital I/O, 5 x 10-bit A/D for PCs. WINI2C/PCI software monitors bus traffic on I2C or
gives windows-interface to develop to get a free
your PC to 90kHz I2C + 20 I/O for hi-speed Internet-enabling inputs, and UART serial interface. SMBus to 400kHz. Master/slave/ Starbucks Card
and debug I2C bus systems.
lines. Free software. Use mul- microprocessor systems. Drop-in Connect I2C devices/sensors UCA93LV is new USB version. multimaster. Trigger output/filter with your order!
tiple boards for more I2C/IO. W3100A-based board for instant to an Ethernet network! NOW! - transparently monitor at for scope. While supplies last -
USB I2C/IO $79 network speeds to 8Mbps. $21.99 FMod-TCP from $232 400kHz! $499 AvitProf $499 not available with any other offers

Stepper Motor Signal Wizard FPGA systems FATfile Storage Easy LCD Touch-Sensing ICs
I/O

Easy-Step 3000- Advanced stepper Signal Wizard - easy-use real-time Hunt Eng - RTG005 a new, self- Micro ALFAT-SD - Ready-made microLCD - Easy way to add 2” sq Quantum ICs - World-beating capacitive
motor drive and control system for DSP-based filter board for audio contained ready-to-go FPGA sys- way to easily add SD storage LCD to your project. microLCD sensor ICs for switching & control.
unipolar stepper motors up to bandwidth signals. Design filters tem with CameraLink connection. to your product. Serial data 128 x 128 color LCD. Add Patented Adj. Key Suppression,
35V/3A- ideal for robots/industrial in seconds without any DSP Makes an ideal starter kit for devel- in - FATfile data out. - $39.95 text/graphics/animations for Spread-spectrum, adj.sensitivity. In use
control - turns you into an knowledge! oping image processing systems. Or design-in a micro ALFAT IC any micro with serial or USB. worldwide by the world’s largestconsumer/
instant motor control expert! $119 Signal Wizard II $399 RTG005 from $2995 for MB storage - $14.00 ea. microLCD $69 appliance manufacturers <$1 (10K)
Serial-Ethernet Cable Ethernet to Serial Ether-IO Ethernet to I2C TCP/IP IC Motion Control
Ethernet

28” cable links serial devices to network EG-SR-7150MJ - Ready-to-go Ether-IO - UDP/IP-controlled 24 FMod-TCP - TCP/IP server with W3150A+ - Hardwired TCP/IP stack PIC-Servo - Motion control boards
without a PC, gives your product an serial-to-Ethernet Gateway. Simple X digital I/O board. 3 x 8-bit TTL I2C, 19 x digital I/O, 5 x 10-bit A/D - cheap micros can now have with integrated power amplifiers
instant IP address.115Kbaud RS-232 set-up for 10/100Mbps Ethernet ports each independently inputs, and UART serial interface. internet capabilities at full speed! for DC-servo/brushless-servo/
port compatible with most 10/100mpbs - 230kbps serial. Ethernet/ programmable. Connects to any Connect I2C devices/sensors 10/100 Off-loads TCP/IP burden stepper-motors. Easy connection
Ethernet hubs. Network your serial Internet-enable any serial part. TCP/IP Ethernet network. to an Ethernet network! for fast time-to-market. Ethernet- to std serial ports for powerful
product easily! eCOV-110-P $99.00 EG-SR-7150MJ <$35 Ether-IO 24 from $99 FMod-TCP from $232 enable almost ANYTHING! < $7.20 multi-axis, mixed-motor control. $160
Bluetooth Radio Data easyRADIO Wireless Controllers TinyOne Zigbee Data Modem
Wireless

Emxys PearlBlue - 100m-Bluetooth CDP-RX-02 (434MHz) - UHF easyRADIO TM Transceiver Owasys - GSM/GPRS/GPS/ TinyOne Zigbee - Complete RF Data Modem - USB-powered
module (UART master/slave bridge). Narrow Band Radio Data Receiver Modules make wireless data Bluetooth/Ethernet wireless solution for fast and reliable data radio transceiver boards add
Easy connection for micro's to PCs, and Transmitter Modules. Great transmission simple for USA controllers for M2M - for autos, transmission. Miniaturized OEM wireless RS232 to your device!
PDAs, phones, etc. IceBlue - PIC16F877 for adding wireless capability to and Europe! Add wireless capability machines, etc. RS232/485/CAN/ RF module ensures fast and easy Get remote control for your
based emb. dev. system for shortest your equipment. to your project today! A/D-I/O. integration into wireless applications. product from PC USB port!
Bluetooth development. <$119 CDP-RX-02 $144 ER900TRS from $35 (100) Owasys from $479 TinyOne Zigbee <$30 RTM-USA $89
Fast USB I/O Easy USB USB-Serial Adapter USB Bus Analyzers GPS Logger
STOP THE PRESS!
- new products
USB

arriving every day!


Byteparadigm - Fast USB 2.0 microUSB - Tiny ready-made USB USB-COM-S - Serial port for laptops Ellisys Tracker110 / Explorer200 TrackStick - Lipstick-sized logger
multichannel input or output/ Interface to 1 Mbps 0.7” x 0.5” without one! instantly adapts high-performance, economical tracks position data for shipments, Please go to
arbitrary digital waveform generator/ based on SiLabs CP2101. older RS232 products to USB! USB 1.1/2.0 protocol analyzers. vehicles, personnel, etc. Records www.saelig.com
logic analyzer. 100MB/s burst; Gnd/RX/TX Suspend, Reset, & 3.3V PC thinks it’s using COMport $999/$2999 date, time, location, speed, heading for late-breaking
thruput to 48MB/s, 22 x I/O. 100mA source –40°C +85°C. but uses the USB - 45”. USBEX300 for debugging USB and altitude at pre-set intervals - announcements.
GP-22050-BASE $1187 microUSB $25 $24.95 (1) or $18.50 (100) wireless Wimedia CALL shows route/speed on PC! $249

www.saelig.com info@saelig.com
1-888-772-3544

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


DesignCycle.qxd 12/7/2006 8:51 PM Page 80

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

CORE NETWORKING
DEVELOPMENT: ZIGBEE
WHEN RABBIT SEMICONDUCTOR RELEASES a development kit, you can be
sure that the electronics within that development kit are aimed at helping you
learn about the latest and most popular technology. If you really want to
understand how something works, purchase an associated Rabbit
Development kit. For instance, I learned about 802.11b by absorbing the
contents of their 802.11b development kit.

M y reasons for feeling this way


about Rabbit Semiconductor
development kits revolve around the
Semiconductor microprocessor control-
ling the development board to allow the
user (that’s you) to build a similar
without any significant change. The
MaxStream XBee ZigBee modules
employ a UART interface, which allows
way that the Rabbit code and libraries application based on the development any microcontroller or microprocessor
are structured. Rabbit libraries are not kit resources. In this edition of Design to immediately use the services of the
compiled object files; Rabbit libraries Cycle, we’re going to take a tour of ZigBee protocol by way of the XBee’s
are actual source code files that you the new Rabbit ZigBee/802.15.4 internal IEEE 802.15.4/ZigBee engine. All
can open with an editor, read, and Application Kit. Not only will you be the ZigBee hardware designer has to do
study. Another Rabbit plus in my book introduced to the newest of the Rabbit in this case is make sure that the host’s
is that every Rabbit development kit Semiconductor development kits, you’ll serial port logic levels are compatible
I’ve ever come into contact with also gain some knowledge about with the XBee’s 2.8-3.4V logic levels.
works as designed with no compro- MaxStream’s XBee IEEE 802.15.4-com- The logic level conversion can be
mises. The hardware is well designed pliant/ZigBee-ready transceivers. Before performed using either a standard RS-
and easy to use. we examine the Rabbit stuff, let’s take a 232 IC or with logic level translators
The idea behind all of Rabbit look at what makes up an XBee. such as the 74LVTH125 or 74HC125
Semiconductor’s development kits is to when the host is directly connected to
transfer enough knowledge about the the XBee UART. Note that I didn’t
subject, the firmware, and the Rabbit
MAXSTREAM’S XBEE require the host microcontroller to
ZigBee’s intended mission is to cut have an on-chip UART. That’s because
■ FIGURE 1. A simple three-wire the traditional wires between sensors, it is a simple thing to emulate a basic
serial interface is all you need to tie a
microcontroller to an XBee ZigBee
traditional wired slave devices, and the UART with firmware. In fact, the
transceiver. The handshaking lines microcontrollers and microprocessors Custom Computer Services C compiler
can be omitted if you follow ZigBee they serve. Thus, if ZigBee is to emulate has built-in UART emulation
rules and send small packets at low a wire, what goes in must come out facilities aimed at Microchip’s PIC
cyclic rates. microcontrollers. A
conception of a typ-
ical XBee communi-
cations link is illus-
trated in Figure 1.
Data is pre-
sented to the XBee
module through its
DIN pin and must
be in the asynchro-
nous serial format,
80 January 2007
DesignCycle.qxd 12/7/2006 8:51 PM Page 81

THE DESIGN CYCLE

which consists of a
start bit, eight data
bits, and a stop bit.
The XBee modules
require the incoming
serial signal to idle at
a logic high state.
Since the input data is
going directly into the
input of a UART with-
in the XBee module,
no RS-232 bit inver-
sions are necessary
within the asynchro- ■ FIGURE 2. The code in Listing 1 is
nous serial data stream. All of the of the MaxStream IEEE 802.15.4/ written around the capabilities of the
required timing and parity checking is ZigBee radios. The XBee-Pro effectively PCDR. If you’re Rabbit challenged, you
automatically taken care of by the radiates 100 mW of RF power versus can download the complete Rabbit
XBee’s UART, as well. the XBee’s 1 mW. Although XBee-Pro microcontroller system reference poster
from the Rabbit website.
As you would expect, the XBee radios have the same mounting
module produces a received data asyn- footprint and behave identically to their 232 converter IC to its left. As I alluded
chronous serial data stream for the host little brothers, XBee-Pro modules are to earlier, the Rabbit ZigBee/802.15.4
on its DOUT pin. So, all you need is a not included with the Rabbit ZigBee/ Application Kit XBee RF Module
simple three-wire (DIN, DOUT, Ground) 802.15.4 Application Kit, which we’re interface board can accommodate the
serial connection to put ZigBee to work about to take a look at. XBee-Pro radio module, as well.
with the XBee module. Just in case you Naturally, the host microprocessor
are producing data faster than the XBee is a Rabbit. Photo 2 shows a
can process and transmit it, the XBee
THE RABBIT RabbitCore RCM3720 microprocessor
module incorporates a CTS (Clear To ZIGBEE/802.15.4 module mounted on a RabbitCore
Send) function to throttle the data being APPLICATION KIT RCM3720 Prototyping Board. The
presented to the XBee module’s DIN Rabbit ZigBee/802.15.4 Application
pin. You can eliminate the need for the The XBee RF Module interface Kit XBee RF Module interface board in
CTS signal by sending small data pack- board that is included in the Rabbit the shot — which is not physically
ets at slower baud rates. If you’re using ZigBee/802.15.4 Application Kit is mounted to the RabbitCore RCM3720
the XBee modules in a true ZigBee fash- shown in Photo 1. The Rabbit Prototyping Board — is included for
ion, the slower speeds and small frames ZigBee/802.15.4 Application Kit XBee clarity. The Rabbit ZigBee/802.15.4
will be automatic. RF Module interface board is very Application Kit XBee RF Module inter-
A simplified view of the XBee inter- simple in design as it is only intended face board connects to the RabbitCore
nals is represented in Figure 2. to provide easy access to the XBee RCM3720 via the RS-232 connector at
Incoming data flowing through the module’s serial interface and power. A the far right of the RabbitCore
XBee module’s DIN pin is buffered by voltage regulator resides underneath RCM3720 Prototyping Board. As you
the DIN Buffer until it can be transmit- the XBee module with nothing mount-
ted. You have the option to send ed on the back side of the XBee RF
characters as they enter the DIN pin or Module interface board. There’s just
buffer up a number of characters to enough on the XBee RF Module
send as a packet. When the XBee mod- interface board to allow the XBee
ule is not sending characters, it can rest programmer access to the XBee’s seri-
in idle mode, enter receive mode, al interface and power connections.
process a command, or just sleep. The serial connector to the far left
The default mode of operation is is connected directly to the XBee serial
called Transparent Mode. In Transparent I/O pins while the RS-232 connector at
Mode, the XBee modules simply act as the bottom of the XBee RF Module
a serial line replacement. All data pass- interface board is buffered by the RS-
ing through the DI pin from the micro-
controller’s UART is queued up for RF ■ PHOTO 1. The only thing you don’t
transmission and all incoming RF data is see in this shot is the XBee’s voltage
regulator, which is nestled under the
routed out of the XBee’s DO pin to the XBee module. Otherwise, there’s an RS-
host microcontroller’s UART input. 232 converter IC, the basic interconnects,
The XBee is the low-power version and some user switches and LEDs.
January 2007 81
DesignCycle.qxd 12/7/2006 8:51 PM Page 82

■ PHOTO 2. The RabbitCore command set has been converted to


RCM3720 is primarily used in function calls that return values
Ethernet applications. However, solicited by the AT commands. Let’s
since the XBee is a serial
device and the RabbitCore wander through a simple Rabbit
RCM3720 module contains four ZigBee/802.15.4 Application Kit
serial ports, the RabbitCore Dynamic C-based XBee application
RCM3720 can be used to spawn and see if we can figure out what’s
some really interesting XBee going on behind the scenes.
applications.
RCM3720 Prototyping Board,
the RabbitCore RCM3720
XBEE FIRMWARE
module is really designed to The first order of business is to use
have its .1-inch 2x20 dual-row X-CTU to configure the XBee module
IDC header plugged into a I/O to match the XBee RF Module
user-designed production interface board hardware. X-CTU is a
motherboard. personal computer application that is
can see in Photo 2, power for the XBee I won’t post the schematics in really part of the MaxStream XBee
interface module is stolen from the print here, as you can get them easily package. The X-CTU application is used
RabbitCore RCM3720 Prototyping from the Rabbit Semiconductor web- to configure and test the XBee modules
Board power rail. site (www.rabbitsemiconductor.com). via a personal computer’s COM port.
The RabbitCore RCM3720 mod- You’ll find the complete set of X-CTU also incorporates a built-in
ule consists of a Rabbit 3000-based schematic diagrams for the Rabbit terminal emulator function. You can
microprocessor with 512K of Flash ZigBee/802.15.4 Application Kit in the download X-CTU from the MaxStream
and 512K of SRAM. The RabbitCore Product Documentation area of the website (www.maxstream.net).
RCM3720 module also includes a fully Rabbit website. Just follow the Rabbit Download the XBee RF Module
functional 10 Mbps Ethernet interface, ZigBee/802.15.4 Application Kit link. interface board schematic and you’ll
which is based on the omnipresent The XBee RF Module interface see that the Rabbit ZigBee/802.15.4
RTL8019AS Ethernet engine IC. The board in Photo 2 connects to the Application Kit XBee RF Module
RabbitCore RCM3720 module offers RabbitCore RCM3720 module’s serial interface boards are physically config-
33 general-purpose I/O lines and four port by way of a standard ribbon ured as follows:
serial ports. Although we have the cable. Rabbit firmware is written using
luxury of mounting our RabbitCore Rabbit Semiconductor’s Dynamic C • DIO0 = Output DS1 LED
RCM3720 module on a RabbitCore 9.25 compiler, which also integrates • DIO1 = Output DS2 LED
the Rabbit microproces- • DIO2 = Input S1 pushbutton switch
sor’s debugging environ- • DIO3 = ADC BAT battery voltage
ment. The XBee applica- monitor
tion firmware that runs on • DIO4 = Input S2 pushbutton switch
the Rabbit microproces-
sor is based on the XBee Thus, we can use X-CTU to set up
AT command set. The the XBee module’s I/O pins this way:
Rabbit ZigBee/802.15.4
Application Kit includes • D0 - DIO0 Configuration = 4
libraries that have taken (output low)
all of the XBee AT com- • D1 - DIO1 Configuration = 4
mands and assembled (output low)
them into simple C func- • D2 - DIO2 Configuration = 3 (input)
tion calls. The parameters • D3 - DIO3 Configuration = 2 (ADC)
of the XBee AT command • D4 - DIO4 Configuration = 3 (input)
set are entered as func-
tion call arguments in the I’ve found that pictures do indeed
Dynamic C source code. speak louder than words. So, rather
Effectively, the XBee AT than ramble along trying to explain
■ PHOTO 3. Just about the numbers behind the DIOX
anything you want to do to Configurations I just showed to you, I
an XBee or XBee-Pro can captured an example X-CTU session,
be done from this window. which you can see in Photo 3.
I’ve opened up the DIO
variables so you can match
Only the XBee End Device gets
them up to the text. the general-purpose I/O configuration
82 January 2007
DesignCycle.qxd 12/7/2006 8:51 PM Page 83

THE DESIGN CYCLE

treatment via the X-CTU. The XBee of LEDs. The ZigBee Coordinator can Poster from the Rabbit website. The
Coordinator is set up using X-CTU to possibly have access and control to all poster file can be found by following
allow devices to join the PAN and the of the ZigBee End Device’s resources. the Rabbit 3000 microprocessor link on
XBee End Device is configured via One of the unique non-IEEE the Product Documentation page.
X-CTU to automatically join the PAN. To 802.15.4/ZigBee things that can be The next step in the firmware chain
make sure things were not out of my configured on an XBee module is a involves setting the initial baud rate of
control, the PAN ID is preset to 0xAAAA Node ID. In the XBee world, a Node the Rabbit microprocessor’s serial port,
in both the PAN Coordinator and End ID (NI) is an ASCII name that is enabling the serial port flow control
Device. I also shut down every channel associated with the ZigBee node. In (RTS/CTS), and flushing the RabbitCore
except channel 11 by setting the SC our little peer-to-peer network, the RCM3720 module’s serial port buffers.
(Scan Channels) parameter to 0x0001. PAN Coordinator has an NI of That‘s all done in Part 2 of Listing 1. The
For those of you that got lost in that DIO-COORD and I assigned an NI of brdInit function has been present in
last paragraph, a ZigBee End Device is STARCHILD-1 to the End Device. every other Rabbit development kit I’ve
the least intelligent tool in the shed. A I’ll use Dynamic C’s STDIO had experience with. The initial opera-
ZigBee End Device will normally sleep window to show you the results of the tional states of the Rabbit microproces-
most of the time and only wake up to execution of the XBee library function sors general-purpose I/O are established
report the status of whatever it may be calls. The application we will be exam- within the brdInit function’s code. As
monitoring. For example, a typical ining uses the RabbitCore RCM3720’s you can see, the Rabbit Dynamic C
ZigBee End Device may monitor such D serial port. If you’ve never source code is self explanatory.
things as temperature, switch closures, programmed in Dynamic C, you’ve The next piece of code listed in
or liquid levels. The ZigBee Coordinator probably never closely examined the Part 3 of Listing 1 uses one of the XBee
is the boss of a PAN (Personal Area layout of the Rabbit microprocessors’ library functions, xb_atModeOn, in an
Network) as at power-up it seeks out a general-purpose I/O logic. Figure 3 is a attempt to contact the XBee PAN
suitable ZigBee channel and creates a graphical depiction of the RabbitCore Coordinator module, which is serially
unique PAN around itself. RCM3720 module’s Port C, which is attached to the RabbitCore RCM3720
The ZigBee Coordinator is the synonymous with PCDR in Listing 1. module via a ribbon cable. The idea
sharpest tool in the shed and in most You can get a full picture of the Rabbit behind the code in Part 3 of Listing 1
instances will rarely sleep as it has to 3000 microprocessor layout by down- is to send the initial “AT <Enter>” and
keep watch over the ZigBee End loading the Rabbit 3000 Easy Reference get the “OK” response, which will
Devices. The ZigBee
Coordinator must listen con-
tinually for incoming data LISTING 1
packets from End Devices. It #define ATCMDRSP_SP D //set to serial port A, B, C, D, E, or F
is also the ZigBee #define DINBUFSIZE 255 //PC1 = RxD -- Xbee pin 2 = Dout
#define DOUTBUFSIZE 127 //PC0 = TxD -- Xbee pin 3 = Din
Coordinator’s job to allow or #define SERD_RTS_PORT PCDR //RTS is output flowcontrol
disallow requesting ZigBee #define SERD_RTS_SHADOW PCDRShadow
End Devices to join its PAN. #define SERD_RTS_BIT 2 //PC2
#define SERD_CTS_PORT PCDR //CTS is input flowcontrol
Thus, we used X-CTU #define SERD_CTS_BIT 3 //PC3
to configure the general- #define DEFAULTBAUD 9600L //xbee factory default baud rate
purpose I/O of a ZigBee
****************************************************************
End Device that is monitor- Part 2..
ing two logic level inputs
(switch inputs) and an brdInit(); serOpen(ATCMDRSP_SP,DEFAULTBAUD);
analog-to-digital converter serFlowCtrlOn(ATCMDRSP_SP); //enable flow control
(battery monitor) input. The serWrFlush(ATCMDRSP_SP);
ZigBee End Device we serRdFlush(ATCMDRSP_SP);
configured also has control ****************************************************************
of two logic level outputs, Part 3..
which are attached to a pair printf("Trying DEFAULTBAUD (%ld) ",DEFAULTBAUD);
if(xb_atModeOn(1500)<0) // if fails try 115200
■ LISTING 1. Another big { printf("FAILED, trying (115200L) ");
plus for Rabbit is that serOpen(ATCMDRSP_SP,115200L);
their code is really easy to serWrFlush(ATCMDRSP_SP);
read and understand. serRdFlush(ATCMDRSP_SP);
For instance, ATCMDRSP_SP if(xb_atModeOn(1500)<0)
or AT CoMmanD { printf("\nTried 9600 baud and 115200 baud and Failed\n");
exit(0);
RESponse_Serial Port is }
assigned to serial port D on }
the Rabbit general-purpose printf("SUCCESS\n");
I/O Port C.
January 2007 83
DesignCycle.qxd 12/7/2006 8:52 PM Page 84

■ FIGURE 3. This is no different from any other microcontroller


you’ve had to deal with. Every microcontroller has its own
general-purpose I/O quirks and the Rabbit is no different in
that department.
verify that the correct baud rate is being used. Baud rates of
9600 bps and 115200 bps are attempted. If things blow up
during the process, the application will halt in its tracks. The
1500 in the XBee_atModeOn argument is the time required
to expire (Guard Time) before placing the XBee module in
AT command mode. A “1” is returned if the xb_atModeOn
function completes successfully.
To give you a better idea of how the XBee library
functions work and what they do, let’s execute a bunch of
arbitrary XBee library functions on the PAN Coordinator’s
Rabbit and see what they do. We’ll also execute some
useful functions aimed at the PAN Coordinator. I’ve
captured the results of the execution of the functions
in Listing 2, as well. The _atCmdRsp lines are showing
actually what is being offered up on the serial port.
Note that in Listing 2, we are matching up the PAN
Coordinator’s RF Module interface board configuration to
the application’s hardware configuration using a series of
LISTING 2 xb_setDX function calls. We also could have foregone using
*Get the channel number X-CTU to assign a Node Identifier as the xb_setNI function
xb_getCH(); call in Listing 2 does that for us.
_atCmdRsp: Tx=ATCH
_atCmdRsp: Rx=B The next code sequence shown below is exclusive
to XBee modules operating in a network. The xb_getND
*Get the 64-bit IEEE 802.15.4 assigned address function fires off a data sequence that attempts to locate all
xb_getSH(); of the XBee nodes in radio range. The ND (Node Discover)
_atCmdRsp: Tx=ATSH
_atCmdRsp: Rx=0013A200 function searches the network for XBee modules and if
found returns their 16-bit short address, their 64-bit IEEE
xb_getSL(); address, the signal strength, and their Node Identifier.
_atCmdRsp: Tx=ATSL
_atCmdRsp: Rx=4008DD8D
int rval,samples,chi,dio,adc;
* Set the Node ID char data[1024]; // must be large enough to hold
xb_setNI("DIO-COORD\r"); // all discovered nodes
_atCmdRsp: Tx=ATNI DIO-COORD char *ptr;
_atCmdRsp: Rx=OK
printf(“Discovering Nodes... \n”);
*Setup I/O for the XBee RF Module Interface Board xb_atModeOn(1500);
xb_setD0(5); // out high waitfor((rval=xb_getND(data)));
if(rval>0)
_atCmdRsp: Tx=ATD0 05
{ printf(“ Found nodes:\n”);
_atCmdRsp: Rx=OK
ptr = strtok(data,”\r”); // first call to
// strtok needs buffer
xb_setD1(5); // out high while(ptr != NULL)
_atCmdRsp: Tx=ATD1 05 { printf(“ MY: %s”,ptr);
_atCmdRsp: Rx=OK printf(“ SH: %s”,strtok(NULL,”\r”));
printf(“ SL: %s”,strtok(NULL,”\r”));
xb_setD2(3); // S1 pushbutton printf(“ DB: %s”,strtok(NULL,”\r”));
_atCmdRsp: Tx=ATD2 03 printf(“ NI: %s”,strtok(NULL,”\r”));
_atCmdRsp: Rx=OK printf(“\n”);
// see if there is another node
xb_setD3(2); // ADC3 for battery monitoring ptr = strtok(NULL,”\r”);
_atCmdRsp: Tx=ATD3 02 }
_atCmdRsp: Rx=OK printf(“End\n”);
xb_setD4(3); // S2 pushbutton
_atCmdRsp: Tx=ATD4 03 When a node is discovered, it associates with the PAN
_atCmdRsp: Rx=OK Coordinator in the standard IEEE 802.15.4 fashion and ships
■ LISTING 2. The _atCmdRsp
*Exit AT Mode lines are showing what back the data package I captured in Sniffer Capture 1
xb_atModeOff(); actually is being offered up (available on the Nuts & Volts website at www.nutsvolts.
_atCmdRsp: Tx=ATCN on the serial port in response com). Let’s see if we can figure out what is going on here.
_atCmdRsp: Rx=OK to the function calls. Here’s the Dynamic C STDIO printout:
84 January 2007
DesignCycle.qxd 12/7/2006 8:52 PM Page 85

THE DESIGN CYCLE

Discovering Nodes... ■ FIGURE 4. Nothing to it. Just match up the bits in the
Found nodes: channel indicator to the bits in this figure. The DIO bits
MY: FFFE SH: 13A200 SL: 4008DD58 DB: 28 NI: correspond to the setup we performed in Listing 2. The
STARCHILD-1 analog-to-digital converter value speaks for itself here.
End
printf(“Forcing input samples for the local XBee...
And, here’s the hex dump of the data array gleaned \n”);
xb_getIS(data); // force sample, get ADC
from the response frame sent by the XBee End Device: samples = axtoi(strtok(data,”\r”));
chi = axtoi(strtok(NULL,”\r”));
dbf2: 46 46 46 45 0D 31 33 41 32 30 30 0D 34 30 30 38 dio = axtoi(strtok(NULL,”\r”));
FFFE 13A200 4008 adc = axtoi(strtok(NULL,”\r”));
dc02: 44 44 35 38 0D 32 43 0D 53 54 41 52 43 48 49 4C printf(“ samples(%04X) channel Indicator(%04X)
DD58 2C STARCHIL active I/Os(%04X) ADC3(%04X)\n\n”,samples,chi,dio,adc);
dc12: 44 2D 31 0D 00 00 00 00 00 00 00 00 00 00 00 00 xb_atModeOff();
D-1
Here’s what the data gathered from the PAN
All of the data fields in the data array are delimited by Coordinator’s general-purpose I/O pins looks like in Rabbit
a carriage return character (0x0D- “\r”). The strtok (string microprocessor memory:
token) function in Code Snippet R.5 is used to parse the
data fields of the data array using the carriage return as the dbf2: 31 0D 31 30 31 37 0D 30 30 30 0D 31 45 37 0D 00
delimiter. The only piece of data that may not be obvious 1 1017 000 1E7
is the signal strength value, which is
converted to decibels before being
output to the Dynamic C STDIO
debugging window. A NULL (0x00)
indicates the end of an End Device’s
data structure. Multiple End Device
data structures can be held in
the data array, which is allocated as
1024 bytes.
Now, let’s look at some code that
produces input samples from the PAN
Coordinator’s general-purpose I/O.
The sequence of events taking place
in the code below work on the
general-purpose I/O setup we pro-
grammed into the PAN Coordinator
XBee node earlier. This code could
also be run on the ZigBee End Device
and transmitted to the PAN
Coordinator. In this case, the input
samples would more than likely be
used by a personal computer collect-
ing data from the PAN Coordinator.
January 2007 85
DesignCycle.qxd 12/7/2006 8:52 PM Page 86

Amazing Devices
And, here’s the resultant printout in the Dynamic C STDIO debugging window:
www.amazing1.com
Laser Modules Forcing input samples for the local XBee...
All laser modules operate from 3 volts and include built in optics
samples(0001) channel Indicator(1017) active I/Os(0000) ADC3(01E7)
providing a parallel beam of 1mr or less. Includes instructions on
safety requirements for FDA full compliance
Red - Class IIIa
LM650P3 - 3mw 650 nm12 x 45 mm ........ $14.95
You can readily see the relationship between the data fields in the hex dump,
LM650P5 - 5mw 650 nm 12 x 45 mm ....... $24.95 the argument fields of the printf function in the code, and the Dynamic C STDIO
LM630P3 - 3mw 630 nm 10.5 x 45 mm .... $34.95
Red - Class IIIb printout. This data was not presented to the RF portion of the XBee and therefore
LM650P10 - 10mw 650 nm 12 x 51 mm ... $99.95
LM650P30 - 30mw 650 nm 12 x 51 mm . $249.95
there’s no Daintree Networks SNA capture to show. So, let’s figure out how the
Green - Class IIIa data in the Dynamic C STDIO window came to be.
LM532P5 - 5mw 532 nm 12X45 mm ........ $49.95
Infrared - Class IIIb The first two data indicators are easily explained with a look at the top half
LM980P30 - 30mw 980 nm 12X30 mm ..... $49.95
Laser Diode Visible Red - Class IIIb
of Figure 4. If you simply match up 0x1017 — which is the channel indicator value
LD630-P10 - 10mw 635 nm 5 mm diode .... $29.95 — to the bit layout in Figure 4, you’ll find that in Listing 2 we actually defined and
High Voltage Capacitors set up every one of the active general-purpose I/O channels in our code.
Ceramic capacitors for voltage multipliers, etc. Pushbutton switches on the XBee RF Module interface board are connected
22/6KV - 22 pfd 6kv .28” x .17” ................. $.35
50/6KV - 50 pfd 6kv .325” x .18” ................ $.45 to DIO lines D2 and D4. Thus far, I have pressed no buttons as the active I/Os
100/6KV - 100 pfd 6kv .46” x .17” .............. $.65
200/3KV - 200 pfd 3kv .3” x .25” ................ $.45
value is equal to 0 (zero). To provide you with a better example of how the DIO
270/3KV - 270 pfd 3kv .3”d x .25” .............. $.45 fields work, I captured a session in which I depressed the S1 and S2 pushbuttons
470/10KV - 470 pfd 10kv .35”d x .25” ......... $.75
1000/20KV - 1000 pfd 20kv .5”d x .37” ..... $2.25 on the XBee RF Module interface board respectively. Here’s what the Dynamic
.01/2KV - .01mfd 2kv .63” x .13” ............... $.50
C STDIO window showed:
Energy Storage Capacitors
Electro-kinetics,wire exploding, can crushing, emp, etc.
25M/5KV - 25 mfd 5 kv 312J 10 x 4 x 3 can ...... $100.00 Discovering Nodes...
32M/4.5KV - 32 mfd 4.5 kv 324J 9 x 4 x 2 can ... $170.00 Found nodes:
10002M/2KV - 1000 mfd 2 kv 2K J 4 x 8 x 7 can $299.00 MY: FFFE SH: 13A200 SL: 4008DD58 DB: 32 NI: STARCHILD-1
1.3M/100KV - 1.3 mfd 100 kv 6500J case ........ $750.00
End
High Voltage Transformers Forcing input samples for the local XBee...
Includes circuit schematics on how to use. samples(0001) channel Indicator(1017) active I/Os(0004) ADC3(01E7)
28K089 - 7kv 10ma 30 khz 9-14v 1”cube . $19.95
28K074 - 4kv15ma 30 khz 9-14v 1”cube . $17.95
28K077 - 2kv 10ma 30 khz 7-9v .7x1.25 .... $9.95
Discovering Nodes...
CD25B - 20 kv trigger pulse 1 x 1.25 ...... $16.95 Found nodes:
CD45 - 40 kv trigger pulse 1.25 x1.25 .... $18.95 MY: FFFE SH: 13A200 SL: 4008DD58 DB: 43 NI: STARCHILD-1
TRAN1035 - 10 kv35 ma bal output ........ $39.95
FLYLABURN - 10 kv 60 ma end grd ...... $49.95 End
FLYEXP - 4 misc flybacks ................... $24.95 Forcing input samples for the local XBee...
FLYHP - High power large flyback ........ $34.95 samples(0001) channel Indicator(1017) active I/Os(0010) ADC3(01E6)
High Volt/Freq Modules
12 vdc with instructions on how to use.
MINIMAX1 - 1kv15 ma 35 khz ................ $17.95 If you match up the 0x0004 with the DIO layout in the lower half of Figure
MINIMAX2 - 2kv10 ma 50 khz ................ $17.95
MINIMAX3 - 3kv10 ma 35 khz ............... $19.95 4 and then correlate that back to the code in Listing 2, you’ll see that I was
MINIMAX7 - 7kv10 ma 35 khz ................ $34.95
SS01S - 1 to 7kvac for ozone .............. $24.95 holding down the S1 pushbutton, which is tied to DIO2. Depressing S2 produced
GRADRIV10 - 7.5 kv15 ma 35 khz adj .... $79.50
PVM300 -20kv25ma 115vac input ......... $179.95
an active I/O value of 0x0010 that directly relates to DIO4 in Figure 4.
High Volt DC Modules
12 vdc with instructions on how to use.
PBK40 - 10 kv 100ua 9 vdc in .................. $34.95
INSTANT ZIGBEE
CHARGE10 - 10kv 2.5 ma ....................... $59.95
SHK10 - 2kv 10 ma shocker .................... $39.95 We by no means covered all of the functionality of the Rabbit
TRIG10 - 20 kv trigger/shock pulses ........ $54.95
SS016S - +20kv 100ua ............................ $29.95 ZigBee/802.15.4 Application Kit and the Dynamic C library code that
SS010S - -20kv for neg ions .................... $24.95 accompanies it. However, we did see how easy it was to get a couple of XBee
Parts for Tesla Coils ZigBee nodes up on a ZigBee PAN.
Includes plans for two of our coils. Parallel for 60&120ma.
4KV/.03 - 4kv30ma60hz floating output ........ $59.95
It’s pretty obvious that the firmware loaded on the XBee modules is an offi-
6.KV/.02 - 6.5kv20ma60hzfloat output ......... $59.95 cial IEEE 802.15.4 MAC and PHY implementation rolled in with some proprietary
9KV/.03 - 9kv 30ma60hz midgrd output ..... $79.95
12KV/.03 - 12kv30ma60hz midgrd output .... $109.95 XBee functionality. The XBee modules are
15KV/.03 - 15kv30ma60hz midgrd output .... $139.95 designed to work right out of the box and
14.4KV/.5A - 14.4kv.5amp pole pig ............ $699.95
Spark Gaps and Electrodes so are the Dynamic C-backed Rabbit XBee SOURCES
RF interface boards. Although it is ■ Rabbit Semiconductor — Rabbit
SPARK1 - Fan cooled dual gap 3/8” tungsten $149.95
SPARK05 - Single gap 1/4” tungsten ............ $49.95
TUNG141B - 1/4” x1” pair electrodes with holders tungsten $14.95
TUNG38 - 3/8” x2” pair electrodeswith holders tungsten .... $59.95
always good to have some background ZigBee/802.15.4 Application Kit —
www.rabbitsemiconductor.com
Toroidal Terminals knowledge, no prior IEEE 802.15.4 or
TO8 - 8 x 2” Spun Aluminum Toroid .... $59.95
TO12 - 12 x 3” Spun Aluminum Toroid . $79.95 ZigBee experience is necessary to ■ Daintree Networks SNA/Daintree
TO24 - 24 x 6” Spun Aluminum Toroid $399.95
TO30 - 30 x 7”’ Spun Aluminum Toroid$525.95
assemble a ZigBee PAN using XBee Networks — IEEE 802.15.4/ZigBee
See website for more data on above items modules and Rabbit microprocessors. Sniffer Software — www.daintree.net
Minimum order is $25.00. Volume pricing available That makes the XBee/Rabbit combination
Information Unlimited, Box 716, Amherst, NH 03031 USA
Orders: 800-221-1705 Info: 603- 673-6493 Fax: 603-672-5406
easy to incorporate into your ZigBee ■ MaxStream — XBee and XBee-Pro —
www.maxstream.net
Email: riannini@metro2000.net Design Cycle. NV
86 January 2007
PersonalRobotics.qxd 12/6/2006 2:43 PM Page 87

PERSONAL ROBOTICS
UNDERSTANDING, DESIGNING & CONSTRUCTING ROBOTS & ROBOTIC SYSTEMS
■ BY PHIL DAVIS

MOTOR TEST LAB — PART 1


BEING AN AMATEUR ROBOTICIST, I am always looking for parts of varying
kinds from which to build robots and, since most of the bots I like to construct
are mobile, one of the major requirements are brushed DC motors.

Y ou can find brushed DC motors just


about everywhere; new on the
Internet, on eBay, on Internet sites which
• Performance under load
• Etc.
came across a product by Medusa
Research, Inc., called the Power
Analyzer Pro and as my friend says, this
sell surplus components, and possibly at Certainly these questions are more had the “smell of almost done.” My
your local walk-in surplus store. The than my simple setup can easily offer, thoughts were that I could use this
thing is, unless you buy it new — which so I set out to look for something a bit device as the center piece of my test
can be expensive — you have no real more capable and with which I could lab and be in production in short order.
idea about the capability of the motor. build my Homemade Motor Test Lab. The Power Analyzer Pro comes as
For example, how do you know what Relative to the robotics hobby, a package with a number of items (see
the ‘stall’ current is so you can use an the radio control hobby is much more Photo 2):
H-bridge of the right size, or how do you mature. Radio control enthusiasts
know what the max RPM is etc., things have been doing their thing for tens of • The analyzer device itself
which can make or break your bot. years. That’s not to say that roboticists
The best thing you can do is get haven’t, it’s just that the R/C hobby • A USB cable for connecting the
one in your hands and test it. has been more commercialized. device to your PC
For several years, I’ve been using Because of this, there are lots of R/C
my own crude test setup using analog components readily available in the • An electronic scale
meters, as shown in Photo 1. Using marketplace such as battery packs,
this setup, not only can I charge my servos, etc., and many of these are • An IR emitter/receiver sensor and
LiPol batteries, I can connect the easily adaptable for robots. cable for measuring RPM
meters in series with a motor and
battery, switch to ‘monitor’ mode, and • Two temperature sensors and cables
watch the amps and voltages change
THE DC MOTOR POWER
as the motor is running. ANALYZER As you can see, this is quite a
This has served me well, but recent-
ly I decided I wanted to understand a Searching through the R/C world, I ■ PHOTO 1. Homemade test setup
little bit more with analog meters.
about the motors
I use, especially
Tupperware
things like: container

• High-end RPM
• A PWM to RPM
graph
• An RPM to
current-to-
voltage graph
• Torque

■ PHOTO 2. Power Cables


for Power Cable for
Mode Switch
Monitor/Charge
Analyzer Pro Monitoring Charging
package.
January 2007 87
PersonalRobotics.qxd 12/6/2006 2:43 PM Page 88

battery pack and/or the can of the


motor. The scale is for measuring
thrust from the prop of the motor being
tested. The Power Analyzer is quite
a sophisticated device and when
connected to your PC with the
provided USB cable, it is capable of
■ FIGURE 1. Power Analyzer Pro remotely controlling a DC motor and of
connection to CPU diagram. measuring and graphing many of the
critical parameters. Just what I want!
My task now was to take the
analyzer and build it into a system for
testing my ad hoc motors. If you look
at the connection diagram in Figure 1,
you can see an example of how the
analyzer might be used in an RC
application. Of particular note is the
ESC. An ESC in the R/C world is an
■ FIGURE 2. Power Analyzer electronic speed control which sits
connected to CPU. between the battery and the motor
and is connected to an output from
complete package designed primarily package of an R/C airplane. The the R/C receiver allowing the user to
for measuring the current, voltage, temperature sensors are, for example, control motor speed remotely by mov-
RPM, and torque of an electric flight measuring the temperature of the ing the throttle on the transmitter.
However, from Figure 1, you can
see that in this case the ESC is not
LISTING 1. Interrupt routine. connected to an R/C receiver, but is
//---------------------------------------------------------------------------------------
connected to an output from the
// Function: Int 0 interrupt handler Power Analyzer. This output emits
// Action: Used to measure a 1-2ms input pulse exactly the same style of PWM (Pulse
// Comment: A smoothing filter might make this work a little better Width Modulation) as that emitted by
// eg. a 4 or 5 length moving average an R/C receiver and so is able to
//---------------------------------------------------------------------------------------
SIGNAL (SIG_INTERRUPT0)
programmatically control the speed of
{ the motor. This is obviously great for
if(PIND & 0x04) { // is pin high testing purposes.
PulseWidth_Start = TCNT2; // get start of time period
} else {
PulseWidth_End = TCNT2; // get end of time period H-BRIDGES AND ESCs
if(PulseWidth_Start > PulseWidth_End) {
RC_Width = (0xff - PulseWidth_Start) + (PulseWidth_End); Hmmmm. Thing is, in the robotics
} else { world, we tend to use H-bridges not
if(PulseWidth_End > PulseWidth_Start) { ESCs and worse yet, the PWM we use
RC_Width = PulseWidth_End - PulseWidth_Start; to drive an H-bridge is quite different
}
} than that emitted by an R/C receiver.
} Let’s look in more detail at the
PWM generated by an R/C receiver
// RC_Width will now have a range of 128 - 255 (in theory) which is intended as input to a servo or
Width_raw = RC_Width; // get for debug purposes
ESC. The width of the pulse of this sig-
if (RC_Width <= 127) // clip as timing may be off slightly nal is typically between one millisec-
RC_Width = 128; ond and two milliseconds long; in the
case of a throttle, 1 ms corresponds to
if (RC_Width >= 255) // clip as timing may be off slightly off and 2 ms corresponds to full speed.
RC_Width = 255;
The second consideration is the fre-
RC_Width = RC_Width - 128; // scale to 0 - 127 quency at which this pulse is emitted
every second. Typically, the pulses
RC_Width = RC_Width + 128; // scale for H-Bridge PWM use come every 20 to 30 milliseconds
RC_Width_cpy = RC_Width; // make copy for use in tasks. which means the frequency is in the
range of 30 to 50 times per second;
}
probably closer to 40, that is 40 Hz.
88 January 2007
PersonalRobotics.qxd 12/6/2006 2:45 PM Page 89

PERSONAL ROBOTICS

On the other hand, the


PWM we drive an H-bridge LISTING 2. FreeRTOS task to output PWM.
with is quite different. The //---------------------------------------------------------------------------------------
width of the pulse goes from // Function: test_motors -- (FreeRTOS Task)
zero time to the time interval // Action: drive PWM
defined by the frequency. The //---------------------------------------------------------------------------------------
void test_motors(void *pvParameters) {
frequency used to drive an (void) pvParameters; // The parameters are not used.
H-bridge varies greatly, from a
few kHz to 100 kHz or more. portTickType xLastWa keTime;
Quite a difference from the const portTickType xFrequen
cy = 4; // delay 5 milisec ticks (4)
PWM used to drive RC devices.
drive_pwm(128); // set to zero speed
To make this system work, I
needed to convert the R/C xLastWakeTime = xTaskGetTickCount(); // Get base ClockTick for delay timer
PWM to a PWM more accept-
able to the H-bridge I wanted // Cycle for ever
to use. This involved taking for( ;; ) {
the output from the Power drive_pwm(RC_Width_cpy); // output PWM to H-Bridge
Analyzer and feeding it into my
own CPU board, converting it vTaskDelayUntil(&xLastWakeTime, xFrequency);
to the PWM style I wanted, and
then sending it back out to an }
}
H-bridge. See Figure 2 for the
configuration of this system.
updates the PWM hardware 50 times lay the components out on a piece of
a second with the current pulse width plywood, to keep everything in place
RC PWM TO as generated by the interrupt routine. and to make it easy to move around.
H-BRIDGE PWM The PWM hardware on the Mega32 Please see Photos 3 and 4 for the
was set to a fre-
The CPU board I am using is based quency of approxi-
around an Atmel Mega32. Converting mately 8 kHz.
Power On/Off
of the PWM from one form to another Switch
required the writing of a small interrupt Atmel

routine, which would measure the


BUILDING 5 Amp
Fuse
Mega32

width of each individual pulse, scale it THE TEST


accordingly, and send it out the PWM LAB Matrix Orbital
Graphics LCD Cable from
hardware of the Mega32. ESC out to
Interrupt 0
Interrupt zero on the CPU was set For neatness’
to generate an interrupt on either the sake, I decided to
leading or trailing edge of a pulse. The
interrupt routine reads the value of a ■ PHOTO 3. Physical
timer at the beginning of the pulse layout of the Motor
Test Lab, top view.
and again at the end of the pulse and
subtracts the two to give the pulse
width. Please see Listing 1 for the 12 Volt 7.5Ah
source of this routine. The timer used Battery
for the width measurement was Matrix Orbital
Graphics LCD Surplus
pre-scaled and I should mention that Motor
5 Amp
the H-bridge is set so that 128 corre- H-bridge
sponds to zero and 255 corresponds RPM Disk
to max, in a specific direction.
Since I’ve been using FreeRTOS
for the last several projects, I saw no
reason not to use it in this project,
even though the task required was Charred
very simple. Please see Listing 2 for black mark
RPM
the source of this task. This task Medusa Research Sensor
Power Analyzer
■ PHOTO 4. Physical layout of the
Motor Test Lab, oblique view.
January 2007 89
PersonalRobotics.qxd 12/6/2006 2:46 PM Page 90

■ PHOTO 5. Motor with with a hot glue gun.


Disk with 8 disk and RPM sensor.
‘lines’
The CPU board has a set
of wires going to a five amp
MEASURING THE RPM
RPM Sensor
H-bridge. I used to have The Power Analyzer does an
two identical H-bridges, the excellent job of internally measuring
second one being where the the voltage, the current, and the
black charred spot is. After applied throttle (PWM). However, to
accidentally reversing the measure the actual RPM, it needs to
polarity of the battery and have an external sensor.
letting the smoke out of the This sensor is an IR emitter/
H-bridge (rather loudly, I might collector pair and in the primary RC
add), I quickly installed a five application of the Power Analyzer, it
amp fuse. The CPU board is is used to measure the RPM of
also connected via I2C to a an airplane propeller. The software
Copper Wire Matrix Orbital LCD (I’ve provided is quite smart in that it
for easy removed the connecting wires allows the selection of the number of
adjustment
for now as they were rather blades on the prop (e.g., two blades
long). or four blades or seven, in the case of
finished layout. The boards have From the H-bridge, there is a a ducted fan) and scales the RPM
rubber feet so as not to scratch any pair of wires running to the current appropriately. This gave me the idea
surfaces such as the kitchen table — motor under test. This motor is of making a disk out of foam board,
an important feature. mounted on a separate board so I and sticking a cut-out circle of paper
As you can see, the Power can exchange motors, drill holes, printed with a pattern of lines which
Analyzer has several cables coming and manhandle it without disturbing I created with a drawing program
out of the side facing the camera. One the electronics. onto it.
is the USB cable going to my laptop, The motor in the photo is one I In Photo 5, you can see I made
one is the cable going to the RPM purchased at our local surplus this disk with 16 lines. As it turned out,
sensor (more on that later), and one store, Electronics Exchange. Aside this worked very well and, with one of
is the cable from the Analyzer ESC from feeling the weight and noticing the features of the Power Analyzer
output going to interrupt zero on my the size, I had no idea about its software, I was able to include a
CPU board. performance when I bought it. The formula which divided the measured
Power is coming in from a 12 volt can of the motor is approximately RPM by eight, simulating a two blade
7.3 Ah battery on the top left to an three inches long and two inches in propeller.
on/off switch and a five amp fuse; diameter and the cost was $6. Why you might ask, did I use 16
from there, it feeds the analyzer and The H-bridge, on/off switch, lines instead of two or even four and
the CPU board. and motor are all fixed in place let the Power Analyzer software
manage the
RPM count? The
Analyzer was
designed to
measure very
high speed
propellers and
has a minimum
resolution of 25
RPM. Since I
want to be able
to test gear
motors — which
at low PWM,
may be turning
at one or two
RPM — I needed

■ PHOTO 6.
Preliminary
result of a
surplus motor.
90 January 2007
PersonalRobotics.qxd 12/6/2006 2:46 PM Page 91

CALL OR
to trick the software into thinking that
there were more revolutions than there
actually were. A disk with 16 lines
CALL
TOLL-FREE
TO ORDER C&S SALES E-MAIL US
FOR OUR
FREE
should allow me to read 1-2 RPM. (800) 292-7711 www.cs-sales.com CATALOG!

SUMMARY Elenco® Snap Circuits


Elenco’s new Snap Circuits make learning electronics fun and easy. Just follow the colorful pictures in
This month, I wanted to go over our manual and build exciting projects, such as: FM radios, digital voice recorders, AM radios, burglar
the basic construction of my lab, alarms, doorbells, and much more! You can even play electronic games with your friends. All parts are
mounted on plastic modules and snap together with ease. Enjoy hours of educational fun while learning
detailing the various aspects and about electronics. No tools required. Uses “AA” batteries.
issues of its construction. As a teaser 6 versions available.
for next month, Photo 6 shows some Great
Build up to 750 projects!
preliminary results of the surplus Gift
As low as $29.95 Idea!
motor shown in the previous photos.
From the graph, it turns out that the
Create
motor — when running flat out at Your Own
100% PWM — draws about 1.7 amps Exciting
to 1.8 amps and has a high-end RPM Experiments
of approximately 8,300, which I must
admit really surprised me. When you Upgrades and replacement
try to turn the shaft of this motor with parts available at:
your hand, you can feel the strong www.cs-sales.com
cogging caused by the powerful 4 Educational Models Available
magnets. This is evidenced by the fact SC-750 - Extreme Version, contains over 80 parts to build over 750 experiments. Includes everything from SC-500
plus experiments in solar, electromagnetism, vibration switches, and 70 computer interfaced experiments. $119.95
the motor does not start to turn until SC-500 - Pro Version, contains over 75 parts including voice recording IC, FM radio module, analog meter,
transformer, relay, and 7-segment LED display. Build over 500 experiments. $89.95
about nine seconds into the test SC-300 -Deluxe Version, contains over 60 parts. Build over 300 experiments. $59.95
where the PWM is at about 20- SC-100 - Snap Circuits, Jr., contains over 30 parts. Build over 100 experiments. $29.95
30% and the current at .5 amps to
.6 amps.
Next month, I intend to talk about Electronic Science Lab Elenco® Educational Kits
how the lab worked out when meas- Maxitronix 500-in-1 Electronic Project Lab Model RCC-7K
Radio Control Car Kit
Model AM-780K
Two IC Radio Kit
Model M-1006K
DMM Kit
Model MX-909 • 18 Ranges
uring the performance of several dif- Everything you need to build $
27.95 • 3 1/2 Digit
500 exciting projects!
ferent motors, with and without gears, • Learn the basics of electronics. 500 different
LCD
• Transistor
electronic experiments, special lighting effects,
looking at various parameters such as radio transmitter and receivers, sound effects,
• 7 Functions
Test
• Diode Test

RPM, current, torque, Kt, Kv, etc.


cool games and MORE!
• Includes built-in breadboard and an LCD.
• Transmitter included
$
9.95
Non-soldering Version
Hopefully, we’ll also learn a lot about • Explore amplifiers, analog and digital
circuits plus how to read schematic AK-870 $27.95 $29.95
AM/FM-108K
$
AM/FM Version 95
18.
diagrams.
‘Prony Brakes,’ so stay tuned. NV • Includes 11 parts.
Visit our website www.cs-sales.com to see our assortment.
• Lab-style manual included.
• Requires 6 “AA” batteries. $
169 Elenco® Test Equipment
Elenco® Quad Power Supply Elenco® Frequency Counter
RESOURCES MX-908 - 300-in-1 Lab $69.95
MX-907 - 200-in-1 Lab $49.95
MX-906 - 130-in-1 Lab $39.95
EP-50 - 50-in-1 Lab $18.95 Model XP-581
4 Fully Regulated Power Supplies in 1 Unit
1MHz-3GHz Model F-2800
• 10 digit LCD

■ Medusa Research Power Elenco® Digital Multimeters


99
$ display
• 16-segment RSSI
Analyzer — www.medusa bargraph
• Resolution to 1Hz
products.com Model M-1750 Model LCM-1950 75
$
• Hi-speed
(300MHz) direct
4 DC Voltages: 3 fixed; +5V @ 3A, +12V

■ Matrix Orbital LCD —


$
24.95
$
59. 95 @ 1A, 1 variable; 2.5 - 20V @ 2A • Fully
regulated & short protected • Voltage &
count
• Includes NiCd
charger and
• Large 1” 3 3/4 current meters • All metal case antenna
www.matrixorbital.com • 3 3/4 Digit LCD
Digit LCD
• Autoranging Freq. Elenco® Oscilloscopes Elenco® 5MHz Sweep
• Freq. to 10MHz to 4MHz
• Cap. to 200µF *Special* Function Generator
• Cap. to 400µF

■ Electronics Exchange Surplus • AC/DC Voltage


• Current up to 10A
• Inductance to 40H
• Res. to 4,000MΩ
$
329
with built-in 60MHz
Frequency Counter
Motor — www.electronics- • Audible Cont.
• Diode Test
• Logic Test Probes included
S1325 30MHz Model GF-8056 $
229
• Diode & $459
exchange.com • Transistor Test Transistor Test
S1330 30MHz Delayed Sweep
• Overload Prot. • Audible Continuity S1340 40MHz Dual Trace $469
Test
S1345 40MHz Delayed Sweep $549
■ FreeRTOS — www.freertos.org/ Quantity Discounts Available S1360 60MHz Delayed Sweep $749
Generates square, triangle, and sine
S1390 100MHz Delayed Sweep $999 waveforms, and TTL, CMOS pulse.

■ WinAVR — Guaranteed Lowest Prices 15 DAY MONEY


http://winavr.sourceforge.net/ UPS SHIPPING: 48 STATES 7%
C&S SALES, INC. BACK GUARANTEE
150 CARPENTER AVE • WHEELING, IL 60090 2 YEAR FACTORY
(Minimum $7.00)
(847) 541-0710 FAX: (847) 541-9904 WARRANTY
■ AVRstudio — www.atmel.com/ OTHERS CALL FOR DETAILS
IL Residents add 8.75% Sales Tax E-mail: sales@cs-sales.com PRICES SUBJECT
dyn/products/tools_card.asp?tool SEE US ON THE WEB www.cs-sales.com
TO CHANGE
WITHOUT NOTICE
_id=2725
January 2007 91
Page92.qxd 12/6/2006 11:02 AM Page 92

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

$UAL#HANNEL 6ARIABLESPEEDTOOL 


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

 

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

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

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

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

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

Phone: (719) 520-5323


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

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

92 January 2007
Full Page.qxd 12/7/2006 10:49 PM Page 93
GetStartedWithPICs.qxd 12/6/2006 4:55 PM Page 94

■ BY CHUCK HELLEBUYCK
GETTING STARTED WITH
THE LATEST IN PROGRAMMING MICROCONTROLLERS
PICs
PIC12F675 REPLACES THE 555 TIMER
IF YOU HAVE BEEN FOOLING WITH ELECTRONICS as long as I have, you will
have seen a lot of changes throughout the years. I watched the birth of
integrated circuits which led to op-amps and TTL or CMOS digital chips, and
eventually to the microcontroller. Somewhere along the way, an eight-pin chip
used by hobbyists all over the world was developed.

T his little eight-pin chip was known as


the 555 timer (shown as a block
diagram in Figure 1). It would be the
troller and I was blown away. To have
all the power of a PIC inside a small
eight-pin package was just amazing. I
adjust the accuracy but never showed
him how to do that. Then one day,
several months after the party, he used
main building block of many electronic began to think of all the 555 applica- it to time a speech he had to do for
projects. Even Forrest Mims who wrote tions it could replace and do so much school. He called me in a panic
most of those RadioShack project books more yet not take up any more space. because he thought he had broken
many years ago used the 555 in various In fact, it would take less space since all something. The clock was really inac-
applications. By just adding a few the external capacitors, resistors and curate. I had to explain to him about
external capacitors and resistors plus an
diodes were replaced by software. The how it worked and the reason for its
occasional diode, you could make the early eight-pin PICs were limited in their inaccuracy and comforted him that he
555 chip do amazing things. Though features but were still far more power- didn’t break it. I was more surprised
some still use the 555, I’ve found thatful than a 555. As the years have gone that he used it and thought to myself
the eight-pin PIC microcontrollers can by, more powerful eight-pin PICs have how I should have built it with a crystal-
do everything a 555 can do and more. been released. The only problem with based oscillator instead. It wasn’t long
Many years ago, Microchip all this was you needed to know how to after that I started getting into PICs.
released the first eight-pin microcon- program the microcontrollers in order He recently told me he still has that
to use them. That was a huge hurdle for old thing which got me thinking. With
many people including me. But with an eight-pin PIC and crystal accuracy, I
NOTE: the release of PICBasic Pro and other could build a really accurate time base.
■ The complete software listing is
available on the Nuts & Volts website PIC compilers, low-cost PIC program- I could even add temperature compen-
at www.nutsvolts.com mers such as my EZPIC programmer, sation using an A/D port to read a tem-
and lots of sample code for PICs, perature sensor. It also got me thinking
■ FIGURE 1 it’s not nearly as difficult to use a about all those old 555 circuits I used
PIC in place of a 555. to build such as a one-shot (monostable
One of the 555 projects I multivibrator) and clock oscillator
built was a large LED countdown (astable multivibrator). I even found an
clock for my nephew about 15 old Forrest Mims circuit book that used
years ago that had a 555 oscilla- the 555 to drive LEDs in sequence
tor at the heart of it. He wanted through a 7441 decoder driver TTL IC.
this for his annual roller hockey All these are so easy to do with a PIC, I
birthday party. He was 11. I realized that there really wasn’t any
knew it wasn’t very accurate need to use a 555 anymore.
since it was really based on For this article, I’ll show you how
a resistor-capacitor charging to build a simple 555 one-shot replace-
scheme that was greatly affected ment circuit using an external inter-
by temperature and voltage rupt. I will also have it act as a pulse
variation but it was good enough generator sending a 50% duty cycle
for a street hockey game. I built it signal out another output pin at the
with a potentiometer so I could same time to cover another 555 good-
94 January 2007
GetStartedWithPICs.qxd 12/6/2006 4:55 PM Page 95

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

ie. (These were popular 555 projects in


their day.) I will use the PICBasic Pro
compiler and the PIC12F675 eight-pin
PIC (Figure 2) for both of these projects.
You can get a PIC12F675 for around
$1 in small quantities at various sources
including Microchipdirect.com. You can ■ FIGURE 2
even get a free sample from Microchip. I
like this part since it’s a 14-bit core PIC which is the same
as the 16F876A that I like to use in my Ultimate OEM mod-
ule and it has the extra stack levels. Most compilers includ-
ing PICBasic Pro offer more commands on PICs with larger
stacks. Some of the other eight-pin PICs Microchip offers
are 12-bit core and only have a smaller stack. PICBasic Pro
will work with these but some commands are not available.
Another big advantage to the PIC12F675 is the on-board
Analog-to-Digital (A/D) converter. The 12F675 also has a
■ FIGURE 3
comparator, 128 bytes of internal EEPROM, 64 bytes of RAM
for variables, and 1K of Flash memory for the program. It even
has a built-in 4 MHz oscillator option so you don’t need an least be close. ■ FIGURE 4
external resonator to run it. On all the eight-pin PICs, the You need to
MCLR pin has the option to internally pull the reset line high store that value in the
allowing that pin to also be used as an I/O pin. Therefore, this OSCCAL register
is a PIC that only requires five volts and ground to make it run. within the PIC to
All these features add complexity to the setup in the make the internal
software so that will take a little explanation, especially the oscillator operate properly. PICBasic Pro handles this for you
internal oscillator. So let’s get that out of the way. and I’ll show you that in the code later. You also have to con-
figure the PIC for the internal oscillator when it’s programmed.
You’ll need to configure the MCLR pin for internal or external
INTERNAL OSCILLATOR operation. You do that in the configuration register also at
The 12F675 internal oscillator is built right into the sili- programming time. PICBasic Pro has an include file that auto-
con wafer that makes up the chip. The factory then calibrates matically establishes this. It’s called 12F675.inc and it’s in the
the oscillator during the assembly process and they store a PICBasic Pro directory. I modified it to match the format below.
correction value at the last location of program memory. You
need to use that value to get the most accurate clock possi- NOLIST
ifdef PM_USED
ble. That requires you to be a little careful when program- LIST
ming it for the first time. I used my EZPIC programmer that I include ‘M12F675.INC’ ; PM header
wrote about last year at this time, to program the PIC12F675. device pic12F675, intrc_osc, wdt_on, mclr_off, pro-
tect_off
The software used is the ICPROG.exe freeware from XALL
IC-Prog.com. This software will first read the PIC12F675 to NOLIST
see what the value of the last location in memory is set to. else
You can see the value for the PIC I loaded in Figure 3. LIST
LIST p = 12F675, r = dec, w = -302
If you write over that location, the calibration adjustment INCLUDE “P12F675.INC” ; MPASM Header
value will be lost. I recommend reading the chip and then __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF &
writing it down on a small sticker to put on the bottom of the _CP_OFF
NOLIST
chip. This way you have the value even if it’s erased. The endif
ICPROG.exe software will even warn you before programming LIST N
as seen in Figure 4. After it reads the PIC memory, it will ask if
you want to use the calibration value read or the value in the The line INTRC_OSC_NOCLKOUT sets the internal
.hex file you are trying to program into the PIC12F675. You oscillator mode. The MCLRE_OFF sets the MLR pin to
can choose which one you want to use. In my program, I internal operation. There are a few other special registers I
didn’t set that location to anything so it showed up as 3FFF. wanted to explain before jumping into the code.
Therefore, I chose to use the value read not the 3FFF value. The
value is 3489 on this PIC12F675 while the previous screen in
Figure 3 shows 3484. This is because I used two different PICs
SPECIAL REGISTER SETUP
when I created these screen shots. This also shows how close Because the PIC12F675 has few pins and lots of features,
the calibration values are from PIC to PIC. If you ever acciden- the various functions such as comparator and A/D are multi-
tally erase one, you can just read a different PIC12F675 and at plex connected to the actual metal pin. To select which ones
January 2007 95
GetStartedWithPICs.qxd 12/6/2006 4:55 PM Page 96

keep the switch input on the interrupt pin GP2


high. The interrupt is set to trip on a falling edge.
These are both set up in the software OPTION
register. The PIC directly drives the LEDs.

SOFTWARE
■ FIGURE 5 The software starts out very similar to other
code I’ve written. I first define the oscillator speed
get connected requires you to set them up in software. The at 4 MHz, then issue the special command that takes the OSC-
ANSEL (analog select) register and the CMCON (comparator CAL value at the end of program memory and stores it into the
control) register need to be set up at the beginning of your OSCCAL register. This is a special PICBasic Pro DEFINE that is
program so you know how the PIC is initially connected. For explained in the early part of the PICBasic Pro manual.
this project, I wanted both the A/D converter and compara-
DEFINE OSC 4
tor turned off and all the I/O pins in digital mode. To do that DEFINE OSCCAL_1K 1
I first have to set up the ANSEL register to have the last four
bits cleared to zero, as referenced in Figure 5. Next, those special register setups are established as
The comparator requires the CMCON register to be set we talked about earlier. Comparators are turned off and the
up for digital operation by putting the last three bits to their A/D is not connected to the outside pins.
proper setting. In this case, setting them all to one disconnects
CMCON = 7
the comparator and lets the pins be digital I/O (see Figure 6). ANSEL = 0
This probably seems a little confusing, but this along
with a lot more information is all in the PIC12F675 data Now the I/O is set up. The eight-pin PICs use a differ-
sheet. First projects are always the hardest. ent name for the I/O so the register to control is the TRISIO
register. Bits set to 1 are inputs; bits set to 0 are outputs.
Since there are only six I/O, it doesn’t matter what the
HOW IT WORKS leftmost bits are set to.
The project will just flash the green LED on GP0 at
close to 5 Hz while waiting for the button to be pressed. TRISIO = %00111100 ‘GP2-5 Inputs, GP1,0 Outputs
This is a 5 Hz, 50% duty cycle clock much more accurate
than the one I built for my nephew. When the button is There is a special register just for the pull-up resistors. It’s
pressed, a one-shot 250 msec pulse will be output on the the WPU (weak pullup) register. A 1 enables the pull-up and a
GP1 pin thus briefly lighting the red LED and freezing the 0 disables it. This is nicer since you can set each pull-up
green LED in whatever state it is during that 250 msec. This individually here, but the 16F876A is all on or all off. This does-
will throw off the clock accuracy, but I really just wanted to n’t turn them on yet. That is done in the OPTION register.
show how easy it was to do these functions in software. The
one shot output could be used to reset something so the WPU = %00000100 ‘ GP2 Pull-up Enabled
clock may not need to be accurate at that point anyway.
I initialize all the I/O to low by directly writing to the
GPIO port. In looking at this, I should have done this before
HARDWARE setting the TRISIO register. It will work but occasionally the
The whole setup is shown in Figure 7 and the schemat- LEDs may initially flash on.
ic is in Figure 8. It’s really simple. I used one of my five-volt
regulator breadboard modules to supply power to the rails. GPIO = 0 ‘ All Ports Low to Start
You could replace the 7805 circuit shown in the schematic
with this. The project uses the internal pullups of the PIC to The OPTION register does a lot of things but here
we only need to turn on the internal pull-ups and set the
direction for the interrupt to the falling edge (high to low).

OPTION_REG = %00000000 ‘ Internal Pull-ups


enabled, ‘ Trigger on Falling
‘ Edge

The interrupt control register enables only the external


interrupt by setting the fifth bit. The eighth bit turns all
interrupts on.

■ FIGURE 6 INTCON = %10010000 ‘ Enable External Interrupt


96 January 2007
GetStartedWithPICs.qxd 12/6/2006 4:55 PM Page 97

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

The ON INTERRUPT command is ■ FIGURE 7


issued to tell the program where to go
when an external interrupt occurs. This
command makes interrupts very easy.

ON INTERRUPT GOTO pulse ‘ Create


‘ Interrupt

The main loop is simple — just flash


an LED like we’ve done before.

Main used five of the


High 0 ‘ Send continuous 5 Hz
six pins.
pause 100 ‘ 50% duty cycle
low 0 ‘ clock pulse out One thing I
pause 100 ‘ pin GP0 did not mention ■ FIGURE 8
goto Main is the I/O limita-
tion. If you look in the data books, you will see that the GP3
The interrupt routine is also quite easy. We first pin is an input only pin so you really have only five outputs
DISABLE any future interrupts while the handler is function- and six inputs with this chip. Five is all you need though
ing. This is hardly an issue since it will run a lot faster than to make the small temperature data logger that I
a person can press the switch, but this also helps to not just described. Give it a try and let me know through email
react to switch bounce multiple times. how it worked. Send any comments about the articles
to chuck@elproducts.com. I like getting the feedback. You
‘ *** Interrupt handler routine *** can also visit my website at www.elproducts.com for
DISABLE the EZPIC programmer and the 5V regulator breadboard
module. I have a whole bunch of new ideas for 2007, so
The interrupt handler just pulses the GP1 pin for 250 stay tuned. NV
msec. This is where you can easily adjust the one-shot
timing without having to change resistors or capacitors like
you would with a 555.
pulse:
high 1 ‘ Send 250 msec pulse
pause 250 ‘ out the GP1 pin
Low 1

We have to clear the interrupt flag before leaving


the interrupt and then issue the RESUME and ENABLE
commands.

INTCON.1 = 0 ‘ Clear interrupt flag


RESUME
ENABLE

Short and simple and our 555 one-shot replacement


with a side of 5 Hz oscillator is ready to go. This took so
little code space. Only 98 of 1,024 words of program
memory were used.

CONCLUSION
As you can see, the PIC12F675 is a handy little part.
PICBasic Pro comes through again to make the software
easy. This program can be expanded in so many ways.
With the SEROUT/SERIN command in PICBasic Pro, you
can make any pin a serial communication pin. Add a large
memory eight-pin EEPROM using the I2COUT/I2CIN
commands to a 12F675 and you have memory storage.
Add a temperature sensor to an A/D pin and you have only
January 2007 97
ClassifiedsJan07.qxd 12/7/2006 9:04 PM Page 98

CLASSIFIEDS
COMPONENTS CONNECTORS/WIRE/CABLE
The RF Connection MIL-Spec Coax Available (Teflon, PVC IIA)
R
T C
O
213 N. Frederick Ave., Ste. 11NV New Product: Belden 9913F, 9913 with
H
N

F
E
N
E
C Gaithersburg, MD USA 20877 High Density PE Foam dielectric,
T
I
O http://www.therfc.com/ stranded center cond. and Duobond
N
III Jacket $0.80/ft or $76.00/100ft
Complete Selection of MIL-Spec Coax, Also New: 9092, RG8X with Type II Jacket.
RF Connectors and Relays Intro Price ............$23.00/100ft
UG-21B/U N Male for RG-213/214 .$5.00 Call for Specials of the Month
UG-21D/U N Male for RG-213/214 .$3.25 Full Line of Audio Connectors for Icom,
N Connectors for 9913/Flexi4XL/9096 Kenwood, and Yaesu
UG-21B/9913 .....$6.00 / Pins Only......$1.50 8 Pin Mike Female $2.50
Floating Point Coprocessor FREE 120 Pg CATALOG UG-21D/9913 ..$4.00 / Extra Gasket.$0.75 8 Pin Mike Male Panel $2.50
Amphenol 83-1SP-1050 PL-259 $0.90 13 Pin DIN for Kenwood $2.75
New Electronic components, kits, UG-176/U Reducer RG-59/8X, $0.25 8 Pin DIN for Icom $1.00
or 5/$1.00 8 Pin DIN for Kenwood $1.50
uM-FPU V3
test equipment, tools, and sup- UG-175/U Reducer RG-58/58A, $0.25 Prices Do Not Include Shipping
32-bit IEEE 754, SPI and I2C interface plies for hams, hobbyists, and or 5/$1.00 Orders 800-783-2666
10 to 70 times faster than uM-FPU V2 businesses. Many hard-to-find Silver Teflon PL-259/Gold Pin, $1.00 Info 301-840-5477
new instructions: matrix, FFT, string, items like variable capacitors, or 10/$9.00 FAX 301-869-3680
12-bit A/D, Flash, EEPROM,
callable user-defined functions
vernier dials, coil forms, magnet
2.7V, 3.3V or 5V, with low power mode wire, and toroids. ROBOTICS
18-pin DIP or SMT, RoHS compliant Ocean State Electronics
uM-FPU IDE code compiler, debugger, www.oselectronics.com
user-defined function programmer
Applications: sensors, GPS, robotics,
signal processing, embedded control
See website for full details PCB SOFTWARE
www.micromegacorp.com
EXCLUSIVE U.S. DISTRIBUTOR
AMATEUR RADIO

PLANS/KITS/
SCHEMATICS
YOUR COMPLETE
SOLUTION!
• PCB Design
• PCB Simulation
• CAD/CAM Menu
121747, Hobby Vers., $175
121743, Pro. Version, $275
www.KELVIN.com

www.nutsvolts.com PUBLICATIONS
CNC Book
BUSINESS SERVICES
Easy CNC
G-code
Bit map draw programs
Bit map image converter
Bit map to G-code
CAD - machine drawings
CAM - DXF to G-code
http://www.cncintro.com

SQUARE 1
SQUARE
ELECTRONICS
(208) 664-4115
Hayden, ID USA
98 January 2007
ClassifiedsJan07.qxd 12/7/2006 9:05 PM Page 99

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

DESIGN/ENGINEERING SERVICES AUDIO/VIDEO

HARDWARE
WANTED
DEC EQUIPMENT
WANTED!!! MICRO
Digital Equipment Corp. CONTROLLERS
and compatibles.
Buy - Sell - Trade MicroStamp11
CALL KEYWAYS 937-847-2300 World’s Smallest 68HC11
or email buyer@keyways.com Microcontroller Module!
telemetry
z
microrobotics
z
LCDs/DISPLAYS smart toys
z
animatronics
z
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)
z SCI, SPI, Output Compare and Input
Capture channels, timer, pulse accumulator
z all 14 I/O lines and 2 interrupt lines
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
SOLAR PRODUCTS  z 32K EE/32K RAM (MS11SP64K)$90

* includes MicroStamp11, manual, PC soft-


Did you know that if you’re ware (assemblers, SBASIC compiler,
MicroLoad utility, and sample programs),

a paid subscriber to
serial cable, Docking Module, & accessories.

www.technologicalarts.com
Nuts & Volts, you can get Toll-free (USA & Canada):
the online version for FREE? 1-877-963-8996

Go to www.nutsvolts.com
Visa • MasterCard • Discover • Amex

PIC Microcontroller
MILITARY SURPLUS Books Looking for robots? Go to
www.servomagazine.com
4 Titles
Beginner to Advanced
Table Of Contents SATELLITE
Ordering Info FREE Satellite TV Buyer’s Guide
On Web Site Home of DishSkinz
http://www.sq-1.com C-band • Ku-band
4DTV • MPEG-2
Get it all with just one call!
800-500-9275
(208) 664-4115
Hayden, ID USA www.skyvision.com
January 2007 99
BookstoreJan07.qxd 12/6/2006 10:40 AM Page 100

S e l e c t e d T i t l e s f o r t h e E l e c t r o n i c s H o b b y i s t a n d Te c h n i c i a n

The Nuts & Volts Hobbyist BOOKSTORE


ELECTRONICS MORE Electronic Gadgets
for the Evil Genius PROJECTS
Practical Electronics for Inventors by Robert E. Iannini LEGO MINDSTORMS NXT
This much anticipated Hacker's Guide
by Paul Scherz follow-up to the wildly
This intuitive, applica- by Dave Prochnow
!
NEW
popular cultclassic Here is an awesome
tions-driven guide to Electronic Gadgets for the
electronics for hobby- next-generation col-
Evil Genius gives base- lection of LEGO
ists, engineers, and stu- ment experimenters 40
dents doesn't overload MINDSTORMS proj-
all-new projects to tin- ects that enables you
readers with technical ker with. Following the
detail. Instead, it tells to build and program
tried-and-true Evil a real working robot
you — and shows you Genius Series format,
— what basic and in just 30 minutes!
each project includes a New technologies
advanced electronics detailed list of materials, sources for parts,
parts and components and expanded sensor
!
NEW
schematics, documentation, and lots of capabilities make it
do, and how they clear, well-illustrated instructions for easy
work. Chock-full of illustrations, Practical easier than ever to
assembly. Readers will also get a quick add a level of sophistication to robotic and
Electronics for Inventors offers over 750 briefing on mathematical theory and a sim-
hand-drawn images that provide clear, architectural creations.The book explains
ple explanation of operation along with the all-new NXT intelligent brick ... the
detailed instructions that can help turn enjoyable descriptions of key electronics
theoretical ideas into real-life inventions interactive servo motors with rotation sen-
topics. $24.95
and gadgets. $39.95 sors that align speed for precise control ...
the ultrasonic sensor that allows robots to
“see” by responding to movement ... the
Electronic Games for improved light and touch sensors that let
101 Spy Gadgets for the Evil Genius robots detect color and feel ... and much
the Evil Genius more. $24.95
by Thomas Petruzzellis
by Brad Graham/Kathy McGowan You can have a wicked
Utilizing inexpensive, amount of fun on your
easily-obtainable com- way to becoming a 50 Model Rocket Projects
ponents, you can build game master! In for the Evil Genius
the same information Electronic Games for the by Gavin D J Harper
gathering, covert Evil Genius, popular The fun, hands-on way
sleuthing devices used how-to author Tom to learn about rocket
by your favorite film Petruzzellis gives you science. Yes, as a mat-
secret agent. Projects everything you need ter of fact, is IS rocket
range from simple to to build 35 exciting science! And because
sophisticated and games and gadgets.You N E W ! this book is written for
come complete with a get complete, easy-to- the popular Evil Genius
list of required parts follow plans, with clear diagrams and format, it means you
and tools, numerous illustrations, and step- schematics, so you know exactly what's can learn about this
by-step assembly instructions. $24.95 involved before you begin. Packed with fun fascinating and growing
projects that you'll love to build and play hobby while having fun
with, this guide develops game expertise creating 50 great proj-
one simple step and project at a time. ects.You will find a detailed list of materi-
Troubleshooting $24.95 als, sources for parts, schematics, and lots
Electronic Equipment of clear, well-illustrated instructions.
by R. S. Khandpur $24.95
From cell phones to
medical instruments Electronic Sensors for the Evil
to digital and micro- Genius — 54 Electrifying Projects 25 Home Automation Projects
processor based by Thomas Petruzzellis for the Evil Genius
equipment, this Nature meets the by Jerri Ledford
hands-on, heavily Evil Genius via 54 fun, Computer technology
illustrated guide safe, and inexpensive has caught up with
clearly explains how projects that allow home automation, and
to troubleshoot, you to explore the it’s now easy and inex-
maintain, and repair
all types of electrical N E W
! fascinating and often pensive to automate
mysterious world of everything in a house
equipment.The natural phenomena — including lighting,
author covers all the essentials such as using your own home- security, appliances,
necessary tools, soldering techniques, test- built sensors. Each entertainment, and
ing, fundamental procedures, and mechani- project includes a list environmental condi-
!
cal and electrical components. $49.95 of materials, sources tions — and here’s NEW
for parts, schematics, and lots of clear, well- how to do it! This
If you don’t see what you need illustrated instructions. Projects include well-illustrated resource offers 25 com-
here, check out our online store at rain detector, air pressure sensor, cloud plete home automation projects that
chamber, lightning detector, electronic gas require only basic household tools and the
www.nutsvolts.com for a complete sniffer, seismograph, radiation detector, and instructions found within its pages.
listing of the titles available. much more. $24.95 $24.95

100 January 2007


BookstoreJan07.qxd 12/6/2006 10:41 AM Page 101

CALL 1-800-783-4624 today!


Or Order online @ www.nutsvolts.com
Take This Stuff and Hack It! Programming the PIC Linux Robotics
by Dave Prochnow Microcontroller with MBASIC by D. Jay Newman
Transform common by Jack Smith If you want your robot
household items into No microcontroller is ! to have more brains
really cool stuff.You of any use without NEW than microcontrollers
don't need to be an software to make it can deliver — if you
electronics genius to perform useful func- want a truly intelligent,
get started turning tions.This compre- high-capability robot —
everyday items into hensive reference everything you need is
high-performing won- focuses on designing right here. Linux
ders.With how-to with Microchip’s mid- Robotics gives you
step-by-step directions
Prochnow's step-by- N E W !
guru Dave range PIC line using
MBASIC, a powerful for "Zeppo," a super-
step directions and but easy to learn pro- smart, single-board-powered robot that can
fully illustrated plans, even beginners can gramming language. It be built by any hobbyist.You also get com-
hack their way to a high-tech home, cooler illustrates MBASICs abilities through a plete instructions for incorporating Linux
toys, and less yard work. Certain to fire series of design examples, beginning with single boards into your own unique robotic
your imagination and start you plotting simple PIC-based projects and proceeding designs. No programming experience is
new, original, and even more creative won- through more advanced designs. $59.95 required.This book includes access to all
ders you can make from ordinary house- the downloadable programs you need, plus
hold items, Take This Stuff and Hack It! is complete training in doing original pro-
the perfect gift for your inner inventor. gramming. $34.95
$27.95
HOME COMPUTING
SERVO CD-Rom
PC Mods for the Evil Genius Are you ready for
MICROCONTROLLERS by Jim Aspinwall some good news?
If you yearn for the Along with the first
Nuts & Volts of BASIC coolest, most crazed 14 issues of SERVO
Stamps — Volume #6 ‘puter around, PC Mods Magazine, all issues
by Jon Williams for the Evil Genius is the from the 2005 calen-
Nuts & Volts of BASIC key to the kingdom! dar year are now
Stamps — Volume 6 This book shows you available, as well.
includes articles #117- how to supercharge These CDs include
128, written for 2005. your PC and create a all of Volume 1,
Article topics consist jaw-dropping system issues 11-12,Volume 2, issues 1-12, and
of RFID Readers Volume 3, issues 1-12, for a total of 26
chased off any shelf, N E W !
that cannot be pur-
and Ultrasonic issues all together.These CD-ROMs are PC
Measurement, SX/B anywhere! You get and Mac compatible.They require Adobe
and the Professional complete, easy-to-follow plans, clear dia- Acrobat Reader version 6 or above. Adobe
Development Board, grams and schematics, and lists of parts and Acrobat Reader version 7 is included on
the advanced MIDI tools, so you know what's needed before the discs. $24.95 – Buy 2 or more
receiver, programming the SX microcon- you begin. $24.95 at $19.95 each
troller in BASIC, mastering the MC14489
display driver, and more! The Nuts & Volts
of BASIC Stamps books are a favorite Nuts & Volts CD-Rom
Parallax technical pick and are a tremen- Here’s some good
dous technical resource for all PBASIC
programming projects. $14.95
ROBOTICS news for Nuts &
Volts readers! Along
Robot Builder's Bonanza with all 12 issues
Third Edition of Nuts & Volts from
PIC Basic Projects by Gordon McComb/Myke Predko the 2004 calendar
by Dogan Ibrahim Everybody's favorite year, the 2005 issues
Covering the PIC amateur robotics are now available,
BASIC and PIC book is bolder and as well.These CDs
BASIC PRO compil- better than ever — include all of
ers, PIC Basic Projects and now features the Volumes 25 and 26, issues 1-12, for a total
provides an easy-to- field's "grand master" of 24 issues (12 on each CD).These CD-
use toolkit for Myke Predko as the ROMs are PC and Mac compatible.They
developing applica- new author! Author require Adobe Acrobat Reader version 6
tions with PIC duo McComb and or above. Adobe Acrobat Reader version 7
BASIC. Numerous Predko bring their is included on the discs. $24.95 – Buy
simple projects give expertise to this fully- 2 or more at $19.95 each
clear and concrete illustrated robotics "bible" to enhance the
!
examples of how NEW already incomparable content on how to
build — and have a universe of fun — with
WE ACCEPT VISA, MC, AMEX,
PIC BASIC can be and DISCOVER
used to develop electronics applications, robots. Projects vary in complexity so
everyone from novices to advanced hobby- Prices do not include shipping and
while larger and more advanced projects
describe program operation in detail and give ists will find something of interest. Among may be subject to change. Ask about
useful insights into developing more involved the many editions, this book features 30 our 10% subscriber discount on
microcontroller applications. $29.95 completely new projects! $27.95 selected titles.

January 2007 101


TechForum.qxd 12/7/2006 4:33 PM Page 102

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
volts.com All diagrams should be
computer generated and sent with your
submission as an attachment. >>> QUESTIONS charge it ahead of when I want to start
it up. To no avail, I have searched and
QUESTIONS I am new to programming and searched for a 6 VDC battery charger/
To be considered, all questions should relate need some advice on which assembly maintainer. I can find 12 VDC
to one or more of the following: code is better to start out on. Almost battery float chargers or maintainers;
❶ Circuit Design every book on programming that I’ve and in fact, I use these $15 gems to
❷ Electronic Theory seen, has a very generic, non-descript maintain most of the lead-acid batteries
❸ Problem Solving overview, so I have no idea where to that I have. I don't want to change the
❹ Other Similar Topics start. What code should I learn? What voltage of the electrical system on this
■ Be brief but include all pertinent informa- book (or books) should I get? tractor — defeats the purpose of having
tion. If no one knows what you're asking, you #1071 Andrew Hahn an "antique." Can you provide me a
won't get any response (and we probably via email circuit that will maintain the voltage of
won't print it either). 6 VDC lead-acid batteries? The circuit
■ Include your Name, Address, Phone Num- I'm looking for a phone call would stay plugged into the 110 VAC
ber, and email. Only your Name, City, and
screener that would provide flexible mains and monitor the battery voltage.
State will be published with the question,
control over incoming calls. A device #1073 Boyd Nielsen
but we may need to contact you.
■ No questions will be accepted that offer that would allow me to enter phone Brooklyn, CT
equipment for sale or equipment wanted to numbers of acceptable callers that
buy. would ring the phone, but give all other What is the frequency and mode
■ Selected questions will be printed one calls a greeting and an option to leave used by the small outdoor temperature
time on a space available basis. voice mail. I have seen one product transmitters? Is the data serial? Is there
■ Questions are subject to editing. that asks the caller to enter a code, but a standard format?
this feature leaves out those whom I #1074 Ron H
ANSWERS might have overlooked or forgotten Wisconsin
■ Include in the subject line of your email, when passing out the code. Does [#5065 - May 2006]
the question number that appears directly anyone know of a commercial product,
below the question you are responding to.
■ Payment of $25.00 will be sent if your
kit, or design article?
#1072 Al Davis
>>>> ANSWERS
answer is printed. Be sure to include your Hickory, NC I have a rear view camera from a
mailing address or we cannot send payment.
2004 Honda MDX. Other than the
■ Only your Name, City, and State, will be
I have an antique agricultural trac- power and ground connections, there
printed, unless you say otherwise. If you
tor that has a 6 VDC electrical system. are leads for video, camera ground,
want your email address included, indicate
to that effect. Because this tractor is no longer used shutter, and camera adap.(?). Placing an
■ Comments regarding answers printed in like the daily workhorse it once was, I oscilloscope across the video and cam-
this column may be printed in the Reader have to charge the battery every month era ground leads gives me horizontal
Feedback section if space allows. or so. Of course, I never remember to blanking and sync pulses but no video.
102 January 2007
TechForum.qxd 12/7/2006 4:36 PM Page 103

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

I have placed a load resistor (75 ohms) however if you are doing a tube amp tator you want, as long as it does not
across the video and camera ground with exposed tubes, I think this option exceed the maximum current of your
terminals. Also, I have tried connecting may "class it up" a little with another 555. Feel free to ask me any further
five volts (through a 10 ohm limiting tube on the base. questions at jfduval@aqra.ca
resistor) to the shutter and the camera The Amperite 115C30 is designed JF Duval
adap. leads; but I still cannot see video for 115-volt operation. One drawback Quebec, Canada
information. is that this has NC contacts rated at
three amps; you could use these to [#12061 - December 2006]
The Information is avaialble from control another relay hidden that can Does a sound level meter record
Honda's Service Site at http://techin take the current for the high voltage transient sounds as well as higher
fo.honda.com The site is a subscrip- transformer. amplitude sounds originating from a
tion service: three days @ $20; a These can be ordered from Allied fundamental frequency? In other
month @ $50; or a year for $250. The Electronics (www.alliedelec.com/). words, if I strike a pan or piece of
Owners and User guides are free on Their part number is 892-1116. wood, the impulse excites some funda-
this site, but for this kind of indepth Craig Kielhofer mental frequency along with tran-
info, you have to subscribe to get Kirksville, MO sients. The amplitudes of the various
access to the Service Info area. transients have varying amplitudes and
Wesley Miller #2 I don’t know much about your usually some "fundamental" frequency
Dillsburg, PA tube amp, but I hope this circuit which may have a higher amplitude.
(Figure 1) will help. This is a mono- Do the various frequencies "add up"
[#9061 - September 2006] stable circuit with a +5 VDC one amp along with the fundamental (within
I have heard that fluorescent lights linear power supply. The resistor and frequency range of an SPL meter) to
can be dimmed. The circuit is a capacitor off of pin 2 triggers the timer produce a reading in dBs?
constant voltage generator (120V) and approximately one second after
a current controller that changes the applied voltage. The resistor and An SPL (Sound Pressure Level)
frequency to lower the light intensity. capacitor off of pin 6 and 7 times the meter is simply an amplified
Can someone supply such a circuit 30 seconds. I used a potentiometer to microphone fed though a bandpass fil-
that uses a variable frequency to get the 58K ohm. I threw in a relay on ter and then displayed, giving you a
change the amount of current flowing? the output so you can have a reading in dbSPL. The combined
wider range of control and you need frequency response characteristics of
Fluorescent lights can be dimmed, to use the normally closed contact on the microphone, amplifier, and filter
but the main challenge in doing so is the relay. are what's important. They are careful-
providing enough filament voltage to Dustin Enns ly tailored to mimic the frequency
the light so the electrons can interact Lehigh, KS sensitivity of a human ear, known as
with the gas to emit light; usually A-weight. Some models also use a
about a 30-50% dimming is the max #3 If I want to design a circuit "flat" response, called C-weight.
possible before the filaments lose heat around a 555 without doing math, I In short, the meter can indicate
and are unable to ignite the gas within use a program named "555
the tube. For more details, visit Don Timer Pro." It can be down-
Klipstein’s website at http://mem loaded from www.schematica. Figure 2
bers.misty.com/don/f-dim.html He com/555_Timer_design/555_
covers this topic and many other types Timer_PRO.htm The lite version
of lights. is freeware and will do for all the
Wesley Miller basic stuff. The schematic in
Dillsburg, PA Figure 2 is from a print screen of
this practical program and it will
[#11061 - November 2006] give you a 30s high pulse from a
I need to build a timer that will let short low impulsion. You can
my tube amp warm up first and then attach to the output the commu-
connect the HV to the tube. I need a
delay of 30 sec. Any schematic for the Figure 1
555 or 4011?

#1 One option available is to use


Amperite 'G' series time delay relays. I
mention this since they are in a glass
envelope with pins on the bottom.
They can be pricey ($96 each),
January 2007 103
TechForum.qxd 12/7/2006 7:34 PM Page 104

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

approximately how "loud" a sound finer bandpass segments. Some of the simple, audio transmitting and receiv-
seems. commonly available models for con- ing system (separate units) that can be
And when it does this, it's "listen- cert use have a resolution of one-third connected to the stereo minijack
ing" to the entire spectrum that most of an octave — that is, they have 31 output on an audio device/computer/
humans hear, including transients, discrete meters, indicating SPL for etc., and the receiver connected to
harmonics, fundamentals, and air- passbands from 20 Hz to 20,000 Hz. speakers that have a stereo minijack
conditioner noise, too. You can also obtain (free) spectrum input. I would like to have multiple
If it's important that you only analyzer computer programs for (3) receivers.
observe or measure a certain portion your PC that'll let you observe with a
of the audio spectrum, you can use an resolution of a few hundred Hz. Purchase a wireless FM transmit-
audio spectrum analyzer, also called a Dan ter. These are readily available today
realtime spectrum analyzer. This is a Pocatello, ID and although primarily designed to
device that will simultaneously display work with portable MP3 players,
the acoustic energy of the entire audio [#12063 - December 2006] will work with any device with a
spectrum broken down into much I want to build an inexpensive, headphone jack. A typical example is
the Genovation Wireless FM Music
Transmitter available from Geeks.com
for $8.99. www.geeks.com/details
.asp?invtid=GENOVATION-307&cat
=MP3 There is nothing special about
this particular model. Any wireless FM
NEW! HIDmaker FS for Full Speed FLASH PIC18F4550 transmitter will work. You should be
Creates complete PC and Peripheral Both PC and Peripheral programs able to find one at your local electron-
programs that talk to each other over understand your data items (even odd ics or department store for about the
USB. Ready to compile and run! sized ones), and give you convenient same price. Some models will transmit
• Large data Reports variables to handle them. the signal a longer distance.
• 64,000 bytes/sec per Interface PIC18F Compilers: PICBASIC Pro, Connect the FM transmitter to the
• Easily creates devices with multiple MPASM, C18, Hi-Tech C. headphone jack of the desired audio
Interfaces, even multiple Identities!
• Automatically does MULTITASKING PIC16C Compilers: PICBASIC Pro, source. The receivers can be any type
• Makes standard or special USB HID MPASM, Hi-Tech C, CCS C. of portable FM broadcast receiver.
devices The typical portable MP3/FM radio
NEW! “Developers Guide for USB HID PC Compilers: Delphi, C++ Builder,
Visual Basic 6. would make an excellent choice.
Peripherals” shows you how to make If you need more range, check out
devices for special requirements. HIDmaker FS Combo: Only $599.95 the professional FM transmitters at
www.Ramseyelectronics.com such as
DOWNLOAD the HIDmaker FS Test Drive today! the FM25B or FM30.
www.TraceSystemsInc.com John K3PGP
301-262-0300 via email

104 January 2007


IndexJan07.qxd 12/7/2006 10:33 PM Page 105

■ LOOK FOR

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

Scott Edwards Electronics, Inc. ...........78


Texas Instruments .................................7
PCB MILLING
AD INDEX Abacom Technologies ...............52
RADIO AND TV Trace Systems, Inc. ...........................104 MACHINES ActiveWire, Inc. .........................32
Atomic Time .........................................44 World Educational Services ...........44, 93 LPKF Laser & Electronics ....................51 All Electronics Corp. ..................66
PolarisUSA Video, Inc. .........................11 XGameStation ......................................32 Atomic Time ..............................44
Powerwerx ...........................................10 PROGRAMMERS Avcom Tec, LLC ........................17
Ramsey Electronics, Inc. ................26-27 Software Conitec DataSystems ...........................70 Budget Robotics ........................58
Pioneer Hill Software ...........................78 Electronics123 .....................................32
BATTERIES/
C & S Sales, Inc. .......................91
microEngineering Labs ........................92
CHARGERS DESIGN/ Circuit Specialists, Inc. .....106-107

Cunard Associates ...............................32 ENGINEERING/ PUBLICATIONS Command Productions ..............17


Conitec DataSystems ................70
Powerwerx ...........................................10 REPAIR SERVICES Mouser Electronics ..............................29
Cosmos .....................................77
ExpressPCB .........................................30
BUSINESS EZ PCB ................................................52 RF TRANSMITTERS/ CrustCrawler .............................92
Cunard Associates ....................32
OPPORTUNITIES Front Panel Express LLC .....................85
RECEIVERS DesignNotes.com, Inc. ...............25
PCB Pool .............................................70
EZ PCB ................................................52 Abacom Technologies .........................52 Dimension Engineering ..............39
Pulsar, Inc. ...........................................32
Linx Technologies ................................65
R4Systems, Inc. ...................................71 Earth Computer Technologies ...32
BUYING ELECTRONIC Trace Systems, Inc. ...........................104
Matco, Inc. ...........................................32
Electronic Design Specialists ....58
SURPLUS ROBOTICS Electronic Goldmine ..................53
Earth Computer Technologies .............32 EDUCATION Budget Robotics ...................................58
Electronics123 ...........................32
GreenChip ............................................32 Avcom Tec, LLC ...................................17 Electronix Express ....................92
CrustCrawler ........................................92
Jaycar Electronics ................................59 Command Productions ........................17 EMAC, Inc. ................................64
Hobby Engineering ..............................39
EMAC, Inc. ...........................................64 HVW Technologies ..............................32 ExpressPCB ..............................30
CCD CAMERAS/ Hobby Engineering ..............................39 Jameco ................................................45 EZ PCB .....................................52
VIDEO Schmart Board .....................................32
XGameStation ......................................32
LabJack ................................................17 Front Panel Express LLC ...........85
Circuit Specialists, Inc. ................106-107 Lemos International Co., Inc. ...............17 GreenChip..................................32
Lynxmotion, Inc. ...................................52
Cosmos ................................................77
Matco, Inc. ...........................................32
ENCLOSURES Net Media ...............................................2
Hagstrom Electronics ................33
Integrated Ideas & Technologies, Inc. ....78 Halted Specialties Co. ...............69
PolarisUSA Video, Inc. .........................11
Ramsey Electronics, Inc. ...............26-27 SATELLITE Hobby Engineering ....................39

IP HOME Lemos International Co., Inc. ................17


HVW Technologies ....................32

CIRCUIT BOARDS AUTOMATION Information Unlimited ................86


Cunard Associates ...............................32 MicroAutomata......................................24 SECURITY Integrated Ideas & Tech. ...........78
Dimension Engineering ........................39 Cosmos ................................................77 Jameco.......................................45
ExpressPCB .........................................30 KEYBOARD Information Unlimited ...........................86
Linx Technologies ................................65
Jaycar Electronics ......................59
LabJack......................................17
EZ PCB ................................................52
Maxstream .............................................6
EMULATORS Matco, Inc. ...........................................32 Lemos International Co., Inc. .....17
Hagstrom Electronics ...........................33 PolarisUSA Video, Inc. .........................11
Micromint .............................................68 Link Instruments ..........................5
PCB Pool .............................................70
Pulsar, Inc. ...........................................32
KITS & PLANS SMT EQUIPMENT
Linx Technologies .....................65
C & S Sales, Inc. ..................................91 LPKF Laser & Electronics .........51
LPKF Laser & Electronics ....................51
R4Systems, Inc. ...................................71 DesignNotes.com, Inc. .........................25 Lynxmotion, Inc. ........................52
Saelig Company, Inc. ...........................79
Schmart Board .....................................32
Earth Computer Technologies .............32
Electronic Goldmine .............................53
TEST EQUIPMENT Madell Technology ..................104
Matco, Inc. .................................32
C & S Sales, Inc. ..................................91
Electronics123 .....................................32 Maxstream ..................................6
COMMMUNICATION EMAC, Inc. ...........................................64
Circuit Specialists, Inc. ................106-107
MCM ..........................................43
Avcom Tec, LLC ...................................17 Conitec DataSystems ...........................70
Hobby Engineering ..............................39 MicroAutomata ...........................24
DesignNotes.com, Inc. .........................25
Information Unlimited ...........................86
COMPONENTS Jaycar Electronics.................................59
Dimension Engineering ........................39 microEngineering Labs ..............92
Electronic Goldmine .............................53 Electronic Design Specialists ...............58 Micromint ...................................68
MicroAutomata......................................24
Electronix Express ...............................92 Jaycar Electronics.................................59 Mouser Electronics ....................29
QKITS ...................................................32
Front Panel Express LLC .....................85 LabJack ................................................17 MVS ..........................................97
RABBIT Semiconductor ..........................3
Jameco ................................................45 Link Instruments .....................................5 Net Media ....................................2
Ramsey Electronics, Inc. ................26-27
Lemos International Co., Inc. ...............17 Madell Technology .............................104
Scott Edwards Electronics, Inc. ...........78 Parallax, Inc. ...............Back Cover
Linx Technologies ................................65 Pioneer Hill Software ...........................78
XGameStation ......................................32 PCB Pool ...................................70
Maxstream .............................................6 Protek Test & Measurement .................25
Pioneer Hill Software .................78
Micromint .............................................68 LASERS Saelig Company, Inc. ...........................79
Syscomp Design ..................................32 PolarisUSA Video, Inc................11
Pulsar, Inc. ...........................................32 Information Unlimited ...........................86
Trace Systems, Inc. ...........................104 Powerwerx ................................10
COMPUTER LSI (micon) Protek Test & Measurement ......25
Hardware Renesas Technology Corp. .................31 TOOLS Pulsar, Inc. ................................32
ActiveWire, Inc. ....................................32 C & S Sales, Inc. ..................................91 QKITS ........................................32
Earth Computer Technologies .............32 MISC./SURPLUS LPKF Laser & Electronics ....................51 R4Systems, Inc. .........................71
Halted Specialties Co. ..........................69 Madell Technology .............................104 RABBIT Semiconductor ...............3
All Electronics Corp. .............................66
Electronic Goldmine .............................53 Ramsey Electronics, Inc. .....26-27
Microcontrollers / I/O Boards
Abacom Technologies ..........................52
Front Panel Express LLC .....................85 WIRE, CABLE Renesas Technology Corp. .......31

Avcom Tec, LLC ...................................17


GreenChip ............................................32 AND CONNECTORS Saelig Company, Inc. ................79
Conitec DataSystems ...........................70 Halted Specialties Co. ..........................69 DesignNotes.com, Inc. .........................25 Schmart Board ..........................32
EMAC, Inc. ...........................................64 MCM ....................................................43 Scott Edwards Electronics, Inc. ..78
Jameco ................................................45
microEngineering Labs ........................92 Syscomp Design .......................32
Micromint .............................................68 MOTORS Powerwerx ...........................................10
Texas Instruments .......................7
Jameco ................................................45
MVS .....................................................97
Net Media ...............................................2
WIRELESS Trace Systems, Inc. ................104

Parallax, Inc. ..........................Back Cover OPTICS PRODUCTS


World Educational Services ..44, 93
XGameStation ...........................32
R4Systems, Inc. ...................................71 Madell Technology .............................104 MicroAutomata......................................24

January 2007 105


Full Page.qxd 12/5/2006 3:33 PM Page 106

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

PowerSupply1 Switching Power Supplies Programmable DC Power Supplies


New to CircuitSpecialists.com are these Highly The CSI 3600 Series
Reliable, Universal AC input/full range single output Programmable DC Power
power supplies. Choose between various 40, 60, 100 Supplies are equipped with a
& 150 Watt versions. They have the approval of UL back-lit LCD display, number
and CUL and come 100% full load burn-in tested and keypad and a rotary code switch
are protected with overload/over and voltage/short cir- for ease of use & quick program-
cuit. Also included is a 2 year warranty. ming. Voltage, Current & Power can all be displayed on the LCD or com-
puter screen (with optional RS-232 interface module). It can be operated at
PowerSupply1 Qty 1 Qty 10 Qty 25 Qty 100 Qty 500 Qty 1000
constant current mode, constant voltage mode & constant power mode. It
40W Series also can be set with maximum limits for current & power output. Ideal
Available in $28.99 $26.09ea $24.53ea $21.95ea $15.98ea $13.79ea
5,12,15,24,48V instruments for scientific research, educational labs or any application
requiring a sophisticated DC-power source.
60W Series
Available in $32.99 $29.69ea $27.91ea $25.95ea $17.69ea $15.49ea Model CSI3644A CSI3645A CSI3646A
5,12,15,24,48V
100W Series DC Voltage 0-18V 0-36V 0-72V
Available in $38.50 $34.65ea $32.57ea $29.99ea $21.18ea $18.49ea
3.3,5,7.5,12,15,24,48V DC Current 5A 3A 1.5A
150W Series Power (max) 90W 108W 108W
Available in $48.99 $44.09ea $39.00ea $37.50ea $26.93ea $23.49ea
5,7.5,9,12,24,28,36V Only $199.00 Each!
Programmable
Programmable DC Electronic
Electronic Loads
www.Cir cuitSpecialists.com The CSI 3700 series electronic
loads are single input program-
mable DC electronic loads that
Circuit Specialists Soldering Station $34.95! provide a convenient way to test
w/Ceramic Element & Seperate batteries and DC power sup-
Solder Stand plies. It offers constant current mode, constant resistance
•Ceramic heating element for more mode and constant power mode. The backlight LCD,
accurate temp control numerical keypad and rotary knob make it much easier to
•Temp control knob in F(392° to 896°) & use. Up to 10 steps of program can be stored.
C(200° to 489°)
•3-prong grounded power cord/static safe tip In Business Model CSI3710A CSI3711A
•Seperate heavy duty iron stand Input Voltage 0-360V DC 0-360V DC
•Replaceable iron/easy disconnect Input Current 0-30A DC 0-30A DC
•Extra tips etc. shown at web site Item# Rapid Heat Up! Input Power 0-150W 0-300W
CSI-STA
CSI-STATION1A
CSI3710A: $349.00 CSI3711A:
CSI3711A: $499.00
Also Available w/Digital Display SMD Hot Tweezer
& MicroPr
MicroProcessor
ocessor Controller
Controller Adaptor Fits CSI
Stations 1A & 2A,
2A, 6-1/2 Digits Digital Multimeter
and CSI906
Item#
CSI-STA
Since 1971 •Stability, Speed and
CSI-STATION2A $29.00 Accuracy
•High Performance: 2000
$49.95 Item# readings/sec
Details at Web Site CSITWZ-STA
CSITWZ-STATION •Multi-Point Scan
•19 Full-Featured Functions
> Soldering Equipment & Supplies > Soldering Stations •Dual Displays with 3-color
Annunciators
Dual Trace 100MHz Oscilloscope •Noise Immunity.
•Built-in USB and GPIB
Outstanding performance and durability for an (optional) Interfaces
incredibly low price of $519. You will find it at most •Easy & Free PC
other locations selling for $975. applications
•Four traces may be simultaneaously displayed in ALT-sweep •6 1/2 Digits M3500A
•Five vertical Modes Chl, Ch2, Dual, Add and Subtract Specifications Compare Price & Specs with
•Bright 6" CRT with an internal graticule •Optional Accessories the Agilent 34410A !
•12 kv acceleration voltage Limi ted Off
Off er Item# 6510 •Designed with 7-1/2 digit techniques to provide user a
•Sweep speeds to 2nS/Div. $519.00! stable, faster and accurate
Details at Web Site > Test Equipment > Oscilloscopes/Outstanding prices measurement. Item# M3500A
•1000VDC / 750VAC
$689.00
Details at Web Site
Dual Output DC Bench Power Supplies > Test Equipment > Digital Multimeters
High stability digital read-out bench power supplies
featuring constant voltage and current outputs. Short- As Low As
circuit and current limiting protection is provided. SMT $93.00!
PC boards and a built-in cooling fan help ensure reli-
able performance and long life. Triple Output Bench Power Supplies
with Large LCD Displays
•Source Effect: 5x10-4=2mV
•Output: 0-30VDC x 2 @ 3 or 5 Amps
•Load Effect: 5x10-4=2mV HOT & 1ea. fixed output @ 5VDC@3A
•Ripple Coefficient:: <250uV ITEM! •Source Effect: 5x10-4=2mV
•Stepped Current: 30mA +/- 1mA •Load Effect: 5x10-4=2mV
*All 3 Models have a 1A/5VDC Fixed Output on the rear panel* •Ripple Coefficient: <250uV
•Stepped Current: 30mA +/- 1mA
CSI3003X-5 0-30v/0-3amp 1-4: $105.95 5+: $99.50
CSI3003X-5: •Input Voltage: 110VAC
CSI5003X5 0-50v/0-3amp 1-4: $114.95
CSI5003X5: $114.95 5+: $109.00 CSI3003X3 0-30VDCx2 @3A $188.00 5+: $183.00
CSI3003X3:
CSI3005X5 0-30v/0-5amp 1-4: $119.00
CSI3005X5: $119.00 5+: $114.00
$114.00 CSI3005XIII 0-30VDCx2 @5A $239.00 5+: $229.00
CSI3005XIII:
Details at Web Site > Test Equipment > Power Supplies Details at Web Site > Test Equipment > Power Supplies

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

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


ESD Safe CPU Controlled
Controlled SMD Hot Air Rework Station
Station Stepper Motors
The heater and air control system are Part #: Motor Frame Holding Torque: Price:
built-in and adjusted by the simple touch Size:
of the front keypad for precise settings. 42BYGH404 NEMA 17 3.4kg.cm/47oz.in $17.95
Temperature range is from 100°C to 57BYGH207 NEMA 23 8kg.cm/111oz.in $24.95
480°C / 212°F to 896°F, and the entire
57BYGH303 NEMA 23 15kg.cm/208oz.in $29.95
unit will enter a temperature drop state
57BYGH405 NEMA 23 20kg.cm/277oz.in $34.95
after 15 minutes of non-use for safety and
85BYGH350B-03 NEMA 34 48kg.in/665oz.in $79.95
to eliminate excessive wear.
Item# CSI825A++ Sale 85BYGH350C-03 NEMA 34 63kg.cm/874oz.in $119.95
•CPU Controlled $149.00!
•Built-in Vacuum System
•Temperature Range:100°C to 480°C / 212°F to 896°F Stepper Motor Contr ollers 2 Phase Microstepping
Microstepping
•15-Minute Stand-By temperature "sleep" mode Stepper Motor Driver (Bi-polar & Unipolar Motors)
•Power:110/120 VAC, 320 W maximum
Part #: Dimensions: MicroStep: Price:
Details at Web Site > Soldering Equipment & Supplies XCW220 100mm x 61mm 1(200), 1/2(400), 1/4(800), $39.95
x 19mm 1/8(1600)
CW220 99mm x 65mm 1/2(400), 1/8(1600) $49.95
Br eadboard / Power Supply / x 30mm
MultiFunction DMM Bundle CW230 115mm x 72mm
x 32mm
1(200), 1/2(400), 1/4(800),
1/8(1600), 1/16(3200),
$59.95
Provides the user with a quick and efficient 1/32(6400), 1/64(12800)
system for breadboarding electronic circuits. CW250 140mm x 94mm 1(200), 1/2(400), 1/8(1600) $69.95
Comes with three built-in regulated power x 45mm
supplies along with a deluxe, easy-to-use CW860 147mm x 97mm 1(200), 1/2(400), 1/4(800), $119.95
breadboard. Included is a multifunction DMM x 30mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800),
with 100VDC, 750VAC, frequency, resist- 128(25600), 1/5(1000),
ance, diode test, audible continuity, transistor 1/10(2000), 1/25(5000),
check,temperature, and capacitance. 1/50(10000), 1/125(25000),
A Super Deal! 1/250(50000)
Details at Web Site
> Breadboards & Prototyping Boards
Only
Powered
Powered Breadboard
Breadboard w/out DMM: $69.00 $69.99! Protek
Protek 2.0 & 2.9GHz Field Str
Strength
ength Analyzers
Item#: PBB272-DMM: $69.99! •Frequency Range : 100KHz ~ 2900MHz 3290N

Powered Breadboard w/Multifunction DMM (CSIMS8264) (2060MHz for 3201N)


•WFM/NFM/AM/SSB modulated signals
You Get The DMM for an Extra $.99 may be measured.
•Sweep Trigger Mode: Free Run, Single
Digital Storage Oscilloscope Module Run, Continuous Wave, Squelch Run
•Sweep Speed: 500 to 2000msec
Convert any PC with USB interface to a high •PLL tuning system for precise frequency
measurement and tuning New
performance Digital Storage Oscilloscope. This
•Built-in Frequency Counter Rev.
Rev. Now
is a sophisticated PC basedscope adaptor pro-
•RS232 interface Available
viding performance compatible to mid/high
level stand alone products costing much more!
Comes with two probes. Item#’s 3290N & 3201N Special
Details at Web Site $1899.00 (for 3290N)
Details & Software Price > Test Equipment > RF Test Equipment $1374.00 (for 3201N)
Download at Web Site Breakthrough!
> Test Equipment > Oscilloscopes/Outstanding Prices
PC based Digital Storage Oscilloscope,
200MHz 5GS/s equiv. sampling USB
interface
Item# 200DSO Only$819.00 Handheld Spectrum Analyzer 2.9GHz
•100kHz to 2.9GHz measurement range
•Measures and demodulates
W-FM/N-FM/AM/SSB signals
SONY Super HAD CCD Color SONY •Sweep mode(Free Run, Single Run, Squelch Run)
Weatherproof
eatherproof IR Cameras Super HAD •PLL tuning system for precise frequencing tuning
•Day & Night Auto Switch CCD™ equipped •100 Saves and loads for waveforms and settings
•Signal System: NTSC camera’s feature dra-
•Image Sensor:1/3" SONY Super HAD CCD •Enhanced Accuracy for Signal Level
•Horizontal Resolution: 480TV lines matically improved Item# PROTEK 7830
•Min. Illumination: 0Lux light sensitivity Special
Details at Web Site
4 8 0n e s Item# VC-827D: $132.00 $2988.00
i > Test Equipment > RF Test Equipment
T V oLl u t i o n
Res
SONY Super HAD CCD B/W SONY Super HAD SONY Super HAD CCD Color
Weatherproof
eatherproof IR Camera CCD Color Camera Weatherproof
eatherproof IR Camera
•Day & Night Auto Switch •Weather Proof •Day & Night Auto Switch
•Signal System: EIA •Signal System: NTSC •Signal System: NTSC
•Image Sensor: 1/3" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super
•Horizontal Resolution: 420TV lines •Horizontal Resolution: 420TV lines HAD CCD
•Min. Illumination: 0Lux •Min. Illumination: 1Lux/F1.2 •Horizontal Resolution: 420TV lines
Item# VC-317D: $59.50 Item# VC-805: $53.95 •Min. Illumination: 0Lux

Details at Web Site > Miniature Cameras(Board,Bullet,Mini’s, B/W, Color) Item# VC-819D: $62.50

Visit our website for a complete listing of our offers. We have over 8,000 electronic items on line @ www.CircuitSpecialists.com. PC based data acquisition,
industrial computers, loads of test equipment, optics, I.C s, transistors, diodes, resistors, potentiometers, motion control products, capacitors,miniature observation
cameras, panel meters, chemicals for electronics, do it yourself printed circuit supplies for PCB fabrication, educational D.I.Y. kits, cooling fans, heat shrink, cable
ties & other wire handleing items, hand tools for electronics, breadboards, trainers, programmers & much much more! Some Deals you won’t believe!
C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
Cover.qxd 12/7/2006 2:12 PM Page 108

Vol. 28 No. 1
NUTS & VOLTS
RING FLASH • CHARGER SWITCH • RS-232 • PICAXE
Propeller Chip Specifications
Power Requirements 500 µA/MIPS @ 3.3 volts DC
External Clock Speed DC to 80 MHz (4 MHz to 8 MHz
with clock PLL running)
Internal RC Oscillator 12 MHz or 20 kHz
System Clock Speed DC to 80 MHz
Cogs 8
Performance 20 MIPS per cog @ 80 MHz
Global RAM/ROM 32 KB RAM / 32 KB ROM
Processor RAM 512 x 32 per cog
I/O Pins 32
Current Source/Sink per I/O 30 mA

January 2007

U.S. $5.50 CANADA $7.00


0 1>

0 74470 89295 3

Das könnte Ihnen auch gefallen