Professional Documents
Culture Documents
Vol. 27 No. 7
NUTS & VOLTS
What can you do with eight 32-bit processors (COGs) in one chip? Real simultaneous multi-processing! The
new Propeller chip is the result of our internal design team working for eight years. The Propeller chip was
designed at the transistor level by schematic using our own tools to prototype the product. The Propeller is
programmed in both a high-level language, called SpinTM, and low-level (assembly) language. With the set
of pre-built Parallax “objects” for video, mice, keyboards, RF, LCDs, stepper motors and sensors your Propeller
application is a matter of high-level integration. Propeller represents the first custom all-silicon product
designed by Parallax. The Propeller is recommended for those with previous microcontroller experience.
Propeller users have already been hard at work developing Objects for the Propeller Object Library and discussing
Propeller programming on our online forums. To join in visit www.parallax.com/propeller.
To order online visit www.parallax.com/propeller. To order by telephone call the Parallax Sales Department
toll-free at 888-512-1024 (Monday-Friday, 7 a.m. to 5 p.m., Pacific Time).
July 2006
0 74470 89295 3
CoverInside.qxd 6/6/2006 1:01 PM Page 2
SONY Super HAD CCD B/W SONY Super HAD SONY Super HAD CCD Color
Weatherproof
eatherproof IR Camera CCD Color Camera Weatherproof
eatherproof IR Camera
•Day & Night Auto Switch •Weather Proof •Day & Night Auto Switch
•Signal System: EIA •Signal System: NTSC •Signal System: NTSC
•Image Sensor: 1/3" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super HAD CCD •Image Sensor: 1/4" SONY Super
•Horizontal Resolution: 420TV lines •Horizontal Resolution: 420TV lines HAD CCD
•Min. Illumination: 0Lux •Min. Illumination: 1Lux/F1.2 •Horizontal Resolution: 420TV lines
Item# VC-317D: $59.50 •Min. Illumination: 0Lux
Item# VC-805: $53.95
Details at Web Site > Miniature Cameras(Board,Bullet,Mini’s, B/W, Color) Item# VC-819D: $62.50
Visit our website for a complete listing of our offers. We have over 8,000 electronic items on line @ www.CircuitSpecialists.com. PC based data acquisition,
industrial computers, loads of test equipment, optics, I.C’s, transistors, diodes, resistors, potentiometers, motion control products, capacitors,miniature observation
cameras, panel meters, chemicals for electronics, do it yourself printed circuit supplies for PCB fabrication, educational D.I.Y. kits, cooling fans, heat shrink, cable
ties & other wire handleing items, hand tools for electronics, breadboards, trainers, programmers & much much more! Some Deals you won’t believe!
C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
Full Page.qxd 6/6/2006 1:08 PM Page 3
TOCJul06.qxd 6/8/2006 5:00 PM Page 4
40 18
46 08
J U LY 2 0 0 6
PROJECTS
and FEATURES ON THE COVER ...
36 LONG-RANGE STEREO This easy-to-build microphone setup
MICROPHONES can bring more than just our furry
Listen to faraway sounds using and/or feathered friends close up
this easily built microphone/ and personal.
amplifier assembly.
■ By J. Ronald Eyton
4 July 2006
Full Page.qxd 6/6/2006 1:48 PM Page 5
Link Instruments
PC-Based Test Equipment
Logic Analyzers
New LA-5000 Series
• 40 to 160 channels
• up to 500 MSa/s
• Variable Threshold
• 8 External Clocks
• 16 Level Triggering
• up to 512K samples/ch
• USB 2.0 and Parallel Interface
• Pattern Generator option
Digital Oscilloscopes
www.Link-instruments.com
July 2006 5
ReadFeed Pg 6 Jul06.qxd 6/7/2006 5:18 PM Page 6
Published Monthly By
ue. Before the test, one is told to short- T & L Publications, Inc.
circuit the capacitor with a 1K resistor 430 Princeland Ct.
Corona, CA 92879-1300
CONSTANT SOURCE to ground. What ground? Just short-
(951) 371-8497
OF IRRITATION? circuit it. And it says the time can vary
from 0 to 60 seconds. But there is no FAX (951) 371-3052
I am writing about the Constant such limit. And in the example using a Product Order Line 1-800-783-4624
www.nutsvolts.com
Current Sources article in the May is- current of 1 mA, the math actually uses
sue. I assume you will get many letters a current of 10 mA, and if the correct 1 Subscriptions
about this one. I have seldom seen such mA were used, the time would be 100 Inside US 1-877-525-2539
messed up articles. When I showed it seconds, well over the above limit of 60. Outside US 1-818-487-4545
to my wife, the first thing she did was One final comment — the article P.O. Box 15277
check to see if it was an April issue! says digital storage oscilloscopes are North Hollywood, CA 91615
All the figures show voltmeters virtually the only scopes manufactured FOUNDER/ASSOCIATE PUBLISHER
with high and low leads — what is the today. That is news to me, as I seldom Jack Lemieux
significance of these? The text for see advertisements for them, but ads
Figure 4 belongs with Figure 5. I think for the ordinary scopes are common. PUBLISHER
Larry Lemieux
the text for Figure 5 belongs to Figure Kenneth E. Stone publisher@nutsvolts.com
6. The circuitry in Figure 6 has Cherryvale, KS
nothing to do with potentiometers, ASSOCIATE PUBLISHER/
and there is no figure for them. The Writer Response: VP OF SALES/MARKETING
scope setup sounds complicated. In response to this letter that was Robin Lemieux
display@nutsvolts.com
In the part about measuring ca- critical of the May issue article on
pacitors, we find, "... the measured time constant current sources, thanks for CONTRIBUTING EDITORS
for the voltage across the capacitor to your reply. Yes, there was a piece of Chuck Hellebuyck TJ Byers
rise from zero to its rated value is pro- artwork that was inadvertently omitted Jeff Eckert Jon Williams
Peter Best Phil Davis
portional to the capacitance." The truth and this had a "displacement" effect Dave Prochnow Paul Verhage
is that the time for a rise to any partic- and adversely impacted subsequent Ray Marston Vern Graner
ular voltage is proportional to the ca- pieces of line art, as well as text, to Ward Silver Gerard Fonte
Ron Eyton Michael Simpson
pacitance. And the particular CCS used some degree, for which I apologize.
might not have a maximum voltage to As for the charging of a capacitor, CIRCULATION DIRECTOR
match the rated voltage of the capaci- the point that was to be made was that Tracy Kerley
subscribe@nutsvolts.com
tor. To do the test, I would use a a capacitor in an RC circuit charges log-
stopwatch and measure the time for the arithmically and after 5 tau (ô) or time SHOW COORDINATOR
Continued on page 98 Audrey Lemieux
PRODUCTION/GRAPHICS
Shannon Lemieux
ADMINISTRATIVE ASSISTANT
Debbie Stauffacher
PIC12HV615/PIC16HV616
Closed Loop Fan Speed Control
The Microchip name and logo, the Microchip logo, MPLAB and PIC are registered trademarks of Microchip Technology Incorporated in the USA and in other countries. © 2006 Microchip Technology Incorporated. All rights reserved.
VDD
Internal shunt
regulator allows
12, 24, 48V
operation
Actual data of the PIC12HV615/PIC16HV616
Fan Control Solution — Closed Loop Response
Timer1 gate Hardware PWM Typical Solution —
feature enables output for half- and Open Loop Response
all-digital period full-bridge drive Motor
and duty cycle
Drive
PWM sensing PIC12HV615
Control Internal pull-up PIC16HV616
resistors reduce Hall
RPM
component count Direct Hall element Sensor
interface with built-in
comparator hysteresis
reduces component cost
Programmable control for
customizeable features
such as:
• PID control PWM Control Duty Cycle
• Alert output
• Tachometer output
• Temperature-based control
• Failure detect and retry
Advantages of the PIC® Microcontroller Fan Now available for purchase on....
Control Solution: microchip
• Meets or exceeds the latest industry specifications DIRECT
www.microchipdirect.com
• Provides closed loop linear control
Get started with
• Software-programmable dynamic response the MPLAB®
In-Circuit
• High level of integration provides simplicity and cost savings Debugger (ICD)
• Offers high voltage support with integrated shunt regulator 2 Module for
only $159.99
• User-enabled comparator for hysteresis direct interface with a
TECH
2006
KNOWLEDGEY
EVENTS, ADVANCES, AND NEWS
■ BY JEFF ECKERT
ADVANCED TECHNOLOGY
SILICON DEVICE this considerably. The device can tion from the outer part. This implies
MODULATES LIGHT produce modulation in a distance of that when the disk — which is basically
only 80 micrometers, which is about a giant cloud of gas and dust — col-
PHOTO BY JENNIE TROWER.
a tenth of the distance required by lapses and forms planets, some of the
traditional silicon optical modulators. planets will orbit in opposite directions.
Once Chen’s devices are com- According to Anthony Remijan, of
bined with lasers on a silicon platform, the NRAO, “This is the first time any-
the chips could become a mainstay of one has seen anything like this, and it
consumer electronic devices, telecom- means that the process of forming
munication systems, biosensors, and planets from such disks is more com-
other devices, allowing higher speeds plex than we previously expected.”
and lower power consumption. The system was discovered
by Remijan and a colleague, Jan
■ Two voltage probes contacting RADIO TELESCOPE M. Hollis of NASA’s Goddard
the surface of the green silicon chip
with the photonic crystals where the SEES STRANGE SOLAR Space Flight Center (www.gsfc.nasa.
laser light’s transmission is slowed to SYSTEM FORMATION gov). The assumption is that
modulate it. this system contains material from two
different clouds instead of a single one.
TECHKNOWLEDGEY 20 06
■ Intel’s Core™ 2 Duo inch (25 mm) thick and weighs popular blog site to go down for several
processors are slated only 6.8 lbs (2.54 kg). hours. In addition, a spammer somehow
for arrival in the third It features a 2.16 GHz Intel derived the addresses of Do Not Intrude
quarter of this year.
PHOTO COURTESY OF INTEL CORP.
Core Duo processor and an members and bombarded them with
improved architecture that is said threatening messages, which in part
the Core™ 2 Duo to provide five times the perform- read, “You are receiving this email
processors for desk- ance of the PowerBook® G4, a because you are a member of Blue
top and notebooks 667 MHz front-side bus that is four Security. Due to the tactics used by Blue
PCs, respectively. The times as fast as the G4, and 667 Security, you will end up receiving this
chips are based on a newly designed MHz DDR2 SDRAM memory message, or other nonsensical spams
microarchitecture and will include two (expandable to 2 GB) that is twice as 20-40 times more than you would
processing cores per chip (hence the fast. The suggested (and generally normally.” As of this writing, the Blue
“Duo” addition). Intel will also call its observed) retail price is $2799. website is up and running again but is
top-end processor, aimed at gamers and still having a few operational problems.
other high-performance applications, SPAM WAR REACHES On the positive side, a 20-year-old
the Intel® Core™ 2 Extreme processor. NEW LEVEL (Jeanson Ancheta, a member of the
According to Intel, these devices Botmaster Underground) who was
will be built on a 65-nanometer design
and manufacturing process technology
that shrinks a processor’s circuitry and
Y ou may be familiar with Blue
Security, Inc. (www.bluesecurity.
com), purveyors of the Blue Frog appli-
prosecuted for hijacking computers,
damaging computer networks, and
sending waves of spam and viruses
transistors, thus producing both higher cation. Blue Frog basically enables you was recently sentenced to 57 months
performance and energy efficiency. to place your email address in the in prison, ordered to pay $15,000 in
They will include what is billed as the company’s “Do Not Intrude” Registry damages, and fork over $60,000 in
industry’s largest integrated memory and download the Blue Frog illicit gains to the government.
reservoir, called the Intel Advanced application. Blue Frog actively fights In addition, a court recently
Smart Cache, which includes an spam by posting opt-out requests on ordered Sanford Wallace and his com-
improved design for faster perform- the sites advertised by spam. pany — Smartbot.Net — to turn loose of
ance in memory-intensive applications. Users may report spam from any $4,089,500 that it derived from a spy-
The basic idea is that having a desktop email client or let Blue Frog ware scam. Apparently, the Internet will
common microarchitecture for the automatically report Gmail, Hotmail, remain a dangerous place for a long
consumer, gaming, notebook, and and Yahoo! spam directly from a time, but sometimes you win a few.
business desktop market segments will browser. It will send up to 1,000
make it easier for computer develop-
ers to create more efficient software
opt-out messages to the same
advertiser, thereby making his life
CIRCUITS
applications and provide the ability to almost as miserable as yours. AND DEVICES
share capabilities across all categories. According to the company, six out SLIMMER CELL PHONE
of the 10 most active spammers have
17-INCH LAPTOP stopped sending things to the “blue
INTRODUCED community” of more than 500,000
users. Unfortunately, though, some of
to make airline travel how engineered a ■ Samsung’s new X820 is billed as the
even more uncomfort- massive denial of world’s slimmest phone.
able is Apple’s new service attack on
17-inch version of the
MacBook Pro. But at
least it’s still only one
sites associated with
Blue, causing five
hosting providers in
I f you’re tired of people asking you, “Is
that a cell phone in your pocket or are
you glad to see me?” then you may be
the US and Canada, interested in Samsung’s X820, which is
■ Apple’s MacBook Pro
is now available in a major DNS only 6.9 mm (0.27 in) thick and weighs
a 17-inch version. provider, and a in at a mere 66 g (2.3 oz). It offers a
PHOTO COURTESY OF APPLE.
July 2006 9
Tech2006.qxd 6/6/2006 11:09 AM Page 10
functional keypad and a beveled cut for HIGH-SPEED DATA portable to make it suitable for both field
a natural grip, and the case is made of RECORDER INTRODUCED and lab use, the unit supports recording
fiberglass-infused plastic for strength and up to eight channels of isolated inputs to
weight reduction. It also includes a two-
megapixel camera, Bluetooth, an MP3
player, and a 176 x 220 color display.
T he new Dash 8HF from Astro-
Med (www.astro-med.com) is
a ruggedized eight-
an internal hard drive at sample rates of
up to 2 MHz with a bandwidth of 200
kHz per channel.
You may have to wait a while to channel data recorder The Dash 8HF
get one, though. It will be marketed that was engineered includes a 250 GB inter-
first in Russia and later in Europe, but specifically for captur- nal hard drive and a DVD
the company hasn’t mentioned the ing high-frequency burner for storing and
introduction of a US version as of this data and transient sig- archiving data. Other
writing. The best you can do in this nals. Ruggedized and features include 10/100/
country is the model T509, available 1000BaseT Ethernet for
from T-Mobile. It’s a relatively plump ■ Astro-Med’s Dash data upload and a USB
8HF is a portable data
9.8 mm (0.39 in) thick. Details are recorder for field or -MED,
INC. 2.0 port for archiving data
O
STR
available at www.samsung.com OF A to external drives. Free Windows-
lab use. OUR
TESY
TO C
PHO based AstroVIEW X software allows
data to be imported to a PC for analysis
and review. Using AstroVIEW X, a user
can import data to popular spreadsheet
and analysis programs including Excel,
FlexPro, DADiSP, and MathCAD with a
simple conversion command.
The system is built into a 16 x
12.125 x 6.628 inch (approx. 41 x 31 x
17 cm) case and weighs less than 21
lbs (7.8 kg). Operating on either 120 or
240 VAC, the device includes a capaci-
tive backup to ensure proper shutdown
without data corruption if power is lost.
Primarily designed for applications
in the automotive, electric utility,
telecommunications, pulp and paper,
metals manufacturing, steel mills, med-
ical, and other industrial, scientific, and
educational fields, it will set you back a
mere $14,750. An optional high-securi-
ty version is available for defense and
aerospace applications. NV
10 July 2006
Full Page.qxd 6/6/2006 2:06 PM Page 11
Q&A.qxd 6/6/2006 11:11 AM Page 12
■ WITH TJ BYERS
QA & WHAT’S UP:
A collection of serious questions
that took time to research finally
appear this month, a very cool
NASA website, and more phone
busy stuff.
A
There are two competing • R — Write once
Q
I have a Panasonic DVD DVD recording standards: • RW — Write/erase multiple times
recorder (model MDR-E50) DVD- and DVD+. Panasonic • DL — Dual layer
and I can’t figure out how to — along with Toshiba, Apple
make a recording. I mean, Computer, Hitachi, NEC, Pioneer, Sam- Write once is self-explanatory. You
which recording blank to use. I called sung, and Sharp — support the DVD- can write to the disc one time and one
Panasonic and they said to use -DVD format. The DVD+ format is supported time only. You can’t add stuff later or
from TDK. But I can’t figure out what by Philips, Sony, Hewlett-Packard, Dell, erase it. It’s now carved in stone. RW lets
that means. I’ve asked many sales per- Ricoh, Yamaha, and others. Sometimes you add to, write over, or erase the data
sons, and they don’t have a clue either. the two formats are interchangeable many times over (typically 1,000). Think
I will purchase a pack of 20 or more if between machines, sometimes not. of it as a big floppy. Dual layer means
I can be assured they are the right ones Both formats have extensions: you have two layers of recording media
for my recorder. How do they work and DVD-R, DVD-RW, DVD-RW DL, on a single side of the disc — almost dou-
how do you know which is which? DVD+RW, and DVD+R, DVD+RW bling the capacity from 4.7 GB to 7.95
GB. Then there are double-sided discs
Designation Write Multiple Layers/Sides Capacity (GB) DVD Forum No. where you can record on both sides —
like an LP record (if you can remember
DVD+R N Single/Single 4.7 DVD-5
that far back) — further increasing the
DVD+R N Single/Double 8.75 DVD-10 storage capacity. Currently, there is no
DVD+RW Y Single/Single 4.7 DVD-5 designation for double sides, only dual
layers. Still confused? Let your fingers do
DVD+RW Y Single/Double 8.75 DVD-10 the walking through Table 1.
DVD+R DL N Dual/Single 7.95 DVD-9
DVD+R DL N Dual/Double 15.9 DVD-18 ABOUT SCOPE PROBES
Q
DVD-R N Single/Single 4.7 DVD-5 Recently, I was given two
DVD-R N Single/Double 8.75 DVD-10 25-year-old Leader LBO-15A
DVD-RW Y Single/Single 4.7 DVD-5
oscilloscopes — dual-channel,
15 MHz. They both work.
DVD-RW Y Single/Double 8.75 DVD-10 Having never owned a scope, it would
DVD-R DL N Dual/Single 7.95 DVD-9 be nice to use them. However, neither
came with a probe and I don’t know
DVD-R DL N Dual/Double 15.9 DVD-18
much about selecting one.
■ TABLE 1. DVD Formats. — Frank Lemon
12 July 2006
Q&A.qxd 6/6/2006 11:11 AM Page 13
QU E ST I O N S & A N S W E R S
A
If I were you, I’d buy
10X Probe Oscilloscope Input
the 15085 TE scope
probe from Marlin P. 9M Coaxial Cable BNC
Jones & Assoc. (800- Probe
652-6733; www.mpja.com). It
has a bandwidth of 20 MHz and
sells for a low $7.95. (MPJA also 15pF 1M 50pF
sells scope probes going up to Compensation
200 MHz.) But that’s just the Adjustment
beginning. Unless you properly
compensate the probe, you will
be displaying the response of ■ FIGURE 1 Scope Probe
the probe itself and not your
circuit. Refer to Figures 1 and 2 for this five volts p-p.).
discussion.
The typical input impedance of an 4) Set the sweep rate to 1 ms/div.
oscilloscope — especially one of that
era — is 1 megohm with 50 pF to 100 5) Adjust the trimmer until the tops
pF. If you put this load across a and bottoms of the square wave are
high-frequency oscillator, not only will flat (Figure 2).
you shift the operating frequency with
the added parallel capacitance, but
you risk stalling oscillation altogether.
AUDIO AMP INPUT
Which is why selecting a good CONFUSION
scope probe is essential to accurate
Q
measurements. The October ‘04 issue
Most probes have an attenuation showed the details of a 700
factor of 10x. A 10x probe has the mW audio power amp using
effect of reducing capacitance by a an LM386. I noticed that your ■ FIGURE 2
factor of 10. The trade-off is that it also input to the amp is on pin 3 (positive
A
attenuates the signal by a factor of 10. input). When I looked at the National Look at the Equivalent
This means that 10 volts at the source Semiconductor datasheet, it shows an Schematic on page 1 of the
becomes one volt at the scope input. “AM Radio Power Amplifier” typical datasheet (Figure 3). You’ll
A 10x probe is made up of a 9 application where the input is on pin 2 see that the + and - inputs are
megohm resistor, a 15 pF trimmer (negative input). This is where I get con- mirror images of each other — mean-
capacitor, and a short length of fused — which is the proper input to use? ing they are interchangeable. What
coaxial cable (Figure 1). When added — George changes is the relationship of the input
to the 1 megohm resistance of
the scope, the probe tip reflects a ■ FIGURE 3
10 megohm load to ground. The
capacitance, on the other hand, is
subtractive, resulting in a reflected
load capacitance of 9 pF (with the
trimmer set to 11 pF).
The trimmer is used to compen-
sate for overshoot and undershoot
that is common when probing a
circuit. This is done in five steps:
A
+V +V For all in- you have a bunch of LEDs you want to
tents and light, and you want them all to be the
purposes, same brightness. This is a challenge
the diode- for most applications because
connected BJT (bipo- the brightness of an LED is directly
Rbias Rload
lar junction transis- proportional to its current flow.
Q1 Q2
Iref Iload tor) and current Sure, you could string them in
mirror are consid- series, but that increases the voltage by
Iref Iload
ered one and the the forward drop of the LED multiplied
Q1 Q2 same. While this by the number of LEDs. That is, four red
Rbias Rload circuit arrangement LEDs in series need at least six volts;
is often glossed over four blue LEDs ups the ante to almost
in college courses, 20 volts. When you only have five volts
without it the op- to work with, a current mirror (Figure 5)
Current Sink Current Source
amp would never is simpler than a boost switching regu-
have come to see lator. Moreover, you can mix and
Current Mirror ■ FIGURE 4 the light of day. In match the LED colors and not have to
fact, the LM741 is worry about their forward voltage drop.
waveform to the output. With the + riddled with them (you’ll find one in Of course, nothing’s perfect. In
input, the input and output are in Figure 3). Like you say, I don’t have the reality, the current flowing through
phase; with the - input, the input and ink to go into depth on the subject, but Q1 is equal to the collector current
output are 180 degrees out of phase. an overview I can do. plus the extra base current needed to
Generally, the + input is used, but This design starts with a transistor drive Q2. This is why it’s important
either will work. whose collector is wired to its base — that the gain of the transistors be as
essentially a diode junction. The cool high as possible, typically 300 or
MIRRORS YES, thing about a diode is that it maintains
a fairly stable voltage across the
more, to minimize the error.
Other configurations have been
SMOKE NO junction even as the current through it devised — using additional transistors
varies. In effect, Rbias establishes a — to take the load off Q1’s collector.
Q
I’m looking for an advanced constant current (Iref) through the Heat, too, plays a role because the for-
explanation — perhaps in- collector of Q1. Now if you couple ward voltage drop of the base-emitter
cluding some experiment the base of the first transistor to the diode is temperature-dependent, and
suggestions — of the so-called base of a second transistor, Figure 4, unless the two transistors are at exact-
diode-connected BJT and the current you create a current mirror. ly the same temperature, you’ll get
mirror. I’ve looked through all of my old Whatever current flows through an error. For further reading, go to the
college texts, the local communit y the base of Q1 also flows through the following websites.
college library, and my county public base of Q2, which, in turn, controls the
library, with no success. I don’t expect current flowing through the collector of www.4qdtec.com/csm.html
you to devote a full column, but any Q2. Here’s where it gets interesting,
pointers that you may be able to because the current through Q2 (Iload) www.allaboutcircuits.com/vol_3/
supply would be greatly appreciated. is equal to Iref. What’s more, Iload is chpt_4/12.html
— Joseph F. Richmond independent of the value of Rload!
Whether Rload is 1 ohm www.ece.cmu.edu/~ee321/
+5V ■ FIGURE 5 or 1,000 ohms, the current spring99/LECT/lect17mar12.pdf
through it will always be equal
R = 4.3/I
to Iref. What we have here is www.kettering.edu/~bguru/Pamp/
a way to control the current PA-04.pdf
220
through Q2 via Rbias. The
20mA circuit can also be rearranged
for current sourcing — shown
POWER SUPPLY
Q2 Q3 Q4 Q5 on the right — with no change DESIGN BOOKS
in performance.
Q
Q1
But the story gets even Regarding the question “Trans-
better. Theoretically, you can former Ratings, Again” in April
parallel as many Q2 transis- ‘06, you showed a group of
tors as you want — and they very useful equations. I would
Matched Current LEDs will all have the same collec-
tor current as Q1. Let’s say
like to go with more detailed theoretical
analysis and mathematical equations. I
14 July 2006
Q&A.qxd 6/6/2006 11:12 AM Page 15
QU E ST I O N S & A N S W E R S
am very interested to know full details works with the charges reversed — ■ FIGURE 6
about rectifier design. Could you please that is, a positive electrostatic
direct me to a good text book (old or image on a negative background.)
new) for that purpose? As the drum continues to
— M.J. rotate, it passes the toner car-
tridge. The toner contains a fine
A
Here are two books that go black powder, which clings to the
into depth on the subject. electrostatic image created by the
Both are available from laser on the drum. It then rolls
Amazon.com. over the paper, which has been
• Power Supply Cookbook, Marty given an even stronger electro-
Brown, Second Edition. static charge, and impresses the
pattern onto the paper. At this
• Reference Data For Radio Engineers point, a whisper can blow the
1977. Chapter 14. powder off the paper and smear
the image or create blotches. The imagine. I haven’t had the time to
RECYCLING LASER paper then passes through a fuser —
heated rollers which melt the
continue this path. But if you do, I’ll be
glad to publish what you discover.
PRINTERS powered toner onto the paper.
So what can you salvage from this?
WORKING WITH
Q
The laser column has been Generally, the rollers are the first to fail.
gone for years, and I miss it. These can be replaced from a mainte- LDO REGULATORS
New laser printers are so nance kit that runs between $20 and
Q
cheap these days, many are $50 for most printers — kits that let you Some time ago, you suggest-
being discarded rather than repaired. DIY (from www.fixyourownprinter. ed an ICL7663 adjustable
Do you know of any hobby use for the com/kits/all — among others). However, voltage regulator for a battery
laser parts? the technology is advancing so fast that operated application. And it
— Tom Grabowski the choice between buying a new print- worked great. Now I have another ap-
er versus repair usually results in the old plication that has the same requirements
A
First, you have to make sure printer being discarded at this point. — except for size. I’m limited to a very
you have a real laser printer What’s left are the cool stepper motors small case. I’m using a PIC16F628 and
and not an LED printer, which — make sure you scrounge the driver a nine-volt transistor battery. Is there a
uses the same paper feed and electronics, too — and a low-power low-power voltage regulator that does
drum mechanism. The construction of a solid-state laser diode that’s likely on its not require all of the resistors and caps
genuine laser printer is shown in Figure last leg. Also be aware that this is a of the ICL7663 design? Maybe an LDO
6. Look for the rotating/spinning mirror. strobed laser with a very low duty cycle. volt regulator is what I’m hoping for.
How does it work? When you Now, if you’re lucky enough to Any suggestions?
send an image of a document or a run across a newer laser printer, you’ll — Brad
picture to the printer, a low-level laser find an array of multi-beam laser
beam “draws” the image on the drum diodes — not the LED diodes I warned
using rotating optics. It generates a you about earlier. Each diode can MAILBAG
negative electrical charge — an elec- output as much as four watts and be Dear TJ,
trostatic image. (In some printers, this multiplexed in any pattern you can I need help regarding the “I’m
Busy!” phone-line indicator in the
March ‘06 issue. I have built two
of these and can’t get them
+
Phone Busy 3V
AA cells
to work. I have tried several
4.7M 4093 chips, components and
Indicator 4093 double-checked the soldering.
4093 4093 The output of the bridge goes
from -50.1 volts “on-hook” to
-8.8 volts “off-hook,” which is
200V
1A LED normal. If you have any sugges-
33K 1N4148
1N5245A 4.7M tions, please let me know.
15V — Roger Hamel KG8XC
Phone 4.7M
100
Line Response: The bridge
0.47
rectifier is backwards. Here
is the corrected schematic
■ FIGURE 7 (Figure 7). — TJ
July 2006 15
Q&A.qxd 6/6/2006 11:12 AM Page 16
A
The LDO (low-dropout) volt- wasted across the regulator as heat — needed an adjustable voltage source,
age regulator is probably the even across an LDO regulator. Since I used the LP2980-ADJ. Figure 8
most misunderstood of all the PIC dissipates 10 mW on its own, shows both designs.
voltage regulators. Many the wasted power amounts to almost
users think that because the voltage
between the input and the output is
half the power your battery has to give.
But that’s only half the story. Let’s
READER’S CIRCUIT:
200 mV or less, it will save power. Not take the 78L05, for example. Not only PHONE BUSY INDICATOR
true. Let’s use your nine-volt battery as must it dissipate your four volts, but it
an example. The 16F628 normally consumes 3 mA even when it’s not I have a circuit (Figure 9) which is
works at five volts and draws about doing anything but sitting there. Math simpler than the one published in the
says that with a nine- March ‘06 issue. It has fewer compo-
volt battery, that’s nents, and is powered by the phone
another 27 mW of line, so there is no battery. The
wasted power. This is transistors are high-voltage types, to
why the LDO was withstand the ringing voltage, and the
invented. To reduce LED is low-current. There is no diode
this wasted battery bridge, as this interface cannot be
power. used here in the UK. The phone
The proper way company employs automated testing,
to use an LDO is to and one test involves a low-voltage
match the input reverse polarity leakage test. If this
voltage to the output circuit is used with a diode bridge, it
voltage. The less volt- would upset the testing, which would
age the regulator has continue ad infinitum, flashing the
to waste, the more LED every few seconds. The circuit is
efficient your design taken from my book Telephone
and the longer the Installation Handbook.
battery will last. For — Steve Roberts
■ FIGURE 9 example, if you Bude, Cornwall England
16 July 2006
Full Page.qxd 6/6/2006 2:08 PM Page 17
• Click-to-ship in 5 days!
• Pay only for what you need
• Revision friendly
• Perfect for prototype and production
RabbitFLEX™ is an unique build system that gives you the Start developing now by ordering the
power to develop custom boards without the hassle and RabbitFLEX Tool Kit and your own
the cost. The RabbitFLEX simple-to-use web interface allows custom RabbitFLEX board. Take your
you to choose from numerous options such as digital I/O, solution to the next level.
analog I/O, serial ports, and Ethernet connections on your
custom board. Just configure and buy online and our patent Configure and Buy Online
pending manufacturing process will deliver your solution www.myrabbitflex.com
Quick-Turn Boards Range From RabbitFLEX Tool Kit
in a matter of days. With RabbitFLEX you will reduce design
risk, manufacturing cost, and development time.
$
149- 279 $ $
199
■ BY CHUCK HELLEBUYCK
GETTING STARTED WITH
THE LATEST IN PROGRAMMING MICROCONTROLLERS
PICs
DEVELOPING WITH A PIC
BOOTLOADER
IF YOU’VE BEEN A REGULAR READER OF THIS COLUMN and have started
to actually program PICs, you are probably tired of moving the PIC from
programmer to project and back again every time you make a change. It not
only damages pins, but can sometimes cause confusion if the PIC is put in the
board backwards or even shifted by one pin. This is why I like to develop with
a bootloader and it’s one of the most difficult items to explain to a beginner.
Option 2 — Bootloader
A bootloader is a custom binary
file pre-loaded in the PIC memory that
allows a PIC to program itself without
use of a hardware PIC programmer
discussed in Option 1. It does this
with special circuitry built inside the
PIC that generates the necessary
■ FIGURE 1 voltages internally. The PIC receives
18 July 2006
GetStartedWithPICs.qxd 6/6/2006 11:25 AM Page 19
G E T T I N G S TA R T E D W I T H P I C s
the binary file through its serial port similar to the in-circuit debugger ■ FIGURE 2
and then programs the internal included with the Atom module
program memory (without over- software that I’ve talked about in
writing the bootloader code). previous articles.
The bootloader software only The MCLoader is included
runs for about a half second. If it with the MCStudio Plus software
doesn’t see a new program arriving at and it gives you the .hex bootloader The value of “Char” is shown in
the serial port connection, it just files for many of the PICs that will Decimal, Hexadecimal, and Binary
jumps to the program that is in its run a bootloader. The MCStudio format at the point just prior to
program memory and runs that pro- standard version comes with executing the command highlighted in
gram. The catch is you need to get PICBasic Pro and you can download red. If you wanted to see the output
the bootloader binary file into the it for free from the mecanique port registers inside the PIC, such as
PIC first before you can run it. This website. The Plus version — which PortB, you would click on the
means you have to either buy a PIC includes the MCLoader and in-circuit Registers tab as seen in Figure 2.
with a bootloader programmed in or debugger — costs $49.95, but to me PortA, PortB, and PortC are
program a blank PIC with the boot- is well-worth the money. Let’s take a shown in Decimal, Hexadecimal, and
loader binary file using a PIC look at why this is such a great tool Binary format. If you have a command
hardware programmer module. So, in for the PICBasic Pro programmer and that is reading the port or driving the
other words, you need Option 1 in why I recommend it. port pins, then you can use this to see
order to get to Option 2. the status of the pins before or after
BOOTLOADER LIMITATIONS
Because the bootloader has to know what
frequency it’s running at to properly communi-
cate with the PC serial port, the bootloader can
only be set at one frequency. For example, if
you have a bootloader running on a PIC at 20
MHz, your program won’t run properly if you
compiled it for 4 MHz operation. You have to
adjust your program to run at the bootloader
speed or re-install a new bootloader that runs at
4 MHz. Most of the bootloader .hex files
which can be seen on the right of Figure 1. I entered the included with MCLoader offer a 20 MHz and 4 MHz
letter “u” and hit the enter key. At the bottom of Figure 1, resonator version for each PIC supported. They will
you see that the letter “u” was received and the hexa- even create a unique frequency version for you if you
decimal value of “$75” is shown next to it. This is the ASCII email them.
value for the small case letter “u.” Notice that you can also At the top of the sample program are two lines shown
see that value shown in the variable “Char” on the right of below.
Figure 1 in the variables window.
All this sample program does is receive an ASCII value DEFINE LOADER_USED 1 ‘ uses a bootloader
define OSC 20 ‘ *** SET THE CORRECT SPEED ***
from the PC and then send back the hexadecimal value to
G E T T I N G S TA R T E D W I T H P I C s
NEXT STEPS
I highly recommend you get a
bootloader to work with a
PIC16F876A or similar. Even if you
just use the directions Ron wrote out
for the PICLoader, you won’t have
to spend a lot of money. You don’t
have to use my RS232 bootloader
module, either. You can find them
from various sources — such as eBay
(www.ebay.com) — or just build your
own. RS232 chips can be found at
various electronic suppliers — such as
Jameco (www.jameco.com) — for
under $2.00.
If you did the project on serial
communication from several issues
back, you probably already have the
circuitry ready to roll; you just didn’t
know it could help you program the
PIC in-circuit also.
I hope I’ve helped clear some
of the confusion about bootloaders
without adding more. It’s just a
great method to use and industry is
using this for field programming more
July 2006 21
NutNVolt200607.qxd 6/6/2006 2:18 PM Page 22
Summer Kits
The Favorites
Solar Trickle Charger
Your vehicle or boat battery will
For
Passive Air Band New006 never be dead again! Leave the
Solar Charger pluged in and your
Aircraft Monitor 2 battery is constantly charged, free-courtesy of the
✔ Monitors the entire aircraft band without tuning! sun! Built-in polarity reversal protection and status
✔ Passive design, can be used on aircraft, no local LED. Battery clips and accy plug provided.
oscillator, generates and creates no interference! SOL5N Solar Trickle Charger $26.95
✔ Great for air shows
✔ Patented circuit and design! 20W Sub-Mini Audio Amp
For decades we have been known for our novel and creative product designs. Delivers a super clean 20W output
Well, check this one out! An aircraft receiver that receives all nearby traffic without from one SMT device! Super Class-D
any tuning. It gets better... there is no local oscillator so it doesn't produce, and design produces NO HEAT! Neat mini
can't produce, any interference associated with all other receivers with an LO. That round or square PCB design! Runs on 18 VDC.
means you can use it onboard aircraft as a passive device! And what will you hear? UAM2 20W Audio Amp Kit $34.95
The closest and strongest traffic, mainly, the one you're sitting in! How unique is
this? We have a patent on it, and that says it all!
ECG Heart Monitor
This broadband radio monitors transmissions over the entire aircraft band of 118- Provides visual and audible display
136 MHz. The way it works is simple. Strongest man wins! The strongest signal of your heart rhythm! Monitor out
within the pass band of the radio will be heard. And unlike the FM capture effect, displays your heart directly on your scope!
multiple aircraft signals will be heard simultaneously with the strongest one the Uses professional reusable probe patches.
loudest! And that means the aircraft closest to you, and the towers closest to you! Runs on a safe and standard 9V battery.
All without any tuning or looking up frequencies! So, where would this come
in handy? ECG1C Electrocardiogram Kit $44.95
1. At an air show! Just imagine listening to all the traffic as it happens Digital Voice Storage
2. Onboard aircraft to listen to that aircraft and associated control towers
3. Private pilots to monitor ATIS and other field traffic during preflight Provides up to 8 minutes of digital
activities (saves Hobbs time!) voice storage that can be broken
4. Commercial pilots to monitor ATIS and other field traffic as needed at down into 8 messages! Great for
their convenience announcements. Built in microphone.
SPECIFICATIONS
5. General aircraft monitoring enthusiasts BS2C Bullshooter-II Kit $69.95
Frequency Range: 118 MHz to 136 MHz
Wait, you can't use a radio receiver onboard aircraft Receiver Type: Patented Passive Detector
because they contain a local oscillator that could gen- IF Frequencies: None! HV Ion Geneator
erate interfering signals. Receiver Sensitivity: Less than 2 uV for detectable Generates a steady state DC volt-
audio age, 7.5kV DC negative, 400uA!
We have you covered on that one. The ABM1 has no Audio Output: 700mW, 8-24 ohms That’s lots of Ions! Feel the con-
local oscillator, it doesn't, can't, and won't generate any Headphone Jack: 3.5mm stereo phone stant blast of fresh air from the air
RF whatsoever! That's why our patent abstract is titled External Antenna: Headphone cord coupled cannons! Runs on 12VDC or our PS adapter.
"Aircraft band radio receiver which does not radiate Power Requirement: 9VDC battery
interfering signals". It doesn't get any plainer than IG7 HV Ion Generator Kit $64.95
Dimensions: 2.25” x 2.8” PC Board
that! Available as a through-hole hobby kit or a factory 2.5” x 4.6” x .9” Case
assembled & tested SMT version. Weight: 4 oz. with battery
Plasma Generator
Provides a stunning 25kV at 20kHz
ABM1 Passive Air Band Monitor Kit $89.95 from a solid state circuit! Build
ABM1WT Passive Air Band Monitor, Factory Assembled & Tested $159.95 your own plasma bulbs, generate 2”
sparks and more! Runs on 16VAC.
Digital Tuned High Performance For PG13 Plasma Generator Kit $64.95
Aircraft Band Receiver New006
2 Laser Light Show
✔ Rock solid dual conversion PLL receiver! Produces impressive laser light
✔ Airport runway lighting controller output! shows just like the big boys do!
✔ 4 user memory scanner banks, 20 freq’s each Variable pattern and speed con-
✔ Full band scanner with skip and skip/timer modes trols and an audio input to modulate the show to
✔ Internal front panel speaker your music! Uses standard laser pointers included.
✔ External antenna input, speaker out, headphone out
✔ Stylish and shielded black metal enclosure LLS1 Laser Light Show Kit $44.95
✔ Available as a hobby kit or factory assembled & tested
Professional features at a hobbyist price! To begin with, we designed it with the LED Strobe Light
latest technology, utilizing a rock stable synthesized PLL dual conversion receiver. We gave it Say goodbye to the fragile glass
superb image and adjacent channel rejection to allow you to lock onto the signals you want and not to be Xenon tube! High power LED’s
bothered by those you don’t! SPECIFICATIONS produce super bright strobe displays.
Frequency Range: 117.975 MHz to 137.000 MHz
Variable flash rate and audio input to
Once we got the RF portion designed we took a close sync the flash to your music. Runs on 12VDC.
25kHz steps
look at the features desired in such a receiver. We LEDS1C LED Strobe Light Kit $44.95
gave it a neat 2x8 line LCD display to show you all the Receiver Type: Dual Conversion PLL
functions. Control of modes and setups is obtained IF Frequencies: 10.7 MHz & 450 kHz
through the front panel controls and confirmed on the Receiver Sensitivity: Less than 1 uV across the band Signal Magnet Antenna
LCD display. On/Off/Volume and Squelch controls are Image Rejection: Greater than -80 dB
Super Hi-Q ferrite rod antenna with
also provided on the front panel. We even gave it a Adjacent Ch. Rejection: Greater than -40dB Faraday shield pulls in the signal and
front panel speaker in case you stack the lighting con- Scanner Banks: 4, 20 frequencies each removes the noise! Great results from
troller or something else on top of it! So far we’ve Audio Output: 1 watt, 8 ohms 500kHz to 15MHz. Super for the AM broad-
described the ultimate aircraft receiver that’s not only Light Controller Output: 3 events, 5 events, 7 events cast band...no more noise! Includes power supply.
the perfect field monitor for a hangar or airport man- output to controller
ager’s office, but for the serious enthusiast. Can it get Power Requirement: 12VDC, 500mA
SM100 Signal Magnet Kit $89.95
any better than that? It sure can! External Antenna: BNC female, rear panel
Dimensions: 5.55”W x 6.45”D x 1.5” H Touch Tone Reader
The top request we’ve had for a professional aircraft
receiver was to embed automatic runway lighting con- Captures dialed phone numbers,
trol. Consider it done! The lighting controller follows the standard protocol for remote runway lighting. The repeater codes, control codes or
pilot “keys” his microphone on the local CTAF channel for the specified number of times. All you need to do is anything that uses Touch Tone!
set the receiver for the lighting control mode, then make sure the squelch is closed and will open on a suitably Phone line and audio inputs. Runs on 12-15 VDC.
strong signal. Typically the number of “keys” or “events” according to the receiver control the lighting as fol- TG2C Tone Grabber Kit $69.95
lows: 3 events, 25% brightness; 5 events, 50% brightness; and 7 events, 100% brightness. The AR2’s
adjustable lighting timer sets turn-on duration to your needs. Includes the matching case and knob set and
power supply. For the aviation professional that is not interested in building the receiver, the AR2 and the light- Tickle-Stick Shocker
ing controller are also available factory assembled and tested, ready to go. Just plug it in and you’re all set. Extremely popular kit, produces a
AR2 Synthesized Aircraft Receiver Kit With Case & AC Power Supply $199.95 pulsing 80V tickle output with a telltale
AR2WT Factory Assembled & Tested AR2 Synthesized Aircraft Receiver $269.95 blinking red LED! And who can’t resist a blinking
AR2L Plug-In Runway Lighting Controller Interface Kit With Case & AC Power Supply $59.95 light! Great fun for your desk! Runs on 3-6VDC.
AR2LWT Factory Assembled & Tested AR2L Runway Light Controller $99.95 TS4 Tickle-Stick Kit $12.95
NutNVolt200607.qxd 6/6/2006 2:21 PM Page 23
The FM30 operates on a 13.8 to 16VDC and include a 15VDC plug in power sup-
ply. The stylish metal case measures 5.55"W x 6.45"D x 1.5"H and is a perfect
match with your computer to broadcast your music files throughout your house. If MORE than just friendly on-line ordering!
you're looking for a super performer without all the features of our FM100 series
transmitters, the new FM30 is for you! (Note: The end user is responsible for com- Clearance Specials, Ramsey Museum, User Forums, Dealer Information, FAQ’s, FCC
plying with all FCC rules & regulations within the US, or any regulations of their Info, Kit Building Guides, Downloads, Live Weather, Live Webcams, and much more!
respective governing body).
FM30B Digital Snythesized FM Stereo Transmitter Kit
CALL OR
CALL
TOLL-FREE
TO ORDER C&S SALES E-MAIL US
FOR OUR
FREE
(800) 292-7711 www.cs-sales.com CATALOG!
Create
Your Own
Exciting
Experiments
15 DAY MONEY
Guaranteed Lowest Prices C&S SALES, INC. BACK GUARANTEE
UPS SHIPPING: 48 STATES 7% 2 YEAR FACTORY
150 CARPENTER AVE • WHEELING, IL 60090
(Minimum $7.00)
OTHERS CALL FOR DETAILS (847) 541-0710 FAX: (847) 541-9904 WARRANTY
IL Residents add 8.75% Sales Tax E-mail: sales@cs-sales.com PRICES SUBJECT
TO CHANGE
SEE US ON THE WEB www.cs-sales.com WITHOUT NOTICE
24 July 2006
Page25.qxd 6/8/2006 10:16 AM Page 25
3mil Track
rack 0 . 1mm Plannar Antenna
Blind Via 0 . 5mm BGA Edged Half Hole
Http://EzPCB.COM
Sales@EzPCB.COM
July 2006 25
PersonalRobotics.qxd 6/8/2006 4:06 PM Page 26
■ BY PHIL DAVIS
PERSONAL ROBOTICS
UNDERSTANDING, DESIGNING & CONSTRUCTING ROBOTS & ROBOTIC SYSTEMS
PERSONAL ROBOTICS
■ PHOTO 3. CAD drawing of the placed in the hole that has the slight
turned rim and finished rim. counter sink which acted as a locater
and gave a better seal. Push the plunger
making up the tire mold: slowly until just a little of the fluid
comes out of the other hole, and then
• Two identical end caps. set it aside for about six hours. Oh, I for-
• The central tube. got, I also purchased Synlube 531 Wax-
• A threaded rod which holds it all Based Mold Release Agent with which
together. I sprayed the inside of the tube — do
not spray the rim. This, in theory, allows
For an idea of what the the rim and tube to separate easily,
unassembled parts look like, take a although I had to slide a feeler gauge
look at Photo 4. inside the rim to get it to come apart.
Assembly involves putting the So that’s it! Make two of these
threaded rod through the bottom and you have the wheels ready to
end cap (although you can’t see it, accept the Copal motor (see Photo 8).
the bottom of the bottom end cap is The next thing to do is to build a
counter sunk to take the head of the “Motor Block” which will hold the
threaded rod) and then placing the motor and wheel and, at the same
rim firmly on top of the end cap (see time, mount firmly onto the chassis
Photo 5). Photo 6 shows the tube in base. The wheel block was cut out
aluminum bar. place, ready for the top end cap. of aluminum and I had originally
Finally, the top end cap is put in intended to cut a slit and have a screw
• A tire, molded over the rim. place and the wing nut is tightened that would tighten it onto the motor.
down. We don’t want any of our Instead I got lazy, didn’t cut the slit,
The rim was designed to be casting material to leak past the end and glued the motor in place. In hind-
mostly hollow to allow the motor to fit caps (see Photo 7). sight, cutting a slit would have been
as far into it as possible; it looks a little Okay, the mold is completely the better mechanical design. Photos
like a thread spool which has been assembled and ready for the casting 9 and 10 show a CAD drawing of the
hollowed out (see Photo 3). material. Note that on the top end wheel block and a mock-up of the
Now, how do you cast a tire? cap, two small holes were drilled: one wheel system mounted to the block.
What do you use for a mold and what as input for the casting fluid and the This completes a wheel unit
substance do you use for the tire other for the excess to come out. The which may be screwed directly onto
itself? Let’s tackle the mold first. casting fluid I used is called Por-A- the chassis base with machine screws.
Mold (the two quart kit Por-A-Mold As a “self contained” unit, it may be
THE TIRE MOLD Soft Kit #33508-1308), which I
purchased online from DickBlick.com
removed and or replaced as a whole,
without affecting the rest of the ‘bot.
Just as the rim is custom turned, The soft version of this is fairly
so are the parts that make up the
mold. The mold forms an enclosure
sticky/gooey (good co-efficient of fric-
tion), and is very flexible and durable.
THE BASE OF THE
around the rim, leaving a vacant area I used an empty syringe without ‘BOT CHASSIS
where we want the rubber to be. the needle to carefully squeeze in a mix
These are the individual pieces of the casting fluid. The syringe was Finally! We get to build the base
■ PHOTO 4. Mold components ■ PHOTO 5. Mold partially assembled, ready ■ PHOTO 6. Mold partially
and rim. for the tube and top end cap. assembled, ready for the end cap.
28 July 2006
PersonalRobotics.qxd 6/6/2006 11:36 AM Page 29
PERSONAL ROBOTICS
■ PHOTO 12. Completed chassis ■ PHOTOS 13 and 14. Completed ‘bot with electronics and sensors.
with wheel system.
July 2006 29
Page30.qxd 6/8/2006 10:19 AM Page 30
• Over 40,000
Products
Stocked
• Access to over
1.5 million
electronic parts
and related
products
• Installer/Dealer
pricing program
• Quotation team,
send us your
quotes for quick
FREE ! response
Catalog
call toll free
1-800-543-4330
refer to or visit Experience Mouser’s time-to-market
www.mcminone.com/magazine advantage! Our vast selection of the
NEWEST products, NEWEST technologies,
no minimums, and same-day shipping on
most orders, gets you to market faster. We
make it easy to do business with Mouser! NEW Products
for NEW Designs
The NEWEST Semiconductors | Passives | Interconnects | Power | Electromechanical | Test, Tools & Supplies from Mouser Electronics
Source Code: NVM39 Mouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, and company names mentioned herein, may be trademarks of their respective owners.
30 July 2006
Full Page.qxd 6/8/2006 10:48 AM Page 31
TM
NewProductsJuly06.qxd 6/7/2006 5:16 PM Page 32
NEW
■ HARDWARE
■ SOFTWARE
■ GADGETS
■ TOOLS
P R O D U C T S
THE TENLAB The TR-50 is
available now at re-
cards, the PC installed with the DVRC-
TI series card doesn’t need to be
TR-50 sellers and distribu- dedicated. The DVRC-TI series cards
tors nationwide with a MSRP of $399. support triplex operation, any chosen
32 July 2006
NewProductsJuly06.qxd 6/7/2006 5:17 PM Page 33
■ H A R D W A R E ■ S O F T W A R E ■ G A D G E T S ■ T O O L S
White colors all operating at 12V. Both play, 51,000 Count DMM is the latest ranges and adjustable duty cycle, con-
whites use .96 watts for the 6” model, addition to its growing line of test and forms to IEC-1010-1 600V CAT IV and
2.16 watts for 12”, 3.84 watts for 24”, measurement instruments. The new 1000V CAT III, and it is CE approved.
and 7.68 watts for 48” lengths. Pure hand-held, battery powered DMM of- The new Deluxe Dual Display
white 6000K LEDs give off 52 lumens fers true RMS ACV and ACA, in addi- 51,000 Count DMM offers versatility
at 6” lengths, 116 lumens at 12”, 206 tion to many features that are useful for and reliability for a broad spectrum of
lumens at 24”, and 413 lumens at 48” troubleshooting complex electrical and bench-top and field applications. In
sizes. Warm White 3000K LEDs radiate electronic circuits. The Model 2890A addition to the unit’s two backlit five-
40 lumens for 6”, 89 lumens at 12”, 158 can also be used to test and evaluate digit LCD readouts that can display
lumens at 24”, and 317 lumens at 48” circuits in a field service application. both ACV and frequency simultaneous-
length sizes. Other varieties of LED col- The Model 2890A is the ideal tool to ly, the meter can be used to measure
ors are available for OEM customers. get the job done quickly and econom- DCV, ACV, DCA, ACA, OHM, diode
Along with each LED tube strip is a ically, and is a must for every tool kit. check, audible continuity, temperature,
mounting clip (MTG-CLIP-STP-001) that The Model 2890A’s features frequency, duty cycle, and pulse width.
snaps onto the back of the tube. Two include true RMS ACV and ACA, Compact (7.56” x 3.55” x 1.46”)
clips are provided per foot of tubing. AC+DC true RMS, five digit LCD for (192 x 90 x 37 mm), and light weight
Each clip has a location for a self tap- both primary and secondary displays, (2 lbs) (936 g), the unit is available for
ping screw that allows users to mount 21 segment analog bar graph, automat- immediate delivery. It is priced at
the LED tubing in different locations. ic polarity indicator, 0.025% basic DCV $305, and comes complete with 9V
Solid-state design renders LEDs accuracy, resistance measurements up battery, test leads, carrying holster,
impervious to shock, vibration, frequent to 500 MΩ, conductance measure- and manual. A complete line of
switching, and environmental extremes. ments up to 50 nS with 0.01 nS resolu- optional accessories is also available.
With an average life span of 100,000- tion, capacitance measurement, fre-
plus hours (11 years), LED lamps oper- quency with ACV measurement, data For more information, contact:
ate more than 20 times longer than the hold, dBm measurement, REL mode, 1 B&K Precision Corp.
equivalent incandescent lamp. LED ms peak hold for glitch capture, back lit Tel: 714-921-9095
lamps produce almost no heat and re- LCD, frequency counter up to 20 MHz, Fax: 714-921-6422
quire 80%-90% less operating power squarewave output with 28 frequency Web: www.bkprecision.com
than equivalent incandescents, making
them as friendly to the environment as
they are to the operating budget.
Prices for TBL3xxF series sealed
tube LED lights retail from $26.95 to
$108.35, depending on length. Large
quantity discounts are available.
Availability is stock to 4-6 weeks for
special requirements. TBL3xxF LEDs
carry a three-year limited warranty.
DELUXE DUAL
DISPLAY, 51,000
COUNT DMM
B &K Precision Corporation’s new
Model 2890A Deluxe Dual Dis-
July 2006 33
Page34.qxd 6/8/2006 10:20 AM Page 34
G
LUH QJ
TX U L
UH ROGH
G
6
LUH QJ
TX U L
UH ROGH
7KH(VFDSH5RERW¶VEXLOWLQ
6
PLFURSURFHVVRUHQDEOHVLWWR (/(&7521,&&$1'/(
FDQQRWEHEORZQRXWE\WKHZLQG6DIHIRU
³WKLQN´RQLWVRZQ
NLGVDQGSHWV*UHDWDWKRPHIRUSDUWLHV
;PDV+DOORZHHQHWF
PP:KLWH
ZDWHUFOHDU
/('9
PFG &RPSOHWH&DUG
0HORG\8QLWµ+DSS\
%LUWKGD\¶%DWWHU\DQG
SLH]RDOOUHDG\WRSOD\
VHFRQGYRLFHUHFRUGHUSOD\EDFN $VIRXQGLQ&KULVWPDV
PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH FDUGVDQGERRNV
ERDUG2QHEXWWRQWRUHFRUGWKHRWKHUEXWWRQ
MXVWKDVWREHPRPHQWDULO\SUHVVHGWRUHSOD\ 7KH9HOOHPDQ
3HUVRQDO6FRSH
WKHPHVVDJHSUHDVVHPEOHG
LVQRWDJUDSKLFDO
86%3,& PXOWLPHWHU
3URJUDPPHU EXWDFRPSOHWH
$VVHPEOHG SRUWDEOH
]LIVRFNHW RVFLOORVFRSHDW
LQFOXGHG WKHVL]HDQGWKH
)UHHVRIWZDUH FRVWRIDJRRG
PXOWLPHWHU
(OHFWURQLFVFRP7HO
(3DUN$YH&ROXPELDQD2+86$
1HZ7KH3&2VFLOORVFRSHWKDW
¿WVLQWKHSDOPRI\RXUKDQG
7KH3LFR6FRSH 3&2VFLOORVFRSHV
7KLVFRVWHIIHFWLYHVROXWLRQLVD3&2VFLOORVFRSHFRQQHFWHGDQG
SRZHUHGYLDWKH86%FRQQHFWLRQ(UJRQRPLFDOO\GHVLJQHG
WR¿WLQWKHSDOPRI\RXUKDQGWKLVLVWKHSHUIHFWSRUWDEOH
FRPSDQLRQIRUWRGD\¶VHQJLQHHURQWKHJR+DQG\WRWUDYHO
ZLWKDQGHDV\WRVHWXSIRUWKHQRYLFHDQGWKHSURIHVVLRQDO
WKH3LFR6FRSH SURYLGHWKHSHUIHFWVROXWLRQWR
\RXUWHVWDQGPHDVXUHPHQWQHHGV$VZLWKDOO3LFRSURGXFWV
OLIHWLPHVRIWZDUHXSJUDGHVDQGWHFKQLFDOVXSSRUWDUHDYDLODEOH
IUHHRIFKDUJH
8SWR06VUHDO 6XSSOLHGZLWK3LFR6FRSH
WLPHVDPSOHUDWH 3LFR/RJDQGELW
SURJUDPPLQJOLEUDULHV
8SWR0+]
EDQGZLGWK &RPSDWLEOHZLWK:LQGRZV
6(0(DQG;3
'LJLWDO(76HQKDQFHV
UHSHWLWLYHVLJQDO NVDPSOHEXIIHU
VDPSOHUDWHWR*6V V
WX
3LFR6FRSH WDF
&RQ GD\
3UHVHQWHGLQDKDQG\SURWHFWLYHFDVHSHUIHFWIRU\RXUWRROER[
6LQJOH&KDQQHO6FRSH6ROXWLRQV WR
6WDUWLQJDW
ZZZSLFRWHFKFRPKDQGKHOGQY
34 July 2006
Full Page.qxd 6/6/2006 2:33 PM Page 35
Eyton.qxd 6/6/2006 10:50 AM Page 36
PROJECTS ●●●●
■ THIS MONTH’S PROJECTS
Stereo Microphones . . . . . . . . .36 LONG-RANGE
S T E R E O
Control Your World — Part 2 . . .40
■ FIGURE 1. Three views of “Big Mike” showing the arrangement for the two
Friends, birders, 24-inch microphones fastened about 18 inches apart on a simple altazimuth
mount. The center tube is an optional Galilean telescope.
electronics
enthusiasts, lend
me your ears
so that you may
listen to faraway
sounds using
these easily built
long-range stereo
microphones.
(with apologies to
William Shakespeare
and Mark Anthony) ■ FIGURE 2a
36 July 2006
Eyton.qxd 6/6/2006 10:50 AM Page 37
BY J. RONALD EYTON
July 2006 37
Eyton.qxd 6/6/2006 10:53 AM Page 38
■ FIGURE 6a
(see Figure 4) using with lenses you can order from them.
“BIG MIKE” four-inch PVC pipe A second, smaller system, based
PARTS LIST as a pier. The optical
telescope in the
on the same principles as Big Mike, was
constructed as a handheld unit (Little
QTY ITEM/DESCRIPTION middle between the Mike) and is shown in Figure 7. This
❑2 24 x 3 inch PVC pipes two mics is not project makes use of readily available
❑2 3-inch PVC hub-to-hub couplings necessary, but if you components and a small wooden
❑2 3 x 1-1/2 inch PVC hub-to-hub pipe increasers
❑2 Two-inch PVC soc caps
are looking for an mount that requires only a little cutting
❑2 Two-inch diameter funnels from set obtained at excuse to make and and gluing. The two microphone/ampli-
American Science & Surplus (www.sciplus.com), use a Galilean fier assemblies (see Figure 8) are the
part number 91078 (You will need to order two telescope (which type you find in household gadget cat-
sets of four funnels to get the two funnels you provides a correct, alogs with names that include “Sonic”
need — these are hard to find and this set is
inexpensive @ $1.75 per set.)
right-side-up view), and “Super Ear.” They work quite well,
❑2 1/2 x 24 x 8 inch pieces of foam camping mattress this is a reasonable but the earphones accompanying them
pad or any other similar material suitable for construction oppor- are wired for mono listening with the
sound dampening tunity. The catalog single microphone/amplifier.
❑1 36 x 4 inch PVC pipe (pier) from Anchor A little cutting and soldering will
❑1 Four-inch PVC hub x hub coupling (pier)
❑1 Four-inch PVC hub closet flange (for base of pier)
Optical Surplus allow you to connect the left earphone
❑1 Velleman MK136 “Super Stereo Ear” mini kit (www.anchoropti to one microphone/amplifier and con-
(“boosts sound 50 times”) cal.com) has instruc- nect the right earphone from the same
❑1 Stereo headphone tions for building a headset to the other microphone/ampli-
Miscellaneous wood boards, hardware, and glue Galilean telescope fier so you can listen in stereo. And yes,
■ FIGURE 7. Photo of “Little Mike” con- ■ FIGURE 8. Pair of “Sonic Super Ears” ■ FIGURE 9. Rear view of “Little Mike,”
structed from two 13-inch long, two-inch used for the microphone/amplifier showing the two-inch outside diame-
diameter PVC microphone tubes mount- systems. The plastic case of one of the ter polyethylene foam pipe insulation
ed nine inches apart on a 12 x 5-1/2 x 3/4 microphone/amplifier systems is shown inside the PVC tubes. The microphones
inch wooden platform using 1/4 x 1/4 inch cemented into a 2 x 1-1/2 inch PVC pipe with foam covers (see Figure 8) fit
mounting rails and cable ties. increaser using Gorilla Glue. nicely into the 1-1/4 inch inside
diameter core of the polyethylene foam
pipe insulation inserts.
38 July 2006
Eyton.qxd 6/6/2006 10:52 AM Page 39
July 2006 39
Simpson2.qxd 6/6/2006 10:56 AM Page 40
●●●●
A while back, I
was researching
sensors for a project
CONTROL YOUR
WORLD
I was working on
when I came across
a little device called
a CMUcam.
PART 2 — Interface Your PC to
The CMUcam is a the CMUcam
low-cost vision
sensor developed T here are two versions of the
CMUcam being sold now: the
perfect for creating web pictures, but
it works great for an image sensor
by Carnegie original CMUcam and
CMU2cam2. I will concentrate on the
the with an RS232 interface.
Mellon University lower-priced CMUcam, but with slight Where Can I Get
modifications, the code presented a CMUcam?
(www.cmu.edu). here will work with both cameras. The
CMUcam has a resolution of 80 x 143 You can’t get a CMUcam
pixels. This low resolution may not be from Carnegie Mellon directly; you
The CMUcam has both must purchase it from a licensed
an RS232 level interface, Z EUS
manufacturer/distributor.
The CMUcam fully-assembled
as well as a TTL level ■ This article uses a Basic program- can be purchased from Images SI,
serial interface so you ming language called Zeus. Zeus is a
simple Windows programming
Inc., at www.imagesco.com This
camera comes with a small cable
can connect it to your environment that specializes in and will cost you about $109.
interface design. A special Nuts &
favorite microcontroller Volts version of the software is
The CMUcam2 camera comes
in a couple of variations, which can
or directly to a PC. available free, along with the
application and source downloads on be purchased from Acroname at
the Nuts & Volts website (www.nuts- www.acroname.com The camera
volts.com). A couple compiled appli- I interfaced was a CMUcam2+,
cations are also provided for those and does not include a RS232 level
who don’t want to play with the code. converter. The camera and level
This article will not present the
actual source code for space consid-
converter will run you about $181.
erations. The actual source code is None of the cameras come with
included in the download and has a printed manual. You will have to
plenty of comments that explain the download the latest manual from the
sections where appropriate. web. The manual will have all the con-
nections and jumpers for the
camera, as well as a list of all
■ FIGURE 1 the interface commands. The
CMUcam2+ comes with a
hookup sheet since it has a
different hardware layout
than the CMUcam2.
The Interface
The camera I purchased
40 July 2006
Simpson2.qxd 6/6/2006 10:57 AM Page 41
BY MICHAEL SIMPSON
July 2006 41
Simpson2.qxd 6/6/2006 10:57 AM Page 42
the form when the alarm is triggered. mine the direction the object is moving.
Figure 5 shows such a dump after I The CMUcam2+ supports five ser-
turned on a light that caused the vos and four I/O ports. The camera also
alarm to trigger. has a sleep mode to conserve power.
You could also modify the The CMUcam has only a single servo
ProcAlarm function to return different hookup. The CMUcam2+ is also much
codes based on which color actually faster than the CMUcam and outputs a
tripped the alarm. better quality picture in poor lighting.
Read the CMUcam manual and The downside to the CMUcam2+
take a look at the many other com- is that if you want to control the cam-
mands. The camera has a servo connec- era with a PC or Pocket PC, you will
tor and commands to control it. You can need a RS232 level shifter.
even set up the camera to track objects. Which is better? It all comes down
to how much you want to spend.
The CMUcam2+ Other than the RS232 level shifter, the
CMUcam2 will do everything the
There are command differences CMU2cam will do, but it costs nearly
between the CMUcam and the $80 more and has a bigger footprint.
CMUcam2. I have included three I have included two CMUcam2
■ FIGURE 5 CMUcam2 program files that will source files. They are called CMU2
work on a CMUcam2 or CMUcam2+. LowResDump.txt and CMU2HighRes
output should look like the form in I thought it important to describe Dump.txt. This will get you started
Figure 4. a few of the differences between the with the CMUcam2 if you decide to
CMUcam and the CMUcam2+. go that route.
Going Further The CMUcam2+ has two resolutions. As a bonus, I created three
The lower resolution is 87 x 143 and applications with ZeusPro. The first is
Okay, so we can trigger an alarm; the higher resolution is effectively 175 a fancy version of the CMUcam alarm
let’s take a look at CMUProgram4.txt. x 254, regardless as to what the program for the CMUcam2. This
Here, we made a few slight modifica- manual states. program will dump the image that
tions to the ProcAlarm function. The The CMUcam2+ buffers the inter- triggered the alarm to disk in the form
function now returns 1 when an alarm nal images so that when dumped, it will of a 350 x 255 jpeg.
is triggered and 0 if not. not blur. There are also several more The other two programs are small
We also added a function called tracking commands for automated web servers that will dump an image
SnapShot that dumps a frame on to tracking, as well as feedback to deter- every 60 seconds and serve it up over
the Web if requested by a browser. Not
to leave anyone out, I created both
CMUcam and CMUcam2 versions.
HobbyEngineering It is already built for you. The
applications, as well as the source can
The technology builder's source for kits, components, supplies, tools, books and education.
be found on the KRMicros website at
www.krmicros.com/Development/
Robot Kits For All Skill Levels ICs, Transistors, Project Kits ZeusPro/ZeusPro.htm
Motors, Frame Components What Else Can You Do?
and Scratch Builder Supplies.
The CMUcam has one servo
Order by Internet, phone, fax or mail.
connector and the CMUcam+ has
www.HobbyEngineering.com five. By mounting the camera to one
Books and 1-866-ROBOT-50 or more servos, you can utilize some
1-866-762-6850 of the built-in auto tracking features
Educational K 1-650-552-9925 or, at the very least, use Zeus to pan
1-650-259-9590 (fax)
sales@HobbyEngineering.com
and tilt the camera.
180 El Camino Real Experiment and have fun, and be
BEAM Kits and Components Millbrae, CA 94030 sure to visit the “Control Your World”
Visit our store near SFO! forum at www.kronosrobotics.com/
forums/viewforum.php?f=21 NV
Most orders ship the day received! World-wide shipping. Convenient payment options.
42 July 2006
Full Page.qxd 6/6/2006 2:35 PM Page 43
#1 in Price.
Lowest prices in the industry.
Absolutely. Positively. Guaranteed!
#1 in Availability.
Unbeatable turnaround on all your orders.
Over 99% of items are on-shelf and ready to ship!
#1 in Choice.
Major name-brand components—plus...
Exclusive generic equivalents for even greater savings!
They’ve got what you want! See for yourself, right now, at www.Jameco.com/NVN
July 2006 43
Page44.qxd 6/8/2006 10:21 AM Page 44
SpectraPLUS 5.0
FFT Spectral Analysis System
44 July 2006
Full Page.qxd 6/6/2006 2:37 PM Page 45
Log on to
www.jaycarelectronics.com/catalog
for your FREE catalog! New
410+ page
1-800-784-0263 Catalog
(Monday - Friday 09.00 to 17.30 GMT + 10 hours only).
For those who want to write: 100 Silverwater Rd
Silverwater NSW 2128 Sydney AUSTRALIA
Graner.qxd 6/6/2006 2:07 PM Page 46
●●●●
The TrainSaver is
a device that THE TRAINSAVER
D I G I T A L
reduces wear and
tear on model
train locomotives
used in commercial
environments.
ELECTRONIC TRAIN
The TrainSaver maximizes
the life of the engine by CONTROLLER
only running the train on
timed intervals, and only It All Started I began to mull over the
when people are present With a Hankerin’ problem and decided I should be
able to rescue the train from
for Bar-B-Que ...
to view the train’s abandonment while maybe at the
The PokeJo’s BBQ restaurant same time enhancing its value to
performance. This reduces that my fellow workers and I the restaurant. A few inquiries with
the cost of ownership frequent here in North Austin, TX, a local hobby shop showed there
has a nifty electric train that cir- might also be other applications for
of the train system by cumnavigates the entire restaurant. such a solution in enhancing the life
increasing the life of the As we entered the establishment
one afternoon, we noticed the train
of other toy trains used in commer-
cial environments. It seems that
engine. The device also was missing! A short chat with the the motor and gear train in many
adds synchronized sound manager revealed the train would
break down from continuous use
consumer grade trains are not
designed for the continuous use to
effects to enhance the and had to be sent to a repair shop. which they are put when placed in
Moreover, the cost of repairing the a commercial venue. Since there
train’s visibility to train engines had gotten high are a limited number of hours their
the audience. enough that the management had gearboxes and motors could
canceled plans to add trains to any provide, we needed to find a way
of their other locations to get the most out of them.
and was even consider-
ing retiring the existing Is it Train Time Yet?
train from our favorite
restaurant! Initially, my design revolved
around various
timer circuits to
A CKNOWLEDGEMENTS reduce the total
■ I would like to thank the following amount of time
people who were critical in making the the train spent in
TrainSaver a reality: Jim Huggans, Sharon a powered condi-
Sudduth, Nic Graner, Paul Atkinson, tion (presumption
Denise Scioli, The Robot Group of Austin, being less run
and the good folks at the PokeJo’s time = longer life).
BBQ restaurant. I built a simple
Prop-1™, BASIC Stamp® are
555 timer circuit
registered trademarks of Parallax, Inc.
to start and stop
46 July 2006
Graner.qxd 6/6/2006 2:08 PM Page 47
BY VERN GRANER
July 2006 47
Graner.qxd 6/6/2006 2:08 PM Page 48
48 July 2006
Graner.qxd 6/6/2006 2:08 PM Page 49
July 2006 49
Graner.qxd 6/6/2006 2:09 PM Page 50
50 July 2006
Graner.qxd 6/7/2006 2:35 PM Page 51
Stop Train
• Check if the idle time has expired. If Testing ...
so, add a lap. Testing ...
is This
• Check if the IR beam is broken. If so, Play Crossing Bell
Thing On? Play Whistle
decrement a lap.
Now that we
• Check if the motion is sensed, if so, had implemented
Idle=Idle+1
reset sleep time. all the functions Yes
in a complete
• Increment all time counters. program, it was Yes
time to set up the Motion=True? Yes RoomIdle=0
The program takes quite a bit of system and test it
space in the Prop-1’s memory, but I out on my work- No
managed to get all the functions in bench. The first
that I was seeking and still had enough thing needed for RoomIdle=RoomIdle+1
Yes
room to add both a diagnostic mode testing is power. I
to help align the IR beam sensor and a used a nine-volt
motion sensor walk test. At the time of 500 mA filtered
RoomIdle=15mins? Yes Rest=TRUE
this writing, the program provides the power supply to
following operations: run the microcon-
troller to insure it
1) Provide a test/calibrate mode for had clean power. Idle=10mins? Yes Laps=Laps+1
the IR LED beam. Make sure the
switch on the Idle=0
No
2) Provide a walk test mode for the Prop-1 is set to
motion sensor. the 0 position,
then connect the Laps = 0?
3) Read the button and add a number transformer to the
of laps when pressed. Prop-1 power No
connector. Now
4) Decrement laps whenever the train we need to con-
IR=unblocked?
passes through the IR beam. nect the unit to
the train like this:
No
5) If the train is idle for a preset time,
then the train runs a single lap. • Connect the Yes
GND wire from IR=blocked?
6) If room is empty for preset time, the train trans-
put the train to sleep. former to the No
GND connector
7) Play a sound when the train starts of the Prop-1. Play Click/Clack
■ FIGURE 12. Logic
up (Train Whistle). flow chart for the
• Connect the Laps=Laps-1 TrainSaver.
8) Play a sound when the train stops positive wire from
July 2006 51
Graner.qxd 6/6/2006 2:09 PM Page 52
the train transformer to the positive from the website shown at the end MaskTime: This value is set in
connector for the train track. of this article). Once the source milli-seconds and reflects how long
code is loaded, locate this section you want to ignore the IR beam-break
• Connect the negative connection near the top of the program shown sensor after it is tripped. This value
on the train track to “output 5” on the in Listing 1. setting is critical if you are unable to
Prop-1. (Be careful not to dislodge the These settings should be set the IR beam sensor so it stays
jumpers between outputs 5, 6, and 7!) examined and understood before interrupted the entire time the train
changes are made. To better under- and cars are present. You will need to
WARNING: Check the polarity of stand these settings, here are some set this value to cause the sensor to
the train transformer output and short summaries of the settings and wait until the entire train has passed
make SURE you do not reverse the what they do: the sensor before decrementing a lap.
voltage provided to the Prop-1 screw
terminals! Reversing the polarity (by TrainIdleTarget: This value is used to Credit: This value determines how
placing the train transformer into determine how long you want the many laps are added to the train for
reverse) can destroy the ULN-2803 or train to wait between automatic laps. each press of the button. If the button
other components! If you believe The default value is 10 minutes. The is replaced with a coin mechanism,
there is a danger of this occurring, you idea is to reduce the total amount of this can be used to determine how
might want to place a 1N4001 diode runtime on the train engine while still many laps are given in return for a
in series with the train power source to having the train perform often enough coin. Most coin mechanisms have a
block reverse voltage from the circuit. to be interesting to observers. If the SPDT switch that is used to detect
train were to run continuously, it the coin. Simply replace (or wire in
Turn on the train transformer and would not only wear the train out parallel) the coin switch with the
set the speed to approximately 50%. sooner, but people would rapidly existing NO pushbutton.
Now, turn the switch on the Prop-1 to lose interest. In a restaurant situation,
the 1 position. having the train run on 10 minute LapLimit: This allows you to limit how
intervals means an average patron will many total laps may be added to the
WARNING: If you use the 2 see three to six laps during an average train. This value was added to limit
position it will attempt to join your meal. how many laps could be added
wall-wart supply to that of the train if someone pressed the lap-button
power supply! This could destroy the RoomIdleTarget: This value is used to repeatedly. In our testing, we
Prop-1 controller! determine how long the performance discovered that sometimes the staff
area of the train remains empty before would rapid-press the button multiple
Once you have the Prop-1 the train is put to sleep. This further times adding lots of laps (i.e., 10 or
showing power, it’s time to down- reduces the total runtime accumulat- more rapid presses at five laps each!).
load the program. Open the Parallax ed by the engine and also gives the This insures that we don’t over run
BASIC Stamp Editor and load the staff a break from the sounds the train the train.
source code (available for download makes.
Once you’ve adjusted these
LISTING 1 settings, download the code to
the Prop-1. If the download is suc-
‘————————————————————————————————————————————————————— cessful, hold down the lap button
‘ Initialize Train System Variables
‘—————————————————————————————————————————————————————
and press the reset button on the
HIGH LED ‘ Turn off the LED in the button Prop-1. The program checks to
SYMBOL TrainIdleTarget = 10 ‘ Minutes of idle before a lap is added see if the lap button is in a down
‘ for the train to run (values 0-254) position on startup. If so, it will
SYMBOL RoomIdleTarget = 15 ‘ Minutes without motion before the train
‘ is put to sleep (values 0-254)
enter a calibrate mode where it
SYMBOL MaskTime = 1000 ‘ How many MS to wait b4 we check for the simply illuminates the indicator
‘ end of the train after beam-break. LED when the IR beam is intact,
SYMBOL Credit = 5 ‘ Number of laps added by a button press and then extinguishes the LED
‘ (or coin drop) when the beam is broken. This
SYMBOL LapLimit = 9 ‘ Set the maximum number of laps that may
‘ be added allows those of us who cannot
SYMBOL TicksPerMinute = 4000 ‘ 4000 ~number of ticks that pass in a minute see into the IR spectrum to
‘ Note that if you alter the loop length you align the LED IR source with the
‘ will have to recalibrate. phototransistor sensor across the
SYMBOL TunnelDelay = 6000 ‘ Delay from end of train till stop execution
‘ (allow train to traverse tunnel) track.
Now that you can see the
52 July 2006
Graner.qxd 6/6/2006 2:09 PM Page 53
July 2006 53
Graner.qxd 6/6/2006 2:10 PM Page 54
causing the train to halt without buzzing sound each time that a
AUTHOR BIO parking in its assigned location (the false lap was detected. With more
■ Vern Graner is a Senior tunnel). Something was obviously investigation, we discovered that this
Systems Engineer with a Software wrong ... but what? crock pot had an old thermostat that
Company in Austin, TX. Though We double-checked the connec- was arcing and generating lots of
married with two kids, he still finds tions and checked the software but noise! It appeared that the interfer-
everything seemed to be set up ence was being picked up by the IR
time to create electronic projects in
correctly. While I was going over the sensor wire and being interpreted by
his so-called “spare time.” You
source code, my son mentioned that the software as the train breaking the
can contact him via email at
a crock pot on a shelf below the beam!
vern@graner.com
train transformer would make a Based on this theory, I added a
few lines of code that would check
the state of the IR sensor and make
sure it stayed in a “beam is broken”
state for at least 100 samples before
it would acknowledge the reading as
valid. Once the False Detection
code loop was added, the false laps
disappeared! Problem solved and the
TrainSaver was done!
Future Expansion
Though I’m happy with the
current incarnation of the TrainSaver,
I’ve already been brainstorming about
future improvements to this device.
For example, the pushbutton switch
could be replaced with a coin box
that would allow patrons to drop a
coin to receive a preset number of
laps from the train. This would allow
the owner of the train system to
recoup some of the inevitable cost of
repairing or replacing a train engine
when it wears out. An external speak-
er could be placed inside a tunnel or
in a fake building near the station
where the train stops so the sounds
would appear to come from the
vicinity of the train.
You could opt to reduce the
number of sounds (i.e., remove the
click/clack) and dedicate that pin to
controlling a relay that would switch the
RESOURCES
■ Vern Graner’s “TrainSaver” website
www.trainsaver.com
■ Parallax, Inc.
www.Parallax.com
54 July 2006
Graner.qxd 6/6/2006 2:10 PM Page 55
July 2006 55
ShowcaseJul06.qxd 6/8/2006 10:02 AM Page 56
SHOWCASE
What’s New
In The Forums?
If you haven’t been to the Nuts & Volts
forums lately, you’ve likely missed out
on a lot of great discussions.There are
over 3,300 registered users and
the number is growing daily. There are
over 36,000 posts covering every
electronics topic imaginable.
Site: www.vandvmachy.com Here are some recent topics that
email: victor@vandvmachy.com
have been in discussion.
USA Office: Blink Manufacturing 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
➥ Playing CD-Rs in older DVD
Cuarto Piso, Santa Monica, Tlal. Edo. De Mexico, 54040
Tels. 011 52(555) 314 5325 & 011 52(555) 360 3648 players
➥ Voltage Regulation
Fax. 011 52(555) 361 5996.
HSC#80806 $24.50
Tripplite Outlet Strip, 5 ft. long ♦ "AVPOD 203" audio/video cable
Slo-Syn Stepping Motor Sound Activated Neon H.V. Electrolytic Capacitor ♦ 8 ft. long, white jacket, gold RCA’s
Model SS-25, 120V, .3A HSC#20794 $39.95 Light for your PC! 2700 uF, 450VDC ♦ 1 double-shielded video, 2 audio
HSC#20725 $26.95 HSC#20441 $9.95 HSC#80809 $9.50
HSC#80807 $29.50
Since 1964!...
Silicon Valley’s BEST place to shop for Electronics!
Three Retail Stores to serve you! Order Toll-Free: 1-800-4-HALTED (442-5833)
Look for us on...
Main Office - Mail Orders... or...ONLINE AT: www.halted.com
3500 Ryder St., Santa Clara, CA 95051 Terms: Some quantities limited; all items are subject to prior sale. Minimum order: $10.00
Santa Clara 1-408-732-1573 seller ID: plus shipping. Orders under $30.00 subject to $3.00 handling fee, in addition to shipping.
Sacramento 1-916-338-2545 hscelectronicsupply All orders shipped by UPS Surface unless otherwise specified. $7.50 UPS charge added
for COD. Visit our website for detailed information on domestic and international shipping.
Rohnert Park 1-707-585-7344
58 July 2006
Fonte.qxd 6/6/2006 11:00 AM Page 59
B Y G E R A R D F O N T E
July 2006 59
Fonte.qxd 6/6/2006 11:00 AM Page 60
RADAR BASICS
Acquisition and
Targeting Radar
A
s most folks know, radar (distance to target) is the most
(RAdio Detection And critical factor. This is pretty obvious
There are two general classes of
Ranging) came of age in World when you think about it. A transmit- radars: acquisition and targeting. The
War II. And everybody knows that ter’s signal decreases by the square acquisition radars are the big,
radar sends out a radio signal that of the distance. Twice the distance stationary, long-range kind while the
bounces back from an object. The means one-quarter signal strength. targeting radars are usually smaller,
range (distance away) of that object But the return signal decreases by portable, and shorter range (some-
is determined by timing how long it the square of the return distance, as times being the guidance system of a
takes for the echo (return signal) to well. So, the return signal decreases weapon). They have two different
come back. Most everyone has seen in strength to the fourth power of the functions.
huge parabolic antennas rotating in distance. So, doubling the distance Acquisition radar is used to
detect objects from a long distance
circles, scanning the sky for incoming to the target results in 1/16 of the
away. Since the object is a long way
airplanes or missiles. At the least on signal being returned (all else being off (sometimes thousands of miles),
TV and the old sci-fi movies. Many equal). its position, relative to the radar,
radar systems use such antennas. It’s for this reason that radar can’t change all that much in a few
But some don’t. transmitters are immensely power- seconds. For that reason, acquisition
It’s also important to remember ful. They can transmit very short radar only illuminates (or “paints” or
that the antenna performs two func- pulses (about 50 μS) that are tens of “lights up”) an object once every
tions. It acts as a transmitting anten- megawatts and more. For example, revolution of the antenna (which is
na for the out-going pulse and as a the AWACS (Airborne Warning And typically every few seconds or so).
For reference, a airplane moving
receiving antenna for the return sig- Control System) klystron-type trans-
at 700 mph, or the speed of sound at
nal. This means that the transmitter mitting tubes are rated at 50 sea level, only travels about 1,000
must be disconnected (or turned off) megawatts peak pulse power. Since feet per second. A 2,000 or 4,000
during the time you want to listen for the pulses are short and the repeti- foot difference at 100 miles is not
a return signal. Otherwise, any return tion rate (or pulse rate) is about too significant. Acquisition radars are
signal will be overwhelmed by the 1,000 pulses per second, the aver- the typical types shown in the
transmitting pulse. Additionally, age power is much less — about 250 movies and were the types used in
precautions must be made so that to 500 kilowatts. But that’s still plen- WWII.
the receiver front end isn’t damaged ty powerful. Of course, not all radars Targeting radars are used to
guide weapons to a target.
or destroyed by the powerful trans- are this powerful. Some portable or
Sometimes these are ground-based
mitting pulse. weapons radars are only a few watts.
radars and sometimes these are
Let’s examine the basic radar In order to locate an object, both incorporated into the weapon itself.
geometry and design factors. Signal its range and direction need to be A “guided” missile is one that is
strength is a critical factor in the determined. The range is obviously directed by ground-based radar to a
performance of any radar system. determined by the delay of the return target. A “homing” missile directs
Obviously, if you can’t detect the signal. The direction is determined by itself from the radar reflection.
return signal, you can’t detect the where the antenna is pointing. If this Note that a homing missile can
object. The more powerful your trans- seems rather crude, you’re right. use a ground-based radar to illumi-
mitter is, the greater the potential Directional sensors measure the nate the target. And in the early days
of radar this was very useful because
range of the radar. The larger the elevation angle and the azimuth angle
it meant the missile didn’t need
transmit/receive antenna, the (compass heading). a radar transmitter. However, if the
greater the range. The larger the Naturally, the radar antenna illumination signal was lost for
target (called Radar Cross Section or must be properly aligned and cali- whatever reason, the missile would
RCS) the stronger the return signal brated so that its elevation and “lose track” (or “lose lock”) and fail
and the greater the range. While not azimuth angles agree with the real to hit the target.
obvious, the longer the wavelength, world (or with the ship’s bow or Additionally, it meant that a
the less signal loss there is. So lower missile’s flight direction). The angle ground radar was dedicated to that
frequencies are better. (However, sensors are often “synchros” or target for the duration of the missile’s
flight. That’s not a problem if there
lower frequencies mean larger and “resolvers” which are a special
are only a few slow airplanes coming
heavier antennas.) type of transformer and will not be at you. But with today’s vast numbers
Of all these factors, the range discussed further.
60 July 2006
Fonte.qxd 6/6/2006 11:01 AM Page 61
Radar System
Signatures
Since radar systems are
expensive to design and devel-
op, there are a limited number
of systems in use around the
world today (perhaps a few
hundred). Clearly, it is important
to know what particular radar
system you want to defeat
before you can design a particu-
lar defense or countermeasure.
There are a handful of
characteristics that identify a
given radar system. The first is
the frequency of operation. The
second is the pulse length. The
July 2006 61
Fonte.qxd 6/6/2006 11:01 AM Page 62
62 July 2006
Fonte.qxd 6/6/2006 11:02 AM Page 63
Relative Intensity
you (your computer actually) create
a return signal of your own. Figure 3
shows such a constructed return
signal. Real
Then you transmit this false Main lobe
return signal at just the proper time
in the radar signature so that the
largest return signal appears on a
radar side lobe. The radar system
assumes that the largest return signal Time
occurs in the main lobe. But in this
case, it isn’t. The radar antenna is
actually pointing in a significantly The field of EW is usually broken basic approaches described here fall
different direction from you. The down into ECM (Electronic Counter into the ECM category. There are
error can be as much as 30 methods for reducing the
degrees. So, if this acquisition effectiveness of jamming,
radar directs a weapon at chaff, and false targets.
you, it’s really pointing in the
“EW is like a chess These methods are ECCM.
wrong direction. (Figure 4 game. Every move by EW is like a chess game.
shows how this happens.) Every move by one side
If that weapon has a one side is answered is answered by the other
targeting radar, it is very side. The competition will
likely that it will never by the other side.” continue until the day that
achieve lock-on because you humans have thought up
will be out of its field-of-view. every possible method of
With proper timing, these false Measures) and ECCM (Electronic ECM and ECCM. That day appears to
return signals can be made to Counter-Counter Measures). The be in the far future. NV
“move” at any speed or direction
(within limits). Multiple false targets
with multiple headings can be
generated with a single side lobe
transmitter. Such an approach can
be used, to a degree, with targeting
radars, as well. But it is harder
because of the higher pulse rates
and because targeting radars don’t
re-acquire the target and expose
their side lobes as much.
Other Topics
This article barely scratches
the surface of this topic. There is
much, much more. Phased-array
and doppler radars have their
own strengths and weaknesses.
Stealth design and some tactical
maneuvers can cause problems for
radars.
July 2006 63
NewsBytesJuly06.qxd 6/8/2006 3:46 PM Page 64
A SNIP HERE, A
NEWS BYTES you can put your band saw in the cor-
■ NEWS ■ I N N O VAT I O N S ■ IDEAS
I
Pioneer, NBC, ABC, Ford, and unsoldering every
f you’ve been looking for that
JVC, NASA and thousands part trying to guess at
of independent service
perfect electronic design system
where the short is?
technicians. (EDS) software package, then look no
$209
further than McCAD. Published by
Inexpensive enough to pay for itself in just Your DVM shows the same shorted reading all VAMP, Inc. (www.mccad.com) — a
one day’s repairs. At $209, it’s affordable. along the pcb trace. LeakSeeker 82B has the company whose name sounds like a
resolution to find the defective component. bad (or, good) vampire website URL —
And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker McCAD has been around for over 29
guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now years, making McCAD one of the
thing you can lose is all the time you’re you can locate a shorted part only a quarter of original PCB CAD programs.
currently spending on trying to repair all an inch away from a good part. Short can be
those dogs you’ve given up on.
Originally, McCAD was only avail-
from 0 to 150 ohms
able for the Mac OS. Today, there is both
CapAnalyzer 88A LeakSeeker 82B a Mac OS X version and a PC Microsoft
Available at your distributor, or call 561-487-6103 Windows (98/ME/NT/2000/XP) version.
Electronic Design Specialists www.eds-inc.com Whichever version you opt to
use, the McCAD EDS enables the
circuit designer to create schematic
diagrams, capture these designs into
PCB layouts, and generate Gerber-
format files. Additionally, there is an
auto-routing feature that will help you
quickly add traces to your layout.
NEW! HIDmaker FS for Full Speed FLASH PIC18F4550 And McCAD EDS is a snap to learn
Creates complete PC and Peripheral Both PC and Peripheral programs and use. Just click, drag, and drop from a
programs that talk to each other over understand your data items (even odd large library of readymade analog and
USB. Ready to compile and run! sized ones), and give you convenient digital outlines. Or, if you have an unusu-
• Large data Reports variables to handle them. al IC pinout, you can edit and create
• 64,000 bytes/sec per Interface PIC18F Compilers: PICBASIC Pro, your own McCAD-compatible outline.
• Easily creates devices with multiple MPASM, C18, Hi-Tech C. You won’t get stumped using
Interfaces, even multiple Identities! McCAD EDS, either. There is ample
• Automatically does MULTITASKING PIC16C Compilers: PICBASIC Pro,
• Makes standard or special USB HID MPASM, Hi-Tech C, CCS C. online documentation for supporting the
devices McCAD EDS. Both web-based files and a
NEW! “Developers Guide for USB HID PC Compilers: Delphi, C++ Builder, couple of hefty PDF files will help to
Peripherals” shows you how to make Visual Basic 6.
answer any software usage question. In
devices for special requirements. HIDmaker FS Combo: Only $599.95 fact, within a couple of hours of installing
the McCAD EDS you can have your first
DOWNLOAD the HIDmaker FS Test Drive today! PCB template reading for etching.
www.TraceSystemsInc.com If you’re willing to live within a
301-262-0300 couple of restrictions on pin number
64 July 2006
NewsBytesJuly06.qxd 6/8/2006 9:59 AM Page 65
and board dimensions (6” x 6”), then • US Modular (www.usmodular.com) is portable hard drive, US Modular offers
you can use the McCAD EDS for FREE also entering the USB drive market with the Dragon Drive. This is a 2.5” exter-
— either the Mac OS or Windows ver- the Stainless Steel Monstor Drives. Priced nal hard drive enclosure which enables
sion. There is also a FREE Gerber File from $99 for the 2GB flavor, the Monstor anyone to “build it yourself” — a high
Viewer for 274-x format plotting docu- Drive fits in the palm of your hand, capacity portable storage device. The
ments. None of these FREE packages requires no extra software drivers, and Dragon Drive turns any 2.5” hard drive
employs any other form of file crip- runs on both Mac and PC computers. into a convenient portable storage
pling or expiration date system. Just There are 2GB, 4GB, and 8GB Monstor drive that can be used on any system
stay within the restrictions and you can Drive options currently available. with a USB or Firewire port. The
design schematics and PCBs for FREE. aluminum casing protects the drive
Otherwise, professional designers • Now, if you’d rather “roll your own” from overheating and vibration. NV
can elect — at anytime — to upgrade
the FREE versions of either McCAD
EDS format for under $1,100. Atmel AVR based Micro64/128
BRIEFLY NOTED Embedded Controller Module
8-Channel Analog to Digital Convertor
Real Time Clock/Calender
29 Digital I/O
SPI & I2C Bus
Two Serial Ports
The OpticSlim M12 Plus Serial Boot Loader
draws power from your PC
USB port. Photo courtesy of RS-232, 422 or 485
Plustek, Inc.
Selectable Baud
1/2+.'4#&'
:%.75+8'.;(14 &XVWRP&RPSXWHU
5
3,&LVDUHJLVWHUHGWUDGHPDUNVRI0LFURFKLS
6HUYLFHV,QF
H[W
FFV#FFVLQIRFRP
7HFKQRORJ\,QFLQWKH86$DQGLQRWKHUFRXQWULHV ZZZFFVLQIRFRPSLFF
Choosing a
HEATSINK — by H. Ward Silver
et's face it — if this article was titled, “Thermal Analysis,” you might
L
Introduction
put off reading it! But choosing a heatsink? Everybody understands what
that’s all about, right? To make that choice, you have to do a little thermal
analysis (gotcha!), but if you can do Ohm’s Law, you already know how!
of voltage and heat flow (P) takes °C/W, which looks a little strange
the place of current. The new symbol until you consider that resistance is
Any time current flows through a — θ — represents thermal resistance, really “volts per amp.” As more
conductor, energy must be dissipated analogous to electrical resistance; power flows through a thermal
in the form of heat with the power — something you’re already quite resistance, the temperature drop
Pd = I2R. (For superconductors, R = 0.) familiar with. The fundamental across it increases; ‘a’ and ‘b’ are two
It’s also true that when a voltage drop equation for heat transfer looks just physical locations and the heat flow
and current flow exist at the same like Ohm’s Law: occurs between them.
time — Pd = V x I. Heating from current What happens if several different
flow is present everywhere in an ΔT = Ta - Tb = Tab = P x θab thermal resistances are encountered
electrical circuit, but by far most of the by the heat flow? Just like electrical
heat is generated within electronic T acts as a “heat voltage,” P like a resistance, the thermal resistances
components. “heat current,” and θab as “heat sum in series. The total thermal
An electrical component gets rid resistance.” T is usually specified in resistance is θ = θ1 + θ2 + ... + θn.
of heat by transferring it to the °C and P in watts. θ is specified in Temperatures at the junction of the
surrounding air. The heat can pass
directly to the air from the surface FIGURE 1. Basic heat transfer is very FIGURE 2. If the heat must flow through a
of the component or a heatsink can similar to Ohm’s Law for resistance. sequence of materials, then the thermal
be used. Either way, if too much resistance of each material sums together,
V just as electrical resistors in series do.
heat builds up, the component can a
be damaged. Most of the time, Total θ = θ1 + θ2 + θ 3
only a few components have a Voltage
Source V I R ΔV
heavy heat load — pass transistors,
driver ICs, solenoids. Nevertheless, θ1
you’re the circuit designer, so Vb
you’re responsible for figuring out ΔV = I x R
which components need to be
cooled and how to do it. θ2 T
Ta Tn
Choosing a HEATSINK
the duty factor of the current. components from the heat-
TABLE 1 For example, if a resistor only carries generating junction to the surround-
Heat Generation in Common current in pulses that are on one-tenth ing — or ambient conditions — is
Electronic Components of the time, multiply Pd by 0.1. written as θja.
For semiconductors, you’ll have This is sometimes referred to as
● Resistor — Pd = I2 x R = V2 / R = V to figure out the average current flow the free-air thermal resistance because
xI and voltage. This can seem daunting it represents the total thermal
in AC circuits, but there is a shortcut resistance between the junction and
● Diode, SCR, or TRIAC — Pd = Vf x that overstates the heat load, leading the ambient air, including all of the
Iavg where Vf is forward voltage drop to a conservative design. For example, intervening package and mounting
and Iavg is average forward current
let’s estimate the heat dissipation in a material.
rectifier that is on for one half-cycle Components made from
● Transistor — Pd = VCE x IC (bipolar)
and off for the other half-cycle. semiconductors such as silicon or
Pd = VGS x ID (FET)
Multiply the peak current by the max- gallium arsenide must be kept cooler
imum forward voltage — this assumes than some maximum temperature
● Inductor, Capacitor, Transformer —
full heat generation whenever the (Tjmax) or the device will be destroyed
Pd = I2 x RLOSS
diode is conducting — then divide by melting or damaged by having its
● Solenoid or Relay — Pd = I2 x RCOIL by two to account for the 50% duty internal structures overheat and
factor. diffuse or migrate. For devices
This overstates the actual made from silicon, the maximum
thermal resistances can be calculated amount of heat generated, which temperature is 125 to 150 °C.
just like voltages in a voltage divider, reaches the maximum value at the To determine what the
as shown in Figure 2. (Yes, there are peak of the current, but is less at maximum temperature inside a
parallel heat circuits, too.) other times. If you design for the esti- device will be, start by looking up θja
The discrete thermal resistances mated heat load, your components in the device’s data sheet and
in series represent the flow of heat will run much cooler. Heating in calculating how much power it
through a series of materials. For other AC circuits can be estimated in will be dissipating during use. The
example, in winter, the heat in your similar fashion. junction temperature will be:
house flows first through the air inside, For estimating an IC’s power dis-
then through the inner wall, through sipation, total the power dissipation Tj = Tambient + P x θja
the insulation, and through the outer from each significant source of heat
wall to the ambient air outside. The — usually the output circuits. If you find Tj will be less than Tjmax,
larger the total thermal resistance, Calculate the power assuming the IC then no heatsink is needed. Be careful
the less heat is lost for any given output is a transistor. Don’t forget to when selecting your ambient temper-
combination of inside and outside include power dissipated by the IC’s ature. Inside an equipment enclosure,
temperatures. Conversely, if you like other circuitry — multiply the power the actual ambient temperature at the
the temperature high or it gets colder supply voltage times current drawn surface of the component may be
outside, you’ll lose more heat because by the IC. quite a bit higher than room tempera-
ΔT is larger. ture. You must also include a safety
Does Your Device factor — 25 percent or 35 °C is often
How Much Heat Does a Need a Heatsink? used.
Component Generate? Let’s say that you find your
Resistors and capacitors generate device’s Tj to be too close to the
Power dissipation in resistors is heat throughout or along their bodies. limit. Either P or θja must be reduced.
pretty easy to calculate, but what They are rated for some maximum To reduce P, you’ll have to change
about semiconductors and ICs? For continuous power dissipation (Pdmax) the circuit design. If you decide to
components where the resistance such as for a half-watt resistor. Pdmax is reduce θja, you’ll have to figure out
isn’t known or changes — such as for also specified at a specific ambient how to pass heat more effectively
an FET — you can’t easily use I2R. temperature because that determines through the component’s outer
In these cases, use V x I. And that the temperature at one end of the surface.
works for resistors, too! Table 1 component’s thermal resistance You must now split θja into two
shows a list of equations for heat string. thermal resistances in series: θjc — the
generation in some common elec- Diodes and transistors generate thermal resistance from the junction
tronic components. heat in the very small volume of the to the outer surface (which you can’t
If a resistor is carrying AC current, junctions or channels that conduct change) and θca — from the case to
use RMS values for voltage and current. This is generally referred to ambient (which you can change). θjc is
current. For either DC or AC currents as the “junction” and is abbreviated the thermal resistance from the
that are intermittent, multiply Pd by as ‘j.’ Thermal resistance in these junction to the case of the transistor,
68 July 2006
Silver.qxd 6/7/2006 9:45 AM Page 69
Choosing a HEATSINK
which might be a metal tab or just the power the component will dissipate. IERC 7-340-2PP-BA is a nice choice,
external plastic surface. This is illustrat- Since θjc is fixed, calculate maximum with a 7 °C/W rating. The margin
ed in Figure 3. case temperature: of 1.4 °C/W also allows for a
small additional amount of thermal
Picking a Heatsink Tcmax = Tjmax - P x θjc resistance in the insulating pad
required between the IC and
One way to cool a component is Estimate the ambient temperature. heatsink.
by moving air across its surface, The required thermal resistance of the
keeping Tambient low. You can use a fan heatsink is then: You might decide that the
or even orient the component so heatsink is too big (it’s about a cubic
that natural convection keeps air θca = (Tcmax - Tambient) / P inch) or too expensive (single
moving across the hot surface. This quantities are $1.75). In that case,
technique is limited to power From the catalogs or websites you must allow a higher junction
dissipation of about one watt or less, of heatsink manufacturers, you can temperature or figure out how to
particularly in small components that now select a heatsink that has reduce the power dissipation in
have small surfaces. both the right θca and fits in your the regulator. You could also lower
For larger amounts of heat, a enclosure. the ambient temperature. Any of
heatsink is required to lower θca. these three will allow you to use
Heatsinks can be anything sufficient- An Example of a heatsink with a higher thermal
ly massive and thermally conductive Heatsink Selection resistance. If you’d like more
to conduct heat away from the information on heatsink selection,
component. Almost any metal A common heatsink application heatsink manufacturer Aavid-
object can be used as a heatsink, is dissipating heat from a pass transis- Thermalloy has published a short
including printed circuit board tor or voltage regulator, such as the tutorial on picking heatsinks
ground planes and the equipment common 7805. (Download the 7805 at www.aavidthermalloy.com/tech
chassis. You don’t have to use a data sheet from www.datasheet nical/papers/semisize.shtml
manufactured heatsink! archive.com) Let’s say the 7805 will
Semiconductors that are intend- drop the input voltage from 12V to Summary
ed to dissipate heat have packages 5V at its output with a peak sustained
designed for use with a heatsink. For current load of 0.5 amps. We’ll That’s the basic process: Figure
example, in the TO-220 package, also assume that the inside of the your heat load, specify the maximum
the semiconductor sits directly on electronics enclosure will be 33 °C or temperature, determine the thermal
a metal tab that is electrically 10 °C higher than room temperature resistances involved, and go shopping!
connected to the device. The TO-3 of 23 °C. Eventually, you’ll become skilled at
package is completely metal and is managing heat — both in reducing its
also electrically connected to the • Start by calculating total heat dissi- generation and in getting rid of it. And
device inside. Why electrically con- pation: PD = (VIN - VOUT) x I = 7V x 0.5 you can chalk it all up to thermal
nected? To avoid an intervening A = 3.5 W. Without a heatsink, this analysis. NV
layer of material that would increase regulator will get mighty toasty!
thermal resistance. The aggravation FIGURE 3. Total device thermal resistance
of having a non-isolated package • Look up the 7805 junction to includes internal and external resistance.
is well worth the improved heat case thermal resistance: Codi
transfer efficiency. Electronics specifies it as Rj-c = 5 Tj
The heatsink’s thermal resist- °C/W. Junction
ance in °C/W tells you how much
the surface temperature (not the • If we set maximum junction
junction temperature) of the temperature at 80 °C, then Tcmax Internal θ jc
attached component will rise per = Tjmax - P x θjc = 80 - 3.5 x 5 =
watt of heat. Assume that this is a 62.5 °C. Case θ ja ΔT ja
value based on a natural convection
figure. Using a fan lowers the • The heatsink’s thermal External θca
heatsink’s thermal resistance. High resistance must be no larger
power heatsinks will have values of than θca = (Tcmax - Tambient) / P =
θca that are specified for different (62.5 - 33) / 3.5 = 8.4 °C/W. Ambient
amounts of air flow. Ta
To select a heatsink, start by • Browsing the Digi-Key
specifying a maximum junction selection of heatsinks (www. Total θ ja = θ jc + θca
temperature. Calculate the amount of digikey.com), I found that the
July 2006 69
Full Page.qxd 6/6/2006 2:43 PM Page 70
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.
1
$ 75
audio cables. Gold-plated,
electronics and molded RCA plugs. Color-coded 1.52" x 0.68" x 0.18" thick. UL.
power tools. CAT# SRLY-10 each
2
$ 95
plugs and labels. 10 for $1.50 ea.
Includes hardware kit to CAT# AVS-31
permanently install Power each
Station in your vehicle. 100 for $2.00 each 12 VDC 800 MA WALL
* Stage One Clean Power to reduce interference. TRANSFORMER
* Built-in cooling fan for optimum performance. LASER POINTER / PEN 2.1mm i.d. coax power plug.
* Audible overload alarm and LED status indicators.
Center positive.
* Gold-plated contacts for maximum conductivity.
* Complete hard-wire install kit included. Good-looking, good quality, ball point pen
CAT# DCTX-1280
* Dual outlet design provides ability to run multiple
devices simultaneously.
* 6.50" x 4.75" x 2.50".
CAT# INV-300
$ 49 95
each
with a bright push-button laser built into the
back end. Metallic-grey pen was a promo-
tional item for a medical company whose
$ 505
each
logo is imprinted on it. Replaceable ink car-
tridge and batteries. 4 AG3 batteries are
PRECISION DC MOTOR
CELLPHONE / CAMERA / Faulhaber 2342.39054.
included. Individually boxed. Excellent price
MP3 CASE Quiet, powerful little
Attractive, ballistic nylon case
fits most cell phones, small
digital cameras and
for a laser pen of this quality.
CAT# LP-100
3
$ 50
each
25 for $3.00 each • 100 for $2.50 each
DC motor. Operates
effectively 3-30 Vdc.
12 Vdc, 70 mA no
MP3 players. Includes a load rating. Overall length without shaft,
removeable carabiner 12 VDC 500 MA 2-STAGE 48mm. Motor is incased in a black aluminum,
that lets you attach keys heat-sinking sleeve with a 30mm square
CHARGER FOR LEAD-ACID mounting bracket on one end. Mounting holes
or other items to the case.
A nylon clip on the back of the case can be BATTERIES on 25mm centers. 2mm diameter shaft
used as a belt clip or attachment to a purse. Designed to maintain extends 12mm on one end of motor. Other
Multiple pockets allow you to carry more than maximum performance end has 11mm diameter gear with 18 teeth.
just a phone - perhaps your MP3 player, or from your sealed lead 90mm wire leads.
other electronic devices. Magnetic front pocket
flap for easy access. Larger middle pocket has
acid batteries. Dual stage
output and regulated current
CAT# DCM-274
6
$ 00
each
$ 503
a zipper for even more security. control to insure that no damage
CAT# CSE-44 10 for $3.00 ea. occurs while battery remains on charger.
24 X 1 LCD
each "Fast-charge" cycle of 15Vdc, 500mA Wintek# WDC2401P-1GNNA.
brings battery to fully charged state at Module size:
BLUE ULTRA-BRIGHT LED 4.25" x 0.79" x 0.3"
which point the float-charge takes over,
Our lowest price ever on 5mm (T 1 3/4) Display size:
maintaining the battery at a constant 13.8
ultrabright blue leds. Water clear in off- 3.5" x 0.4"
Vdc. LED indicators; red indicates fast-
state. We don't have exact specs, but LED Built-in driver.
charge, green indicates power-on and float-
is at least 1500 mcd, very bright and clear. 14 pin male header, pins on 0.05" centers.
charge. Screw terminals allow user to
CAT# LED-122 attach desired cable and connector. UL. Includes hook-up diagram.
70 ¢ CAT# LCD-111
each
100 for 45¢ each
1000 for 35¢ each
CAT# BC-212
$ 12 75
each 10 for $1.50 each $ 851
each
MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.
70 July 2006
Page71.qxd 6/8/2006 11:37 AM Page 71
2105 - High-perf. USB2.0-pwrd Micro ALFAT-SD - easy, ready- AudioWave - Software turns your easyRADIOTM ER900TRS Transceiver K2 9p-9p self-pwrd RS-422/485 UCA93LV - USB-connected I2C
scope-in-a-probe! Up to 100MS/s, made way to add SD storage to Soundcard into a Sweep Generator! Modules make wireless data K3 9p-9p isolated RS-422/485 interface for PCs - 400kHz master/
25MHz 24kbuffer. +/-100mV to your product. Serial data in/FATfile Easy-to-use digitally-controlled LF- transmission simple for USA and K3-232 9p-9p isolated RS232 slave/monitor WINI2C/UCA software
+/-20V. 20nS/div – 50S/div data out. - $39.95. signal-generator, 1Hz-20kHz. Great Europe ! Add wireless capability to K232-ISOL 25p -25p RS232 gives windows-interface to develop
C/VB/Delphi/LabView/ VEE drivers. Or design-in an micro ALFAT ic for for service calls! your project today! KD485-STD DINrail - isolated and debug I2C bus systems.
PP317 from $199! MB storage - $14.00! AudioWave only $59.95! from $35 (100pr) KD485-PROG programmable! UCA93LV only $499!
Stepper Motor Easy VGA CleverScope FrontDesign SM PCB Adapters Disturbance Logger
Easy-Step™ 3000 - advanced stepper microVGA - graphics adapter that CleverScope - 100 MHz Scope, FrontDesign - software for designing OM-Adapt SM miniboards have ACR PowerWatch - PowerWatch
motor drive and control system for allows micros to display text & graphics Spectr.Anal, LogicAnal, & SigGen. for professional-looking front panels - two footprints on either side. Now 120V - monitor/record essential voltage
unipolar stepper motors up to 35V/3A on any VGA monitor. Connect to any PCs. 4 Msamples storage! Easy A-B, with a host of drawing functions. use your ultra fine pitch SMD disturbances from any power socket.
and 3 Amps - ideal for robots/industrial host micro controller, embedded math! 2 x 10 bit ch, 8 dig. I/P. Opt. Print, mill or engrave, or export final components with more useful 0.1" Set thresholds and plug it in. No
control – turns you into an instant device or a PC with a USB or serial 0-10 MHz SigGen.+ math + filters. at 600 dpi. inline spaced holes. wiring! 4000 events; optical alarm.
motor control expert! from $119! port. Clever & simple to use. $139! CS328 only $999! FrontDesign only $79.95! One-to-one pinouts. $9.52! from $495!
USB <> RS485 Easy USB USB Logic Analyzer Touchpanel Controller Instant FPGA FT232R Module
USB-COMi (non-isolated) or uUSB - Tiny USB ready-made ANT8 Matchbox-sized USB-powered CUTOUCH - 320 x 240 Blue Hevday - Instant FPGA Logic – UM232R - FT232R 24-pin DIP
USB-COMiSI (isolated) offer self- USB Interface to 1 Mbps 0.7” x logic analyzer. Sample 8 channels GraphicLCD Touchpanel/controller j u s t a d d k e y s t r o k e s ! F a s t e s t module - USB-TTL serial converter
powered USB to RS485 conversion 0.5” based on SiLabs CP2101. at up to 500 million samples-per-sec. CUBLOC Program in BASIC and/or 100 MHz FPGA logic design. for your project. Reference circuit
with baud rates 184bps - 3Mbps. Gnd/RX/TX Suspend, Reset, & View traces on PC. Print or save LadderLogic. 82 I/Os and 2 RS232 Design / control / monitor visually! for FT232R. Plug-in module adds
PC thinks it’s talking to a COMport! 3.3V 100mA source –40°C for later review! (16-ch. ver. too MODBUS support. FPGA with an OS! USB1.1 instantly!
COMi/COMiSI only $48/$85! +85°C. Micro USB only $25! $333!) ANT8 $222! CT1720 only $359! HDK-0501 only $499! UM232R only $19.99!
Easy LCD 4ch 12-bit USB scope USBwiz CAN-USB USB Bus Analyzers RF Testing
Customer Comments USB Temp Logger Ether-IO Signal Wizard FREE COFFEE Saelig Company Inc.
searches the world to bring
"Your personal service you unique, easy-to-use
control and instrumentation
makes you different"
products from overseas.
"I like being able to talk to Call 1-888-7SAELIG Customers include: Intel,
EL-USB-1 - Standalone USB temp Ether-IO - UDP/IP-controlled 24 X Signal Wizard - easy-use real-time Philips, NEC, Kodak, Nokia,
a human being that Mention Offer# SBW
data logger (25 to +80oC). Stores digital I/O board. 3 x 8-bit TTL ports DSP-based filter board for audio US Military, Microsoft, Dell,
understood what I needed." to get a free
16K Li-backed readings. Log data each independently programmable. bandwidth signals. Design filters Xerox, Universities, T.I.,
STARBUCKS Card
for >1 year! from $59.95! Connects to any TCP/IP Ethernet in seconds without any DSP Harris, Sony, J&J, Thomson,
"Delivery prompt .. with your order!
El-USB-2 (+ humidity) $79.95! network. knowledge! Sandisk, General Dynamics,
While supplies last -
product works great!" EL-USB-3 (voltage) $69.95! Ether-IO 24 from $99! Signal Wizard II only $399! Not available with any other offers H-P/Compaq, etc.
Saelig Co. searches the world to bring you unique, easy-to-use Also: Wireless Temp Loggers, PC for harsh environments, Temp Loggers, Automotive
control and instrumentation products from overseas. Customers Diagnostic Kit, PCI board, PC for Healthcare, Wi r e l e s s c o n t r o l l e r , O s c i l l o s c o p e , J T A G
include: Intel, Philips, NEC, Kodak, Nokia, US Military, testing, Indicator modules, SBC Compact control, Ether/IO, Industrial IO modules,
Microsoft, Dell, Xerox, Universities, T.I., Harris, Sony, J&J, Software for soundcard - front panels - logic simulation and hardware control - CAD
Thomson, Sandisk, General Dynamics, H-P/Compaq, etc. If you don’t see what you need maybe we can find it for you? - Ask for sales!
Page73.qxd 6/8/2006 10:28 AM Page 73
Amazing Devices
www.amazing1.com
Laser Modules
All laser modules operate from 3 volts and include built in optics
providing a parallel beam of 1mr or less. Includes instructions on
safety requirements for FDA full compliance
Red - Class IIIa
LM650P3 - 3mw 650 nm12 x 45 mm ........ $14.95
LM650P5 - 5mw 650 nm 12 x 45 mm ....... $24.95
LM630P3 - 3mw 630 nm 10.5 x 45 mm .... $34.95
Red - Class IIIb
LM650P10 - 10mw 650 nm 12 x 51 mm ... $99.95
LM650P30 - 30mw 650 nm 12 x 51 mm . $249.95
Green - Class IIIa
LM532P5 - 5mw 532 nm 12X45 mm ........ $49.95
Infrared - Class IIIb
LM980P30 - 30mw 980 nm 12X30 mm ..... $49.95
Laser Diode Visible Red - Class IIIb
LD630-P10 - 10mw 635 nm 5 mm diode .... $29.95
UNDERSTANDING
Digital Logic ICs
PART 1 — Digital Logic IC Basics
M
odern digital logic ICs are used as pre-amplifiers, power known as the “logic” type, in which
widely available in three amplifiers, oscillators, and signal the ICs are designed around fairly
basic types: TTL devices processors, etc., and give a basic simple logic circuits such as digital
(typified by the 74LS00 logic family), output that is directly proportional to buffers, inverters, gates, or flip-flop
“slow” CMOS devices (typified by the magnitude (analog value) of the elements. Digital logic circuits come
the “4000” logic family), and “fast” input signal, which itself may have in a variety of basic types and can be
CMOS devices (typified by the any value between zero and some built using a variety of discrete or
74HC00 and 74AC00 logic families). prescribed maximum limit. integrated technologies. Figures 2
Each of these families has its own One of the simplest types of through 7 show a selection of very
particular advantages and disadvan- linear IC elements is the unity-gain simple logic circuits that are designed
tages, and its own special set of buffer. If a large sine-wave signal is around discrete components.
usage rules. connected to the input of this circuit, Figure 2(a) shows a simple
This four-part mini-series explains it produces a low-impedance output inverting digital buffer (also known as
the basic principles and usage rules of almost identical form and ampli- a NOT logic gate), consisting of an
of each of these three digital logic tude, as shown in Figure 1(a). Digital unbiased transistor wired in the
families, and provides practical usage ICs, on the other hand, are effective- common-emitter mode, and Figure
guidance for the vast range of ICs ly blind to the precise amplitudes of 2(b) shows the international symbol
available in each of these families. their input signals, and simply recog- that is used to represent it. The
This opening article concentrates on nize them as being in either a low or arrowhead indicates the direction of
digital logic IC basics. a high state (usually known as logic-0 signal flow, and the small circle on
and logic-1 states, respectively). the symbol’s output indicates the
Digital Logic IC Basics Their outputs similarly have only inverting action.
two basic states, either low or high The circuit action is such that Q1
An IC can be described as a (logic-0 or logic-1). One simple is cut off (with its output high) when
complete electronic circuit or type of digital IC element is the non- its input is in the zero state and is
“electronic building block,” integrat- inverting buffer. If a large sine-wave driven fully on (with its output pulled
ed into one or more semiconductor signal is connected to the input of low) when its input is high. This
slices (or “chips”) and encapsulated this circuit, it produces an output that information is presented in concise
in a small, multi-pin package. An IC (ideally) is of purely digital form, as form by the Truth Table of Figure 2(c),
can be made fully functional by shown in Figure 1(b). which shows that the output is at
wiring it to a suitable power supply Digital ICs are available in a logic-1 when the input is at logic-0,
and connecting various pins to variety of rather loosely defined and vice versa.
appropriate external input, output, categories such as memory ICs, Figure 3(a) shows a simple non-
and auxiliary networks. electronic delay-line ICs, and micro- inverting digital buffer, consisting of a
ICs come in both “linear” and processor support ICs, etc., but the direct coupled pair of common-
“digital” forms. Linear ICs are widely most widely used category is that emitter (inverter) transistor stages.
74 July 2006
Marston1.qxd 6/7/2006 9:29 AM Page 75
FIGURE 1. When a large input sine wave FIGURE 2. Circuit (a), symbol (b), and FIGURE 3. Circuit (a), symbol (b), and
is fed to the input of a linear buffer (a), it Truth Table (c) of a simple inverting Truth Table (c) of a non-inverting digital
produces a sine-wave output, but when digital buffer. buffer.
fed to the input of a digital buffer (b), it
produces a purely digital output.
FIGURE 4. Circuit (a), symbol (b), FIGURE 5. Circuit (a), symbol (b), and Truth FIGURE 6. Circuit (a), symbol (b), and
and Truth Table (c) of a simple two- Table (c) of a two-input NOR gate. Truth Table (c) of a simple two-input
input OR gate. AND gate.
Figure 3(b) shows the arrow-like gate’s Truth Table, which indicates describe the relative density or
international symbol used to represent that the output goes to logic-1 only if complexity of integration:
it. Figure 3(c) shows the Truth Table inputs A and B are at logic-1.
that describes its action, e.g., the Finally, Figure 7 shows the circuit, • SSI (Small Scale Integration) —
output is at logic-0 when the input is symbol, and Truth Table of a two-input Complexity level between one and 10
at logic-0, and is at logic-1 when the NAND (Negated-output AND) gate, gates.
input is at logic-1. in which the output is inverted
In digital electronics, a “gate” is a (as indicated by the output circle) and • MSI (Medium Scale Integration) —
logic circuit that opens or gives an goes to logic-0 only if both inputs are Complexity level between 10 and 100
output (usually defined as a high or at logic-1. gates.
logic-1 state) only under a certain set Note that although the four basic
of input conditions. Figure 4(a) shows types of logic gate circuits described • LSI (Large Scale Integration) —
a simple two-input OR gate, made here are each shown with only two Complexity level between 100 and
from two diodes and a resistor, and input terminals, they can, in fact, be 1,000 gates.
Figure 4(b) shown the international designed or used to accept any
symbol used to represent it. Figure desired number of inputs, and can be • VLSI (Very Large Scale Integration) —
4(c) shows its Truth Table (in which used to perform a variety of simple Complexity level between 1,000 and
the inputs are referred to as A or B). logic operations. Many types of digital 10,000 gates.
Note that the output goes to logic-1 if buffers and gates are readily available
A or B goes to logic-1. in IC form, as are many other digital • SLSI (Super Large Scale Integration)
Figure 5 shows the circuit, logic circuits, including flip-flops, — Complexity level between 10,000
symbol, and Truth Table of a two-input latches, shift registers, counters, data and 100,000 gates.
NOR (Negated-output OR) gate, in selectors, encoders, and decoders.
which the output is inverted (as indi- Practical digital ICs may range Note that most logic ICs of the
cated by the output circle) and goes from relatively simple logic devices — types described throughout this series
to logic-0 if either input goes high. housing the equivalent of just a few of articles have complexity levels
Figure 6(a) shows a simple two- basic gates or buffers — to incredibly ranging from four to 400 gates, and
input AND gate, made from two complex devices housing the equiva- are thus SSI, MSI, or LSI devices. In
diodes and a resistor, and Figure 6(b) lent of tens of thousands of intercon- broad terms, most microprocessor ICs
shows its standard international nected gates, etc. By convention, the and moderately large memory ICs are
symbol. Figure 6(c) shows the AND following general terms are used to VLSI devices, while large dynamic
July 2006 75
Marston1.qxd 6/6/2006 10:43 AM Page 76
“
time. various forms of ringing, overshoot, Logic, or DTL. Figure 13 shows the
In each square-wave cycle, the undershoot, etc. The magnitudes of basic circuit of a three-input DTL
high part is known as its mark and the these distortions vary with the quality NAND gate. DTL used a dual five-volt
low part as its space. In a symmetrical or structure of the amplifier or gate. power supply, gave a typical propa-
square wave such as the one in Figure In practice, pulse input wave- gation delay of 30 nS, and gave an
8, the mark and space periods are forms may sometimes be so imper- output of less than 0.4 V in the logic-
equal. Such waveforms are said to fect that they may need to be “condi- 0 state and greater than 3.5 V in the
have a 1:1 Mark-Space (or M-S) ratio, tioned” before they are suitable for logic-1 state. DTL is now obsolete.
or a 50% duty cycle (since the mark use by modern, fast-acting digital ICs. Between the late 1960s and mid
duration forms 50% of the total Specifically, they may have such long 1970s, several other promising IC
cycle period). Square waves are not rise or fall times that they may have to logic technologies appeared. Most of
necessarily symmetrical, but are be sharpened up via a Schmitt trigger them soon disappeared back into
always free-running or repetitive, i.e., before they are suitable for use. oblivion again. Amongst those that
they cycle repeatedly, with consistent Again, many mechanically- came and either went or receded in
mark and space periods. derived pulse waveforms, such as importance were HTL (High
A pulse waveform is a bit like a those generated via switches or con- Threshold Logic), ECL (Emitter
square wave. It has both rise and fall tact-breakers, may suffer from multiple Coupled Logic), and PML (P-type
times, but only one portion — either “contact bounce” problems such as MOSFET Logic). The most durable of
its mark or its space period — is spec- those shown in Figure 11(a). In this these technologies was ECL, which is
ified; the duration of the remaining case, they will have to be converted to still in production and gives very fast
period is unimportant. Figure 9(a) the clean form shown in Figure 11(b) operation, but at the cost of very high
shows a basic “positive-going” pulse before they can be usefully used. current/power consumption.
waveform, which has a ‘rising’ or Figure 14 shows the basic circuit
positive-going leading edge, and Logic Families of the ECL digital amplifier — a non-
Figure 9(b) shows a “negative-going” saturating emitter-coupled differential
pulse waveform, which has a “falling” Practical digital logic circuits and amplifier (Q1 and Q2) with emitter-
76 July 2006
Marston1.qxd 6/7/2006 9:30 AM Page 77
FIGURE 7. Circuit (a), symbol (b), and Truth Table (c) of a FIGURE 8. Basic parameters of a square wave.
two-input NAND gate.
FIGURE 9. Basic forms of FIGURE 10. A perfect pulse, fed to the input of a practical amplifier or gate, produces an
(a) “positive-going” and (b) output pulse that is distorted both in form and time. The output pulse’s time delay is called
“negative-going” pulses. its propagation delay, and (in (b)) = (t1 + t2) / 2.
FIGURE 11. Mechanically derived FIGURE 12. IC version of a three-input RTL FIGURE 13. IC version of a three-input
pulse waveforms often suffer from NOR gate. DTL NAND gate.
contact bounce (a), and must be
cleaned up (b) before use.
July 2006 77
Marston1.qxd 6/6/2006 10:43 AM Page 78
FIGURE 16. Circuit and Truth FIGURE 17. Circuit and Truth Table of a basic TTL inverter. FIGURE 18. TTL inverter with
Table of a basic CMOS inverter. open-collector output.
FIGURE 19. TTL non-inverting buffer FIGURE 20. TTL three-input NAND gate. FIGURE 21. Tri-State
with open-collector output. logic enables several
outputs or inputs to
be connected to a
FIGURE 22. An external 2 kΩ pull-up resistor common bus. Only
connected to the output of a totem-pole one output/input must
stage pulls the output to almost +5 V in the be made active at any
logic-1 state. given moment.
forward-biased base-collector load currents. Typically, a single basic (when lightly loaded) switches
junction of Q1, thus driving Q4 TTL stage has a propagation delay of almost fully between zero and the
to saturation and simultaneously about 12 nS. positive supply rail value.
cutting off Q3. Alternatively, it can be used to
Under this condition, Q4 gives an Basic TTL Circuit drive an external load (such as an LED
active pull-down action and can sink Variations or relay, etc.) that is connected
fairly high currents, while the output between OUT and a positive supply
takes up a typical loaded value of 400 There are five very important rail, in which case the load activates
mV. Note that (ignoring external load variations of the basic Figure 17 TTL when a logic-1 input is applied.
currents) the circuit consumes a inverter circuit. The simplest of these The second variation is the non-
quiescent current of about 1 mA in is the so-called “open collector” TTL inverting amplifier or buffer. This is
the logic-1 output state, and 3 mA in circuit, which is shown in basic form made by simply wiring an additional
the logic-0 output state. in Figure 18. Here, output transistor direct-coupled inverter stage between
Thus, the basic TTL inverter can Q3 is cut off when the input is at the phase-splitter and output stages of
only be used with a five-volt supply, logic-0, and is driven on when the the standard inverter. Figure 19 shows
has a very low input impedance, input is at logic-1. Thus, by wiring an an open collector version of such a
consumes up to 3 mA of quiescent external load resistor between the circuit, which can be used with
current, has an output that does not OUT and +5 V pins, the circuit can an external resistor or load. In this
switch fully between the two supply be used as a passive pull-up voltage example, Q4 turns on when a logic-0
rails, and can source or sink fairly high inverter that has an output that input is applied.
July 2006 79
Marston1.qxd 6/6/2006 10:44 AM Page 80
6XUSOXV6DOHVRI1HEUDVND
%DGJHU2PQL5HPRWH1HWZRUN0RQLWRULQJ6\VWHP(43%$'*(5
'R\RXRSHUDWHDUHPRWHEDVH"$UHSHDWHU"$SDFNHWIRUZDUGLQJV\VWHP"'R
\RXKDYHDYDFDWLRQKRPH\RXZRXOGOLNHWRPRQLWRUUHPRWHO\"$OPRVWDQ\UHPRWH
FRQWURODSSOLFDWLRQ6WDUWDQGPRQLWRUDJHQHUDWRUUHPRWHO\¶VRIXVHV
7KHUHDUHPDQ\RFFDVLRQVZKHQLWLVGHVLUDEOHWRFROOHFWGDWDDQGDODUPVIURP
UHPRWHVLWHVRUHYHQKDYHUHDOWLPHFRQWURORYHUVHFXULW\3DUWLFXODUO\VXLWDEOHIRU
WHOFRVDQGZLUHOHVVRSHUDWRUVZKHUHIRUH[DPSOHUHPRWHFHOOVLWHPRQLWRULQJFDQ
QRZEHDFKLHYHGLQDFRVWHIIHFWLYHPDQQHUWKH%DGJHU2PQL5HPRWHLVDKLJKO\ÀH[LEOHXQLWWKDWDOORZVDOOWKLVDQGPRUHLQDVLPSOHWRLQVWDOO8IRUPDW7KHUH
DUHWKUHHPRGXOHW\SHV7KH%LVWDWH$QDORJXH0RGXOH%$0WKDWKDVHLWKHURULQSXWVWKH6HULDO$ODUP0RGXOH6$0ZLWKWZRRULQSXWVDQGWKH5HPRWH
$FFHVV0RGXOH5$0
&RQQHFWWRWKHRXWVLGHZRUOGYLD'6/SKRQHOLQHRUUDGLRPRGHP7KH2PQL5HPRWHDFFHSWVDQDORJ77/YROWDJHDQGGU\FRQWDFWLQSXWVWRUHSRUWVWDWXVRI
DODUPV\VWHPVZHDWKHUPRQLWRUVUDGLRVFRPSXWHUVDQGQHWZRUNVYLUWXDOO\DQ\DQDORJGLJLWDORUPHFKDQLFDOGHYLFH,WFDQDOVREHFRQWUROOHGWRRSHQRUFORVHGU\
FRQWDFWVURXWHGDWDWRRWKHULQSXWVDQGFRQWUROH[WHUQDOGHYLFHV6HHRXUZHEVLWHIRURWKHUSRVVLEOHFRQ¿JXUDWLRQVDQGXVHVIRUWKH%DGJHU2PQL5HPRWH
3OHDVHYLVLWRXUZHEVLWHZLWKRYHUSDJHVDQGLPDJHVZZZVXUSOXVVDOHVFRP
+,0DQXDOVVRIUDGLRPLOLWDU\DQG 9DFXXP7XEHV2YHUYDFXXP (0,5),)LOWHUV6LQJOH3KDVH7KUHH
WHVWHTXLSPHQWPDQXDOVRQKDQG WXEHVLQVWRFN 3KDVH 6LQJOH/HDGVW\OHV
1LFKRODV6WUHHW2PDKD1()D[HPDLOJULQQHOO#VXUSOXVVDOHVFRP9LVD0DVWHUFDUG$PHULFDQ([SUHVVRU'LVFRYHU
&DOORUHPDLOIRUVKLSSLQJDQGWRWDOFKDUJHV$OO63(&,$/6LQWKLV$GRQO\JRRGIRUGD\DGYHUWLVLQJF\FOH1RH[FHSWLRQVSOHDVH
9LVLWRXUZHEVLWH#
ZZZVXUSOXVVDOHVFRP
July 2006 81
Stamp.qxd 6/6/2006 10:47 AM Page 82
■ BY JON WILLIAMS
STAMP APPLICATIONS
PUTTING THE SPOTLIGHT ON BASIC STAMP PROJECTS, HINTS & TIPS
S TA M P A P P L I C AT I O N S
sequencer.” This coding technique is the software analog a our program is doing this:
player piano; as the “sheet” is scrolled, events are picked up
and “played.” 1) Timing/Trigger input loop
We can create a play “sheet” (outputs sequence) in an 2) Process sequence 1 if running
EEPROM table and include the timing between events to 3) Process sequence 2 if running
control how quickly things move. The timing will actually
control the duration between table reads, therefore, Steps 2 and 3 above are identical; the only difference
controlling the timing between possible output changes. So, being the pointer to the tables used and the escape
Rule #2 of a dual prop controller on the BS1 is that events destinations (Sequence 1 escapes to Sequence 2, Sequence
are table-driven. 2 escapes back to Main). Since we’re talking about
Okay, how are we going to get some known timing tables, let’s have a look at them as they’re structured in the
element into the prop control? The answer is deceptively program:
simple: use the trigger input check code to create a
specific delay. In order to keep things really simple, I use SYMBOL Seq1Start = 0
100 ms. Let’s have a look: SYMBOL Seq1Mask = %00111000
Main: Sequence1:
FOR loopTmr = 1 TO 5 EEPROM (%00000001, 5)
seq1 = seq1 | Trigger1 EEPROM (%00000010, 5)
seq2 = seq2 | Trigger2 EEPROM (%00000100, 5)
PAUSE 20 EEPROM (%00000010, 5)
NEXT EEPROM (%00000001, 5)
EEPROM (%10000000, 0)
As you can see, this looks a bit different than our SYMBOL Seq2Start = 12
stock trigger-detection loop — usually such a loop waits SYMBOL Seq2Mask = %00000111
until a trigger is present before dropping through. In this
Sequence2:
case, though, what the loop does is update (if a trigger EEPROM (%00100000, 2)
input is present) one or both bit status flags (seq1 and EEPROM (%00010000, 2)
seq2) for the sequences. The loop always runs five times EEPROM (%00001000, 2)
and, with a 20 ms PAUSE embedded in the loop, it takes EEPROM (%10000000, 0)
just a bit longer than 100 ms to scan the inputs. This
100 ms delay will be used as our core timing element Notice, too,
(we’re going to keep things simple and ignore program that we’re embed-
overhead). ding some named
Let me take a small detour for a moment on a BS1 constants in the
programming habit. When I write code for the BS1, I always table section; we
start assigning variables at B2, leaving B0 and B1 available don’t normally do
for future use. Why? Because these are the only two BS1 this but, for BS1-
variables that allow bit-level access and — in this program — based table pro-
we need them. Since most BS1 programs are small and we grams, it’s a good
generally have enough RAM, start your assignments at B2 idea as we have to
so that you have the bits in B0 and B1 available if an update assign these values
requires them. manually; keeping
Back to the program: Note that the OR operator is the assignment
used in the trigger loop. The reason for this is that seq1 and code close is just
seq2 denote the running state (1 is running, 0 is not handy, especially
running) of the respective sequences. By using the OR after changing the
operator, we can start a sequence (0 OR 1 = 1), and if the length of either of
sequence is already running, there is no change on a the tables.
subsequent trigger input (1 OR 1 = 1). Note that the For each
Prop-1 inputs pins — P6 and P7 — have been set to active- sequence, we have
high, that is, their SETUP jumpers have been moved to the a start value. This
DN (pull-down) position. is the location in
EEPROM where
TABLE MANNERS the actual table
data starts. The
Now things get a little bit heavy; our code has to slice-
■ FIGURE 1. Dual
and-dice two sequence tables, dealing with each step in Controller
each table as independent entities. In the simplest terms, Connections.
July 2006 83
Stamp.qxd 6/6/2006 10:48 AM Page 84
second constant is a pins mask for the other ANDing the current pin’s state with the protection mask.
sequence. This will be used for clearing the pins of one Just for clarification, the mask for sequence 1 is designed
sequence without disturbing the pins under control by to protect the pins for sequence 2 (and vice-versa). With
the other. Remember, this code is supposed to behave the pins updated, the record pointer is incremented to
like two independent sequencers, so I/O pins are point to the timing for this step. This gets read into timer1
assigned to just one sequence and cannot be controlled and the pointer is incremented a second time to point to
by both. the next table entry.
Finally, each table entry consists of two bytes: If this is not the end of the sequence, the program
the first is the outputs (with an end-of-sequence flag will make its way back to the top and the timer will
embedded in bit 7), and the second is the timing value, be updated in the Run_1 section. If you look closely
which is expressed in units of 100 ms (from the timing at the last entry in each table, you’ll see that the pin’s
input loop). output value has bit 7 set. This is used as the end-of-
Now for the nitty-gritty. Let’s have a look at how the sequence indicator. Since pinsTemp is assigned to
sequence processing works. This part of the program is B1, the variable endOfSeq is aligned in BIT15 (bit 7 of
divided into two sections: A) if sequence running and timer B1, which we’ve aliased to make the program easier
active, decrement timer, and B) load next step (outputs and to follow).
timer). If endOfSeq is 1, the program will clear the status
Section A is labeled Run_X (X is 1 or 2) in the program. variable — seq1 — and then reset the table pointer — pntr1
Here’s the code: — back to the beginning. The code for sequence 2 is
identical; the only difference being that it has jumps back to
Run_1: the top of the program at Main.
IF seq1 = Stopped THEN Run_2 And there you have it — on a tiny little Prop-1
IF timer1 = 0 THEN Reload_1 controller we have the ability to control two props,
timer1 = timer1 - 1 completely independent of each other. And you
GOTO Run_2
thought it took a big PC to do time-slicing! Okay, I’m
exaggerating a bit, but that is in essence what we’re
Remember that with the BS1, we don’t have doing.
IF-THEN-ELSE, so we’re limited to IF-THEN-Address.
This is not a programming problem, it just means that
we have to be very deliberate in our design, often
EVEN FARTHER?
using what seems to be inverted logic. In this case, Believe it or not, we can go even farther with this
we want to update the timer if the sequence is running technique, but we’ll save that for another day. I have
(seq1 = 1), so our first check is to see if it’s stopped actually written a program that will control two sequences
(seq1 = 0). If the sequence is stopped, then we and can use the Prop-1 outputs, as well as an RC-4 for AC
blow right by the rest of this section and deal with outputs (lights, etc.). The program works, but it’s a bit of a
sequence 2. bear and, with all the code to manage parallel and RC-4
Let’s say that the sequence is running and that we outputs, it doesn’t leave a lot of room left for sequence
have time left for the current table entry. What we do is tables.
decrement the sequence timer value and then move on to Okay, gang, Halloween is not that many months away,
the next sequence. Again, the timing delay is created at so start your code writing now — and if you’re in a budget
the trigger input loop so there is no need to put a PAUSE pinch, you can double-up your Prop-1. And if you’re in the
here. Columbus, OH area this month, come by the Midwest
When the sequence is running and the timer has Haunters Convention and say hello to John Barrowman
expired, we will jump to the next part of the sequence and me. We’ll have a booth there and love to meet new
processor: Reload_1. friends.
Until next time, Happy Stamping. NV
Reload_1:
READ pntr1, pinsTemp
PINS = PINS & Seq1Mask | pinsTemp JON WILLIAMS
pntr1 = pntr1 + 1
READ pntr1, timer1
jwilliams@parallax.com
RESOURCES
pntr1 = pntr1 + 1
IF endOfSeq = No THEN Run_2 MIDWEST HAUNTERS CONVENTION
seq1 = Stopped
pntr1 = Seq1Start
www.midwesthauntersconvention.com
PARALLAX, INC.
At Reload_1, we begin by reading the next table entry www.parallax.com
into pinsTemp. This is then sent to the outputs after
84 July 2006
Page85.qxd 6/8/2006 10:34 AM Page 85
USB Programmer $119.95 LAB-X Experimenter Boards BASIC Compilers for PICmicro®
Pre-Assembled Board
for PICmicro® (with accessories)
Available for 8, 14, 18, 28,
Easy-To-Use BASIC Commands
Windows 9x/Me/2K/XP Interface
and 40-pin PIC® MCUs
2-line, 20-char LCD Module PICBASIC™ Compiler $99.95
9-pin Serial Port BASIC Stamp 1 Compatible
Sample Programs Supports most 14-bit Core PICs
Built-In Serial Comm Commands
Full Schematic Diagram
Pricing from $69.95 to $349.95 PICBASIC PRO™ Compiler $249.95
Supports All PICmicro® MCU Families
Direct Access to Internal Registers
Includes:
Programmer, USB Cable,
PICPROTO™ Prototyping Boards Supports In-Line Assembly Language
Interrupts in PICBASIC and Assembly
ZIF Programming Adapter for 8 to 40-pin DIP, Double-Sided with Plate-Thru Holes Built-In USB, I2C, RS-232 and More
Software for Windows 98/Me/NT/2K/XP Circuitry for Power Supply and Clock Source Level Debugging
Large Prototype Area
EPIC™ Parallel Boards Available for Most PIC® MCUs See our full range of products, including
Port Programmer Documentation and Schematic books, accessories, and components at:
starting at $59.95 Pricing from $8.95 to $19.95 www.melabs.com
6ISIT /UR
7
HTTPWW EBSITE !T
WELEXPC
OM
-(: 37%%0 $# 0/7%2 3500,)%3 3/,$%2).'