Professional Documents
Culture Documents
3 Nuts & Volts INVERSE KINEMATICS: A UNIVERSAL ROBOTICS CONTROLLER March 2004
Circle #60 on the Reader Service Card. 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, capaci-
tors,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 Circle #145 on the Reader Service Card.
Page 3.qxd 2/3/2004 8:59 PM Page 3
♦Std. D25 rear panel conn. ♦5.25” core height, 5.50”L and 3.50”W
7-Bay Cabinet Dot Matrix Display Internet Video Phone 80W Power Supply hole-to-hole center mounting footprint
♦SCSI ID switch included #80544 $20.00 #19429 $8.00 #19442 $5.00 #18415 $5.00 ♦Screw primary, hvy lugged sec. leads
♦New, HSC 90-day warranty ♦New, HSC 90-day warranty
HSC#19703 $24.95 HSC#19986 $45.00!
Go Wireless!... 9.1GB Ultra SCSI 4.3GB SCSI HD 1U Rack Cabinet 150W Power Supply External Hard Drive
HSC#18753 $14.00! #18412 $10.00! #19437 $9.00! #19266 $8.00
♦Proxim ‘Symphony’ series... Systems!
♦2.5 GHz - 1.6 Mpbs Uses PC parallel port - Drives not Incl.
♦’HomeRF’ - not 802.11 ♦’Datafab’ “Mobile Disk” MD-2
Wireless PCI Card ♦For 2.5” IDE hard drives
#19743 $9.95! AC/DC VHS Player Pixie2 QRPp Xcvr! PCMICA SCSI 200W Power Supply ♦Drivers @ www.halted.com/
#19048 $10.00! #Pixie2 $9.95 #19160 $35.00 #19267 $8.00 onlineresources.html
♦Boxed, w/cables, for DOS, Win95+
Wireless PCI Card Best Buy Prices!! HSC#19975 $19.95!
#19737 $9.95!
Electric Field Meter DVM w/Tilt-Up Display 18GB SCA SCSI Color Touch Screen!
♦Measures radiation from cell phones ♦3 1/2 digit display ♦Seagate ‘Cheetah’ Ultra -2 Wide ♦ ALPS LFH8P4032E
microwave ovens, computers, ‘bugs’, ♦0.5% basic accuracy ♦Formatted Capacity: 18.21GB ♦240x320 diag. LCD STN
security, two-way radios...more...
♦Range: 10MHz to 4.5GHz ♦AC/DC, volts, current, ♦Speed: 10,000RPM
display w/CCFL backlight
♦4-wire touchscreen intfce. Special!...
♦Meter and LED displays
capacitance, frequency,
♦HSC 90-day warranty
temperature & HFE ♦2.75” x 3.50” x 0.375” 2 for $59.95!
♦See pg. 60, Feb. QST mag. ♦Compare at prices of $70, $80 & up! ♦HSC Special!!...get our
‘SCS3700’ SCA to SCSI 1 adapter
♦http://hubbard.engr.scu.edu/embedded/
♦New,90-day warranty ♦New, 90-day warranty Reg. $12.50...for $7.50 w/this drive! lcd/lfh8p4032b/lfh8p4032b.html for info
Since 1963!...
Silicon Valley’s Electronic Marketplace
3 Retail/Wholesale Locations: Order Toll-Free: 1-800-4-HALTED(442-5833)
Main Office - Mail Orders... or...ONLINE, AT: www.halted.com
3600 Ryder St. Santa Clara, CA 95051 Terms: Some quantities limited; all items are subject to prior sale. Minimum order:
Santa Clara 1-408-732-1573 $10.00 plus shipping. Orders under $20.00 subject to $2.00 handling fee, in addition
to shipping. All orders shipped by UPS Surface unless otherwise specified. $6.00 UPS
Sacramento 1-916-338-2545 charge added for COD. Visit our website for detailed information on domestic and
Rohnert Park 1-707-585-7344 international shipping methods.
March 2004
Vol. 25 No. 3
PROJECTS
42 ADDING SOUND TO YOUR PROJECTS
Use various integrated circuits to set your
projects apart from others through the use
COLUMNS
of sound.
by Martin Dubuc 30 ELECTRONICS Q&A
Basic Electronics; HGH for Old Electronics; SSR
46 HDD EXERCISER Meets MCU; Commodore Still Alive; Moody
Give your defunct hard disk drive some get LEDs; and more.
up and go.
by Evert Fruitman 84 IN THE TRENCHES
For design engineers facing real world
51 BUILD A 1 MHz FREQUENCY COUNTER problems. This month: Troubleshooting
Building this useful benchtop tool is interesting Circuits.
and instructive.
by Paul Florian JUST FOR STARTERS
16
Interface Choices, Part 1: Transistors.
D E PA R T M E N T S
97 Advertiser’s Index 69 News Bytes Nuts & Volts (ISSN 1528-9885/CDN Pub Agree#40702530) is published monthly for
75 Classified Display Ads 78 NV Bookstore $24.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879.
14 Electro-Net 7 Publisher’s Info PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL MAILING
67 Electronics Showcase 6 Reader Feedback OFFICES. POSTMASTER: Send address changes to Nuts & Volts, 430 Princeland
38 New Product News 94 Tech Forum Court, Corona, CA 92879-1300 or Station A, P.O. Box 54, Windsor ON N9A 6J5.
cpcreturns@nutsvolts .com
MARCH 2004
4
Full Page.qxd 2/6/2004 10:15 AM Page 5
Reader Feedback
Errata
Author Thomas Henry, designer of
the Clangora percussion synthesizer
(November 2003), offers the following
NUTS & VOLTS
MARCH 2004
6
Page7.qxd 2/5/2004 1:57 PM Page 7
Published Monthly By
T & L Publications, Inc.
430 Princeland Ct., Corona, CA 92879-1300
(909) 371-8497
FAX (909) 371-3052
www.nutsvolts.com
Subscription Order ONLY Line
1-800-783-4624
FOUNDER/ASSOCIATE PUBLISHER
Jack Lemieux
PUBLISHER
Larry Lemieux
publisher@nutsvolts.com
ASSOCIATE PUBLISHER/
VP OF SALES/MARKETING
Robin Lemieux
robin@nutsvolts.com
ADVERTISING SALES DIRECTOR
Rich Collins
rich@nutsvolts.com
MANAGING/TECHNICAL EDITOR
Dan Danknick
dan@nutsvolts.com
EDITORIAL ASSISTANT
Alexandra Lindstrom
CONTRIBUTING EDITORS
James Antonakos Gerard Fonte
Jan Axelson Evert Fruitman
Mark Balch Mike Keesling
Michael Kornacher TJ Byers
Ed Driscoll Paul Verhage
Martin Dubuc Jon Williams
Jeff Eckert Paul Florian
CIRCULATION DIRECTOR
Mary Gamar
subscribe@nutsvolts.com
SHOW COORDINATOR
Audrey Lemieux
WEB CONTENT/NV STORE
Michael Kaudze
michael@nutsvolts.com
PRODUCTION/GRAPHICS
Rosa Gutierrez
Shannon Lemieux
DATA ENTRY
Karla Thompson
Debbie Lockett
Copyright 2004 by T & L Publications, Inc.
All Rights Reserved
TechKnowledgey
2004 From the Electronics World
Events, Advances, and News
Advanced is still in the early stage, so it is not have demonstrated the modulation of
Technologies yet possible to say what all the appli- light emission in phase with a base
cations will be, but a light-emitting current in transistors operating at a
Light-Emitting Transistor
transistor opens up a rich domain of frequency of 1 MHz. Obtaining still
Promises Revolutionary integrated circuitry and high-speed higher speeds is considered certain.
Change signal processing that involves both "At such speeds, optical inter-
electrical signals and optical signals." connects could replace electrical
A transistor usually has two wiring between electronic compo-
ports: one for input and one for out- nents on a circuit board," Feng pro-
put. "Our new device has three ports: jected. This work could be the begin-
an input, an electrical output, and an ning of an era in which photons are
optical output," detailed Feng. "This directed around a chip in much the
means that we can interconnect same fashion as electrons have been
optical and electrical signals for dis- maneuvered on conventional chips.
play or communication purposes."
Unlike traditional transistors, Computers and
which are built from silicon and ger- Networking
The newly discovered light-emitting manium, the light-emitting transis-
transistor has three ports: input, electrical Create Your Own P2P
tors are made from indium gallium Network
output, and optical output.
Illustration courtesy of Walid Hafez, phosphide and gallium arsenide. "In
University of Illinois News Bureau. a bipolar device, there are two kinds
of injected carriers: negatively A peer-to-peer (P2P) network, in
case you are not up on the ter-
tronics, as it has in electronics. be modulated at transistor speed." with the only size limit being your
"We have demonstrated light Although the recombination own available hard disk space and
emission from the base layer of a process is the same as that which connection speed. You can even syn-
Everything For Electronics
heterojunction bipolar transistor and occurs in light-emitting diodes, the chronize and update multiple copies
shown that the light intensity can be photons in light-emitting transistors of the same file across multiple com-
controlled by varying the base are generated under higher-speed puters. The basic process involves
current," said Holonyak. "This work conditions. So far, the researchers creating a library on your machine
MARCH 2004
8
Tech2004.qxd 2/4/2004 11:00 PM Page 9
TechKnowledgey 2004
UPDATED
· Determine surplus stepper motor specs using subroutines, loops, lookup tables, interrupts
· Using a text editor, using an assembler, using MPLAB
simple easy to build test equipment.
· Design and build microcontroller-based control systems · Timing and counting (timer 0), interfacing, I/O conversion
Microcontrol'n Apps - Intermediate $44.95
(flow charts and code examples included).
· Design and build stepper motor driver circuits. · Serial communication - PICmicro to peripheral chips
· Analyze the mechanical characteristics of stepper motor- · Serial EEPROMS
· LCD interface and scanning keypads
driven devices.
· The book is full of experiments, circuits and code. $34.95 New Titles · D/A and A/D conversion - several methods
· Math routines
Same Useful · 8-pin PICmicros
· Talking to a PICmicro with a PC using a terminal program
Books · Test equipment and data logger experiments
NUTS & VOLTS
MARCH 2004
10
Tech2004.qxd 2/4/2004 11:01 PM Page 11
TechKnowledgey 2004
for you, public opinion poll results, and Save Money with Surplus
so on. Theoretically, it could also be set LEDs
up to keep track of interest rates, avail-
able credit on a card, your blood alco-
hol level, or even the emotional state of
your spouse (which may be directly
I f you use LEDs and are on a budg-
et, it might be useful to visit
www.SurplusLED.com, a website
related to your blood alcohol level). created late last year by LEDtronics
Essentially, it can handle any (www.led.net) to sell off surplus
information that can be fed into a net- products. SurplusLED.com was creat-
work and the company claims that ed to service a range of consumers,
the device is compatible with existing from purchasing agents to govern-
long-range networks, as well as short- ment procurement officials, who want
range (Bluetooth 802.11) ones. There to stretch their budgets in today's lean
are no monthly fees for the standard economic environment. The inventory
data channels, although some option- The FlexUSB cable employs a flexible changes daily and includes based LED
al premium services involve a fee. connector for use in confined spaces. lamps and bulbs, products for PC
Is it a practical data output boards and displays, and discrete LEDs.
device or just a desktop toy? That your CPU closer to the wall without The products include 1.8 mm
probably depends on the application mangling the USB connector, take a green round dome LED panel dots,
you choose. If you can think of a look at the FlexUSB cable from red discrete cylindrical flat-top LEDs,
spectacular use for the technology, Ideative, Inc. (www.FlexUSB.com). rectangular bicolor LEDs, green dif-
send your ideas to Ambient Devices. Introduced at the 2004 fused 5 mm square discrete LEDs,
They are open to suggestions. International Consumer Electronics red T134 (5 mm) flangeless low-
Show in Las Vegas, NV, it utilizes less dome LEDs, discrete T1 (3 mm)
USB Cable for Confined than half the footprint of traditional bicolor dome LEDs, and some con-
Spaces USB connectors and allows the cable sumer LED products, such as LED
direction to be set and locked in four flashlights, LED key chain lights, flash-
TechKnowledgey 2004
Industry and the according to research firm IDC a healthy growth cycle for over half of
(www.idc.com). In a recent report, the semiconductor industry. From 2003
Profession they wrote that, "Stronger than to 2008, IDC predicts that the semicon-
18% Growth Forecast for expected mobile phone and PC ductor market will grow at a compound
Semi Industry in 2004 shipments have stabilized average sale annual growth rate of 12%, rising from
prices and increased capacity utiliza- $160 billion in revenue this year to
Tadahiro Sekimoto to
healthy growth rate of 18% this year, mobile phones and PCs, which will drive Receive Award
www.gatewayelectronics.com
(Electronically Speaking, Gateway’s Got It!)
Hobby Engineering
Robot Kits, Parts, Tools and Books
Your BASIC Stamp Headquarters
www.hobbyengineering.com www.parallax.com
Wo r l d ' s S m a l l e s t
E t h e r n e t We b
Ser ver
w w w. n e t m e d i a . c o m
ONE PASSircuitTM
From only
$6.95
See the World’s Largest Collection +S&H
of LCDs and LCD Products www.onepasinc.com www.allelectronics.com
ELECTRO-NET
LEDs For Sale
White .75/ea Blue .30/ea
CueCats • Simple Low-Cost
Barcode Scanners Try It Website/Print Ads — 25,000+
average online sessions per month
www.etronicstuff.com www.mavin.com
Thousands of active electronics hobbyists,
Robots For When You’re USB DAQ
NUTS & VOLTS
World’s
World’s Smallest
Smallest Video
Video Cameras
Cameras •• Wireless
Wireless Video
Video •• Covert
Covert Video
Video
SUPERCIRCUITS
1280 HOUR TIME LAPSE VCR COMPLETE QUAD
VIDEO SECURITY
This Time Lapse VCR Lets SYSTEMS
You Record 1280 Hours--
That’s Nearly 2 Months!
• Records for 1280 hours in time lapse mode
• 40-hour real time recording Only
• Easy-to-use on screen programming $199.95!
• Alarm, panic, repeat and timer capabilities
• Diamond like carbon coated head for super durability
• Endless loop recording--set it and forget it • 4 PC-152C Video Cameras with HG
Comes with power cable, wireless remote control, complete instructions and 1 year Model, or 4 PC-154C with PG Model, or 4 PC-23C
manufacturer’s warranty. with UG Model (shown above)
VCR-1280 Hour Time Lapse VCR ................................................. $199.95 • 4 4MM, 6MM or 8MM C-Mount Lenses (Your choice-
Mix or Match)
• 4 12 Volt Power Supplies
COLOR WIRELESS CLOCK RADIO CAM • 4 MB-1 Mounting Brackets With Extenders
• 4 25, 50 or 100 Foot BNC to BNC Integrated
Easy To Install, Video/Power Cables Your choice- Mix or Match)
Transmits Up • 1 QS-22 Realtime Quad Processor
To 300 Feet! • 1 Quad Processor Power Supply
Only $109.95! • 1 12 Inch Black and White Monitor (14 inch with UG
PART 15 system)
• FCC approved for license free operation
• 2.4 GHz for rock solid wireless performance FCC • 2 3 Foot Video Cable
• Latest gen CMOS color camera, 300 line resolution, 2 lux APPROVED Comes with easy connection instructions and 1 year
NO
L
E
IC IR
• Includes clock camera/transmitter, receiver & power supply ENS
E REQU warranty. Cameras come with 2 year warranty.
• Three channel operation, 1 year warranty VSS1-HG High Grade 4 Camera B&W Realtime
CCS8 Color Covert Wireless Clock Cam ....................................... $109.95 Quad Video Security System ......................... $399.95
PART 15
2.4 GHZ WIRELESS RV & TRUCK SYSTEM New! Vehicle
FCC video system for
COVERT VIDEO SYSTEM APPROVED
• Rugged weatherproof
under $100!
NO
CMOS camera
D
L
E
MICRO AUDIO
WeatherProof
Zoom Camera
Versatile 5-50 MM
Zoom Lens SYSTEM SUPERCIRCUITS
• 5-50 MM Zoom See Hundreds Of Amazing
• Color CCD Video Products Online At
• 330 Lines of resolution Super
www.supercircuits.com
• 12 Volts DC 130 mA Draw High Gain
• DC-Driven auto iris lens or Call Us Today To Order
Preamplifier! or Request A Free Catalog
• 0.6 Lux 1.4 fstop
• 5.75” x 3.5 dia • Built-in preamp for low noise,
• Built in plug and play cables
• 30 Day MBG
high gain and auto level
adjustment by the on-board IC 1-800-335-9777
• The weight is under 1/2 ounce One Supercircuits Plaza, Liberty Hill, TX 78642
• 1 Year Warranty Phone 1-512-778-6950 Fax 1-866-267-9777
• Output is line level
Comes with mounting brackets, plug and play cables and • Runs on 6-15 volts DC at 20 mA
1 year manufacturer’s warranty and 30 day money-back Prices, specifications and availability are
• Comes with 6 ft power/audio subject to change without notice. Published
satisfaction guarantee.. cables and a 30 day MBG terms & conditions apply. Copyright 2003
PC219ZWP Weatherproof Zoom Camera .. $219.95 PA3 Micro Audio System $12.95 Supercircuits, Inc.
Please call us at 1-800-335-9777 to be rushed your free Microvideo and Security Catalog!
JustForStarters.qxd 2/4/2004 10:49 PM Page 16
T
here are many projects Next month's column continues a brief review of BJT operation.
where a control circuit drives the discussion with other isolation
or senses external or high- techniques. NPN BJTs
current signals. Control circuits are
typically constructed with digital or Transistors BJTs are manufactured in two
analog integrated circuits (ICs) that varieties: NPN and PNP. NPN and
have relatively low drive strengths. The first question to ask is PNP refer to the stacking of positive-
TTL and CMOS ICs are capable of whether true isolation or merely ly and negatively doped silicon. Each
driving a range from several hundred amplification is required. If you want variety behaves similarly, but with
microamps to several milliamps. to turn on a light bulb or drive a DC opposite polarities. To keep things
Such drive strengths may suffice for motor, control signal amplification simple, we can use NPN BJTs as our
one or two small LEDs, but what may be all that is warranted. A few working example. A more complete
about light bulbs, AC-powered a tests to verify if this is the case discussion of transistor usage and
ppliances, and motors? What about include: operation can be found in my book,
situations where safety or noise con- Complete Digital Design. Figure 1
cerns prohibit directly connecting the • Is the load DC? shows the basic silicon structure of
control circuit to a load being driven? an NPN BJT and its corresponding
Many projects require a partial • Does the load share a common symbol in a circuit diagram. The
or complete isolation between a ground with the control circuit? three contacts on a BJT are the
control circuit and its input/output base, emitter, and collector. When a
signals. Fortunately, there are • Is the load safe enough to not sufficient voltage is applied to the
numerous solutions to this problem. cause a damaging voltage surge on base-emitter junction, a large current
Selecting an appropriate scheme the control signal? may flow from collector to emitter.
depends on the type of isolation This voltage is approximately 0.7 V,
required. This month's column dis- • Is the control circuit immune to the forward voltage of a silicon
cusses transistor-based isolation electrical noise that may emanate diode. (The base-emitter junction
techniques for DC control signals, as from the load? forms a diode because P-N silicon
compared to analog signals such as junctions naturally form diodes.)
audio or video. DC isolation requires If the answer to all of these ques- Figure 2 shows the basic
only the transmission of an on/off tions is yes, transistors may be most hookup scheme for using an NPN
state from one circuit to another. appropriate for driving the load. BJT in a digital, or DC, amplification
Transistors are solid-state role. BJTs are also capable of AC
Figure 1. The NPN BJT structure and its amplifiers that enable a amplification, where the load is driv-
electrical symbol. small control current to en with a higher amplitude version of
modulate the flow of a the input signal; however, we are
much larger current. There dealing with the DC amplification
NUTS & VOLTS
The Base Resistor You can pick a different value if you are
using a CMOS driver with higher output
A current limiting resistor is voltage and current.
required to protect the transistor and At this point, the circuit in Figure
the driver. The base-emitter junction 2 is capable of sinking up to 40 mA
has no inherent mechanism for limit- (IC = ßIB = 100 x 0.4 mA) of load
ing the current flowing through it. Yet, current. Depending on the load's
the junction tries to maintain approx- characteristics, you may place a
imately 0.7 V across it. So, what hap- current limiting resistor between the
pens if you connect a 5 V battery to load and collector, as well.
the base? The base will draw as much
current as it can until the voltage falls Maintaining Figure 2. Basic digital amplification
below 0.7 V. In most situations, the Operation with an NPN BJT.
transistor will lose this battle and
simply overheat to the point of One thing to keep in mind is A transistor is useful in an input
destruction. A current limiting resistor the minimum permissible collector sensing circuit if the external signal
ensures that the base voltage can be voltage. A typical saturation voltage falls outside the control circuit's
safely maintained at the silicon's nat- between collector and emitter is 0.3 V. specifications. Typical digital ICs
ural 0.7 V threshold. Any excess In our circuit, the emitter is at ground restrict the logic input levels to be
voltage is dropped across the resistor. (0 V), so the saturation voltage is 0.3 within a diode drop of the IC's voltage
Selecting RB can be done with V. If the collector falls below 0.3 V, the rails. If an IC runs on a 5 V supply, the
varying degrees of accuracy, depend- transistor will no longer conduct. You legal input range might be -0.7 to +5.7
ing on how much current you are must ensure that the load can operate V. Manufacturers may further restrict
trying to drive. BJTs relate the current in the voltage difference between the this range to prevent damage to the IC.
flowing into the base and collector saturation voltage (0.3 V) and the Figure 3 shows an NPN BJT used
through a constant called beta, ß power rail. in an input sensing circuit. Here, we
(many transistor manufacturers refer If the circuit is supplied with 5 V, assume that the input circuit ranges
to ß as hFE). The collector current, IC, the allowable voltage difference is 4.7 from 0 to 12 V. The input may be a
may not exceed the product of ß V. If the load needs higher voltage, hazard alarm or other sensor that
and the base current, IB. Put more you may introduce a higher supply operates on a higher voltage. A 12 V
succinctly: IC = ßIB. Despite ß effects, voltage, such as 12 V. Keep in mind input is outside the legal range for
the circuit may further restrict the that the control circuit and load practically all logic ICs. We first select
collector (load) current. Beta varies power supplies must share a com- a current-limiting base resistor, RB, to
with the specific transistor. A mon ground connected to the emitter. provide a safe base current, IB. The
common value is ß = 100. voltage across RB is known — the
Many situations allow a rough Higher Load input (12 V) minus the base-emitter
selection process for RB. Let's say Currents junction voltage (0.7 V) is 11.3 V. A
that you have a 74LS-type TTL driver. wide range of resistances is accept-
When the driver goes high (greater Transistors with higher ß are able for this application. 10KΩ yields
than about 2.7 V), the transistor will available to provide more collector IB = 1.13 mA. Even 100KΩ gives an
turn on because the base will be current. Yet, a single BJT eventually acceptable IB = 0.113 mA. Keep in
brought from low (0 V) to high. The runs out of steam as higher load mind that the transistor only has to
74LS family is specified with about currents are desired. Multiple transis- drive a logic input, so very little col-
0.4 mA maximum high-level drive tors may be cascaded in various
strength. We can pick RB to use all of topologies, such as a Darlington Figure 3. A BJT in an input-sensing role.
that current to provide maximum pair to increase the final load
load current. current. These circuits are out-
First, we calculate the voltage side the scope of this article.
drop across the resistor as the differ-
ence between the driver output volt- What About
age (2.7 V) and the base-emitter junc- Inputs?
tion voltage (0.7 V), which is 2 V. Now,
using Ohm's law (V = IR), we find that So far, we've covered only
2 V divided by 0.4 mA gives a resist- control outputs. Inputs work sim-
ance of 5KΩ. The standard resistance ilarly, but the base is driven by
value 4.7KΩ is good enough. That's it. the external circuit being sensed.
MARCH 2004 17
JustForStarters.qxd 2/4/2004 10:50 PM Page 18
lector current is required. This takes reduces power consumption because sistor is off. Therefore, no collector
care of the design work at the "dirty" less collector current, IC, is required current flows and RC pulls the logic
side of the circuit. On the control, to pull the collector down to 0.3 V. A input high (5 V). When the external
or clean, side of the circuit, we have lower resistance more rapidly pulls signal is high (12 V), the transistor
to connect the control input to the the collector up to 5 V when the tran- conducts current through RC and the
transistor so that legal voltage levels sistor turns off. The compromise is logic input is pulled low (0.3 V). This
are generated for high and low logic between power consumption and should not be a problem, but it must
levels. The low voltage level is signal rise time. A good place to start be compensated for. If the external
determined for us by the transistor's is selecting RC = 4.7KΩ, correspon- event is deemed active when the sig-
saturation voltage, about 0.3 V, which ding to IC = 1 mA. 4.7KΩ should give nal is at 12 V, the control input should
is well within the typical 74LS specifi- a fast enough rise time. If not, 3.3KΩ, regard an active state as logic-low.
cation. The high voltage level is also 2.2KΩ, or lower values can be used.
determined — this time by the control Negative Input
circuit's voltage supply (5 V, in this Logical Inversion Levels
example). So, the remaining design
point is selecting a value for the It is important to realize that The input circuit can also operate
collector resistor, RC. Choosing RC is the input sensing circuit performs a and protect the control circuit from
a compromise and there is no single logical inversion function. When the negative input levels. If a negative
correct answer. A higher resistance external signal is low (0 V), the tran- voltage is applied to the BJT's base,
the transistor will not conduct. The
transistor does not translate a nega-
About the Author tive base voltage to a negative collec-
tor voltage. However, a transistor does
Mark Balch is the author of addition to his work in product design, have physical limits. Be sure to check
Complete Digital Design (see www. Mark has actively participated in indus- the manufacturer's data sheet for the
completedigitaldesign.com) and try standards committees and has pre- maximum allowable voltage from
works in the Silicon Valley high-tech sented work at technical conferences. emitter to base, which is typically in
industry. His responsibilities have includ- Mark holds a bachelor's degree in elec- the order of several volts.
ed PCB, FPGA, and ASIC design. Mark trical engineering from The Cooper
has designed products in the fields of Union in New York City. He can be Transistor Usage
telecommunications, HDTV, consumer reached via Email at mark@complete Qualifications
electronics, and industrial computers. In digitaldesign.com
Four qualifiers were listed earlier
for whether a transistor is an
appropriate isolator. Let's review
them with an understanding of BJT
basics in mind. First, the load has to
be DC because the transistor circuit
cannot handle an AC power signal.
Second, the transistor has a common
emitter terminal and, therefore, both
the driver and load must share that
common ground. Third, the transistor
can break down under high-ampli-
tude voltage surges. Fourth, load
noise (e.g. motor noise) can pass
from the collector to the base. Many
interface problems can be solved with
transistors. Transistors are compact
NUTS & VOLTS
Autotrax
Electronic Design Automation
autodesk
TM
authorised developer
®
Schematic Capture
SPICE Simulation
PCB Layout
Auto-Layout/Router
3D PCB Visualization
Database Support from
$45
Drag and drop parts onto your schematic.
Connect them together.
Add virtual instruments such as scopes and function
generators.
Use the PCB design wizard to create your PCB.
Autolayout and autoroute the board.
View the board in 3D.
Output to Gerber and AutoCAD/Solidworks.
2.0
It just gets
Why wait? Download AutoTRAX EDA NOW!
Better!
www.autotraxEDA.com
MicroMemories.qxd 2/4/2004 11:25 PM Page 20
Micro Memories
Bulletin Board Systems:
Before There Was a World Wide Web
I
n 1978, the Internet existed, but While early modems were built Christianson and Suess seemed
it was still largely restricted to primarily to allow personal computer somewhat surprised by how popu-
universities and the military (and owners to log onto mainframes, they lar their pioneering BBS had
still called Arpanet.) It was only a also had the ability to be accessed become.
year before that Hayes had released themselves, giving others the option They reported getting calls
the first modem for PCs. While of logging onto that personal from as far away as Hawaii,
CompuServe (see the October 2003 computer. Australia, and Europe, with the
“Micro Memories”) and the Source The genius of Christianson and average user (no matter where he
were positioning themselves as Suess was in their effort to allow the was located) connecting for 20 min-
national online services, Ward information on one computer to utes a pop.
Christianson and Randy Suess of be shared in a coherent, logical fash- Eventually, Christianson and
Chicago had another idea for con- ion, modeled after the proverbial Suess began selling their software at
necting groups of users to comput- town bulletin board. So, depending $50.00 a copy, though they admitted
ers: the bulletin board systems or upon the nature of the BBS, users at the time that they had little hope
BBS. could dial-in, log-on, and exchange of turning a profit.
Christianson and Suess began computer information, movie Not surprisingly, other entrepre-
trying to build a personal computer reviews, sporting news, etc. Most neurs arrived on the scene once
version of the large mainframes that BBS were free, but a few charged they saw the viability (not to men-
they had previously logged onto. membership fees or kept their virtual tion the actual idea!) of BBS soft-
In 1977, Christianson wrote doors open through selling products ware.
Xmodem, the first computer pro- to their members.
gram used to transfer files between In an April 1980 interview The 1980s: BBS’
computers equipped with modems. with Kilobaud Microcomputing Heyday
The next year, he teamed with Magazine, (reprinted at www.port
Seuss to create the first BBS soft- commodore.com/commodore/ While there weren't any $399 .00
ware. bbs/cbbs.html) the Chicago-based eMachines or package deals that
Many early BBS ran on Apple IIs and The Commodore Pet was a late 1970s The IBM PC was introduced in 1981
provided information for their users. and early 1980s PC that competed with and became one of the dominant PC
the Apple II and TRS-80. designs of the 1980s.
NUTS & VOLTS
Everything For Electronics
20 MARCH 2004
MicroMemories.qxd 2/4/2004 11:25 PM Page 21
Jr.
MARCH 2004
22
Full Page.qxd 2/3/2004 9:59 PM Page 23
Technology degree granting school. Call or write us for your FREE Course Catalog! Or call (800) 243-6446 PT31
NEW
Cours
Learn How To Design & Build PCBs! e
Learn how to design and build printed circuit boards with this unique new
distance learning course from CIE Bookstore.
Designing a PC board is not complicated if you follow the basic rules outlined
Complete
in this course. Every lesson is presented in a clear easy-to-understand format Program
which makes learning this material fun and easy. $
14995
Earn a Certificate of Completion in PCB Design from CIE Bookstore when finished,
instructor assistance and on-line priority grading is included with tuition.
FM SUPER SALE
Save Up To $500!
Professional 35W FM Stereo Transmitter
✔ 35W output, temperature and VSWR protected
✔ Automatic audio & power controls
✔ Digitally synthesized PLL for rock solid frequency stability
✔ Digital display of all parameters
✔
✔
Automatic battery back-up switch
110/220 VAC, 12 VDC operation
35 Watts, Frequency Agile...And Simple To Operate!
USE IT ANYWHERE IN THE WORLD
We designed the PX1 to be the gold standard in transmitters intended for worldwide service. Whether your power main is 110, 220 VAC, or 12 VDC, the PX1 can handle
it. Our battery back-up option is ideal for remote areas with questionable power; a standard automobile battery is seamlessly switched in when regular power is lost -
your listeners will never miss a beat! Automatic VSWR protection ensures maximum power into any antenna situation that may develop such as ice or wind damaged ele-
ments; conditions that would shut competitive transmitters down.
EVERYTHING IS INCLUDED!
First we took our state of the art PX1 FM Stereo Transmitter and installed it in an impact resistant, rack mount travel case.
Then we added the Superscope PAC750 integrated mixer/cassette deck/CD deck. We prewired them, then added a professional microphone and some cables. Finally, we
included our 3.4 dB gain omnidirectional FM Broadcast antenna with 100 feet of matching low loss coaxial cable. There you go, a complete radio station, ready to plug in,
and be on the air! Just imagine: Show up, open up the case, plug in the AC power, temporarily mount the antenna, connect the coax, and you’re all set! The applications
are endless! From live remotes to station backup transmitters, our “Station In A Box” is your solution! (Note: The end user is responsible for complying with all FCC Rules
& Regulations within the US, or any regulations of their respective governing body).
Some customers have even mounted them on the roof of their van, and have operated the station from inside the van! If you’re set-
ting up a temporary station this is ideal!
We also include 100 feet of low loss LMR-400 coaxial cable, with connectors pre-installed to get you on the air quick. Just plug it in at
both ends!
PXB35 Professional 35W FM Stereo Station In A Box WOW!! Get On The Air QUICK SAVE $500! $3295.95 x
$3795.00
L
ast time, we examined the between the transmitter and receiver. An 8-bit shift register is parallel
basic operation of the simple Figure 2 shows the frame format. loaded (via the LOAD input) with the
fiber optic communication The format of the transmission six bits of frame data to transmit,
system shown in Figure 1. We saw frame (Start bit, D0 through D5, along with hard-wired start (0) and
that six data bits were packed into an Stop bit) represents a hardware stop (1) bits. Bits are clocked out at
8-bit frame, with transmitter and protocol. This protocol must be used a rate determined by TxCLK. When
receiver circuits on each end provid- at both ends of the communication the WR input clocks the D flip flop,
ing the parallel-to-serial and serial-to- link for reliable data transfer. the Q-not output goes low, allowing
parallel conversions. The receiver must expect the same the 4-bit counter to begin counting
This month, I will show the frame format or the frame bits and changing the state of TxRDY.
details behind the transmitter and will be interpreted differently at the After eight bits have been clocked
receiver circuits and explain how a receiver. Who knows what problems out, the output of the inverter goes
software protocol is used to transmit might occur as a result of this? low, clearing the flip flop, which, in
eight bits of data. Since this is an asynchronous turn, clears the counter. When the
Before we examine the transmit- communication system (no clock counter output goes to 0000, the OR
ter and receiver hardware, let us transmitted with the data), we must gate allows the shift register to be
review the format of the 8-bit trans- use the Start and Stop bits as fram- loaded with new data.
mission frame that is exchanged ing bits to assist in synchronization Figure 4 illustrates the receiver
between the transmitter circuitry; its input/output signals are
Figure 2. A transmission frame. and receiver. We shall described in Table 2.
soon see that the falling Unlike the transmitter, the receiv-
edge of the Start bit sets er uses an RxCLK clock that is 16
the receiving machinery times faster than the incoming bit
in motion. Figure 3 shows rate. This allows the bit stream to be
the schematic diagram of sampled in the middle of each bit for
the transmitter. Table 1 higher accuracy and helps eliminate
explains the input/output timing problems due to the slight
signals. difference in clock frequencies on
each end of the communication link.
Figure 1. Fiber optic communication link allowing full-duplex A falling edge on the RxD input
communication between endpoints. clocks a one through the first D flip
flop, allowing both counters to begin
counting. After the first eight RxCLK
NUTS & VOLTS
6XUSOXV6DOHVRI1HEUDVND
*HLJHU0OOHU7XEH )XMLWVX3HQ&RPSXWHUV)RXUPRGHOVWR 9DFXXP7XEHV2YHUWXEHW\SHV
785&. FKRRVHIURP OLVWHG
7KH EDVLF EXLOGLQJ EORFN IRU D %HWD SDUWLFOH
)HUULWH5RGV VOHHYHVLQPDQ\VL]HV (OHFWURO\WLF&DSDFLWRUV6LQJOHDQG
DQG JDPPD UD\ GHWHFWRU 7KHVH RUJDQLFDOO\
PXOWLSOHVHFWLRQ
TXHQFKHGWKLQZDOO*HLJHUWXEHVZHUHPDGHE\
5D\WKHRQ%UDQGQHZQHYHUXVHG:HLQFOXGH &U\VWDOV7KRXVDQGVDYDLODEOH
%DOODQW\QH%RGLQHSURMHFWRUPRWRUV
VRPHEDVLFLQIRUPDWLRQZLWK\RXUSXUFKDVHWR
KHOS \RX JHW VWDUWHG7KLV WXEH LV IRU *DPPD
UDGLDWLRQRQO\ZLWKDYROW*HLJHUWKUHVKROG 0DULQH,QVWUXPHQWV$QWLTXH6WDGLPHWHU 6KRFN0RXQWV
DQGDYROWRSHUDWLQJYROWDJH
Table 1. Transmitter circuit input/output signals. Table 2. Receiver circuit input/output signals.
Input/Output Input/Output
Signal description Signal description
Signal Signal
Parallel input data. D0 is the LSB and is transmitted first Parallel input data. D0 is the LSB and is received first (after
D0 - D5 D0 - D5
(after Start bit). Start bit).
Read. This input signal indicates that parallel data has been
WR Write.This input signal initiates a transmission. RD read from the latch and resets the RxRDY signal.
Transmitter clock. A bit is clocked out of the transmitter Receiver clock. A bit is clocked into the receiver every 16
TxCLK RxCLK
with each TxCLK cycle. RxCLK cycles.
Transmitter ready.This indicates the transmitter is ready Receiver ready.This output signal indicates the reception of a
TxRDY RxRDY
to begin a new transmission. new frame.
and correction. This would Table 3. Frame types and descriptions. being the symbolic names of
require the addition of at least the 110000 and 111111
D5-D4-D3-D2-D1-D0 Frame Type Description
one parity bit to the frame for- Reserved frames. Using one of
LN: Lower Frame carries the lower four bits
mat. One parity bit can only 0-0-D3-D2-D1-D0 Nybble of data byte. these groups saves us the
detect errors, not correct UN: Upper Frame carries the upper four bits time of one frame — a savings
them; two or more parity bits 0-1-D7-D6-D5-D4 Nybble of data byte. of eight bits of bandwidth
are required for error detection 1-0-A3-A2-A1-A0 ADR: Frame carries the address of a (ADR, CPAT versus ADR, LN,
Address destination station.
and correction. UN). If there are many pat-
RES:
For example, four parity 1-1-R3-R2-R1-R0 Reserved Reserved control frame. terns that look like 00000000
bits added to eight bits of data or 11111111 in the original
allow us to detect and correct all sin- ed with many patterns that look like data, a good savings in total transmis-
gle bit errors. So, we must add a par- this: 00000000 and 11111111. In this sion time (or bandwidth) will result.
ity generator to the transmitter and a case, you may want to use two of the So, we have seen that a digital
parity checker to the receiver. It is Reserved frame types to represent fiber optic communication system is
also possible to add the error detection each pattern. For example, let a combination of hardware and soft-
and correction at a higher protocol Reserved frame 110000 code the ware, with protocols established that
layer, using software instead of hard- 00000000 pattern and 111111 code allow each end of the communication
ware. For example, we could require the 11111111 pattern. Now, a special link to interface properly with each
that an ACK (acknowledgement) frame two-frame group is created to carry other. Next time, I will show a differ-
be returned after each frame group the “compressed” patterns. Thus, we ent fiber application, called the Fiber
(ADR, LN, UN) has been received. have (ADR, CPAT1) and (ADR, Optic Ring Oscillator, whose frequen-
We may also improve the perform- CPAT2) representing our compressed cy of oscillation is directly dependent
ance of the fiber communication patterns, with CPAT1 and CPAT2 on the speed of light in the fiber. NV
system by employing digital data com-
pression. For a system such as this, the
cost of the compression circuitry would
be far more than the cost of the simple
transmitter and receiver circuits.
Compression may also be preformed at
a higher layer, using software.
For instance, suppose you know
in advance that your data is populat-
Electronics Q&A
In this column, I answer Basic Electronics the plates? Contrary to what you may
101: Capacitance think, the charge in the capacitor
questions about all aspects decreases. Why? Because the battery
of electronics, including . This may fit in the category of a holds the voltage across the capacitor
computer hardware,
Q foolish question, but I have been
curious about it for some time.
constant, so, as you push the plates
apart and add work, the charge has to
software, circuits, electronic Assume a capacitor is made up of decrease to satisfy Coulomb's Law. In
two plates separated by a given effect, you are pushing current back
theory, troubleshooting, and distance. Add a significant charge, into the battery with your physical
anything else of interest to then disconnect the power source. action. As before, the capacitance
Now, physically separate the plates. decreases because of the increased
the hobbyist. What happens to the charge? separation of the plates. I guess some
Feel free to participate John S.Young things never change.
Scottsdale, AZ
with your questions, as HGH for Old
well as comments and . It's not a foolish question and I'll Electrolytics
suggestions.
A bet most readers can't answer it.
When voltage is first applied to the . I recently took a box of Mallory
You can reach me at: plates, the charge isn't immediately
transferred to the capacitor. Instead,
Q 6000 µF/60 V capacitors out of
storage, where they have been sitting
TJBYERS@aol.com. work has to be done to get the charge around for about 15 years. I would
on the plates (I'll spare you the math!) like to use them in an upcoming
—- work that is measured in Joules. audio amplifier project, but have con-
When you physically separate the cerns about the health of these elec-
What's Up: plates, you add work. The result is trolytics. Can I use my variable power
added energy to the capacitor and supply to "reform" the caps or is there
How capacitors work extra charge. In other words, you end a circuit I can build that will restore
up with more charge and voltage than these caps to their former glory?
and how to add life to before. Let's see what else happens at Henry S.Wypa
the same time — refer to Figure 1. Rose City, MI
Capacitance, on the other hand,
aging electrolytics.Two decreases. That's because capaci- . Electrolytics use a very thin film
PC power supply tance is inversely related to the dis-
tance between the plates, is directly
A of oxide on the positive electrode
that serves as the dielectric between
proportional to the area of the plates, the plates; the oxide needs a small
solutions, an MCU and isn't a factor of charge. leakage current to keep the film in
What happens if you keep the place. If left unpowered for long peri-
power interface, and battery attached when you separate ods of time, the oxide layer can break
down, making the capacitor into
LED mood lights. A nifty more or less a dead short. If
power is applied to a capacitor
NUTS & VOLTS
ers Q&A
Reforming
Figure 2 Figure 3 IN+
1490
Lamp
25uF
63V 1N4003 600
5W
IN-
+
1N5263B
56V Basic Solid-State Relay
+
+
115VAC 24VAC 25uF Device +5V
1k
100mA 63V Under Test
1N4003 >60V
Done IN+ IN+
Solid- Solid-
State State
Electrolytic Capacitor Reformer Out IN-
Relay
Out IN-
Relay
MCU MCU
the current is limited to a safe level. the right times and Logic-Low Logic-High
This allows the oxide layer to reform in the right places. Active Active
slowly, without producing excessive However, I am
heat and gases. While you can ride not sure of the
hard on your variable power supply to best way to use those logic levels to expensive. With your meager voltage/
reform an electrolytic, it's a very time- actually turn something on, like a fan. current requirements, I'd build the
consuming task. Reforming can take The fans I have are 24 VDC 0.2 amp, SSR from scratch, using a 4N25 chip
up to several hours. A better solution is brushless. and a transistor, as shown in Figure 4,
the reformer circuit shown in Figure 2. Also, I need to activate a refriger- and save a lot of dough.
A 24 volt wall-wart and voltage ator motor, which is 120 VAC 1.1 Again, the relay can be logic high
doubler provide the 60 volts needed amps. I've been trying to research this or low activated — you decide. What
to reform the electrolytic. The 600 myself, but there seem to be many I've done here is interface the 4N25 to
ohm resistor limits the reforming different devices that might work. the microcontroller/PC output and
current to 100 mA, an acceptable Should I be worried about noise boost its current level to 800 mA,
level for caps of this size. If you can't from these motors contaminating the using a 2N2222A transistor. I've
find a 600 ohm, 5 W resistor, one can digital side of the system? I'd really shown the controlled device as a fan
be made by stringing six 100 ohm, appreciate any help. motor, but you can control any DC-
1 W resistors together in series. (You Dan Green, Jr. operated device within the 2N2222A's
can reduce the reforming current for Lynnwood,WA 40 volt, 800 mA power range.
lower capacitance values by increas-
ing the resistance. The acceptable . The best solution is a solid-state Commodore Still
leakage limit can be calculated from
A = 0.01CV, where C = capacitance in
A relay — SSR. The driver output
from the microcontroller/PC can be
Alive
µF, V = applied voltage in volts, and A either high or low, because the SSR . I am trying to replace a defective
= the leakage current in mA.) When
current flows through the cap, the
uses an LED interface. That is, your
processor output and the load are for-
Q Commodore Plus/4 power supply,
but I'm not having much luck. A friend
"reforming" lamp will light. As the ever isolated and you decide which gave me the schematic (Figure 4), but
capacitor gets up to snuff and is able logic turns on the relay. To illustrate, some of the values are missing. I
to hold a charge, the lamp goes off realize that the "coil" of a solid-state wonder if you know what they are.
(current ceases to flow) and the relay is nothing more than an LED. Craig Cook
"done" LED lights. Given that premise, you can make the Oak Harbor, OH
outputs of whatever TTL-compatible
SSR Meets MCU interface work with the relays in
Figure 3. If you want the relay to be Solid-State Relay
. I am building a microprocess on, with the output low, the IN+ termi- 40V, 800mA
Q or-based environmental control
system for a wine storage room. It
nal has to be connected to +5 V. If you
want the relay to be on when the logic
+5V Vcc
is designed around the Maxim/Dallas output is high, then the IN- terminal has 4N25 Fan
1-Wire line of products (including the to be grounded. A suitable SSR for your IN+ Motor
DS18S20-PAR digital temperature AC-powered refrigerator is the Sharp
IN-
sensor and DS2405 addressable S101N12, available from Digi-Key 470
2N2222A
switch) and I have a fairly good grasp (800-344-4539; www.digikey.com).
of the digital side of the system, as in Although there are DC-
having the right 1s and 0s show up at voltage solid-state relays, they can get
Figure 4
MARCH 2004 31
Q&A.qxd 2/4/2004 11:59 PM Page 32
Q&A
Blue
Pin3 +6V Figure 7
9VAC
Jameco LED Fader
Fuse 102234 Brown
1A 1N4001 7805 Pin1 8 4 +6V
+5VDC 10k
9VAC IN OUT 7
115VAC 1A
COM 3
+
+
100k 555
Black
6 47uF
220uF 0.33 0.1 Pin2
Figure 5 GND 2 1k
100k
Blue 47uF 1 5 Direction 100k
Commodore Power Supply Pin4
9VAC
.01 2N2222
Off-Line Power
Figure 6
Supply Basics
. I have a Citizen GSX-130
Educational K 1-866-762-6850
1-650-875-0715 The fact that you have high
1-650-952-7629 (fax)
sales@HobbyEngineering.com voltage leads me to believe the prob-
1405 Huntington Avenue, Suite 150 lem isn't the transistor itself, but the
Everything For Electronics
BEAM Kits and Components South San Francisco, CA 94080 control circuitry that drives the tran-
Visit our showroom near SFO! sistor. The controller can be anything
from a simple comparator (like an
Most orders ship the day received! World-wide shipping. Convenient payment options. LM339) to a dedicated IC controller.
MARCH 2004
32
Q&A.qxd 2/5/2004 12:00 AM Page 33
Q&A
+
10uF 10k
Chris Raney-Phairoh Pin1 Pin2
via Internet GND Trigger
Q&A
Figure 10 +12V
0-60 min. 0-60 min. 0-60 min. 0-60 sec.
1M 1M 1M 1M
+
13
Reset
1N4148 558 3300uF 558 3300uF 558 3300uF 558 68uF
Trigger Trigger Trigger Trigger
Q1
Timing Timing Timing Timing NPN
Start
12 4
.01
10k
558 Timer
Prevent Compressor The first timer needs to be adjustable and over to guarantee that there is no
Rust from 30 to 180 minutes; the second water build up in the storage tank.
timer needs to be adjustable from 15 Bill Blackburn
. I am trying to build a timing to 60 seconds. When the time is up via Internet
Q circuit to operate a drain valve for
my air compressor. Basically, I need
on the first timer, it starts the second
timer. This opens a solenoid valve to . This design cries for an NE558
two timers, both independently
adjustable by using potentiometers.
drain water from the compressor's air
tank. This cycle repeats itself over
A timer IC — a specialized version
of the 555, with four timers in one
NUTS & VOLTS
Everything For Electronics
MARCH 2004
34
Q&A.qxd 2/5/2004 12:01 AM Page 35
Q&A
+
ed without the need for RadioShack 9.1k 3k
R1
coupling capacitors, 1k 273-059 LMC662
LED + Sensitivity
-
thus making the design LM339 1k
500
simpler. In fact, it lends +Red
Test
R2
itself well to ring-counter 1k Probes
LED 10k 220 1N4148 -Black
topology, which is the LM339 1k
design I'm using for R3
your circuit (Figure 10). 1k
LED
+ LMC662
The timers are LM339 1k
arranged in a ring, with
R4
the output of the last 1k 10k 1k
MARCH 2004 35
Q&A.qxd 2/5/2004 2:44 PM Page 36
Q&A Co
in old musical reverb units (including enough time to figure them out and
Figure 13 some kits) from the 80s and pull the plug before the breaker or
electronic organ boards of the same fuse pops. This motor is similar to one
era. You aren't limited to the Seticon I took off a treadmill and I noted that
SAD series. Chips from Panasonic it used an inductor (about the size of
(the MN30xx/MN32xx) and Reticon a small avocado) with the speed con-
(R5106) can be made to work using trol, doubtless to limit current.
a daughterboard that plugs into your If Paul goes ahead without a long
existing sockets. Try the following cord or an inductor, maybe the solid-
two websites first. If they don't work, state stuff should be sized to handle
let's hope one of our readers will about 50 amps RMS. He may be better
have a few laying around that they off dialing the speed up, not just plug-
are willing to part with. Good luck! ging it in with the high speed already
set. By the way, these speed con-
www.parastream.com/hardware trollers are for sale from places like
www.analogman.com/parts.htm Johnstone Supply and WW Grainger.
Rosser B. Melton, Jr.
Oops — Corrections Denton,TX
down resistor (1 k) can be as low as Ahead!
120 ohms before the 558's ratings Dear TJ,
are exceeded, which should be plen- It appears that errors appeared Here is a schematic for a very
ty of base current to saturate a 5-amp in two schematics published in the simple 60 Hz frequency meter
transistor, like the TIP120. When the January 2004 issue. Here are the (Figure 13) that I use in my motor
valve closes, the first timer is trig- correct drawings. home. It uses less parts than the one
gered again and the loop continues. Figure 11 (Figure 1 in the Jan. you published in the January 2004
issue), the "LED Voltmeter," has the issue ("RPM to Hertz") and is proba-
My Bucket Has a wrong comparator designation — it bly just as accurate. As I remember
Hole in it was originally designed for an LM324. it, the meter is a 1 mA movement,
Here is the correct schematic for the scaled 0 to 10, with six being the 60
. I need two Seticon SAD4096 LM339 comparator. Figure 12, the Hz point that I calibrate from the
Q (Bucket Brigade) ICs — the ones
used in a Centaur (1980s) pinball
"Audible Continuity Tester," has an
extra line that looks like a wire and
commercial power line.
Rick Shepard AI5H
game. Are equivalent ICs useable as creates a short on the input probes. via Internet
replacements or is there an alterna- Here is the correct schematic.
tive design arrangement available to Cool Websites!
perform the same function? Some MAILBAG
functional limitations might be Mars Rover JPL website. Updated daily.
acceptable if they are known. Dear TJ, http://marsrovers.jpl.nasa.gov/home/index.html
C. Casiday In regard to your answer, "High-
MarsDaily:Your portal to Mars
cccas@dslextreme.com Power PM Speed Controller," that's
www.marsdaily.com/
a sizable motor with a pretty "stiff"
. Once the mainstay of solid- input characteristic. Your circuit Space telescopes:
A state audio delay, Bucket
Brigade ICs are long obsolete. Today,
would be just fine with a series-
wound motor, but Paul should
Chandra X-Ray Observatory
http://chandra.harvard.edu/
the signal is digitized and stored in expect to see peak currents of 100
GLAST
memory (typically RAM) for retrieval amps or more until the motor http://glast.gsfc.nasa.gov/public/resources/
at a later time, much like the way comes up to speed. brochures/trifold/trifold_web.pdf
digital oscilloscopes create signal Limiting these peak currents
delay. The maximum delay time is could be achieved by something Hubble
NUTS & VOLTS
determined by the digitizing rate and as simple as using a long (20’, http://hubblesite.org/
the depth of the memory. I'm afraid say) piece of line cord, like Spitzer (Space Infrared Telescope Facility)
this would be more of a project than the one on a vacuum cleaner, www.spitzer.caltech.edu/
Everything For Electronics
MARCH 2004
36
Full Page.qxd 2/3/2004 10:18 PM Page 37
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.
“CLIP-ON” 3-LED LIGHT 3 CONDUCTOR POWER CORD 12 VOLT 2.5 AMP CIGAR
Small bright light with three ultra- WITH THUMBWHEEL SWITCH SOCKET ADAPTOR
bright white LEDs provides Table-top power
7 foot black 2 cond./18AWG
ample illumination for reading, supply provides
power cord. SPT-2 insulation.
repairs or emergencies. A In-line thumbwheel switch 12 Vdc, 2.5 Amps
strong adjustable spring rated (6 Amps / 125 Vac) is (4 Amps max) of
clip enables user to 16” from the end of the cord. power for
attach it to nearby Molded polarized plug one equipment
object for hands-free end. Stripped and tinned with an automotive
operation. Keep one ends. Hanked. UL, CSA. cigarette-style power cord. Ideal for cell
handy in your glove compartment or purse. CAT# LCAC-142 phones and chargers, laptop computers and
Overall length 4 inches. Operates on 3 AAA
90¢
audio equipment.
cells (not included).
CAT# FL-9 $6.00 each each
Case of 250 70¢ each
1000 for 55¢ each CAT# DCTX-1226 $ 9 95 each
8
$ 50
each
6 for $7.50 each Includes hook-up diagram
CAT # LCD-87
$ 11 25
each
CAT# BC-72
$ 1875 each
MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.
MARCH 2004 Circle #50 on the Reader Service Card.
37
New Products.qxd 2/6/2004 9:28 AM Page 38
A HIGH-DENSITY 1U 350 tolerance, the units are designed for long life and trouble-
free operation. They also comply with worldwide safety
WATT POWER SUPPLY FOR and performance standards from UL, CSA, VDE, NEMKO,
DISTRIBUTED ARCHITECTURE AUSTEL, CB, and CE.
APPLICATIONS Available now, pricing begins at $299.00 in OEM
quantities. For more information, please contact an Astec
E merson
Network
Power, a
Power representative in your area. To locate a
representative, go to the Astec Power website and click on
the sales office button on the home page.
division of For more information, contact:
Emerson,
has intro- ASTEC POWER
duced a new 350 5810 Van Allen Way
watt bulk power supply in a compact Carlsbad, CA 92008
package that is ideally suited for product designs using Tel: 760-930-4600
distributed power architecture. The high-efficiency Email: tomtillman@astec.com
switching power supply from their Astec Power division Web: www.astecpower.com
is the first model in the new high-density 4 x 7 power Circle #117 on the Reader Service Card.
supply family. The NTS353 weighs in at 8.3 watts per
cubic inch and can deliver up to 350 watts of total
power.
Featuring active power factor correction to minimize
WIRELESS INTERFACE MODULE
input harmonic distortion, the Astec Power NTS353 is a AND EVALUATION KIT
compact 85-264 VAC power supply that is ideal for 1U
(1.75-inch) rack installations and other low-profile
applications. The unit can deliver its full rated output of
350 watts with 30 CFM forced air or 200 watts with
L EMOS International has announced the SPM2-433-28
Transceiver bi-
directional wireless
convection cooling. interface module,
The device is also suited for use as an AC-DC front available in 433.92,
end for DC-DC converters in a wide variety of 869.85, and 914.5
applications, including telecommunications, networking, MHz frequencies.
test and measurement, single-board computers, and Complete with built-
gigabit Ethernet devices. A built-in ORing diode eliminates in command line
the need for external circuitry when using the unit in a configuration and
redundant configuration. For maximum versatility, it is link diagnostics, the
also available with a top cover fan, designated by a –CF SPM2-433-28 even
suffix on the model number. has remote open-air
Only 1.5 inches high, the Astec Power NTS350 has a unit configuration
footprint of only four by seven inches and can be set up capability; it has a range up to 200 m outdoors and 50 m
for lengthwise or crosswise airflow, giving designers indoors. The SMP2 has a DTE speed of 600-115,200
layout flexibility. bps and an air data speed of 600-14,400 bps. It has
The device also features a 12 V 1 A auxiliary output point-to-point addressability and provides point-to-multi-
and 5 V at 2 A standby output, as well as overload, over- point and broadcast capabilities. With a digital serial
voltage, and thermal protection. interface and hardware-free flow control, the unit also
The Astec Power NTS353 includes a built-in Class B has a low operating current and auto standby mode. An
EMI filter, remote sense, remote inhibit, and single-wire evaluation kit is available for the 23 mm x 39 mm x 4
parallel on the primary output that enables current- mm SPM2-433-28, which conforms to EN300 220-3 and
sharing to balance loads. It also has an operating EN301 489-3.
temperature range of zero to 50°C without derating and The SPM2 Evaluation Kit is compatible with PDAs,
NUTS & VOLTS
can function up to 70°C by derating the output 2.5 organizers, and laptops; it is suited for all handheld and
percent per degree Celsius. It complies with IEC portable terminals, as well as EPOS equipment, barcode
EN61000-3-2 harmonic and IEC EN61000-4-X scanners, and belt clip printers. It is ideal for many data
Everything For Electronics
T he new TiniPod™,
a tiny 1.0" x
1.3" controller
acceleration-limited, velocity-profiled control of the moves
of three axes of motion control at the same time, and do
other tasks such as communications via serial or CANBus.
board, ships this The CANBus opens the possibility of distributed
month from processing networks, particularly in automotive and
New Micros, Inc. industrial applications, so parallel hardware can be
The TiniPod is a combined with parallel software. The TiniPod can be
complete micro- programmed in a number of languages: C (third party),
controller sys- Small C (included), Forth, or the resident IsoMax (included).
tem with a built IsoMax is based on state machine programming
in high-level-lan- concepts. Programming real time tasks amounts to
guage and parallel processing operating system, IsoMax™. describing virtual machines that will sense conditions, take
Hardware features on this new processor include 16 actions, and move to new states. The machine
General Purpose Digital I/O lines, one RS-232 serial construction is very readable. Development is interactive
channel, and CAN Bus. The GPIO lines share functions through the RS-232 and will typically be done on a PC,
with a four-wire SPI Interface, six General Purpose Timers, laptop, PDA, or any serial device — even dynamically by
and six Pulse Width Modulation (PWM) outputs. another microprocessor. Programming in IsoMax means
The PWM outputs are hardware based and can be used interactively creating new processor tasks — each being a
to control six R/C Servos or grouped to control three-phase state machine or thread — and then testing that code.
LAB-X Experimenter Boards EPIC Programmer - $59.95 Books on PicBasic and PICmicro MCUs
Assembled hardware platforms Programming PIC Microcontrollers with PicBasic $49.95
for development. Each has RS- Experimenting with the PicBasic Pro Compiler $39.95
232 serial port, clock oscillator, PIC Basic - An Introduction $34.95
power supply, plus other PIC Microcontroller Project Book $29.95
hardware. ICSP connection Easy Microcontrol'n $29.95
allows you to make program Time'n and Count'n $34.95
changes without removing the Microcontrol'n Apps - PIC MCU Application Guide $44.95
MCU. Bare PCBs available. Serial Communications Using PIC Microcontrollers $49.95
LAB-X1 for 40-pin MCU (shown) Assm: $199.95, Bare: $49.95 Low cost programmer for PIC12Cxxx,
LAB-X2 for 28 or 40-pin MCU Assm: $69.95, Bare: $24.95 12CExxx, 12Fxxx, 14Cxxx, 16C505, PICProto Prototype Boards
LAB-X3 for 18-pin MCU Assm: $119.95, Bare: $24.95 55x, 6xx, 7xx, 84, 9xx, 16CE62x, PICProto3 for 28-pin PICmicro MCUs (3" x 3") $14.95
LAB-X4 for 8 or 14-pin MCU Assm: $124.95, Bare: $24.95 16Fxxx, 17C7xx, 18Cxxx, and 18Fxxx PICProto4 for 8-pin or 14-pin (1.5" x 3") $9.95
microcontrollers. Can be used for PICProto8 for 8-pin (1.2" x 2") $8.95
PicBasic Compiler In-Circuit programming. Connects PICProto18 for 18-pin (1.5" x 3") $9.95
to parallel port. Software included PICProto18L for 18-pin (3.6" x 4.1") $19.95
PicBasic converts your BASIC programs
for DOS and Windows 9x/ME/2K/XP. PICProto64 for 40-pin (3.6" x 4.1") $16.95
into files that can be programmed
directly into a PICmicro MCU. Make EPIC Assembled $59.95 PICProtoUSB for 28-pin or 40-pin (3.6" x 4.1") $19.95
use of the latest microcontroller EPIC Bare PCB $34.95 PICProto80 for 64 or 80-pin TQFP (3.6" x 4.1") $19.95
technology without learning C or 40/28 pin ZIF Adapter $34.95 PICProto80 with pre-soldered PIC18F8720 $60.00
Assembler. Compatible with DOS and AC Adapter $9.95 PICProto prototyping boards are designed to help you get your PICmicro
Windows 9x/ME/2K/XP. EPIC Bundle $99.95 projects finished faster, with less effort. There is a high-quality blank PICProto
PicBasic Compiler $99.95 (bundle includes EPIC, AC Adapter, board for almost every PICmicro microcontroller. Each double-sided board has
PicBasic Pro Compiler $249.95 25-pin Cable, and 40/28 pin ZIF) a solder mask on both sides and hundreds of plated-through holes for your parts.
MARCH 2004 39
New Products.qxd 2/6/2004 9:29 AM Page 40
E verSecure™, a Matco
Company, introduces
headphone jack and a mono 325 mW amplified speaker
connector.
Everything For Electronics
the new PDV-040 Pocket The module has 1 MByte of onboard flash storage
Digital Video Recorder, and a connector on the reverse side for an SD/MMC card
specifically designed for up to 1 GB in size in FAT16/32 format. MP3 Playback is
mobile surveillance applica- CBR or VBR and up to 48 KHz at 320 Kbps.
MARCH 2004
40
New Products.qxd 2/6/2004 9:29 AM Page 41
The µMP3 module is a small (2.5” by 2”) footprint Cricket system, and a serial port connector for serial
board. The TTL serial is configurable from 9600 to 115 K control at 9,600 or 19,200 baud. A native OOPIC Gamoto
bps. It requires a 5 V-regulated source at 150 mA and has Object is in development.
an onboard 3.3 V LDO regulator. Gamoto is flexible — up to eight Gamotos can be on
Software for MP3 organization, I/O configuration, and the same I2C or Cricket bus. The address of each motor is
play list creation is included. The kit also includes a set using dip switches.
bundled text to MP3 speech creation package — Text Gamoto is strong — high-speed encoder feedback
Aloud MP3 — trial version (30 days from Nextup.com). allows precise control over position, speed, and
The µMP3 module is perfect for OEM, kiosk, acceleration of brushed DC motors up to three amps.
advertising, real estate, robotics, or any project where you Trapezoidal motion profile processing allows
want to make your product produce clear speech or acceleration ramp, constant velocity cruise, and then
music. With up to 4,000 files per device, you can create deceleration ramp down. Eight profiles can be stored in
libraries of speech or music, controlled from your flash.
microcontroller. Gamoto is sensitive — current sense feedback actively
The µMP3 module retails for $99.95 (US, qty. one) and detects torque and collisions. Four analog inputs allow
only $49.00 each (US, qty. 1,000). connection of additional sensors.
For more information, contact: And, lastly, it’s easy going — the firmware is
upgradeable.
ROGUE ROBOTICS For more information, contact:
103 Sarah Ashbridge Ave.
Toronto, ON M4L 3Y1 GAMATRONIX
Canada Tel: 978-567-8925
Tel: 416-707-3745 Fax: 647-439-1577 Email: sales@gamatronix.com
Email: info@roguerobotics.com Web: www.gamatronix.com
Web: www.roguerobotics.com Circle #151 on the Reader Service Card.
Circle #108 on the Reader Service Card.
G amatronix
introduces the new
Gamoto, a smart PID
closed-loop motor controller
designed with robot hobbyists and
students in mind. Key features
include power, precision, speed,
communication options, and ease
of use.
Gamoto is smart — it gives you
three choices for communication: I2C
bus, a Cricket Bus connector with
pigtail for easy plug-in to the Handy
MARCH 2004 Circle #113 on the Reader Service Card.
41
Dubuc.qxd 2/4/2004 10:54 PM Page 42
Adding Sound To
Your Projects
This Month’s
Projects Grab Ears Along With Imaginations
W
inbond offers a suite of integrated a lower sampling rate (lower recording quality).
Adding Sound . . . . . . .42
HDD Exerciser . . . . . 46 circuits that you can leverage to add For 60-second recordings (ISD2560), the
Frequency Counter . . 51 sound capability to your electronic proj- sampling rate is 8 kHz. For 120-second recordings
ects. I will introduce two of their product lines — (ISD25120), it is 4 kHz. The sampling rate defines
the ChipCorder and the Text-to-Speech integrated the quality of the recording. To give you a basis
circuits — and discuss some of their applications. for comparison, compact disks are sampled at
Winbond voice and speech chips use a similar 44.1 kHz, while voice on your telephone is
architecture. These chips contain four major sampled at 8 kHz. The ISD25xx contains the
The Fuzzball blocks: non-volatile memory (also called circuitry to receive three different types of audio
NVRAM) to store uncompressed voice or audio, inputs: microphone (MIC), audio in (ANA IN), and
Rating System the necessary functions to process audio input, auxiliary in (AUX IN). The ISD25xx also contains
the required circuitry to produce audio output, the amplification circuit for the audio output. A
To find out the level
and the digital logic that controls the behavior of speaker can be attached directly to the chip
of difficulty for
the chip. Data stored in non-volatile memory is without an external amplification stage. ISD25xx
each of these persistent, even when power is removed from the can be cascaded together for longer duration.
projects, turn to circuit. The operation of the chip is straightforward.
Fuzzball for The P/R pin is used to indicate whether the chip
the answers. ChipCorder should be recording (low) or playing back (high).
The scale is from The chip enable pin is used to start or stop the
1-4, with four The ChipCorder product line implements record/playback operation. When the chip enable
Fuzzballs being voice record and playback capabilities. Several pin is low, the chip starts the record or playback
the more difficult messages can be stored on the ChipCorder operation at the address specified by the address
or advanced integrated circuits. They can then be played back input pins (A0 to A9). In playback mode, the
on demand. This product line is broken down in chip outputs the audio until it reaches the end
projects. Just look
several families. We will look at the ISD25xx, of message (EOM) marker. When the EOM
for the Fuzzballs in
ISD400x, and ISD5x16 families. Each chip offers marker is encountered, a pulse is applied on the
the opening header.
unique recording duration, sound quality, audio EOM pin. In record mode, when the end of
You’ll also find features, and control mechanisms. memory is reached, the OVF output pin goes low.
information included The interface of this device to a microcontroller
in each article on ISD25xx requires 15 pins (five for control and 10 for
any special tools address selection). The ISD25xx offers a mode
or skills you’ll The ISD25xx can record between 60 to 120 where messages can be recorded and played
need to complete seconds of sound, depending on the model. All back sequentially without the need to specify
the project. models have the same amount of memory (480 K addresses explicitly, translating into significant
cells, segmented in 600 rows). The recording savings in the interfacing pin count. If address
Let the length varies according to the sampling rate used input pins A8 and A9 are set high, the chip can be
soldering begin! by each model. A device that records longer uses configured to work in one or more of the six oper-
ational modes. One of these operational modes is
the push-button control operational mode. When
this mode is selected, the chip can record a series
NUTS & VOLTS
Project Addi
cells and provides eight to 16 minutes of the ChipCorder chips presented in this selected, the chip can record up to 16
voice recording at 4/8 kHz sampling. article. They implement voice record/ minutes of speech. If 8 kHz sampling
The ISD4003 and ISD4004 families also playback capabilities similar to other is selected, the chip can record up to
come in various packages: 28-pin SOIC, ChipCorder chips, but offer a eight minutes of speech. The ISD5116
PDIP, and TSOP. richer feature set. The memory size of and ISD5216 also have the ability to
the ISD5116/ISD5216 is the same as the store digital data. This is typically used
ISD5116 and ISD5216 ISD4004 (segmented in 2,048 rows). to store system configuration and other
However, the sampling rate of these application data, such as phone num-
The ISD5116 and the ISD5216 models can be programmed through bers. The data can be stored as 2,048
families are the most advanced of software. If a 4 kHz sampling rate is rows of 2,048 bytes. The ISD5116 uses
an I2 C two-wire interface for control
purposes. This interface is used to con-
trol the operation of the chip (play,
record, perform message cueing, and
stop), but is also used to configure the
chip and provide operations to store
and retrieve digital data. The ISD5116
and ISD5216, like the ISD25xx, contain
a speaker driver. They also offer an
AUX OUT output. Unlike other chips in
the ChipCorder family, ISD5116 and
ISD5216 chips implement adjustable
volume control and amplification gain.
These chips also provide a feed
through mode (voice captured by a
microphone can be configured to go
directly to ANA OUT). Voice can be
recorded on two simultaneous channels
(microphone and ANA IN), which
enables the recording of both sides
(duplex) of a conversation. The above
characteristics make these chips good
choices for more complex applications,
especially those targeted at cellular
phones or other portable devices. In
addition to the features of the ISD5116,
the ISD5216 contains an integrated
CODEC to record and play back digital
audio (PCM, Law, etc.), a capability that
is especially useful in telephony appli-
cations. The ISD5116 and ISD5216
families come in the following packages:
28-pin SOIC, PDIP, and TSOP.
Text-to-Speech
Integrated Circuits
Winbond also manufactures the
WTS701 text-to-speech integrated
NUTS & VOLTS
Be an FCC
LICENSED
phonemes, and sends the appropriate audio stream to the
digital or analog output circuitry. The normalization process
consists of expanding abbreviations and numbers into pro-
nounceable words. The audio streams for the phonemes are
built into the chip's memory. The chip also contains a dic- ELECTRONIC TECHNICIAN
tionary that converts words into sequences of phonemes.
The chip provides commands to download different lan- Learn at home in your
guage, speaker, and normalization databases. The WTS701
spare time.
contains the same CODEC as the ISD5216, which makes it
possible to output the speech in digital form.
The WTS701 has a built-in speaker driver and an AUX OUT
output. The WTS701 chip is only available in 56-lead TSOP,
which makes it difficult to include in homegrown prototype
boards. However, for hobbyists, Devantech manufactures the
SP03 Text-to-Speech Synthesizer module which is based on the
Earn up to
WTS701 integrated circuit. These modules come with a piezo
$100 an hour
speaker. Up to 30 phrases can be stored on the module PIC
and more!
microcontroller or text can be sent directly on one of the three
No previous experience needed!
supported interfaces: RS232, I2 C, and parallel. These modules
can be purchased at www.acroname.com or www.batz.com You can earn more money
Applications if you get an FCC License!
Not satisfied with your present income?
Winbond ChipCorder and Text-to-Speech integrated cir-
Add prestige and earning power to your
cuits open up a wide range of possibilities for audio applica-
electronics career by getting your FCC
tions. The voice and playback functions can be used to add
sound to telephony products, toys, robots, and multimedia
Government License.
installations. The Winbond chips can be a very important part The Original Home-Study course pre-
of many different messaging applications: automated pares you for the “FCC Commercial
response systems, voice mail, automotive communications, Radiotelephone License” at home in your
and GPS/navigation systems. spare time.
For telephony applications, the voice record and play- This valuable license is your professional
back can also be used to record and play back DTMF “ticket” to thousands of exciting jobs in:
tones. There is tremendous opportunity for cellular phone Communications, Radio-TV, Microwave,
applications, including recording or downloading personalized Maritime, Radar, Avionics & more…you
ringers. Finally, the text-to-speech capabilities of the WTS701 can even start your own business!
can prove very useful for automated attendant applications.
You can find the ChipCorder and text-to-speech integrated cir- No need to quit your job or go to school.
cuit data sheets and various application briefs on the This proven “self-study” course is easy,
Winbond website. These documents are well-written and con- fast and low cost!
tain several application circuits that show how to connect the GUARANTEED TO PASS – You get your
chips to microcontrollers, input, and output devices. We have
seen that Winbond provides a good selection of integrated cir- FCC License or your money will be refunded.
cuits to handle voice messaging.
The ISD25xx family is well suited for the design of simple Call for FREE facts now!
push-button driven circuits. In such designs, there is no need
for a microcontroller to control the chip. For more sophisticat- (800) 932-4268 Ext. 220
ed applications, the ISD5116 is a powerful chip that provides www.LicenseTraining.com
many features. Its I2 C interface simplifies its control. If the
microcontroller used in the circuit does not support I2 C, then COMMAND PRODUCTIONS or mail
FCC LICENSE TRAINING - Dept. 220 coupon
the ISD4004, with its SPI port, provides a suitable alternative. P.O. Box 3000 • Sausalito, CA 94966 today
However, the ISD4004 requires external circuitry to drive Please rush FREE details immediately!
speakers and does not contain some of the audio features of Name
the other chips, such as automatic gain control. Finally, if
Address
there is a need to synthesize speech in your application, you
can use the WTS701 Text-to-Speech integrated circuit. NV City State Zip
M
y son, Tim, asked Extremely strong
me, “Hey, Dad, magnets drive the
can you make heads rapidly back
something like I saw at and forth as the coil on
Comdex?" He had just the head assembly
come home from a com- responds to current
puter-oriented seminar and pulses sent to it. You
wanted to find out if we do want to see your
could make the heads on a program on the screen
defective hard drive rattle sometime today, don't
back and forth for Show you? I can remember
and Tell — silly question. His an early computer that
older sister, Joy, had asked took eight minutes to
about a louder metronome. load the program. A
His younger sister, Robbi, later upgrade cut the
had asked about a violin- time to two and a half
tuner. Joy now has a loud minutes. I would
metronome and Robbi has a tuner (Nuts & Volts, expect that same program — if it came from a modern
November 1999). So, with that for an excuse, I shook HDD — to load in a few seconds.
my head up and down and headed for the workroom. The strong magnets — probably some of the most
powerful you are likely to run into — make this possible.
HDD The electronics on the bottom of the hard drive tell the
head where to look on the disk and indicate when it has
While the CPU (central processing unit) serves as arrived there. This is a simplified version of what goes
the brains of a computer, the HDD (hard disk drive) on, but explains some of the things that make an oth-
stores the programs that the CPU processes. Some erwise dead drive into an interesting and somewhat
systems have more than one HDD. Some of the earliest educational instrument.
computers stored the programs on a flexible (floppy)
disk that the user inserted into a slot so the computer Where to Get a Used Drive
could access it. To change programs, change floppy
disks. If you go much farther back in time than that, I worked in an electronics group that serviced
you would call your computer an abacus. laboratory equipment and took care of the computers
in a large department at a state university. When one of
What's Inside the computer people would say that a drive needed
replacing because it could no longer reliably store and
The more modern systems will have a hard drive retrieve information or it had just plain crashed, I stood
that consists of two or more hard disks with magnetic there with my hand out.
pick-up heads on each side of the disks. The system You could probably find some older, obsolete, or
is assembled in a clean room that is almost beyond even dead units courtesy of friends or a service place.
NUTS & VOLTS
imagination (They really are - Editor Dan). Note the If at all possible, have them plug the unit in and see if it
mirror-like finish of the disk in the photo. If a particle will go through the initialization process. If not, politely
the thickness of a human hair gets into the assembly, it decline the offer unless you want the magnets from it.
Everything For Electronics
can trash the system. That is just one of the reasons Those are worth having — or you could make the seem-
why they have the labels warning that breaking the seal ingly simple head rattler out of the unit.
and taking off the cover will void the warranty — it You might try looking in a thrift store. Sometimes
would probably ruin the unit. they have ancient machines that work, but fall short of
MARCH 2004
46
Fruitman.qxd 2/4/2004 10:42 PM Page 47
an HDD Exerciser
Init
When you first apply power to the drive — 5 volts
and 12 volts — the disks start spinning up, going for their
rated speed of anything from 3,600 to 7,200 RPM. The
faster speeds allow faster access to the data.
When the machine decides that the disks have
reached operating speed, the heads move around.
They have to find track zero, the reference track. In the
process of doing this self-test, they put on quite a
show.
The display that Tim saw at the show simply put
alternating pulses into the coil in the head, which drives
it back and forth. When I started playing with a drive, I Circle #83 on the Reader Service Card.
applied the normal 5 and 12 volts to the drive. That
caused it to go through the initialization process. Once
the heads found the reference position, the disks kept on
spinning and the heads just sat on track zero.
Show Time
Interrupting the power for a second or so caused
the show to restart. The heads would go to the center of
the drive, while the disks spun up again. When they
reached their speed, the heads moved to the middle of
the active area, rattled back and forth for a few seconds
— probably checking for mechanical defects — then
went to the track zero position. That seemed like more
fun than just watching the heads rattle from side to side.
Making it Automatic
You can make the drive put on this display by
feeding it 5 volts and 12 volts at a total of about one
amp. Then, periodically interrupt either power supply for
anything from less than a second to maybe 10 seconds.
The longer time allows the disks to spin most of the way
down or even come to a complete stop. You can decide
which one you like and adjust the values, as shown in
the schematic.
Project
RESOURCES
TIME LAPSE VIDEO RECORDER NEW and NICE!
New, 4 head, T/L recorder with all the 2X20, VFD DISPLAY,
features at a RS-232 INPUT,
great price. 12VDC POWERED!
UN-LTD.
UN-LTD.
Up to 960 The Siemens model BA63 POS, (point
hours on a of sale) display with enclosure, base
standard T-120 VHS tape. 12 different modes and 10ft. cable. Easily interfaced to your
for record & playback Audio recording in device via RS-232. Basic hookup info
SURVEILLANCE OPTICS ELECTRONICS 12H and 24H mode. 30Day memory included as well as ESC sequences.
backup. Easy setup on- screen menus. Has VT100 emulation mode. Easy to
ORDERS. 800.810.4070 Auto-Repeat recording mode. Serial or One- read, with approx. 0.4"H characters. Display module
Tech 603.668.2499 shot recording. Time, Date, speed, and
Alarm indicators on screen. IR Remote
can be removed in seconds from housing if desired.
Cable has six pin mini-DIN connection to module.
fax 603.644.7825 control included. These deluxe units are Overall size of housing: 8"W x 3.5"H x 1.8" D add 3"
12VDC ±1V@200mA, S-VIDEO on 4pin DIN connector. Std. video out on mV/mW up to about 20mW. New
is powered by 12DC @300mA. Receiver size is:
BNC. Size: 51mm x 51mm x115mm long. Regulated power supply incl. All surplus from the printing industry.
6"L x 3"W x 1.5"H, The transmitter is powered by
functions externally controlled. C-mount lens not included. We have the Mounting via threaded brass insert
5VDC @ 450mA. (all AC power supplies and
best price available for the 12V1E-EX CAMERA. VERY LIMITED QUANTITY in the base. Overall size: 2.8"L x
cables included). Choose your choice of a 14dB YAGI antenna
AVAILABLE. DON'T BE FOOLED by 1/3", NON - EXVIEW, LOOK ALIKES! 1.1"W x 0.4" thick.
or a 24dB Parabolic antenna. (see antennas at WWW.RESUNLTD4U.COM)
GMV-EX6K..$449, Accy, 6mm, f1.2 Manual Iris Lens..$69 DETECTOR- 07...$10ea.
AST-LR-YAGI....$299 set. AST-LR-PARA....$359 set.
HDD Exerciser
you want the disks to spin down all the way in most
drives. Some of them take just a few seconds and some
of them take a good 10 seconds to stop. If you want the
heads to move as much as possible, make C2 smaller
so that it interrupts the power for just a short time.
Putting It Together
First, take apart the drive. This may require a
common Phillips screwdriver, an Allen wrench, a Torx
wrench, or all of them. Look for fasteners hidden under
the warning labels. Once you get the screws out, the
cover usually lifts off with the aid of a thin blade slipped
under it. Set it and a couple of the screws aside. You
can use them to hold the cover to the side, as shown in
the photo.
Feel free to use a different means of supporting
the board, even putting it in a small box along with the
regulators. Keep in mind that the regulators do get
warm and must be heatsinked. As you can see, I just
put them on the old cover with screws long enough to
hold the board. Then, I put the board on its own mount-
ing stud: a 4-40 machine screw with three nuts on it.
One holds the screw to the cover, the other two hold the
board away from the cover.
Power comes in from the cable that is shown on the Circle #90 on the Reader Service Card.
left side of the photo. Since the wall-mounted power
module had a cable with a battery clip on it, a used
battery clip taken from a dead 9 V battery made a con-
Turn Your Multimedia PC into a Powerful
venient connector. This also makes it convenient to use Real-Time Audio Spectrum Analyzer
the power module for other projects when the hard drive
gets tired of exercising. Features
• 20 kHz real-time bandwith
• Fast 32 bit executable
The Board • Dual channel analysis
• High Resolution FFT
• Octave Analysis
Once upon a time, I made a blinking light for Tim's • THD, THD+N, SNR
bike. He wanted two large LEDs, blinking alternately measurements
• Signal Generation
and placed at the focal points of a trailer-type of side
• Triggering, Decimation
light. I wrote about that and other LED projects (Nuts & • Transfer Functions, Coherence
Volts, October 1999). Fred, from Far Circuits, made the • Time Series, Spectrum Phase,
and 3-D Surface plots
final board, which you see in the photo. I changed a few • Real-Time Recording and
of the values and added the output transistor, Q4. If you Post-Processing modes
contact Fred for the board, ask for the bike light board Applications
from 8/14/99. I had one extra board left over when • Distortion Analysis
• Frequency Response Testing
Priced from $299
starting on this project. This saved a lot of time and • Vibration Measurements
(U.S. sales only – not for export/resale)
gave it a nicer appearance. • Acoustic Research
The bike light board did almost everything needed System Requirements
here. Just leave off one of the original transistors, the • 486 CPU or greater DOWNLOAD FREE 30 DAY
• 8 MB RAM minimum TRIAL!
LEDs, add a resistor, a power transistor, and wire it as in • Win. 95, NT, or Win. 3.1 + Win.32s
www.spectraplus.com
the schematic. • Mouse and Math coprocessor
• 16 bit sound card
The power transistor approaches saturation, as it
has only 50-75 mV, 0.05-0.075 volts across it when
delivering the 12 volts to the drive. It never gets warm
to the touch, so it does not need a heatsink — which is FFT Spectral Analysis System
a subsidiary of Sound Technology, Inc.
why it is mounted directly on the board. You will want
Sales: (360) 697-3472 Fax: (360) 697-7717 e-mail: pioneer@telebyte.com
the plug that fits the power socket on the disk drive.
MARCH 2004 Circle #99 on the Reader Service Card.
49
Fruitman.qxd 2/5/2004 2:47 PM Page 50
Again, you can buy one or find Power Connections 5 volt supply connected to the plug.
one left over from a defunct power Then, connect the output of the 12
supply or inside a dead computer. The schematic shows the power volt regulator to the board and the
I suppose that you could still connections. The red line goes to output from Q4 to the yellow wire.
use one of the original LEDs for the 5 volt supply and the yellow line You can check the operation of
added effect, as it would show when goes to the 12 volt supply. The the driver board before plugging it
the power to that part of the circuit black lines go to the minus — or the back into the hard drive. You may
turns on and off. return — from the power supplies. want to tack in 2 to 10 microfarad
Some of the capacitors for C1 and C2.
Parts List drives show the That could save a lot of waiting
voltages on the time. With the values shown,
R1 47K, 1/4 W
bottom of the the output stage stays on or off
R2, R4 4.7K
control board. If for about 10 seconds. With 10
R3 180K they do, that microfarad caps, the output stage
R5 3.9K will let you should cycle about once per sec-
R6 330Ω confirm your ond. You can check that with a 12
connections. volt pilot light in place of the drive
C1 100 µF 16 V (vary the value for effect) across the yellow and the black
C2 100 µF 16 V Winding wires. An analog meter would fol-
C3 1000 µF 16 V It Up low those changes. A digital meter
C4, C5 0.1 µF 16 V would show changes. Any of those
After you indications will tell you that the
mount the oscillator, Q1 and Q2, is turning Q3
Q1-Q3 2N3904, 2N2222 small-signal, NPN transistor regulators, you and Q4 on and off.
Q4 TIP32 or similar plastic, PNP power transistor. may want to tie
them to Trouble?
LM7812 three-terminal, 12 volt regulator the connector
LM7805 three-terminal, 5 volt regulator and plug that into If, for some reason, that does
Perf board or PC board — or Bike Light from 8/14/99 the drive to make not check out, look for defective or
FAR Circuits website catalog www.farcircuits.net sure that it does incorrectly wired transistors or
(847) 836-9148 indeed play. possibly a bad capacitor — C1, C2.
When you finish Do include the two 0.1 microfarad
15 to 20 volt, 1 amp unregulated DC power supply
playing, leave the caps across the output of the
regulators or you could have some
unpredictable events. Include C3 in
that category once you connect this
electronic switch to the hard drive,
since many of the wall-mounted
power modules have less than ade-
quate filtering built into them. A lot
of times, they depend upon the
filters built into the equipment that
they power.
A Simple One-MHz
Frequency Counter
With an Introduction to Signal Conditioning
I
f you work with digital or analog oscillators, at some that V-out decreases, until it just equals zero. Now,
point you will want to double-check their operating measure VGS (it will be less than zero). As mentioned
frequency. Analog oscilloscopes will only get you earlier, the frequency counter design requires a VGS (off)
within a half-order of magnitude or so; a good frequency between -1.5 V and -3.5 V. Pick an MPF102 in this range clos-
counter will take you the rest of the way. est to -2.5 V. You may have to test a handful of FETs to find
In this article, I will show you how to build a simple one in the appropriate range. If you don’t have any luck with
frequency counter, like the one shown schematically in your batch of MPF102s, you may want to try some 2N4416
Figures 1A and 1B. It has a response range from 1 Hz to 1 FETs. The 2N4416 has a maximum VGS (off) of -6 V.
MHz, a resolution of 1 Hz, and a typical sensitivity of ±250
mV or less. The maximum input voltage is 30 VAC (using Power Supplies
a 10X scope probe). This provides an accuracy of ±30
PPM at ±1Hz, with a supply voltage of 12 V @ 200 mA. The Five volts are supplied to the circuit through regulator
circuit is composed of an input amplifier, power supplies, U6. Diode D3 provides reverse polarity protection of the
reference clock, and eight-digit
counter. I will explain the operation
of each one in the following sections. Figure 1A. The input stage and
power supply.
Input Amplifier
Examine Figure 1A, paying
particular attention to the input
stage. Diodes D1 and D2 clamp the
input voltage of the FET to ±700 mV
when high input voltages are
applied. This stage is powered by 9.1
V to allow for maximum voltage
swing at the collector of Q2 without
clipping. This stage has a gain of
between four and eight, depending
on the input frequency. Note that, in
order to work properly, the VGS (off)
voltage of FET Q1 must be between
-1.5 V and -3.5 V. The data sheet for
the MPF102 specifies a maximum
VGS (off) of -8 V. Typical values of
VGS (off) are around -2 V.
In order to guarantee the proper
operation of the amplifier, construct
the test circuit given in Figure 2 to
determine the VGS (off) of any given
FET. Adjust R1 so that V-out is
approximately 2 VDC. Turn R1 so
MARCH 2004 51
Florian.qxd 2/4/2004 11:12 PM Page 52
Project
Motor Speed
Control
PID Motor
Position
Control
Solutions Cubed
3
Phone 530-891-8045
www.solutions-cubed.com Solutions
MARCH 2004 Circle #148 on the Reader Service Card.
53
Florian.qxd 2/4/2004 11:13 PM Page 54
Project
MARCH 2004
54
Full Page.qxd 2/3/2004 10:21 PM Page 55
CALL OR WRITE
C&S SALES
CALL TOLL-FREE
FOR OUR
(800) 292-7711 FREE
Orders Only 64 PAGE CATALOG!
~
Secure On-line Ordering @ cs-sales.com
Se Habla Espanol FREE GIFT with online purchase (use coupon code NV) (800) 445-3201
25MHz
DS-203 20MHz/10Ms/s Analog/Digital $695
100MV - 35MHz. Audio output 1kHz @ 1V
rms.
and TTL, CMOS pulse. $
199. 95 • Transmitter Incl.
• 3 1/2 Digit LCD
• Transistor Test 12.95
$
56
Axelson.qxd 2/5/2004 12:05 PM Page 57
ge by Jan Axelson
run Java programs, called servlets, which can serve web ten in C for Rabbit Semiconductor's RabbitCore modules.
pages that contain real-time information and respond to
mouse clicks and other user input. The servlet engine I The Web Page
used for the Device Controller is Shawn Silverman's
Tynamo web server, which is free for personal use. Listing 1 is the HTML source code of the page a
My website at www.Lvr.com contains the complete browser might receive on requesting the Device
DeviceController servlet code and instructions for running Controller's web page. The text between angle brackets
it. For loading files into the TINI and testing the web (<>) contains HTML code that tells the web browser how
server on a network, you'll need a PC with an RS-232 to display the text and images on the page.
serial port and an Ethernet network port. The page includes four images. Ledon.gif and ledoff.gif
Why use Java? The Java language is designed from are images of lit and unlit LEDs. The images reflect the
the ground up for use in networking applications and the states of the Device Controller's LEDs when the page was
support built into the TINI's software greatly simplifies requested. The other two images are identical switches, or
network programming. If you're not an experienced Java buttons (button.gif), which users click to toggle the LEDs.
programmer, an introductory text will get you started. The When a user clicks a button's image, the browser's
TINI supports an older, simpler, but still very capable, JDK computer uses the HTTP (hypertext transfer protocol) to
distribution (1.1.8). If you prefer to program in C instead of send a GET request over the network to the Device
Java, my website also has a Device Controller project writ- Controller. If the user clicks the first LED's button, the
request contains the text /servlet/DeviceController?button1.
FIGURE 2. Dallas Semiconductor's DSTINIm400 The /servlet/DeviceController portion of the request tells the
module contains a DS80C400 Network Device Controller to run the DeviceController servlet. The
Microcontroller and can run Java programs.
text following the question mark tells the Device Controller
57
Axelson.qxd 2/5/2004 12:06 PM Page 58
LISTING 1. The HTML code for Figure 1's web page includes Listing 2. continued ...
links to images that match the states of the LEDs.
led1On = toggle(led1);
<html> } else {
<head>
<title>Device Controller </title> // Don't toggle the LED.
</head> // Read the LED's state and set led1On true if the state is 0
// (on) and false if the state is 1 (off).
<body> led1On = (led1.readLatch() == 0);
<h1> Device Controller Demo</h1> }
<table> boolean led2On;
<tr> if ("button2".equals(query)) {
<td><img src ="ledon.gif" ></td> System.out.println("Button 2 was clicked");
<td><img src ="ledoff.gif" ></td>
</tr> // Toggle the LED.
// A logic low turns the LED on.
<tr> led2On = toggle(led2);
<td> } else {
<a href="/servlet/DeviceController?button1">
<img src="button.gif"></a> // Don't toggle the LED.
</td> // Read the LED's state and set LED2 On true if the state is 0
<td> // (on) and false if the state is 1 (off).
<a href="/servlet/DeviceController?button2"> led2On = (led2.readLatch() == 0);
<img src="button.gif" ></a> }
</td>
</tr> // Set the images and text to match the LEDs' current states
// If led1State (led2State) is true, LED1 (LED2) is off.
</table> // If led2State (led2State) is false, LED1 (LED2) is on.
String led1Image;
<p>LED 1 is on.</p> String led1State;
<p>LED 2 is off.</p> if (led1On) {
<p>Click a button to turn an LED on or off.</p> led1Image= "/ledon.gif";
<p>The web page will update to show the current states of the LEDs.</p> led1State = "on";
}
</body> else {
led1Image = "/ledoff.gif";
</html> led1State = "off";
}
LISTING 2. The servlet's doGet() method services HTTP
requests for the web page. String led2Image;
String led2State;
/** if (led2On) {
* Responds to HTTP GET requests. led2Image= "/ledon.gif";
* led2State = "on";
* @param request the HTTPServletRequest object }
* @param response the HttpServletResponse object else {
* led2Image = "/ledoff.gif";
* @throws ServletException led2State = "off";
* @throws IOException }
*/
public void doGet(HttpServletRequest request, HttpServletResponse // Return the web page to the client.
response) SendWebPage (response, led1Image, led2Image,
throws ServletException, IOException led1State, led2State);
{
//The query string sent by the client tells which button } //end doGet
// was clicked on the web page.
NUTS & VOLTS
if ("button1".equals(query)) {
System.out.println("Button 1 was clicked"); On receiving a request to run the DeviceController
servlet, the TINI executes the doGet() method found in
// Toggle the LED.
Listing 2. One of the parameters passed to the method is
MARCH 2004
58
Axelson.qxd 2/5/2004 12:06 PM Page 59
an HttpServletRequest object that contains information LISTING 3. The servlet's toggle() method toggles the LED
about the request. If the user has clicked a button, the at the named port bit.
object's getQueryString() method contains either "but-
ton1" or "button2" to indicate which button was clicked. /**
* Toggles the specified bitPort bit and returns the new state.
If the query string contains button1 or button2, a call *
to the toggle() method in Listing 3 toggles the state of the * @param bitPort a bit that controls an LED.
corresponding LED. Port bits on the DS80C400 control the */
LEDs. Led1 is controlled by Port 5, bit 4, and led2 is private static boolean toggle(BitPort bitPort) {
controlled by Port 5, bit 5. Figure 4 shows the circuits. if (bitPort.readLatch() == 0) {
On the DSTINIs400 board, the bits are accessible from
header J21. On the TStik, the bits are contacts 29 and 30 // If it's 0, set the bit to turn the LED off and return false.
bitPort.set();
on the SIMM connector. I chose these bits, in part, because return false;
they're easily accessible. The bits also function as part of } else {
the SPI interface, which isn't available if you use the bits to
// If it's 1, clear the bit to turn the LED on and return true.
control the LEDs. You can program the TINI to control any bitPort.clear();
other I/O bits or peripherals you wish. return true;
In the servlet code, led1 and led2 are BitPort objects in }
} // end toggle
the TINI-specific class com.dalsemi.system.BitPort. The
class's readLatch() method returns the last value written to
a bit. The set() method sets a bit's value to 1 and the FIGURE 4. A DSTINIm400 or TStik can control these LEDs.
clear() method sets a bit's value to 0.
In Listing 2, after toggling the requested LED, the TINI
sets the values of four variables that display the states
of the LEDs as images and text on the web page. The
variables led1Image and led2Image each contain a file
name ("ledon.gif" or "ledoff.gif"), depending on the state of
the corresponding LED. In a similar way, the led1State and
led2State variables each contain the text "on" or "off."
A call to the application's SendWebPage() method
sends a web page that displays images and text that match
the states of the LEDs on the TINI. A series of out.print
statements writes the web page's contents to the
ServletOutputStream object out. The browser that requested
to run the servlet receives the web page in an HTTP response.
This statement in the SendWebPage() method sends
the contents of the page's <head> section, which contains Resources
the page's title:
out.print("<head><title>DeviceController</title> Ant Sun
</head>" (Ant build tool) (Java Development Kit)
www.jakarta.apache.org www.java.sun.com
In a similar way, out.print statements send the rest of Borland Systronix
the HTML code that makes up the web page. (JBuilder Java environment and (TStik module)
In sending the page, the servlet inserts the file names compiler) www.systronix.com
and text that match the states of the LEDs. This statement www.borland.com
places the contents of the led2Image variable (either TiniAnt
Dallas Semiconductor (TINI add-on for Ant)
"ledon.gif" or "ledoff.gif") on the web page: (DSTINIm400 module) tiniant.sourceforge.net
out.print(led2Image); www.dalsemi.com
Tynamo
This statement places the contents of the led1State Rabbit Semiconductor (TINI web server and servlet
variable (either "on" or "off") on the web page: (RabbitCore modules) engine)
www.rabbitsemiconductor. www.tynamo.com
com
out.print (led1State);
MARCH 2004 59
Axelson.qxd 2/5/2004 12:06 PM Page 60
If the TINI's IP address has an assigned domain name, you can Ethernet (RJ-45) connector to the PC's Ethernet connector.
also access the Device Controller using the domain name: If your PC connects to an Ethernet repeater hub or switch,
attach a straight-across cable between the TINI and an
Everything For Electronics
6. To run the web server in Windows' Hyperterminal or other monitoring and control tasks and serve web pages
a similar application, create a Telnet connection with these which enable users to view and control the TINI's activities.
settings: My website (www.Lvr.com) has links to more
documentation about the TINI and Tynamo web server
Host Address = the TINI's IP address and how to use them, as well as the complete source code
Port = 23 for the Device Controller. NV
Connect = TCP/IP
Click Call to connect to the TINI and
run the web server by entering this
text in the Telnet window:
source web/bin/WebServer
http://192.168.1.9/servlet/Device
Controller
MARCH 2004 61
NearSpace.qxd 2/4/2004 11:48 PM Page 62
by L. Paul Verhage
near space mission as an asset. sky remains pitch black. Beneath the light of dawn, the
lights of Kansas City, which were over 100 miles away at
Amateur Science Experiments the time, were bright. Instead of the sky turning orange at
Everything For Electronics
That Will Knock Your Socks Off dawn, my videotape shows the ground turning orange.
Finally, the Earth’s shadow, which is noticeable from the
I have flown many experiments over my seven years ground, is much more distinct in near space.
and 44 flights in the hobby. Some of my best experiments Photographs of the horizon during the day show a
MARCH 2004
62
NearSpace.qxd 2/4/2004 11:49 PM Page 63
Near Space
Weather Stations
Do you want to know the air temperature, pressure,
and relative humidity found in near space? If so, then
launch a lightweight weather station. A pressure sensor will
show that the atmospheric pressure decreases by a factor
MARCH 2004 63
NearSpace.qxd 2/4/2004 11:50 PM Page 64
Near Space
over to the Dickinson County from an altitude of 50,000 feet Many people are inspired
Sheriff. The sheriff's department because Kansas farmers really by visiting locations like the
released these photographs of hate that. For GPSL 2004, Idaho Grand Canyon. A subset of
Everything For Electronics
Near Space
Adventure
There is one last benefit I can think of; in addition to
amateur science, program management, and inspiration,
there's the adventure. After liftoff of the stack (the near
spacecraft and its launch vehicle), crews will begin their Six stacks are about to be launched.You’ll actually count
eight balloons because of the red piball (pilot balloon)
chase. A rough idea of the near spacecraft's landing zone and the extra balloon on Don Pfister’s stack.
is known because of flight predictions; however, the details The piball was launched by EOSS to gauge wind speed
of the chase and recovery are not known in advance. and direction before GPSL 2002 launched.
Driving over obscure back roads and through tiny
towns can be great fun, especially when your convoy is gram is low enough that almost anyone can get a foot in
equipped with a dozen antennas, several laptops, and the door. An amateur near space program is not a dead-
radios. Try stopping at a gas station and waiting for a end activity. Just testing materials and their applications to
balloon burst while constantly looking up at the sky — this near space is an example of the important work that still
kind of behavior makes the locals wonder what you're up needs to be done. Best of all, the results of these tests are
to. When you show them a tiny dot in the sky and explain applicable to spacecraft engineering and construction.
that it's your balloon at 90,000 feet, you will amaze most With more and better sensors and electronic devices
of them. becoming available to the public, you'll always have new
The last part of the chase, approaching the landing experiments to perform in near space. If space exploration
zone, creates a high level of excitement as you attempt to appeals to you, but the cost is prohibitive, then consider
reach the near spacecraft before it lands. Be aware though, beginning your own poor man's space program. Where
the near spacecraft is under no obli-
gation to land close to the road.
TM
Depending on the location of the
landing zone, your recovery crew MicroStamp11
may end up going for a hike to recov-
er the near spacecraft and launch The World’s Smallest
vehicle. Most of the time this hike is
fun, but it can also be a challenge, so
68HC11 Microcontroller
be prepared. Module!
After having recovered the near • harness the power of the world’s most popular 8-bit
microcontroller in your own projects!
spacecraft, your crew will usually • easy-to-use Windows interface for fast loading via
drop off their film and head to lunch. your PC’s serial port
• control LEDs, speakers, lights, relays, motors, LCDs,
Lunch is a time to share stories of servos, and much more with your own easy-to-write
past and present adventures. Don't programs
• “plug right in” to any solderless breadboard (with
be too surprised if you turn some included adapter), so you can try out your ideas fast!
heads at the restaurant with your sto- • re-programmable in-circuit thousands of times!
• your program stays inside MicroStamp11™ until you
ries. You'll also realize that you prob- replace it– even with no power applied!
ably did more that morning than • runs on standard alkaline or NiCd batteries for hours,
or use a DC adapter
most people will do all weekend. • tiny stamp-size 1.4 inch x 1.0 inch module
• demo of powerful new XPad visual programming
environment included with Starter Package!
Final Comments toll-free USA and Canada • Starter Packages* from $49
MARCH 2004 65
NearSpace.qxd 2/4/2004 11:53 PM Page 66
Near Space
Announcing N&V’s
NUTS & VOLTS
Electronics Showcase
For a list of
retailers that carry
Nuts & Volts in
their store or
if you would like to
carry Nuts & Volts
in your store, go to
www.nutsvolts.com
3,&3URJUDPPHUNLWV 1(:
&RPSOHWHGRFXPHQWDWLRQRQRXUZHEVLWH Are you
6 +86$&DQDGD2WKHU
86%SURJUDPPHU&RQQHFW
WR86%RUVHULDOSRUW)UHH MORE POWER! missing
VRIWZDUH'R]HQVRI3,&V
VXSSRUWHGLQFOXGLQJ& amr Gadgets are something?
))=,)VRFNHW up to 2,000 times
You can order back issues
QRWLQFO&36NLW faster than a stamp.
3,&)[3URJUDPPHU
([SHULPHQWHU6HULDOSRUW
Higher performance, of Nuts & Volts at
lower price. Free
&RPPHQWHGVRXUFHFRGHWR
SURJUDPWKHLQFOXGHG) development s/w, www.nutsvolts.com
DQGWKHQÀDVKWKH/('VLQ
ZD\V&36NLW
Forth, Basic and
assembler runs interactively or untethered.
or call us at
7ROO)UHH :H Finally, technology as good as your ideas. 800-783-4624
VKLS
7HO ZRUOG
Stock up today!
ZZZHOHFWURQLFVFRP ZLGH http://www.amresearch.com
ShowcaseMar04.qxd 2/6/2004 10:48 AM Page 69
Site: www.vandvmachy.com
email: victor@vandvmachy.com
USA Office: V & V Mach. and Equip. Inc. 14019 Whispering Palms Dr.
Houston, TX 77066, PH. 281 397 8101, Fax. 281 397 6220.
Mexico Plant: Marketing Tech. De Mex. SA de CV. Alamo 93
Cuarto Piso, Santa Monica, Tlal. Edo. De Mexico, 54040
Tels. 011 52(555) 314 5325 & 011 52(555) 360 3648
Fax. 011 52(555) 361 5996.
News Bytes
CRC Detects Errors in Digital Data Communications and Can Encrypt Data
n our modern age, the importance of digital electronic Cyclic Redundancy Check is a code — or algorithm —
I data communications by telephone lines, through a
modem, special high-speed lines, or over the airwaves by
that has three basic and endearing qualities: it provides
extreme error detection capabilities, requires a minimum
radio cannot be overstated. The transfer of information of hardware and software, and is easy to implement.
via these media is critical for the successful operation of These advantages can make the application of this
government, military, business, and banking. Without this system by hobbyists and hardware hackers a reality. I
technology, our information age and the Internet would will demonstrate that CRC circuits are very easy to
be impossible. breadboard and utilize.
The reliability of data communications over Parity check, checksum, and CRC all work by
distance is of the utmost importance because of the applying an algorithm to a message. This algorithm,
critical requirements of its users. If the medium cannot be or code, produces a binary value that represents the
relied upon for error-free performance, it is useless. The message in some digital logic way. This value is
damaging effects that can compromise the system are then appended to the end of the message before it is
noise, distortion, and interference. These three gremlins transmitted out. The receiver at the other end of the link
have the ability to turn a digital one bit message into a receives the message and binary value combination, then
digital zero bit and vice versa. If this reversal of a bit applies the same algorithm to the message to produce its
occurs, then an error has crept in, possibly undetected. own binary value. The receiver compares the two values
This scenario could be disastrous. and, if they are equal, then the message was received
Since we cannot guarantee a perfect medium correctly. If they are not equal, then the receiver tells the
between a source transmitter and a destination receiver, transmitter to retransmit the message.
some method to detect errors must be employed. The primary benefit of CRC is that it can detect more
Thankfully, there are some systems that can do this. types of data errors than the other two methods. For
Parity check and checksum are two ways, but they instance, it can detect all single bit errors, all double bit
have limitations. Another method is a code called errors, any odd number of errors, and most burst errors.
Cyclic Redundancy Check (CRC). CRC is a popular and Parity check, on the other hand, can only detect single bit
powerful means to ensure that a transmitter and receiver errors, while checksum can detect all single bit and some
can communicate data reliably, even in the worst of multiple bit errors. Obviously, CRC is the most robust of
conditions. CRC is so well regarded that the Internet the group.
relies on it for error detection.
In this article, I will present a short course on CRC Modulo-2 Arithmetic
and supply the knowledge needed to implement simple
NUTS & VOLTS
digital electronic circuits to perform CRC. Later, I will In exploring the theory behind CRC, we will begin
present a modification to the concept, where a method of with a short lesson on modulo-2 arithmetic. Modulo-2
data encryption, along with the normal error-detecting arithmetic is normal binary addition or subtraction, but is
Everything For Electronics
MARCH 2004
70
Kornacher.qxd 2/5/2004 2:42 PM Page 71
arithmetic. For those familiar with logic half adders, it's just will be replaced by r remainder bits to become the FCS.
the exclusive-OR logic operation. For example, adding, The transmitter's pre-defined pattern divisor P is a
subtracting, and multiplying, respectively, are as follows: code word or key that must be known by the receiver, too.
The quotient produced by the division has no function in
1111 1111 11011 this scheme and is thus ignored. Incidently, though, the
+ 0110 - 0110 x 1101 number of bits q of quotient Q will be the same as the num-
1001 1001 11011 ber of bits of message M, or q = m. Later, I will show how
00000 the quotient can be used in a method of data encryption.
11011 When the receiver receives the data — message M with
11011
10101111 the FCS — it divides this combination, in modulo-2, by the
identical pattern divisor P that the transmitter used. If the
remainder of this division is zero, then no errors crept into
In short, to add the bits in the columns when there is message M during transmission and the validity of the
an odd number of binary ones in a column, then the sum message can be ensured. The quotient of this division is,
of that column is a binary one. If there's an even number again, not used in this process and is also ignored.
of ones in the column, then the sum of that column is a With this much now known, see Example 1 for a
binary zero. It's that simple. Modulo-2 long division, which reference regarding using modulo-2 long division. The
we'll discuss next, is not so intuitive, but, by studying the remainder, 1110, is four bits long, but, since we know that
examples, the steps will become clear. the length of the remainder must be one bit less than the
divisor for a total of five bits, we add a zero to the most
Cyclic Redundancy Check significant bit (MSB) so it becomes 01110. The quotient,
just for the sake of completeness, also has a zero added to
Cyclic Redundancy Check can be described in three the least significant bit (LSB), because its length must be
ways: modulo-2 arithmetic (which I will continue with next), equal to the message for a total of ten bits.
polynomial arithmetic, and digital logic circuits. Because of The FCS remainder R, 01110, is appended to
space limitations, I will not be able to present the polynomial message M, 1010001101, to become 101000110101110,
arithmetic aspect, but we will look at some circuits. We will which is transmitted. The receiver obtains the message
have to do some simple math; since we're just dealing with and divides 101000110101110 by the same pattern P to
ones and zeros, hopefully it won't be too difficult. produce, if there are no errors, a remainder of zero, as we
In a transmitter, let us define message M as being m will see in the modulo-2 long division shown in Example 2.
bits long. This m bit message will be divided, using Since the remainder is zero, no errors occurred during
modulo-2 long division, by a pre-defined binary pattern transmission and the message is valid and reliable.
divisor P. The division, just like regular long division, will
produce an r bit long remainder R known as the Frame Digital Circuits
Check Sequence (FCS). From now on, I shall refer to
remainder value R as the FCS to prevent confusion with Having now finished covering the fundamentals, you
other remainders that will be discussed later. The r bit FCS might be wondering how all this gets us to some practical
will be appended to the end of the m bit message M to be logic circuits. The truth of the matter is that the mathemat-
sent out as the data transmission. ical division operations we just discussed can be represent-
The previous paragraph has thus defined the ed by digital shift registers. In addition, the binary ones and
philosophy employed in the
transmitter. There are a few loose Example 1 Example 2
ends. The length of pattern P,
therefore, must be r + 1 bits long. 1101010110 <-Q 1101010110 <-Q
The number of bits of the FCS ________________
must be less than the number of P-> 110101|1000110100000110101
<-M P-> 110101|101000110101110 <-M
110101
bits of message M, or r < m. 111011 111011
The long division process can 110101 110101
be done by either software or, as I 111010 111010
110101 110101
will later show, by hardware. The 111110 111110
division is the easiest to do in soft- 110101 110101
ware, but hardware is much faster. 101100 101111
110101 110101
To perform the division properly, 110010 110101
message M must initially be padded 110101 110101
with r zero trailing bits. At the end of 01110 <-R 00000 <-R
the division process, the r zero bits
MARCH 2004 71
Kornacher.qxd 2/5/2004 12:00 PM Page 72
gates needed.
Let us now
present the
schematic for the
pattern divisor cir-
Figure 1 cuit in Figure 1.
Please notice that
zeros of the pattern-divisor correspond to the presence or this circuit uses a serial logic feedback arrangement. This
absence of a simple exclusive-OR logic gate. will allow the serial data message to be divided in
This information tells us how to build the circuit modulo-2 long division arithmetic. Also, a circuit usually
that will be the pattern divisor, which will generate the has the input on the left and the output on the right, but
FCS used in CRC. A branch of error control code theory here, I have reversed it to more closely resemble the
called cyclic codes is what we have been talking about convention used in writing binary numbers, where the
previously. Fortunately, shift register circuits and MSB is on the left and LSB is on the right. This way, it will
exclusive-OR gate logic can imitate the function of be easier to understand the connection between the two.
modulo-2 math and cyclic codes. As you can see, it is relatively simple for this circuit to
To build the divisor circuit, the number of shift-regis- perform a long division operation in modulo-2 on serial
ters and exclusive-OR gates needed is determined by the data. The shift register chip I used for this project is a TTL
bits of the divisor pattern P. If we have j total number of 74273 and the exclusive-OR gate chip is a 7486. The 74273
bits in the pattern P, then we need j - 1 number of shift reg- has eight independent shift registers with a common clock
isters. And, if k is the number of binary one bits of P, then and master reset. The registers can be connected together
k - 1 will be the number of exclusive-OR or have the exclusive-OR gates inserted in between,
Figure 2
NUTS & VOLTS
Everything For Electronics
MARCH 2004
72
Kornacher.qxd 2/5/2004 12:01 PM Page 73
according to where the one bits of the wanted to show how the basic divider
pattern are located.
Example 3 circuit worked and what peripheral
Figure 2 is the schematic for the Q-> 1101010110 circuits were needed to accomplish
whole circuit I used to demonstrate 110101 <-P that.
the CRC principle. In the lower right is 1101010110 Another way of looking at this
0000000000
the divider circuit, just mentioned. On 1101010110 circuit is as if it was being employed
top is the circuit to input the message 0000000000 at the receiver end, since both the
to be serially shifted through the 1101010110 receiver's divider circuit and the
1101010110
divider circuit. It uses two 74165 101000110101110 transmitter's divider circuit are
eight-input parallels to serial shift identical. With this way of looking at
registers. On the lower left is a 74164 M-> (1010001101)(01110) <-R it, the lower part of the circuit in
serial to parallel eight-output shift Figure 2 would be the receiver and
register to hold and display the output data. the top part of the circuit would simulate the transmitter.
There is a de-bounced switch to manually operate the So, according to your point of view, the circuit could
shift-clock and another logic switch to simultaneously load separately simulate both ends of a network.
the 74165s with the message and clear the registers of With this in mind, if the five padded zeros appended to
the 74273 and 74164 to zero. The LEDs will be used to the message are replaced with the FCS value of 01110 and
indicate the states of the registers and values that we are the clear-load is initiated, then, after toggling the shift-clock
interested in. 15 times, the quotient will again appear at the output
To make the circuit work, message M plus the padded LEDs, but this time, the divider circuit will show a remain-
five zeros — 101000110100000 — must be applied to the der value of zero (no LEDs illuminated), thus showing that
74165s, as shown, by setting the input data switches high the receiver received the message correctly, proving the
or low, accordingly. Then, to load the 74165s with the CRC operation.
message and to reset the 74273 and 74164, the clear-load
line must be momentarily brought low, then high. It is Data Encryption
imperative that the registers are initialized to the zero state
or our calculation will be wrong. If you will recall, I said that the long division process
Next, it is a simple matter of toggling the shift-clock by the transmitter CRC circuit, which produced the FCS
control to shift the message through the divider circuit remainder, also produced the quotient Q. This quotient, as
until the quotient 1101010110 appears at the end of the I said, being an unneeded byproduct of the process, was
74164. The FCS remainder value 01110 will appear from ignored. To implement a method of data encryption, this
the divider circuit, proving the operation of the transmit- quotient can be utilized. Hence, instead of transmitting the
ter's CRC circuit. Do not shift any further; any more message and FCS in the usual way, the quotient and FCS
shifting will corrupt the remainder. Since the message with could be transmitted. The receiver, in turn, instead of
the five zeros is 15 bits long, it should take 15 toggles of dividing like before, would simply multiply the received
the shift-clock to move
Figure 3
it through to the end.
This design would
probably be very close
to an actual transmitter
circuit employed in a
system. What I have
not shown is that the
FCS remainder value
would be appended to
message M in another
circuit and then shifted
out to be encoded in
the format to be trans-
mitted. This format
would either be a
modem for a telephone
line or a modulator for
a radio transmitter. I
omitted this, as I only
MARCH 2004 73
Kornacher.qxd 2/5/2004 12:01 PM Page 74
Orders: 1-800-221-1705 times to get the 15-bit product (mes- topic. What I have hopefully done is
Fax: 1-603-672-5406 sage and calculated FCS). Five more given enough guidance for you to
Email: riannini@metro2000.net toggles of the shift-clock would shift experiment with Cyclic Redundancy
Catalog $2.00 in the actual FCS, but, unfortunately, Check for yourself. NV
Circle #152 on the Reader Service Card. MARCH 2004
74
ClassifiedsMar.qxd 2/5/2004 12:57 PM Page 75
CLASSIFIEDS
CLASSIFIED ADVERTISING
$50.00 Per Inch — No extra charge for color (Limited time offer). No proofs will be sent. Ads to be typeset by Nuts & Volts must be
Classified ads must be paid in full prior to the closing date. received by the closing date. Supplied ads must be received by the
Visa/MC/Amex accepted. Payment for ads received after the closing artwork due date.
date will cause the ad to be placed in the following issue, at our Call the office at 909-371-8497 or Email classads@nutsvolts.com
discretion. Minimum charge is one inch with half-inch increments. for closing dates, available sizes, and special prepay discount offers.
MUSCLE ®®
WIRES
NASA/JPL
Test Equipment
MARCH 2004 75
ClassifiedsMar.qxd 2/5/2004 12:50 PM Page 76
CLASSIFIEDS
Security Connectors Wire/Cable
consumer
consumertrtrtronics
onics .net
onics.net T
H
E R
F
C
O
N
N
E
The RF Connection MIL-Spec Coax Available (Teflon, PVC IIA)
213 N. Frederick Ave., Ste. 11NV New Product: Belden 9913F, 9913 with
Gaithersburg, MD USA 20877 High Density PE Foam dielectric,
Hi-Tech Sur vival Offers!
C
T
I
O http://www.therfc.com/ stranded center cond. and Duobond
Electronics, security, energy,
N
III Jacket $0.80/ft or $76.00/100ft
Complete Selection of MIL-Spec Coax, Also New: 9092, RG8X with Type II Jacket.
computers, Net, phones, medical, RF Connectors and Relays Intro Price ............$23.00/100ft
legal, financial,weird. Cat.$1 UG-21B/U N Male for RG-213/214 .$5.00
UG-21D/U N Male for RG-213/214 .$3.25
Call for Specials of the Month
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
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
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
UG-175/U Reducer RG-58/58A, $0.25 Prices Do Not Include Shipping
or 5/$1.00 Orders 800-783-2666
Silver Teflon PL-259/Gold Pin, $1.00 Info 301-840-5477
or 10/$9.00 FAX 301-869-3680
lonestartek.net
Unique / Original / Customized / Special
Needs Special Projects Devices
Electronics, security, energy,
phones, cars, biomed, EMF, RF, Manufacturer and distributor of
sound, light, mind control, improv... electrical and electronic wire
and cable since 1973.
ITEMS AVAILABLE FROM OUR STOCK:
Hook up wire, Shrink tubing,
Components Cable ties, Connectors.
Wire cut & strip to specs.
If interested, please call
1-800-626-7540
FREE 120 Pg CATALOG
FAX: 714-563-8309
See us on the Internet:
Electronic components, kits, www.anaheimwire.com or
test equipment, tools, and email: info@anaheimwire.com
supplies for hams, hobbyists, Visa/MC/Amex.
and businesses. Many hard-to-
find items like variable RS485/422/232/TTL
capacitors, vernier dials, coil
forms, magnet wire, and toroids. ASC24T $45 • Converters
• Repeaters
Antique Electronics
Ocean State Electronics • Fiber Optics
www.oselectronics.com • Digital I/O
• Multidrop RS232 www.ChildhoodRadios.com
SWEEP A ROOM FROM THE DOOR
• Custom Units
ZAP CHECKER MODEL 270 RF Transistors, Door Knob Caps, • Auto TX Enable
The resource for collectors of
RADIO DIRECTION FINDING COUNTER-SURVEILLANCE INSTRUMENT vintage (50s & 60s) electronics:
T Power Supplies, Tubes, Coax,
CIEN Extensive Interface Product Line
EFFI G Teflon Wire •Parts •Supplies •How-to Videos
BUTION! SENSITIVITY - VERY HIGH RS232 “Extension Cords” •Tools •Batteries •Adapters •Service
C 2SC2879 2SC2290 3-500Z 4CX250B
DETE
2.4 GHz bugs detected at 30+ feet Documents •Message Board,
BROADBAND - 10 MHz - 4.5 GHz
Up to 115.2 Kbps, 4000 ft. ++ •Links to Collectors, & More
See our website for other products
Hot for detecting 2.4, 1.2, 0.9 GHz devices Large Multidrop Networks.
3 DETECTION MODES
www.westgateparts.com Isolated Units. Smart Units
LINEAR - For initial detection from a distance
LOG - To pinpoint the device
MID - To sort through multiple signal sources
Westgate 1-800-213-4563
Remote Relay “Extension Cords” WANTED:
SILENT VIBRATOR Call the RS485 Wizards at FOR HISTORICAL MUSEUM
For covert detection of covert devices
CLASSIFIEDS
Military Surplus Design/Engineering Services
ELECTRONIC MILITARY SURPLUS 2000 WATT SOLA REGULATOR Do you still think that you can-
Sola CVS 2000 Watt Constant Voltage
WHEATSTONE BRIDGE
ZM-4 Wheatstone Bridge used
WEBSITE: fairradio.com
+/-0.15%; As a resistance sub-
stitution box it is adjustable in
to build virtually any circuit you want! Micro-p, robotics,
1 ohm steps from 0-10110
E-MAIL: fairradio@fairradio.com
PHONE: 419-227-6573
ohms. The current limit of the
resistors is 16-500ma depend-
lasers, motor controls, even bipolar steppers. Complete
ing on setting. Galvanometer indicates balance in test
FAX: 419-227-1313 circuit. Requires three “D” batteries. Also 22.5 to 200
VDC for more accurate readings above 1000 ohms.
projects with power supply, crystal oscilator, you name it
and fits in a case. The Future of ONE PAS, INC.
2395 St Johns RD - Box 1105 5.8x7.3x8.8, 12 lbs sh. Used Reparable, $34.50
Lima, OH 45802 Used Checked, $49.50; Manual repro, $12.00
Affordable Robotics
Training Courses in:
Basic Electronics
Digital Electronics
Relay Control
Misc. Electronics
Servo Controllers Wanted
PLC Systems
Hydraulic Systems Wanted: Balancing machines &
vibration analyzing equipment
From Basic to Advanced! manufactured by the following:
WWW.UCANDO-CORP.COM •Spectral Dynamics •Hofmann
•Bentley Nevada •Schenck •IRD
1-800-678-6113
Cable TV Mechanalysis •Gishott
Contact Mike Park at E.T.
FREE SHIPPING! Balancing, 12823 Athens Way,
UCANDO VCR Educational Products Co.
(Est. 1988)
Join our on-line Los Angeles, CA 90061
310-538-9738
electronics forums! FAX: 310-538-8273
www.nutsvolts.com
MARCH 2004 77
BookstoreMar04.qxd 2/5/2004 12:21 PM Page 78
Prices do not include shipping and robot that saves you diagnose and solve circuit and mechanical
may be subject to change. 80% of the price of an problems in car stereos, cassette players,
Ask about our 10% subscriber off-the-shelf bot — and can be customized CD players,VCRs,TVs and TV/VCR com-
discount on selected titles. to suit your purposes exactly because you bos, DVD players, power supplies, remote
designed it. $34.95 controls, and more. $34.95
MARCH 2004
78
BookstoreMar04.qxd 2/5/2004 12:22 PM Page 79
Personal Robotics
Universal Robotics Controller
V
ery often, in our quest for L6 robotic arm. The L6 arm has six we have to "lift the hood" on IsoMax.
functionality, we stray away R/C servos and presents quite a Be prepared, because this is where
from our processor of challenge from a dynamics point of things get a little wired (cool for
choice when we need a feature that view. Instead of using the IsoPod, I weird). IsoMax, a superset of
just isn't found in our magic bag of decided to try my hand at the FORTH, is like a programming
tricks. Often times, we are forced ServoPod, the IsoPod's big brother. language construction set. With it,
to look in directions we wouldn't The ServoPod is essentially identical, you build new words by stringing
normally consider. except that it has more storage and together previously defined words.
Consider the desktop PC — most more analog inputs. Also, since it was These words themselves can further
likely interfaced to a 20 GB or larger specifically designed for R/C servos, it be strung together into even more
hard drive, possibly with more than is a little easier to work with, as well. words. In this way, what you are
256 MB of RAM, and probably run- To accomplish this, we need a few key doing is writing your own language
ning at better than a 1 GHz bus elements: a command interpreter, a and, the deeper you nest these
speed. Try generating accurate PWM kinematics engine, and a motion words, the higher the level of the lan-
on the parallel port, however, and you processor. guage you are writing, since the
are in for a challenge. The desktop The command interpreter is our words get more specific to the task
PC just isn't made for that. interface to the outside world. The at hand. The converse of this is true
In this article, I will lay out some kinematics engine essentially uses regarding the previously defined
groundwork for a "universal robotics trigonometry to "untangle" the arm words. The deeper you go into their
controller" that, for convenience, will into an easily manageable system. own definitions, the closer you get to
initially be interfaced to a personal Finally, we have a motion processor the compiler and command inter-
computer via RS232 or a USB to that will drive our R/C servos. preter. This deep, dark place is
RS232 converter, but could just as Because of the modularity of IsoMax, where we will draw our secrets from
easily be adapted to other microcom- we easily re-write any of these ele- in order to build our own command
puters and microcontrollers via RS232, ments to accommodate different interpreter. We will tap into the power
RS422, RS485, SPI, or even CANbus. hardware. To work off the CANbus, of EVALUATE (see sidebar).
To keep things fun, I have for instance, we simply redirect the EVALUATE looks at a string at a
chosen to interface to LynxMotion's command interpreter to look at the given address, of a given length, and
CAN module for acts upon it as though you had typed
input, rather than the it in. In this example, we are looking at
serial port. Similarly, the terminal input buffer, but we can
if we wanted to run re-write it to look at any input stream.
six quadrature encod- The implications of this are
ed motors instead of far-reaching. For instance, you can
R/C servos, we would actually build software that writes
simply re-write the software by combing previously
motion processor to defined words into strings and
NUTS & VOLTS
ng Personal Robotics
Personal Robotics
Figure 3
Software has built-in
command wizard.
Kronos Robotics
and Electronics
www.kronosrobotics.com
703-779-9752 !!
fax 703-779-9753
e b site
w
this
•Onlinee Store
v
i e
el Information
b
•Free
u w on’t •Free Software
Yo
•Projects
•PC Boards
In The Trenches
Troubleshooting Circuits
M
uch of a design engineer's approach is to put a working old 74Hxx, etc.)? What does complexity
time is spent making things product and a failing new product side add to the difference? That's simple —
that aren't working work. by side and compare any differences. the more complicated the chip, the
Often times, this can be a real First, do a detailed visual exami- greater the likelihood of difference.
challenge, especially if the design nation. Is the PCB (Printed Circuit Even the same chip from the
steps (circuit design, board layout, Board) the same revision? If there same manufacturer can be different.
assembly, etc.) are performed by is even a minor difference in parts In particular, "die shrink" parts (parts
different people. The engineer must layout, you can be sure the revisions reduced in size to use less silicon) can
determine not only the problem with are different. Look closely. Are all of be subtly different.
the product, but also which design the parts identical? Do the capacitors Does your new product use a "B"
step is faulty and how to correct it. and resistors have the same values? version of the microprocessor (µP)
This month, we'll look at some Sometimes, someone grabs a wrong while the old one has an "A" version?
approaches that can help in such reel and 10K ohm resistors are where Of course, if there is a programmed
situations. 1K resistors should be. Are the toler- part in your product, you must check
ance values the same? Are the ICs if the programming is the same. This
Repair (integrated circuits) identical and from last question is not always easy to
the same manufacturer? Most often, a verify, but should be.
Engineers are generally not 74LSxx and a 74ALSxx are compati- If there are no physical differences
called in for simple repairs — it's too ble, but not always. Even worse, differ- between the old and new versions, you
expensive. However, they may be ent manufacturers have different man- will have to examine the electrical
called in to determine the cause of ufacturing processes, which results in differences.
failures. For example, the pass transis- the "same" chips being different. The best way to do this is with a
tor in the power-supply fails too often; I think it's important to really note side-by-side comparison. It's helpful to
this is really a circuit analysis problem this point. The "same" chips from reduce the size of the problem, if you
and will not be discussed. After all, the different manufacturers can be very can; you can use the same power sup-
problem with the circuit has been different. Take the 74LS123 chip as an ply for both boards. Remove or disable
identified. Rather, we will discuss how example; this is a timer chip and uses extraneous circuits; if this makes a
to find and identify circuit problems. an external resistor and capacitor difference, you've found an important
Engineers will often be called to (RC) for timing. The table below shows clue. Once you've located an electrical
locate a failure that suddenly appears the nominal timing for a 10K resistor difference, finding the problem is
for no apparent reason with a product. and 100 pF capacitor. usually fairly straightforward. Be
It is very important to know before- patient, thorough, logical, and think
hand that there is, indeed, a reason. Signetics 500 nS about what you are doing.
Something has changed. Regardless Texas Instruments 600 nS Don't forget to take notes; there's
of what the manager or technician has SGS (Thompson) 530 nS nothing worse than wondering if
said, something is different in the new Motorola 550 nS something you saw yesterday is
product. This is obvious; if nothing different today. Remember, there must
had changed, the product would still You can see that there is up to a be an electrical difference or there
work. 20% difference in pulse widths. If a wouldn't be a problem.
NUTS & VOLTS
Sometimes, but not very often, 74123 is used for a 74LS123, the
the failure has a fairly obvious cause. I difference can be as much as 100%. I Re-design
say not often because something that chose this old part to illustrate a point;
Everything For Electronics
is easy to fix often would have been if a basic, simple circuit like the If you don't have an old product to
found by a technician — engineers get 74LS123 is so different, what will the compare with the problem unit, then
the juicy problems. difference be with different manufac- you have to treat it as a re-design
In most instances, the best turing processes (74HCxx, 74ALSxx, problem. This approach is a little more
MARCH 2004
84
InTheTrenches.qxd 2/4/2004 11:41 PM Page 85
te
general and less mechanical than your efforts. A failure in one circuit
comparing two units. Normally, you rarely causes a failure in an apparently
will have had some contact with the unrelated circuit — rarely, not never.
re-design because re-designs are done The first thing I do is carefully check
by engineers. However, with overseas the power supply. It is amazing how
contractors, high turnover rates, force many bizarre effects can come from a
reductions, and everything else, it's problem there. Look for noise, spikes,
becoming more common to be called etc. A high frequency oscilloscope is
in cold. required. Sometimes, a spectrum
When troubleshooting a re-design, analyzer is useful here. Check at the
you do have the knowledge that a sim- power-supply source, at the suspected
ilar product did, indeed, work at some circuit, and at individual chips of that
time in the past. This means that it's circuit. (I had one µP that actually
unlikely to find a fundamental error in executed the wrong instructions when
the design. Rather, you are expecting the power supply was too low.)
to find a more subtle error. You are RF (radio-frequency) noise on the
looking for an incompatibility, rather power supply line is sometimes difficult
than an outright failure. to see, but can wreak havoc with both
First, define precisely what the analog and digital circuits. Analog IC
problem actually is. It's surprising how front-ends rectify RF and can cause
often this is overlooked. What defines a drift, offset, oscillation, distortion, and
failure and what defines proper opera- lots of other strange effects. Digital cir-
tion? These specifications should be cuits can get triggered, reset, or simply
available. If not, you may never be able latched-up.
to fix the problem. If the power supply is okay, then
For example, a friend was once you have to actually think. What could
tasked to reduce the noise in a cause the problem you are seeing?
specialized counter. The last three (Sometimes, it's useful to make a
digits weren't stable. The first day, he list.) Next, devise a way to test for this
found some power supply noise that possibility. Run the test and see what
could be filtered out and, by doing so, happens. Again, it's useful to
he was able to improve matters. Only document what you do; this saves you
the last two digits were unstable. After time and confusion if the cause of the
two more days, he got down to only problem is hard to find.
one unstable digit.
Finally, at the weekly meeting, he Make a Test Circuit
had to admit that he was having real Sometimes, you can't easily do a
problems getting the last digit stable test on the circuit in question. Perhaps
without significant changes to the you want to cut a lot of traces or need
circuit. His boss answered, "Only the access to a point that is physically
last digit is unstable? Gee. That's better difficult to get to. In this case, it's
than it's ever worked." It turned out that sometimes possible to make a test
the last two digits were expected to be circuit. This is almost always useful,
unstable. He had spent four additional but, because of the time and effort
frustrating days trying to make involved, it's not always practical.
something "work" when it was already If the test circuit fails in the same
working to specifications. way as the problem circuit, then you
Once you define the problem, you have a much easier circuit to work with.
can usually find it fairly quickly. You've eliminated extraneous parts of
However, finding the problem and find- the system and have narrowed the
ing the cause of the problem can problem down to a unit that you can
sometimes be two different things. control better. On the other hand, if the
Nevertheless, this generally targets the test circuit works properly, you now
problem to a specific area, which is have something to compare the faulty
important. circuit with. Clearly, this makes things
This tells you where to concentrate easier, too.
MARCH 2004 Circle #134 on the Reader Service Card.
85
InTheTrenches.qxd 2/4/2004 11:42 PM Page 86
In The Trenches
In The Trenches
a high-voltage generator; the output the reference. Nothing made a differ- points. If you aren't getting anywhere
was not stable. The unit measured the ence. Finally, I sat down and just with your approach, then your
output voltage and fed it back as an thought — where could the noise be approach isn't working and it's time to
error signal into an op-amp coming from? The op-amp circuit was try something different. Taking a break
regulator circuit. It was easy to find the simple. It obviously wasn't coming and re-thinking the problem can help
noise on the output of the op-amp, but from where I was testing. It had to be with this. Noise can enter the circuit
was the op-amp causing the noise or coming from somewhere else. The from any pin — even the ones you
was it just amplifying it? What's more, only other place was the grounded pin don’t think of as possible. Ground
the noise was so great that it was seen of the op-amp, but it was grounded! noise is something you must always be
on the power supply rail. So, was the What kind of signal could come from a aware of. It plagues analog and digital
power supply noisy or was the circuit ground? I used an ohmmeter to verify circuits. It comes from improper PCB
noisy? that the pin was, indeed, grounded. layout. (Inexpensive PCB auto-routers
The last question was fairly easy to Once this was established, I are notorious for this.) Finally, it shows
determine. I cut the power supply trace hooked up the oscilloscope with the that you can't believe what your client
to the op-amp and inserted a 100 ohm ground lead to the main power supply says. He had initially denied that there
resistor. Then, I put parallel 100 µF and ground and probed the "grounded" were any changes. When shown that
0.1 µF capacitors from the op-amp op-amp pin. Surprise! There was noise the grounding was faulty, he was forced
power pin to ground. This isolated the at the op-amp that wasn't at the power to admit that, "just a few," traces were
op-amp from the rest of the power sup- supply. This was the source of the re-routed, "but the circuit wasn't
ply. The capacitors filtered out noise. noise. I took a piece of heavy gauge changed."
The result was clean power to the op- wire and connected it directly from
amp, but the noise was still there. the power supply ground to the op- Intermittent
I spent most of the day chasing the amp ground pin. The noise went away Problems
noise around the op-amp circuit. I and the circuit worked perfectly. This
filtered here. I filtered there. I filtered incident illustrates several important By far, the most likely cause for an
In The Trenches
intermittent failure is a bad connection. have one. The timing diagram for a dig- CMOS ICs apparently working without
Cables, sockets, solder joints, and ital circuit is just as necessary as a power. They even appear to work well!
broken traces are common problems. schematic. (Proper attention to set-up Here's how this happens. There are
Tapping components, flexing the and hold times is absolutely critical for clamping diodes on every input pin to
board, bending cables, and re-heating reliable circuit operation.) If a timing reduce latch-up and to protect against
solder joints are ways to find problems diagram isn't available, you will proba- over- or under- voltages. These diodes
like these. With analog circuits, if it's bly have to make one. Yes, this takes a steer current to the power rails. If the
not a bad connection, it's probably lot of time, but if a proper diagram was input is greater than the positive sup-
heat-related. There are a few other available during the design stage, then ply, the current is passed to the power
mechanisms for analog circuits which this problem would probably have been pin. If the voltage is less than ground, it
occasionally fail. Look at the schemat- identified and eliminated at that time. is passed to ground. An IC that doesn't
ic and find the most likely parts, then (Also — let's be practical — you'll prob- have the power pin connected will have
heat them with a heat gun and cool ably need the diagram sometime in the the power pin driven internally by any
them with a cooling spray to find the future, anyway.) Usually, you will actu- positive signal on the input pins via the
culprit. Sometimes, multiple parts have ally save time by stopping and making protection diodes. With a typical
to be heated/cooled for the problem to the timing diagram for two reasons. capacitor across the power pin to
be seen. This means you may need a The first is that, by generating the ground, the power pin can actually get
refrigerator or heat chamber for testing. diagram, you are required to analyze charged up to a diode drop below the
With digital circuits, intermittents and understand the circuit. Second, it's input signal. With the low current
are usually caused by timing errors a powerful troubleshooting tool. The requirements, that may be enough to
(when a bad connection is not at fault). exception to intermittent digital circuits make the IC look like it's operating
Sometimes, heating and cooling will occurs when software is involved. properly, but it isn't. The voltage is
make the problem better or worse, but Erratic software has an entirely differ- reduced by at least a diode drop (0.7
the fundamental problem is not caused ent cause. Troubleshooting software is V) at the output. So, if this signal is
by temperature. It's an error in the tim- something that books are written about used to drive the next layer of logic,
ing. Heating and cooling only change — we won't discuss it further, now. that output will be an additional diode
the timing slightly. These problems can drop lower. You can see that, after a few
be difficult to find because timing is a Phantom Power levels of logic, there is no voltage left
relative thing. A clock pulse to a count- to drive anything. In addition, the
er may look fine, but, if it occurs too How many times have you operational speed is greatly reduced,
soon after a reset, there may be prob- forgotten to apply power to a circuit although this may not be apparent at
lems. You need a good timing diagram and wondered why it wasn't working? first glance. In other words, while
of the circuit. Please don't say you don't On several occasions, I have seen it may initially appear to be a cute
trick to power circuits, it really isn't a
practical design approach. It is a
strange thing to troubleshoot, and it's
The Standard for checking Locate shorted or leaky quite common to see this on new
Capacitors in-circuit components or conditions circuit designs. CMOS 4000 series and
Good enough to be the to the exact spot in-circuit 74Cxx series ICs exhibit this effect. I
choice of Panasonic, Still cutting up the pcb, don't think any other logic families do.
Pioneer, NBC, ABC, Ford, and unsoldering every This may carry over to other low-power
JVC, NASA and thousands part trying to guess at CMOS devices, like microprocessors
of independent service where the short is?
and other specialized ICs. They all have
technicians. $179 clamping diodes, as well.
Inexpensive enough to pay for itself in just Your DVM shows the same shorted reading all
one day’s repairs. At $179, it’s affordable. along the pcb trace. LeakSeeker 82B has the Conclusion
resolution to find the defective component.
And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker Troubleshooting is different
guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now depending on whether the product is
NUTS & VOLTS
thing you can lose is all the time you’re you can locate a shorted part only a quarter of
new or in need of repair or re-design-
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
ing. The best tool is between your ears.
If you understand the product well, you
Everything For Electronics
Stamp Applications
Measure High, Measure Low
The unappreciated lookup table do this month is create a program for the BS2pe (or
BS2p) that will talk to the DS2760 and display the ther-
swings into action this month! mocouple temperature in Celsius and Fahrenheit.
Temperature on a Wire
I
'm pretty sure I've made this confession before, but if I
haven't, here goes: I'm a bit of nut when it comes to As you can see in Figure 2, the DS2760 is a one-chip
temperature. Let's just say that I have an exceptional solution for thermocouple interfacing. The BS2p/BS2pe
temperature curiosity. I have thermometers of one sort or makes talking to a 1-Wire device a snap; the rest is just
another spread from one end of my home to the other and assembling the code. Here's the plan:
I seem to be checking them constantly. I even found a use-
ful little atomic travel clock with a thermometer built in; I • Measure the cold junction temperature (this comes from
can keep track of the exact time when I travel and monitor inside the DS2760).
the environment at the same time — I like that. • Measure the Seebeck voltage.
In science and industry, one of the most popular meth- • Find the thermocouple voltage that corresponds to the
ods of measuring temperature is with a thermocouple. cold junction temperature.
They're inexpensive and fairly accurate. They're easy to • Adjust the Seebeck voltage based on the cold junction
use, but the process of using them properly is not neces- temperature.
sarily very simple. Let's back up a bit ... a thermocouple is • Look up the compensated temperature and display on
constructed by joining two dissimilar metal wires at one the LCD.
end (see Figure 1). A voltage will be developed between
the joined and open end that is proportional to the temper- Alright ... you know the drill: We've planned our work,
ature difference between the two ends. This is called the now let's work our plan.
Seebeck voltage, named after Thomas Seebeck, who dis- Let's start at the top and make sure that we actually
covered the affect in 1821. have the DS2760 connected. Note that this program is
The trick is that Seebeck voltage is very small — on the designed for just one sensor — it can be modified for
order of fractional to low millivolts — so we just can't pull multiple units, but that's beyond the scope of what we're
out our trusty DMM and measure it. Another point going to do here. (You could, for example, include tables
for consideration is establishing a reference at what is for various thermocouple types and select the type — you
called the "cold junction" (the point where we measure the can download an example from Parallax.) After checking
Seebeck voltage). This connection is called the cold junc- to make sure that we're connected to a BS2p or BS2pe
tion because, prior to electronic compensation, this con-
nection point was placed in an ice bath to keep it Figure 1. Thermocouple connections.
at (or very near) 0°C. If you look at a standard thermocou-
ple table, you'll see that the reference junction is specified
at 0° C.
Lucky for us, technology is on our side. Dallas
Semiconductor makes a neat little chip called the DS2760,
which was actually designed for monitoring Lithium-ion
batteries, but works very nicely as a thermocouple inter-
face. To the best of my knowledge, the use of the DS2760
as a thermocouple interface was originally presented by
Dan Awtry of Dallas Semiconductor. What we're going to
MARCH 2004 89
Stamp.qxd 2/5/2004 12:14 PM Page 90
Stamp
Read_CJ_Temp:
OWOUT OW, %0001, [SkipNet, $69, $18]
OWIN OW, %0010, [tmpCJ.BYTE1, tmpCJ.BYTE0]
IF (tmpCJ.BIT15) THEN
tmpCJ = 0
error = 1
ELSE
tmpCJ = tmpCJ.HIGHBYTE
error = 0
ENDIF
RETURN
Figure 2. DS2760 thermocouple interface schematic.
To retrieve the temperature, we send the SkipNet
(required for 1-Wire communications), we initialize the ($CC) command (Only one device is connected, so no
2x8 LCD and then retrieve the serial number from the serial number is required.), followed by $69 (read), and
1-Wire device connected to P8. then the register. Since 1-Wire devices work with bytes,
our OWIN instruction breaks the tmpCJ variable into
Check_Device: bytes using internal PBASIC aliases: BYTE1 (high byte)
OWOUT OW, %0001, [ReadNet]
OWIN OW, %0010, [SPSTR 8]
and BYTE0 (low byte).
GET 0, char Remember that the temperature is left-aligned within
IF (char <> $30) THEN tmpCJ, so the sign is currently sitting in Bit15. If this bit is
LCDOUT E, LcdCls, ["NO"] one, the temperature is negative. To keep things simple,
LCDOUT E, LcdLine2, [" DS2760"] we will disallow negative cold junction temperatures (In
STOP
ENDIF theory, it should be 0° C, not lower.) and set tmpCJ to
zero and the error flag to one.
We'll send the ReadNet ($33) command to the When the temperature is — as it will be in most cases
DS2760 using OWOUT, specifying a front-end reset — positive, we can convert the raw value into degrees by
(perform the reset process before sending data). ReadNet taking the high byte of the raw temperature. Yes, I know
instructs the connected 1-Wire device to transmit its what you're thinking: "Huh?" Okay, here goes ... The raw
eight-byte serial number. value needs to be right shifted by five bits to correct the
Since we're not going to put the whole thing to use — alignment.
but may want to display it later — we'll buffer it into the Okay, that's easy. Then, we have to multiply by
Scratchpad RAM using the SPSTR directive with OWIN. 0.125 to get whole degrees. As it turns out, 0.125 is a
The first byte of the serial number string will be the device convenient fractional value because multiplying by 0.125
type; for the DS2760, this is $30. If that byte isn't $30, the is the same as dividing by eight. And, as luck would have
program will put a message on the LCD and stop the it, dividing by eight is the same thing as a right shift by
program. three bits. So, in total, we have a right shift of eight bits,
The reason we don't use END above — where STOP which means that our whole degrees result is simply the
appears — is that END puts the Stamp into low-power high byte of the raw temperature value.
mode. The Stamp's watchdog timer will interrupt the Let me interrupt this broadcast for a minute and talk
NUTS & VOLTS
low-power mode every 18 milliseconds, causing the pins about those "convenient fractional values." While the
to "glitch" (this is a known behavior). What I saw happen Stamp has operators (*/ and **) that can help with frac-
in testing is that the glitch on the LCD's E pin caused the tions, there are times when we don't need to take that
Everything For Electronics
display to be blanked, obliterating the message. STOP route. In this case, for example, we could have used the */
halts the program without placing the Stamp in operator with $40 to multiply by 0.125, but it's simpler to
low-power mode, so the I/O pins remain in their current divide by eight. Now I admit, 0.125 is a common value
state without interruption. and easy to recognize, but what about a value like
MARCH 2004
90
Stamp.qxd 2/5/2004 12:15 PM Page 91
Stamp
0.0769? Here's a tip: When in doubt about a fraction that Turning the Tables on Tough
is less than one, enter it into your scientific calculator and Math
then press the reciprocal [1/x] key. If the value is a whole
number (or very very close) — cha-ching! — divide by the A key element of this program is the use of large tables
whole number. If that value happens to be an even power to hold the thermocouple data. The reason we use a table
of two (2, 4, 8, 16, 32 ... ), then we can use the shift oper- is that the thermocouple output voltage versus tempera-
ator instead of dividing, since it's faster. Okay, back ture is not linear and, in fact, would require a multi-order
to work. The next step is measuring the Seebeck voltage equation to maintain accuracy. One of my favorite features
from the thermocouple. The process is identical to of the BS2p family is the ability to use READ and WRITE
measuring temperature. across program slots. This lets us put our code in slot zero
and our table(s) in slots one and higher. The STORE
Read_TC_Volts: instruction is used to select a table.
OWOUT OW, %0001, [SkipNet, $69, $0E]
OWIN OW, %0010, [tCuV.BYTE1, tCuV.BYTE0]
To compensate for a cold junction value above 0° C,
signTC = tCuV.BIT15 we'll determine the voltage that would be generated by that
tCuV = tCuV >> 3 temperature for our thermocouple. This is simple; we point
IF signTC THEN at our table with STORE and then calculate the address
tCuV = tCuV | $F000 within the table by multiplying our cold temperature value
ENDIF
tCuV = ABS tCuV */ 4000 by two. This is necessary, since we are using words (two
RETURN bytes) to store the thermocouple output voltages.
The voltage is stored as a 13 bit (12 bits plus sign) STORE PosTable
READ (tmpCJ * 2), Word cjComp
value in the current registers ($0E and $0F) of the
DS2760. The reason it's in the current register is that the
DS2760 uses a shunt to convert a current to voltage for Notice that we're taking advantage of a new PBASIC
reading. In our application, we're using the external sense 2.5 feature: using the Word modifier with READ. The only
resistor version of the DS2760, which lets us measure a caveat is that data must be stored in the table as low-byte,
voltage with a resolution of 15.625 microvolts per bit. After high-byte. This is not a problem for us, as we're creating
retrieving the voltage into the variable tCuV, we save the the table using the Word modifier. At this point, cjComp
sign by making a copy of Bit 15. holds the cold junction compensation voltage for
As with the temperature, the voltage is going to be our thermocouple. Now, it's time to combine the compen-
left-aligned when in our word variable and the sign bit is the sation voltage with the Seebeck voltage. After we've done
MSB. that, we can do a reverse lookup in the table to determine
After the sign is saved, we correct the bit alignment in the thermocouple temperature.
tCuV by shifting right three bits. Now,
if the sign bit is one, that means the
voltage is negative and the value in
tCuV is represented in two's-compli-
ment format. Keep in mind that the
shift process pads the opposite end
with zeros (the high-end bits, in this
case), so we need to put ones in those
positions to make the two's-compli-
ment value of tCuV correct.
This will let the ABS function
return the right value. The final step is
to multiply by 15.625 to get micro-
volts. As the factor is fractional and
greater than one, we'll use the star-
slash (*/) operator. The parameter
for star-slash is calculated by multiply-
ing 15.625 and 256.
Okay, we have the cold junction
temperature and the Seebeck volt-
age; now, it's time to do a bit of math
and determine the actual thermocou-
ple temperature.
MARCH 2004 Circle #79 on the Reader Service Card.
91
Stamp.qxd 2/5/2004 12:15 PM Page 92
Stamp
ENDIF
RETURN
Where in the Table is My Value?
Everything For Electronics
With the compensated voltage (cjComp) in hand, Our code is actually modified a bit from the
all we have to do now is find that value — or its closest traditional binary search. In typical applications, the
match — in the table; that position will be our actual search will report the position or “not found”. We want the
thermocouple temperature. Okay, how do we find it? One closest position if the actual value is not in the table. This
MARCH 2004
92
Stamp.qxd 2/5/2004 12:15 PM Page 93
Stamp
Figure 3. Don't touch ... the stove is hot! Figure 4. Dry ice is really cold! Figure 5. And torches get really hot!
is accomplished by monitoring the span between the high width of our value and the width is then used to pad the
and low pointers. When it falls to one or zero, we've display with spaces ahead of the printed value. The sign
searched the whole table and we will use the low pointer bit is used with a bit of math to print a space for positive
as our search result. values and a hyphen for negatives. The DEC modifier
Now that we have the correct Celsius temperature, we finishes the process.
can convert to Fahrenheit and send the values to an LCD.
Temperature Hunting
Display_Temps:
IF (tempC = 0) THEN
signC = 0
As you can see in the photos, I assembled my test
ENDIF unit on a standard BOE. By using a nine-volt battery, I
was able to roam around and test temperatures. My first
tempF = tempC * 9 / 5 spot of interest was the hot water coming out of the tap
IF (signC) THEN in my hotel room; I was visiting the California office
tempF = 32 - tempF
ELSE when I wrote this. How hot was it? A whopping 140° F!
tempF = tempF + 32 That's hot. However, I had access to hotter things, like
ENDIF that burner on the stove — over 800° F.
signF = tempF.BIT15 What about measuring cold temperatures? I picked
tempF = ABS tempF
up some dry ice at the supermarket and measured it at
LOOKDOWN tempC, >= [1000, 100, 10, 0], idx around minus 100° F. Wow, that is cold. Please ... before
LCDOUT E, LcdLine1, [223, "C ", REP " "\idx, you go off on your own temperature hunting expeditions,
signC * 13 + 32, DEC tempC] be aware that you can be burned by extreme heat or
LOOKDOWN tempF, >= [1000, 100, 10, 0], idx extreme cold (like dry ice). I had a friend take the photos
LCDOUT E, LcdLine2, [223, "F ", REP " "\idx, for me so that I could focus on not getting too close to the
signF * 13 + 32, DEC tempF] "danger zone" with my hands. Even if your thing isn't
thermocouples or temperature measuring, I do hope that
Before we do the conversion, we’ll fix the sign bit you found the use of tables interesting. After finishing this
for Celsius, if required. There may be times when the project, I thought of a couple other projects that could be
temperature is just a hair below zero and the sign bit will simplified with a table; I would also get better resolution
get set. It's an easy fix. with a table than I would using integer math. You can use
There's no magic in converting from Celsius to your favorite PC programming language to calculate val-
Fahrenheit; we use the formula F = C x 9 / 5 + 32. As our ues and output your table as text that can be copied into
program uses absolute values with a separate sign bit, an the Stamp editor. I'm currently experimenting with a very
IF-THEN structure will take care of the "+ 32" part of the interesting multi-platform language called Python. Check
equation. This actually points to another reason for using it out — you might find it interesting and useful too.
absolute values: The divide operator (required in Until next time, Happy Stamping. NV
the Fahrenheit conversion) cannot be used with two's-
compliment (negative) values.
Resources
Jon Williams
To keep things on the LCD neat, I use Tracy Allen's jwilliams@parallax.com
right justification trick with REP (repeat) modifier for
serial output instructions (SEROUT, I2COUT, Parallax, Inc.
OWOUT, and LCDOUT — even though it uses a parallel www.parallax.com
buss). A LOOKDOWN table is used to determine the
MARCH 2004 93
Tech Forum.qxd 2/5/2004 1:28 PM Page 94
Tech Forum
Tech Forum
erase the "memory effect" of NiCad
batteries? If not, does anyone have a
schematic for a zapper that will work?
#3044 Anonymous
via Internet
these batteries should be charged
QUESTIONS from a constant voltage source until I need a diagram to build a simple
the battery voltage reaches 7.2 to amp hour meter to drive an
My local middle school is using 7.35 volts, with the current not to electromechanical counter. I have an
an old scoreboard system in the gym exceed 900 mA. AD645 analog to digital converter,
for basketball games. It worked great, #3042 Jay Harford the power supply, the counter, etc.,
but it used a mechanical timer for via Internet but the circuit I put together does not
time outs, which would ring a bell on work. Perhaps a fresh diagram will
the console. Now, the mechanical FM radio reception is usually help me dope it out.
timer no longer works and I would like poor inside office buildings, as steel in #3045 Jim Buckwalter
to replace it with an electronic timer the roof and walls blocks much of the Visalia, CA
that can trigger a relay to activate the signal. Is there a way around this?
scoreboard buzzer. The timer will Could you put an antenna outside Does anyone have a simple
need to have two timed selections — and run a cable to another antenna circuit that uses an IR sensor to
30 and 60 seconds — and only needs inside, maybe with a broadband trigger a camera? I'd like to snap
to activate the buzzer for two seconds. booster amplifier? pictures of the nocturnal visitors in
#3041 Rick #3043 Kent Durvin the backyard of my country home.
via Internet via Internet #3046 Dan Gorkiewicz
via Internet
I need a charger circuit for a 6 V If I isolate the two prongs of a
4.5 Ah gel cell. I understand that stun gun, can I use it as a zapper to Does anyone have a simple
circuit that can be used to count the
This is a READER-TO-READER Column. All indicate to that effect. number of times a bird goes in and
questions AND answers will be provided by • Comments regarding answers printed in this out of a birdhouse? I teach science to
Nuts & Volts readers and are intended to column may be printed in the Reader students in Michigan and I think this
promote the exchange of ideas and provide Feedback section if space allows. would help spark their interest.
assistance for solving problems of a technical #3047 Dan Gorkiewicz
nature. All questions submitted are subject to QUESTION INFO via Internet
editing and will be published on a space To be considered
available basis if deemed suitable to the All questions should relate to one or more of In the 2” x 4” framing of an outer
publisher. All answers are submitted by readers the following: wall of my home, I would like to install
and NO GUARANTEES WHATSOEVER are 1) Circuit Design a cat door that can move up and
made by the publisher. The implementation of 2) Electronic Theory
down. I envision a motorized rack and
any answer printed in this column may require 3) Problem Solving
4) Other Similar Topics
pinion assembly. I know of a pressure
varying degrees of technical experience and
should only be attempted by qualified sensor that would control the
individuals. Always use common sense and Information/Restrictions operating circuit, but I need some
good judgement! • No questions will be accepted that offer sources for electric motorized rack
equipment for sale or equipment wanted to and pinion assemblies.
Send all material to Nuts & Volts Magazine, 430 buy. #3048 Michael K. Lenihan
Princeland Court, Corona, CA 92879, OR fax • Selected questions will be printed one time via Internet
to (909) 371-3052, OR email to on a space available basis. (Cat guillotine? — Editor Dan)
forum@nutsvolts.com • Questions may be subject to editing.
Does anyone have any
ANSWER INFO Helpful Hints suggestions as to electronic
• Include the question number that appears • Be brief but include all pertinent information. schematic development software
directly below the question you are responding If no one knows what you’re asking, you won’t vendors with up-to-date and extensive
to. get any response (and we probably won’t print
NUTS & VOLTS
Tech Forum
look at the pinouts of a device. by measuring the loss of heat from a nature of impurities found in
#30410 Sassan Smarghandi metallic probe. Diamonds are diamonds, they are either extremely
via Internet excellent conductors of heat and will good electrical insulators or could
draw the heat from the probe faster have lower resistances and, in some
I have a Drake 2 A than simulated stones. cases, (Type IIb stones) even act as
communications receiver and would In recent years, moissanite — P-type semiconductors!
like to replace the obsolete vacuum which is extremely rare in nature — Diamonds are photoconductive,
tubes (6BE6, 6BA6, etc.) with solid has been synthesized in laboratories retaining their high resistivity only in
state devices (FETs, etc.). I would and its thermal conductivity the dark or in light with no UV
appreciate any advice or schematics approaches that of diamond, so the content. Type IIb stones are even
that anyone can provide. thermal test is not sufficient to photoconductive to gamma rays (like
#30411 Richard Harris identify a true diamond and an a Geiger tube).
Winamac, IN additional reflectivity test needs to be If DC voltage is applied across a
performed to distinguish between the Type IIb stone, at first the current will
ANSWERS two. be small — perhaps a few milliamps.
Diamonds have the highest After a few minutes, it will rise to
[1046 — January 2004] thermal conductivity of any naturally several amperes and the stone will
I was in a shop and observed a occurring material. In fact, a diamond become red hot and eventually
desk clerk verify that the stone in a conducts heat so rapidly that it can vaporize if the current is not cut off.
diamond ring was genuine. He be plunged red hot into liquid This does not seem to occur if AC is
used a probe device that became nitrogen without being harmed, used; instead, the diamond
warm at the tip. It was placed whereas most non-metallic minerals scintillates with blue light!
against the stone in question and a would shatter (hence the popularity Rahul Karnik
red or green LED illuminated to of diamond tipped tools). It is also via Internet
indicate authenticity. exceptional in resisting electricity
(think heatsink). [1043 — January 2004]
Electronic diamond testers work Depending upon the levels and How can I burn old and
Tech Forum
obsolete tapes and records onto tapes into CDs, you can even make a Casper, WY 82605-0127 or
CDs? I have a CD-R/W drive, but I little extra money providing a media compnew@trib.com
can't figure out how to input from conversion service to those unable to John Hemminger
an outside-the-computer source. find CDs of their favorite oldies. Brookfield, MO
John McMichael
You'll need a sound card with an Laramie,WY [1049 — January 2004]
external audio input jack (most cards I salvaged some lithium-ion
have an "aux" jack), cables to [10414 — January 2004] rechargeable batteries and need to
connect to the sound card, (tape I have an old TRS-80. When I build a charger for them. They are
deck output, turntable/preamp loaned it out, someone overwrote 3.6 V, 1200 mAh in size. Can I use
output, etc.), and suitable software. the master disk. I’m looking for a my NiMH battery charger?
The signal level output by most replacement and will pay for a
turntables is very low and needs to be download, disk, or any fix. Lithium-ion batteries need a
amplified before going to the sound special charger to recharge them.
card, while the line-out from most The TRS-80 computer might be Trying to use a NiCD or NiMH charger
tape decks can go directly to the old, but a number of working will either ruin the battery, cause a
sound card's input jack. machines are still being used on a fire, or do nothing (if the protective
I personally use and recommend daily basis. Stan Slater and Ron Gatlin circuitry works).
"Audio Cleaning Lab," by Magix. It are the publishers and editors of Go to Maxim's website
does everything from recording with Computer News 80, which is (www.maxim-ic.com) to learn more
automatic track detection and published bi-monthly and supports about Li-ion battery charge circuitry.
placement, sound cleaning (click and the TRS-80 series of computers. They Search on their website for "battery
hiss removal), sound enhancement can provide disk operating systems, management," there is a lot of
(equalizer, stereo FX, etc.), to burning software and hardware, primarily for information about the chips they
a CD. Visit www.magix.com to see the Model III and IV. make for battery charging.
everything this great program can do. Stan and Ron can be contacted at Robert Zusman
Besides converting your old LPs and Computer News, PO Box 50127, Scottsdale, AZ
NUTS & VOLTS
Everything For Electronics
MARCH 2004
96
IndexMar04.qxd 2/6/2004 10:21 AM Page 97
Advertiser’s Index
Abacom Technologies ............34 Command Productions ...........45 Jameco.....................................13 O-Navi LLC..............................69 Rogue Robotics .......................68
ActiveWire, Inc. .......................68 Conitec DataSystems .............12 Kronos Robotics & Electronics ...83 PAiA Electronics ......................68 Saelig Company ......................54
Akida LLC ...............................67 Cunard Associates .................67 LabJack ...................................86 Parallax, Inc. ........... Back Cover SchmartBOARD .....................68
All Electronics Corp. ...............37 Earth Computer Technologies ...35 Lakeview Research .................68 PCBexpress ............................34 Scott Edwards Electronics, Inc. ...95
Amazon Electronics ................68 eBay ...........................................5 Lemos International Co., Inc. ....35 PCB Fab Express ...................47 SGC ..........................................7
AM Research, Inc. ..................68 Electronic Design Specialists....88 Linx Technologies .............43, 66 PCBPro ...................................95 Simulation Technology Corp. ..21
Atomic Time.............................41 Electronix Express...................11 Lynxmotion, Inc. ...............50, 68 Pico Technology Ltd. UK ...........9 Solutions Cubed .....................53
Autotime Corp. ........................67 EMAC, Inc. .............................49 Pioneer Hill Software ...............49 Square 1 Electronics ..............10
Autotrax EDA ..........................19 M2L Electronics ......................67
Eptsoft Limited ........................12 Supercircuits............................15
Basic Micro, Inc. .......................18 ExpressPCB ...........................61 Matco, Inc. ..............................69 Protek ......................................44 Surplus Sales of Nebraska .....27
Bellin Dynamic Systems, Inc. ....67 Front Panel Express LLC ........91 Maxstream ..............................85 Pulsar, Inc. ..............................68 Syspec, Inc. ............................67
C & S Sales, Inc. ....................55 Halted Specialties Co. ..............3 microEngineering Labs............39 QKITS......................................67 Technological Arts ..................65
Carl’s Electronics, Inc. ............67 Hobby Engineering ..................32 Microtech Source, Inc. ............67 Ramsey Electronics, Inc. ...24-25 Trace Systems, Inc. ................28
Catexa .....................................67 Information Unlimited ..............74 MVS ........................................47 Resources Un-Ltd. ..................48 Trilogy Design .........................86
Circuit Specialists, Inc. ......98-99 Intronics, Inc. ..........................68 Net Media ............................2, 87 Robodyssey Systems .............67 UltraDense...............................67
Cleveland Institute of Electronics ...23 IVEX .......................................22 New Micros, Inc. ......................33 Rogers Systems Specialist......29 V&V Machinery & Equipment, Inc. ..69
Akida LLC.....................................................................67
AMATEUR RADIO & TV Amazon Electronics .....................................................68
AM Research, Inc. .......................................................68 PUBLICATIONS
Basic Micro, Inc. ..........................................................18
Atomic Time ................................................................41 Conitec DataSystems...................................................12 Lakeview Research .....................................................68
Linx Technologies .................................................43, 66 EMAC, Inc. ..................................................................49 Square 1 Electronics ...................................................10
Ramsey Electronics, Inc. .......................................24-25 microEngineering Labs ...............................................39
SGC ..............................................................................7
Supercircuits ...............................................................15
Surplus Sales of Nebraska ..........................................27
MVS .............................................................................47
Net Media.................................................................2, 87 RF TRANSMITTERS/
New Micros, Inc. ..........................................................33
Parallax, Inc. ............................................... Back Cover RECEIVERS
BATTERIES/CHARGERS Scott Edwards Electronics, Inc. ...................................95
Square 1 Electronics ...................................................10
Abacom Technologies .................................................34
Linx Technologies .................................................43, 66
Cunard Associates ......................................................67 Technological Arts .......................................................65 Matco, Inc. ...................................................................69
Trace Systems, Inc. ....................................................28
BUYING ELECTRONIC UltraDense ..................................................................67
ROBOTICS
SURPLUS DESIGN/ENGINEERING/ Akida LLC.....................................................................67
Earth Computer Technologies......................................35
Rogers Systems Specialist .........................................29
REPAIR SERVICES Hobby Engineering ......................................................32
Kronos Robotics & Electronics ....................................83
ExpressPCB ................................................................61 LabJack .........................................................................86
CCD CAMERAS/VIDEO Front Panel Express LLC ............................................91
Pulsar, Inc. ..................................................................68
Lemos International Co., Inc. ........................................35
Lynxmotion, Inc. ......................................................50, 68
Solutions Cubed ..........................................................53 Net Media ..................................................................2, 87
Autotime Corp. ............................................................67 New Micros, Inc. ............................................................33
Circuit Specialists, Inc. ...........................................98-99 Trace Systems, Inc. ....................................................28
Matco, Inc. ...................................................................69 V&V Machinery & Equipment, Inc. ..............................69 O-Navi LLC ...................................................................69
Ramsey Electronics, Inc. ......................................24-25 Robodyssey Systems ....................................................67
Resources Un-Ltd. ......................................................48
Supercircuits ...............................................................15 EDUCATION Rogue Robotics ...........................................................68
Simulation Technology Corp. ......................................21
Solutions Cubed.............................................................53
Cleveland Institute of Electronics ................................23
CIRCUIT BOARDS Command Productions ................................................45
Autotrax EDA ..............................................................19
EMAC, Inc. ..................................................................49 SATELLITE
Eptsoft Limited ............................................................12
Cunard Associates ......................................................67 Hobby Engineering ......................................................32 Lemos International Co., Inc. .........................................35
ExpressPCB ................................................................61 PCB Fab Express ........................................................47
IVEX ............................................................................22
Maxstream ..................................................................85
PCBexpress ................................................................34
Protek ..........................................................................44
Simulation Technology Corp. ......................................21 SECURITY
PCB Fab Express ........................................................47 Syspec, Inc. .................................................................67
Information Unlimited ..................................................74
PCBPro .......................................................................95 Linx Technologies .................................................43, 66
Pulsar, Inc. ..................................................................68
Saelig Company ..........................................................54
KITS Matco, Inc. ...................................................................69
Supercircuits ...............................................................15
SchmartBOARD ..........................................................68
V&V Machinery & Equipment, Inc. ..............................69 Amazon Electronics .....................................................68
Autotime Corp. .............................................................67
C & S Sales, Inc. .........................................................55 STEPPER MOTORS
COMPONENTS Carl’s Electronics, Inc. .................................................67
Earth Computer Technologies ....................................35 Jameco ..........................................................................13
Bellin Dynamic Systems, Inc........................................67 EMAC, Inc. ..................................................................49
Catexa..........................................................................67
Electronix Express .......................................................11
Hobby Engineering ......................................................32
Information Unlimited ..................................................74
TEST EQUIPMENT
Front Panel Express LLC .............................................91 PAiA Electronics...........................................................68
Jameco ........................................................................13 Bellin Dynamic Systems, Inc..........................................67
QKITS .........................................................................67 C & S Sales, Inc. ...........................................................55
Lemos International Co., Inc. ......................................35 Ramsey Electronics, Inc. .......................................24-25
Linx Technologies .................................................43, 66 Circuit Specialists, Inc. .............................................98-99
SchmartBOARD ..........................................................68 Conitec DataSystems ....................................................12
Maxstream ..................................................................85 Scott Edwards Electronics, Inc. ...................................95
Microtech Source, Inc. ................................................67 eBay.................................................................................5
PCBexpress .................................................................34 Electronic Design Specialists.........................................88
PCB Fab Express ........................................................47
Pulsar, Inc. ..................................................................68
LASERS Intronics, Inc. .................................................................68
LabJack .........................................................................86
Solutions Cubed ..........................................................53 Information Unlimited ..................................................74 Pico Technology Ltd. UK................................................9
Resources Un-Ltd. ......................................................48 Pioneer Hill Software ....................................................49
COMPUTER Protek ..........................................................................44
Hardware
MISC./SURPLUS Saelig Company ..........................................................54
Syspec, Inc. .................................................................67
ActiveWire, Inc. ...........................................................68 Trace Systems, Inc. ....................................................28
Autotime Corp. ............................................................67 All Electronics Corp. ....................................................37
Front Panel Express LLC .............................................91
Catexa..........................................................................67
Earth Computer Technologies ....................................35 Halted Specialties Co. ...................................................3 TOOLS
Halted Specialties Co. ...................................................3 Microtech Source, Inc. ................................................67
Rogers Systems Specialist .........................................29 Resources Un-Ltd. ......................................................48 C & S Sales, Inc. .........................................................55
Surplus Sales of Nebraska...........................................27 Surplus Sales of Nebraska ..........................................27 Protek ..........................................................................44
Software
Catexa..........................................................................67 PROGRAMMERS WIRE/CABLE
Eptsoft Limited ............................................................12
IVEX ............................................................................22
Pioneer Hill Software ...................................................49
Amazon Electronics .....................................................68
Basic Micro, Inc. ..........................................................18
& CONNECTORS
Trilogy Design .............................................................86 Conitec DataSystems...................................................12 Jameco ........................................................................13
Intronics, Inc. .................................................................68 Linx Technologies .................................................43, 66
Microcontrollers / I/O Boards M2L Electronics ............................................................67 Microtech Source, Inc. ................................................67
Abacom Technologies..................................................34 microEngineering Labs .................................................39 Rogers Systems Specialist .........................................29
MARCH 2004 97
Full Page.qxd 2/3/2004 10:49 PM Page 98
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
Circle #145 on the Reader Service Card. 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 2/3/2004 10:55 PM Page 2
Circle #60 on the Reader Service Card. 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, capaci-
tors,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 Circle #145 on the Reader Service Card.
Cover.qxd 2/6/2004 2:56 PM Page 108
Vol. 25 No. 3
Nuts & Volts
INVERSE KINEMATICS: A UNIVERSAL ROBOTICS CONTROLLER
March 2004
0 74470 89295 3