V

o
l
.
3
2

N
o
.
1
N
U
T
S

&

V
O
L
T
S
C
H
A
O
S

P
E
N
D
U
L
U
M



S
I
M
P
L
E

D
C

U
P
S



W
I
-
F
I

S
P
R
I
N
K
L
E
R

S
Y
S
T
E
M
J
a
n
u
a
r
y

2
0
1
1
U.S. $6.50 CANADA $7.50
Cover.qxd 12/8/2010 2:16 PM Page 1
Low-cost Industrial
Serial to Ethernet Solutions
- |nstantly network-enable any serlal devlce
- No programmlng ls requlred for serlal to Lthernet appllcatlon
- Customlze to sult any appllcatlon wlth a development klt
SBL2e Chip
2-port serlal-to-Lthernet server
wlth elght A/D converter lnputs
and optlonal SP|, |2C perlpheral
devlce support
SBL2e 200
2-port serlal-to-Lthernet server
wlth four A/D converter lnputs,
optlonal |2C perlpheral support
and l0-pln header
SBL2e
Serial-to-Ethernet server
with RS-232 support
SBL2e XA
Lxternal server wlth up to
four A/D converter lnputs,
up to elght dlgltal |/O and up
to two UAPTS (one PS-232)
SBL2e 100
2-port serlal-to-Lthernet server
wlth four A/D converter lnputs,
optlonal |2C perlpheral support
and P145 connector
Hardware Features
Up to three serlal ports, l0/l00 Mbps Lthernet, up to l0 dlgltal |/O,
l2-blt A/D converters, operatlng temperature -40 to 85 C, 32-blt performance
Software Features
TCP/UDP/Telnet/HTTP modes, DHCP/Statlc |P support, web-based or
AT command conñguratlon
Low Prices
S8L2e Chlp.................... $l0.50 (Qty. l0k, Devlce P/N: S8L2eCH|P-236|P)
S8L2e 200...................... $l9.95 (Qty. l000, Devlce P/N: S8L2e-200|P)
S8L2e l00...................... $2l.95 (Qty. l000, Devlce P/N: S8L2e-l00|P)
S8L2e X........................... $79.00 (Qty. l000, Devlce P/N: S8L2eX-l00|P)
S8L2e XA........................ $79.00 (Qty. l000, Devlce P/N: S8L2eXA-l00|P)
Need a custom solution?
Net8urner Serlal to Lthernet Development Klts are avallable to customlze any
aspect of operatlon lncludlng web pages, data ñlterlng, or custom network
appllcatlons. All klts lnclude platform hardware, ANS| C/C++ compller, TCP/|P
stack, web server, e-mall protocols, PTOS, and N8 Lcllpse |DL.
Information and Sales | salesQnetburner.com
Web | www.netburner.com Telephone | l-800-695-6828
Full Page.qxd 11/1/2010 3:34 PM Page 2
www.downmagaz.com
GET STARTED IN 3 EASY STEPS
1. Purchase PIC32 Ethernet Starter Kit
and Multimedia Expansion Board
2. Download MPLAB® IDE
3. Start designing!

www.microchip.com/graphics
Multimedia Expansion Board - DM320005
PIC32 Ethernet Starter Kit – DM320004
Power Your Connected Graphics Solution
With the PIC32 Microcontroller
M
e
m
o
r
y
A
n
a
l
o
g
D
i
g
i
t
a
l

S
i
g
n
a
l








C
o
n
t
r
o
l
l
e
r
s
M
i
c
r
o
c
o
n
t
r
o
l
l
e
r
s
www.microchip.com/graphics
T
h
e

M
i
c
r
o
c
h
i
p

n
a
m
e

a
n
d

l
o
g
o
,

t
h
e

M
i
c
r
o
c
h
i
p

l
o
g
o
,

P
I
C

a
n
d

M
P
L
A
B

a
r
e

r
e
g
i
s
t
e
r
e
d

t
r
a
d
e
m
a
r
k
s

a
n
d

P
I
C
t
a
i
l

i
s

a

t
r
a
d
e
m
a
r
k

o
f

M
i
c
r
o
c
h
i
p
T
e
c
h
n
o
l
o
g
y

I
n
c
o
r
p
o
r
a
t
e
d

i
n

t
h
e

U
S
A

a
n
d

i
n

o
t
h
e
r

c
o
u
n
t
r
i
e
s
.

A
l
l

o
t
h
e
r

t
r
a
d
e
m
a
r
k
s

m
e
n
t
i
o
n
e
d

h
e
r
e
i
n

a
r
e

t
h
e

p
r
o
p
e
r
t
y

o
f

t
h
e
i
r

r
e
s
p
e
c
t
i
v
e

o
w
n
e
r
s
.

©

2
0
1
0
,

M
i
c
r
o
c
h
i
p
T
e
c
h
n
o
l
o
g
y

I
n
c
o
r
p
o
r
a
t
e
d
.

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d
.

9
/
1
0
Connectivity and graphical user interfaces are essential in today’s
applications. You’re challenged to deliver intuitive, high impact,
connected solutions while maintaining fexibility to support
several diferent product options. Microchip’s PIC32 series of 32-bit
microcontrollers ofer the right performance, memory size and
peripherals to help achieve your goals.
With 1.56 DMIPS/MHz performance topping any device in its category, up to
512 Kbytes of Flash, 128 Kbytes of RAM and integrated connectivity peripherals
like Ethernet, CAN and USB the PIC32 can deliver the mix of performance and
fexibility needed to help you meet your design challenges.
Microchip gets you there with:
• PIC32 Starter Kits – Standalone easy to use development boards with
integrated debugger/programmer
• Multimedia Expansion Board – The most complete user interface development
solution in it’s class – enabling development of highly interactive, graphics
and audio-based interfaces with WiFi connectivity – a modular add-on to any
PIC32 Starter Kit.
• Microchip’s FREE Graphics and Connectivity libraries and code examples
– Eases your development efort and speeds your time to market
Full Page.qxd 9/2/2010 1:42 PM Page 3
Full Page.qxd 12/7/2010 9:15 AM Page 4
www.downmagaz.com
Full Page.qxd 8/2/2010 8:50 PM Page 5
Projects & Features
www.nutsvolts.com
30 Explore Electronic Chaos
Need more chaos in your life? Well, we’ve got a
simple, electronically-driven pendulum that can
produce all the randomness you like.
■ By Norm Looper
40 A Simple DC UPS
This article describes a simple uninterruptible power
supply circuit that you can incorporate into your low
power DC projects to ensure continued operation
during power failures.
■ By Philip Kane
44 Build a Wi-Fi Sprinkler System
Be master of your lawn-watering system with this
Wi-Fi project. This month, you’ll learn the building
blocks of the Rabbit RCM5450W module that runs it.
■ By Bob Colwell
Columns
2011
Nuts &Volts
6 January 2011
Departments
08 DEVELOPING
PERSPECTIVES
28 NEW PRODUCTS
49 SHOWCASE
66 ELECTRO-NET
72 NV WEBSTORE
76 TECH FORUM
80 CLASSIFIEDS
81 AD INDEX
January
Nuts & Volts (ISSN 1528-9885/CDN Pub Agree #40702530) is published monthly for
$26.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879.
PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL MAILING
OFFICES. POSTMASTER: Send address changes to Nuts & Volts, P.O. Box 15277,
North Hollywood, CA 91615 or Station A, P.O. Box 54, Windsor ON N9A 6J5;
cpcreturns@nutsvolts.com.
10 TechKnowledgey 2011
Events, Advances, and News
Read about a new approach to electronics,
a solar-powered wireless keyboard,
do-it-yourself thermocouples, plus more
cool stuff you’ll find fascinating.
14 The Spin Zone
Adventures in Propeller Programming
From Spin to PASM and Back Again!
22 Q & A
Reader Questions Answered Here
This month’ questions cover a CAT 5 cable
tester, a model railroad sequencer, a low
battery circuit, and an LED replacement
for incandescent lamps.
50 The Design Cycle
Advanced Techniques for Design Engineers
Time for Some RTCC Translating.
58 Smiley’s Workshop
Programming

Hardware

Projects
AVR_Toolbox — Documentation and
Libraries.
67 Near Space
Approaching the Final Frontier
The NearSpace UltraLight —
The Everyman’s Flight Computer.
Page 30
Page 50
TOC Jan11.qxd 12/6/2010 2:22 PM Page 6
www.downmagaz.com
B
itS
co
p
e
M
o
d
e
l 1
2
0
1
2
0
Mixed SignoI OsciIIoscopes
AnoIog + DigifoI
ßitScope
Digital Storage Oscilloscope

Dual Channel Digital Scope with industry
standard probes & POD connected analog
inputs. Fully electrically isolated from PC.
DSP Waveform & Timing Generator

Built-in synchronized waveform generator.
Synthesize arbitrary waveforms, triggers,
clocks, bursts, chirps, noise and more.
Multi-band Spectrum Analyzer

Display analog waveforms and their spectra
simultaneously in real-time. Baseband or RF
signals with variable bandwidth control.
lntegrated Waveform Data Recorder

Record to disk anything BitScope can capture.
Allows off-line replay and waveform analysis.
Export captured waveforms and logic signals.
Multi-platform & user programmable

Supports Windows, Linux and Mac OSX. User
programming libraries, drivers & third-party
software integration options available.
Mixed Signal Waveform Analyzer

Capture and display analog and logic signals
together with sophisticated cross-triggers
for precise waveform timing measurement.
BitScope Software and Libraries
BítScope 120 íncíudes DSO, an íntuítíve test and
measurement software appíícatíon for your PC.
DSO test ínstruments íncíude a dígítaí storage
oscíííoscope, spectrum anaíyzer, íogíc & míxed
sígnaí anaíyzer, íntegrated arbítrary waveform
generator and data recorder, aíí ín one package.
DSO ís fast and deep, wíth díspíay rates up to
50Hz & hígh speed capture of up to 64kS/frame.
The data recorder supports offííne repíay and
sígnaí anaíysís for home assígnments or sharíng
waveform data wíth coííegues and students.
Other software optíons íncíude WaveMeter and
BítGen for synthesís and anaíysís appíícatíons or
BítLíb for customízed appíícatíons & íntegratíon
wíth many thírd-party numerícaí anaíysís tooís.
Windows, Linux or Mac
Fully lsolated USB
Logic}Timing Analyzer Probes lndustry Standard Scope Probes
Software lncluded
Encíosed ín a new íow profííe soííd extruded aíumíníum case, BítScope
can handíe the harshest workíng envíronments.
Its fuíí metaí |acket and eíectrícaííy ísoíated desígn means that unííke
cheap píastíc aíternatíves ít ís aíso híghíy noíse ímmune for the most
sensítíve míxed sígnaí measurement appíícatíons.
BítScope ís buíít tough to íast a íífetíme.
On the road or ín the íab, BítScope ís the ídeaí choíce!
N
e
w
M
o
d
e
l
N
e
w
M
o
d
e
l
bitscope,com/nv
Full Page.qxd 10/4/2010 9:59 AM Page 7
by Bryan Bergeron, Editor by Bryan Bergeron, Editor
DEVELOPING
Modding
A
common thread in most of the emails we received in
response to my question about the future direction of
Nuts & Volts was the desire for more and more affordable
hands-on projects. As many readers point out, these two
goals tend to be at odds with each other. Why would
someone spend $20 on parts and shipping, and another
$20 on a custom printed circuit board when a superior
circuit with a nice case and battery compartment can be
had for $15 at a local retailer?
As I’ve noted in past editorials, one way around the
cost issue is to go with a kit. Kits tend to be cheaper than
buying parts piecemeal
because of reduced
shipping costs, especially if
you have to order from
multiple suppliers. Kits also
reduce the risk of failure.
You plug in and solder the
parts and — assuming
you’ve followed the
directions faithfully — the
circuit should be good to
go. You’ll have to pay
attention to capacitor and
LED polarity, proper
orientation of ICs in their
sockets, and the like, but
that’s about it.
While kits are fun — I
spent most of my money
as a youth on HeathKit projects — they often lack the
challenge of building a circuit from scratch. However, it’s
not an all or nothing proposition. For a great mix of
challenge, affordability, and fun, you should try your hand
at modding. Modding is simply taking an existing circuit
and making it better. Examples of modding include
increasing the output power of an amplifier, improving the
regulation or efficiency of a power supply, improving the
selectivity and sensitivity of a shortwave receiver,
increasing the clock speed of a microprocessor, or
changing the audio characteristics of a guitar effects pedal.
The accompanying figure shows a typical mod sold
on eBay for guitar effects pedals. For about $15 (including
shipping), you get a small bag of capacitors, resistors, and
a chip or two. By replacing the stock components with
those from the kit, mod shops claim they can enable your
pedal to produce better sound effects.
Every electric guitarist that I know is a modder at
heart. They’re constantly changing the pickups in their
guitars and experimenting with different chip sets, tubes,
and passive components in their amplifiers and other
music equipment.
Modding can be a good business. While you can get
a bag of parts and instructions for $15, most guitar effects
pedal modders on eBay charge $50 to $100 for labor.
Modding as a source of supplemental income is
something to consider in an economic downturn.
The best thing about modding is that you start with
just about everything you need. For example, if you’re
increasing the low frequency response of a stereo amp,
you don’t have to worry
about a chassis (have you
priced one lately?), display,
controls, and the rest. You
can focus your efforts on
the power supply and
power amplifier circuitry.
It takes a bit of
discipline to be a good
modder. In contrast with kit
building, it’s generally a bad
idea to make all the
changes you have planned
and then plug in the
equipment. Because you
may not be working with a
schematic, you could make
a mistake that will take you
hours to undo if you rush
through the project. It’s better to make a small change
such as changing the capacitors in the signal path and
then checking the results rather than to update the power
supply, as well. If your circuit stops working because of a
mod error, you want to know which mod is responsible.
It’s a good idea to take good notes when you mod. It’s
amazing what you can forget when you’re interrupted in
the middle of a modding project.
By the way, in case you’re curious, the mod shown in
the figure turned out great. In addition to the standard
mod component changes, I rewired the pushbutton switch
and made a few other changes that really improved the
quality of the distortion produced by the pedal. This
highlights another point of modding — start with what’s
safe and proven, but don’t end there. Add your own spice.
It’ll stretch you as an experimenter and you’ll learn a lot
more in the process. NV
PERSPECTIVES
8 January 2011
DevPerspec Jan 11.qxd 12/6/2010 9:12 AM Page 8
www.downmagaz.com
Published Monthly By
T & L Publications, Inc.
430 Princeland Ct.
Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
Webstore orders only 1-800-783-4624
www.nutsvolts.com
Subscriptions
Toll Free 1-877-525-2539
Outside US 1-818-487-4545
P.O. Box 15277
North Hollywood, CA 91615
FOUNDER/ASSOCIATE PUBLISHER
Jack Lemieux
PUBLISHER
Larry Lemieux
publisher@nutsvolts.com
ASSOCIATE PUBLISHER/
VP OF SALES/MARKETING
Robin Lemieux
display@nutsvolts.com
EDITOR
Bryan Bergeron
techedit-nutsvolts@yahoo.com
CONTRIBUTING EDITORS
Jeff Eckert Russ Kincaid
Joe Pardue Fred Eady
Norm Looper Philip Kane
Bob Colwell Jon Williams
Paul Verhage
CIRCULATION DIRECTOR
Tracy Kerley
subscribe@nutsvolts.com
SHOW COORDINATOR
Audrey Lemieux
MARKETING COORDINATOR
WEBSTORE
Brian Kirkpatrick
sales@nutsvolts.com
WEB CONTENT
Michael Kaudze
website@nutsvolts.com
ADMINISTRATIVE ASSISTANT
Debbie Stauffacher
PRODUCTION/GRAPHICS
Shannon Christensen
Copyright © 2011 by T & L Publications, Inc.
All Rights Reserved
All advertising is subject to publisher’s approval. We
are not responsible for mistakes, misprints, or
typographical errors. Nuts & Volts Magazine assumes
no responsibility for the availability or condition of
advertised items or for the honesty of the advertiser.
The publisher makes no claims for the legality of
any item advertised in Nuts & Volts. This is the sole
responsibility of the advertiser. Advertisers and their
agencies agree to indemnify and protect the publisher
from any and all claims, action, or expense arising from
advertising placed in Nuts & Volts. Please send all
editorial correspondence, UPS, overnight mail, and
artwork to: 430 Princeland Court, Corona, CA 92879.
Printed in the USA on SFI & FSC stock.
EVERYTHING FOR ELECTRONICS
Mouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, and company names mentioned herein, may be trademarks of their respective owners.
Get Your Hands On What’s Next.
The Newest Products For Your Newest Designs

mouser.com
Scan
ducts For Your Newest Designs

January 2011 9
DevPerspec Jan 11.qxd 12/6/2010 1:30 PM Page 9
NEW LASER-BASED
MISSILE DEFENSE
I
n rough terrain places like Afghanistan, the military
has to rely on helicopters for many operations.
Because choppers tend to operate at low altitudes and
at relatively slow cruise speeds, they are highly
vulnerable to shoulder-launched heat-seeking missiles.
The good news is that a new laser technology developed
at the University of Michigan (www.umich.edu) and
spin-off Omni Sciences (www.omnisciinc.com) looks like
a promising solution. Mohammed Islam, a professor in
the Department of Engineering and Computer Science,
has created an assembly of cheap, off-the-shelf fiber
optic components to build a sturdy, portable
"mid-infrared supercontinuum laser" that can blind
heat-seeking missiles from a distance of 1.8 miles.
According to the prof, "Our lasers give off a signal that's
like throwing sand in the eyes of the missile." The key is
the fact that supercontinuum lasers give off a beam of
light with a broad range of wavelengths rather than just a
single one. They operate in longer infrared wavelengths
that are invisible but can be felt as heat. As a result, the
device can mimic an engine's electromagnetic signature
and confuse incoming weapons. An additional advantage
is the device's simplicity. "The laser-based infrared
countermeasures in use now for some aircraft have 84
pieces of moving optics. They couldn't withstand the
shake, rattle, and roll of helicopters," Islam noted. "We've
used good, old-fashioned stuff from your telephone
network to build a laser that has no moving parts." The
system — developed with funding from the US Army and
DARPA — is likely to have many other military
applications, but it is particularly well suited for
helicopters. ▲
TECHKNOWLEDGEY
EVENTS, ADVANCES, AND NEWS
2
0
1
1
■BY JEFF ECKERT
■A Stinger infrared-seeking missile is launched in a
Marine live-fire exercise.
ADVANCED TECHNOLOGY
A NEW APPROACH TO ELECTRONICS?
A
ccording to a recent report in the online journal Advanced Materials, researchers at Oregon State University
(http://oregonstate.edu) have solved a mystery that has eluded scientists since the 1960s, leading to the possibility of
an entirely new approach to electronics. The discovery involves the creation
of a high performance "metal-insulator-metal" (MIM) diode. According to
Douglas Keszler, a chemistry prof at OSU, "This is a fundamental change in
the way you could produce electronic products, at high speed on a huge
scale, at very low cost, even less than with conventional methods. It's a basic
way to eliminate the current speed limitations of electrons that have to move
through materials."
Today's silicon-based electronics work with transistors that control
electron flow which is limited by the speed with which electrons can move
through the materials. A MIM diode, in which an insulator is sandwiched
between two layers of metal performs the same function in a different and
much faster manner. In this device, "the electron doesn't so much move
through the materials as it ‘tunnels’ through the insulator almost
instantaneously appearing on the other side." A patent application has been
filed for the new technology which may offer a way to "simply print
electronics on a huge size scale even less expensively than we can now. And
when the products begin to emerge, the increase in speed of operation could
be enormous." ▲
■ Asymmetric MIM diode developed at
Oregon State University.
10 January 2011
Photo courtesy of Lance Cpl. Manuel Valdez.
Tech2011 - Jan 11.qxd 12/2/2010 2:15 PM Page 10
www.downmagaz.com
T E C H K NOWL E DGEY 2 011
CHINA BECOMES
SUPERCOMPUTER
TOP DOG
U
ntil recently, the world's
fastest supercomputer
was the Cray XT5 Jaguar
system at Tennessee's Oak
Ridge National Laboratory,
with a speed of 1.76
PFlops/s. It appears now that
China's Tianhe-1 (Chinese for
"Milky Way") has smashed
the record with a sustained
computing speed of 2.507
PFlops/s. According to the
developer — the National University of Defense
Technology — the achievement comes from upgrading
the Intel and NVIDIA processors, and the installation of
some domestically produced FeiTeng-1000 CPUs.
Specifics weren't offered, but
before the upgrade, the 155
ton machine reportedly used
14,336 Intel Xeon CPUs and
7,168 NVIDIA Tesla GPUs
(each with 448 cores). It has
a theoretical top speed of 4.7
PFlops/s. According to Liu
Guangming, director of the
National Center for
Supercomputing in Tianjin,
Tianhe-1 has begun trial use with clients that include the
Tianjin Meteorological Bureau and the National Offshore
Oil Corporation. "It can also serve the animation industry
and bio-medical research," he noted. ▲
COMPUTERS AND NETWORKING
■The Tianhe-1 supercomputer
— clocking in at 2.507 PFlops/s
— is now the world’s fastest
supercomputer.
NEXT-GENERATION GRAPHICS PROCESSOR FOR CONSUMER DEVICES
C
oming to a range of consumer products soon is ARM's fourth-generation Mali™ GPU, said to deliver five times the
performance of the current Mali processors. According to ARM, "The debut of the scalable, multicore Mali-T604 GPU
raises the performance bar for visual computing in the consumer electronics space, including mobiles, tablets, DTVs, and
automotive infotainment. The tri-pipe innovative graphics architecture within the Mali-T604 GPU addresses the
computationally intensive demand inherent in next-generation interactive user interfaces and gaming."
The unit is designed to meet the needs of General Purpose computing on GPU (GPGPU) and extends API
support to include Khronos™ OpenCL™ and Microsoft® DirectX®. GPGPU support is noted to be increasingly
important for enhanced Augmented Reality applications and gesture recognition. The new Mali processor also reduces
memory bandwidth consumption by up to 30 percent which improves energy efficiency. The GPU is available for
license by ARM partners, and Samsung will be the first to embed it in its products. For details, visit www.arm.com/
products/multimedia/. ▲
SOLAR-POWERED
WIRELESS KEYBOARD
D
emonstrating that there's more to keyboards
than a bunch of keys, Logitech
(www.logitech.com) has introduced what is probably
its slickest keyboard yet. The K750 eliminates the
need to change batteries by powering itself from
ambient light, even indoors. According to the
company, not only is it powered by light, but energy
consumption is so low that it can work in total
darkness for up to three months. (So, if you spend a
lot of time typing in the dark, you're in luck.) In
addition, the K750 is only 1/3 of an inch thick, and it features the company's concave Incurve keys™ which are
designed to support the shape of your fingertips and help guide fingers to the right keys. The device operates with 2.4
GHz wireless connectivity and includes 128-bit AES encryption for added security. Suggested retail is $79.99. ▲
January 2011 11
www.nutsvolts.com/index.php?/magazine/article/january2011_TechKnow
■ The solar-powered Logitech K750 wireless keyboard.
Tech2011 - Jan 11.qxd 12/2/2010 8:06 AM Page 11
NEW CAMERAS FOR MACHINE VISION
I
f you happen to be involved in manufacturing
inspection, intelligent traffic systems, food inspection, or
any field that makes use of high-speed color cameras,
you may be interested in the new lineup from Ontario-
based DALSA Corp. The new Genie HC series consists of
the HC640 (up to 300 fps, 640 x 480 resolution), the
HC1024 (117 fps, 1024 x 768), and the HC1400 (75 fps,
1400 x 1025). All comply with the Automated Imaging
Association's GigE Vision standard for direct link to a PC,
and they offer Gigabit Ethernet technology, transmitting
data over standard CAT-5e and CAT-6 cables up to 100
m. The Genies come with the company's Sapera™
Essential and Genie Framework software packages,
designed to provide fast and simple setup (said to take
only a matter of minutes). Other features include a
ruggedized RJ45 connector highly suitable for robotic
applications, and 1000x anti-blooming, resulting from the
company's proprietary CMOS technology. Information on
these and the DALSA's full line of machine vision
products can be found at www.dalsa.com/mv. ▲
■A Genie
high-speed
color camera,
designed for
machine
vision on the
factory floor.
PC-TO-TV CONNECTION
T
he latest from Imation (www.imation.com) is the Link™ Wireless Audio/Video Extender which allows you to send
both audio and high-def video content (including Internet TV, movies, photos, games, video-conferencing, business
conferences, and so forth) to a television or projector using wireless USB technology. The Link works as a digital
entertainment server, providing up to 720p video quality
and 1080p for still images, along with two-channel audio.
The PC- and Mac-compatible device uses a directional
antenna to provide a line-of-sight range of up to 30 ft (9
m). The receiver connects to the TV set via an HDMI or
VGA input, and the transmitter connects to any standard
USB 2.0 port on a laptop or desktop. The only snag is
that you need at least a 1.6 GHz processor, and a dual
core is recommended. The unit lists for $149.99, but you
can pick one up for about 10 percent less from various
online stores. ▲
■The Imation Link provides wireless connectivity
between a PC and TV.
12 January 2011
CIRCUITS AND DEVICES
DO IT YOURSELF THERMOCOUPLES
I
f you have ever said to yourself, "Boy, I sure wish I could fabricate
my own thermocouples," DCC Corporation
(www.dcccorporation.com) can make that wish come true. The
HotSpot capacitive discharge welder is designed for just that purpose.
The HotSpot generates an electric arc that fuses standard couple
elements into freestanding beads and welds them to a base metal of
any thickness. Stored weld energy ranges from 5 to 50 watt-seconds,
and you can weld wire pairs up to #24 gauge at a rate of 5 to 10
welds per minute, depending on the energy setting. Power is
provided from the AC power line via a step-down transformer, or
from a gel-type battery that allows a few hundred welds without the
AC connection. DCC says it's faster than gas welding and produces a
more reliable contact mechanical twisting or clamping. Plus, the
compact size (3.25 x 6 x 6.25 inches or 8.25 x 15.25 x 15.9 cm) and light weight (6.25 lb or 2.8 kg) make it highly
portable. For only $689, you can join the list of 200+ current users, ranging from Abbott Labs to Zilog.
What? You say you've never wished for such a thing? Well, check out DCC's website anyway. Oddly enough, they
also manufacture and sell some cool ultralight and experimental aircraft based on designs by Earthstar. You can pick one
up as a kit or in ready-to-fly form. ▲
■ DCC’s HotSpot capacitive discharge welder for
thermocouple fabrication.
Tech2011 - Jan 11.qxd 12/2/2010 8:06 AM Page 12
www.downmagaz.com
INTEL INVESTING
M
oney is tight all over, but Intel is bucking the trend and has announced $6-8 billion in funding for future generations
of manufacturing technology in American facilities. The gigabucks will underwrite next-generation 22 nm
manufacturing technology among several existing factories, plus a new fab plant in Oregon. The projects are expected to
support 6,000 to 8,000 construction jobs, and create up to 1,000 permanent high-tech positions.
"Intel makes approximately 10 billion transistors per second," said Brian Krzanich, senior VP and general manager.
"Our factories produce the most advanced computer technology in the world, and these investments will create capacity
for innovation we haven't yet imagined. Intel and the world of technology lie at the heart of this future. Contrary to
conventional wisdom, we can retain a vibrant manufacturing economy here in the United States by focusing on the
industries of the future."
Although Intel generates approximately three-fourths of its revenues overseas, it maintains three-fourths of its
microprocessor manufacturing in the US. This new investment commitment will allow the company to maintain its
manufacturing employment base at these sites. NV
COGSIMA 2011
CONFERENCE
SCHEDULED
O
n Feb. 22-24, the 2011 IEEE
International Multi-Disciplinary
Conference on Cognitive Methods in
Situation Awareness and Decision
Support will be held at the Miami
Beach Resort and Spa. If you don't even
know what that means, don't worry.
You're not alone. The conference is
expected to draw only 140 attendees.
But, so what? We're talking February
and Miami Beach. Heated pool, deep-
sea fishing, scuba, access to the Miami
Beach Golf Club, and rooms starting at
$79. Come to think of it, maybe you need to know more about cognitive methods. ▲
INDUSTRY AND THE PROFESSION
■ Forget the cold. You
could be here.
T E C H K NOWL E DGEY 2 011
GIZMOS THAT BRING YOUR DREAMS TO LIFE!
1000’s of LED’s in stock
1.8mm, 3mm, 5mm,
and 10mm from $.40
1/2 watt $.95
1 watt Stars $3.60
RGB $1.50
UV, IR, Surface Mount









RGB LED Strips
12v LED Bars
LCD Displays
Graphic and Character
Basic robot animal
kits start at $25
Lego Flashlights
Keychain $7.95
Head Lamp $11.95
7 Inch Lamp $19.95
Dynamo Lamp $21.95
Let that light shine in the
next generation!
www.SurplusGizmos.com
503-439-1249
5797 NW Cornelius Pass Road
Hillsboro Oregon 97124
To see the best deals join our online
mailing list or stop by our retail store!
3 watt LED strip $10.00
Not just bright… Stupid Bright!!
Noritake Vacuum Fluorescent Display
Regular $50 now $25.00 each
Works with all micros and arduino

Atmega 8/168/328
Development board
$35

Atmel STK500 USB
ISP programmer $38
Robot Kits Are Here:
Completely configurable,
expandable, and modifiable.
Visual programming.
Great for kids age 10 and up
With student workbook.
Starting at $95
Ask about school discounts
January 2011 13
Tech2011 - Jan 11.qxd 12/2/2010 8:07 AM Page 13
I
know what you’re thinking: “He mentioned PASM –
man, I don’t want to learn Assembly!” With the speed
improvement of the Propeller over the BASIC Stamp, you
don’t have to for everything, but there will be times when
using PASM over Spin is required, and other times when it
would just be nice in terms of performance improvement.
For example: If you want to create a 1-Wire driver, it is
my opinion that it must be done in PASM. The timing
requirements of that protocol are very strict (it’s
asynchronous, so they have to be) and the ~5
microseconds time per Spin instruction is just too coarse.
In the “nice to have” category, you can find floating point
math objects in the Object Exchange (ObEx) that are
written in Spin and PASM — the latter being much faster.
In applications like real-time process control that require
floating point math, speed is important and PASM is a big
help. Thankfully, as with the floating point libraries, there
are a lot of great PASM objects available for us to use.
There is no person in their right mind that would
accuse me of being the brightest bulb in the box and yet I
have been able to write PASM code for many applications.
I find PASM far friendlier than other flavors of Assembly
and am getting better all the time. You will, too — once
you dig in.
That said, I’m getting ahead of myself, and this article
is not about PASM programming but how to share
variables in a complex project, such as how to connect
Spin code to PASM code when that need arises. Again,
this seems to be a stumbling point for many Propeller
newcomers and it is my hope to put a “regular guy” spin
(pun intended) on the process to help you create cooler
Propeller programs. As with many programming
languages, Spin has features that protect the casual
programmer, while giving the advanced programmer the
tools for creating code as he or she desires.
SCOPING THINGS OUT
Before we get to the Spin-to-PASM connection, it’s
probably a good idea to talk about variable scope as this
will answer the “Why do we have to do it that way?”
question before we get there.
Let’s start with a very simple program; this will print a
random number of stars (asterisk character) on a terminal
every 500 mS:
obj
term : “fullduplexserial”
var
long stars
pub main | lottery, idx
term.start(RX1, TX1, %0000, 115_200)
pause(1)
term.tx(CLS)
SPIN ZONE
■BY JON WILLIAMS
ADVENTURES IN PROPELLER PROGRAMMING
For those of us that started with the BASIC Stamp and then (perhaps)
migrated to the SX via SX/B, there can be a bit of a learning curve moving to
the Propeller and its native language, Spin. Personally, I like programming in
Spin and I think my exposure to other programming languages allowed me
to pick it up and adopt it pretty quickly. Like anyone, though, it took a few
programs before the "Aha!" moment revealed itself. In working with friends,
I got the idea that sharing variables and the cog-to-cog connection is a real
challenge. So, let's start the new year with a tutorial of sorts so that we can
get a really firm grip on these processes. Once you have your own "Aha!"
moment, a whole new world of programming fun opens up for you.
14 January 2011
FROM SPIN TO PASM AND
BACK AGAIN!
Spin Zone - Jan 11.qxd 12/2/2010 8:19 AM Page 14
www.downmagaz.com
repeat
?lottery
idx := ||lottery // 32 + 1
printstars(idx)
pause(500)
pub printstars(count)
if (count > 0) and (count =< 32)
repeat count
term.tx(“*”)
term.tx(CR)
Starting from the top, we can see that this object —
our top object — has a child object called term that is of a
FullDuplexSerial type. Let’s skip past this for a moment
and come back to it.
In the VAR declaration section, we have a long called
stars. Variables declared in the VAR section are global to
the object; that is to say that any of the methods in the
object have access to them. While we’re not doing it now,
we could access stars from the main() method, as well as
from the printstars() method.
In the main() method, we have two local variables:
lottery and idx. The only code that has direct access to
these variables is in main(). If I wrote a line of code in
printstars() that attempted to use lottery or idx, the
compiler would complain. This is what we mean by scope:
it refers to the access of a variable. Some variables have
global scope, some are local. On the storage side, all
variables for Spin code are stored within the 32K hub
RAM; it is the compiler that prevents local variables in one
method from being [directly] accessed by another
method.
In Spin, local variables can have the same name as
local variables in other methods; the local scope prevents
conflicts. What we cannot do is give a local variable the
same name as a global variable in the object as this would
create a conflict for the compiler. I try to give most
variables unique names but as in this case, there are
generic names I use for local variables that have meaning
to me. For example, lottery for random numbers and idx
for an array index or generic counter.
At the top of the our listing, we declared an object
called term that will handle serial communications to a
terminal program. If we open that object, we’ll see that it
also has a global VAR section. With these variables
defined in a VAR section, do we have access to them from
our top object in the main() and printstars() methods?
No. As I stated earlier, global variables are only global to
the object in which they are defined. A child object
usually provides access to its variables through custom
methods. The benefit of this strategy is that a child object
controls what it reveals to its parent.
It may seem a bit of a hassle to have to write a
method to expose the value of a variable in the child
object, but this is really for the best. Imagine if variables in
a child object VAR section became global to a project in
which the object is used. It’s likely that we’d have all sorts
of naming conflicts in the project, rendering the use of
separate object files, well, useless.
A couple final notes vis-a-vis scope for child objects:
A parent has access to those child methods that are
declared as public only. From time to time, we will create
child object methods that should only be called from
within that object. In these cases, we should declare the
method as private. Finally, child objects do not have
access to methods in their parent.
WHAT’S YOUR ADDRESS, MAN?
I have deliberately used the term “direct access” a
couple of times — let me explain why. As I indicated
earlier, all Spin variables are stored in the hub RAM. It
stands to reason, then, that we should be able to get to
any variable from any piece of code. We can ... if we
know that variable’s address.
You may see code that looks like this:
pntr := @myVariable
The @ symbol tells the compiler to move the address
of myVariable into pntr; without the @ symbol, we would
copy the value in myVariable to pntr. This is tricky at first
but really useful. If we know the address of a hub variable,
we can get to it from anywhere — even from anther cog.
To write a value to a known address, we could do this:
long[pntr] := someValue
This bit of code tells the compiler to write a long (four
bytes) to the address stored in pntr. We can also write
words and bytes. This technique allows objects to update
variables in other objects, even when normal scope rules
would prevent it.
Of course, we can also read a value this way:
someValue := long[pntr][2]
Knowing the base address, we can treat the hub RAM
as an array, as shown above. In this particular example,
the second word after the location indicated by pntr will
be moved into someValue.
It should be clear that the key to allowing one method
or object to access variables in another — even from
another hub — is to share the address of the variable(s)
you want to allow access to.
Let me give you a real-world example: I’m working on
a pan/tilt controller for my buddy, Lou. The circuit includes
an MCP3208 ADC chip. In Lou’s project, I want the
joysticks to be read every millisecond and automatically
update an array that is part of the main program. The
ADC object I’m working on (in PASM, hence runs in
another cog) uses the following call to initialize:
analog.init(CS, CLK, DIO, @joysticks)
The first three parameters are the pins used by the
S P I N Z ONE
January 2011 15
www.nutsvolts.com/index.php?/magazine/article/january2011_SpinZone
Spin Zone - Jan 11.qxd 12/7/2010 8:03 AM Page 15
ADC chip. Note that the forth is prefixed with @ which
indicates I want to pass the address of the array called
joysticks. The PASM code will use the wrword instruction
to write a word variable to a hub location; knowing the
hub address of joysticks[0] lets me update the array.
What I hope you grasp by now is that if a variable
lives in the hub RAM, we can get to it from anywhere,
even a PASM cog. What we cannot do, however, is
directly manipulate a PASM variable from another cog. Of
course, we can indirectly manipulate a PASM variable —
this requires a gateway to the cog and will be the focus of
the rest of this article.
FROM SPIN TO PASM AND BACK
When dealing with a variable that’s part of a PASM
program, access to the variable from outside the cog
requires some code. In general, the outside code passes a
request to the cog through a known hub variable. The cog
must read this request and respond as desired, which
could be to write a value to some location in the hub that
is known to the outside code.
Propeller newcomers — especially those with
Assembly experience in another processor — often ask
how to integrate PASM methods into their Spin programs.
As with variable access in a PASM cog, we can’t — at least
not directly.
Keep in mind that our Spin code is running in a Spin
interpreter (virtual machine is probably a better description)
that has been loaded into a cog. A cog running the Spin
interpreter can only run pre-compiled Spin byte codes
(which are stored in the hub); there is no way to interleave
straight PASM code into these programs. What we do,
then, is create a PASM program and launch it into its own
cog. To access this code, we create a Spin interface that
allows values to move from Spin to PASM and back again.
I like creating templates for programs that will adopt a
similar structure and I have one for creating subroutines in
PASM. Of course, it requires a little bit of effort to take it
from template to working program, but it handles a lot of
the grunt work required to pass commands from Spin to
PASM, and to get a result from PASM to Spin. You can
find that code in __pasm_subs.spin (I use the double
underscore to force it to the top of the file’s pane in the
Propeller Tool).
As learning by specific example is best, and blinking
LEDs is something we can do with virtually any Propeller
development setup, let’s learn how to connect from Spin
to PASM by creating a little LED control mechanism.
Remember, we’re not blinking LEDs for the sake of
blinking LEDs, but to start to get comfortable connecting
Spin to PASM. Once we’re comfortable with the
connection, the sky is the limit!
Okay, we can’t get there without knowing where
we’re going, so let’s make some decisions:
1) We’ll have a command that allows us to turn an LED on
or off.
2) We’ll have another command that lets us blink an LED
a specific number of times — we can also specify the
blink timing (ms).
The fully commented blinker object is led_ctrl.spin.
Let’s dissect it — though not in order as we find in the
listing — to get a handle on how it works.
At the top are the variables that are global to the
object:
var
long cog
long mstix
long cmd
long pin
long pulses
long timing
The first variable, cog, is used to indicate that the
PASM cog is loaded. The way in which this variable is
used is very standard in PASM objects created by Parallax
and others.
The next group is what we’re going to be working
with. The first, mstix, holds the number of counter ticks
per millisecond. We need this for delays, and this really
should be set at run-time to account for the speed at
which the Propeller is running. Cmd will hold the
command passed to the PASM code, and also serves as a
flag to indicate when an external process is finished. Pin is
the pin number we want to use. Pulses will hold the pulse
count for that feature. It is also used to hold the state for
direct on/off control. Finally, timing will hold the pulse
timing in milliseconds for that feature.
As with other PASM objects, we need to launch the
code into its own cog. Some objects use a method called
start(), though I prefer to use init() as this prevents
confusion with I
2
C commands that are often used with the
Propeller. For this program, we don’t have to pass any
parameters to the init() method:
pub init | ok
finalize
mstix := clkfreq / 1_000
cmd := 0
ok := cog := cognew(@entry, @mstix) + 1
return ok
The first thing we need to do is make sure that our
object doesn’t already have a cog loaded and running. If it
does, the finalize() method will shut it down.
Initialization is pretty simple: We set the number of
counter ticks per millisecond in mstix, clear the command
(so that the PASM cog will wait for a valid command), and
then we start the cog. Note that in the cognew instruction
we pass the address (@) of the code that will be loaded,
as well as the address of mstix which is the first in our list
of working variables.
There was a recent post in the Propeller forum that
16 January 2011
Spin Zone - Jan 11.qxd 12/2/2010 8:20 AM Page 16
www.downmagaz.com
the interface to a PASM-coded object should be through a
single variable (usually a variable address) which is passed
in the par register (the second parameter in the cognew
call). In the past, I have violated this idea by allowing Spin
to “poke” values into the Assembly code before it is
launched into its own cog. There is a good reason for the
par only access: this allows creators of other languages to
adapt our PASM objects. This is a good thing as it allows
our hard work (the PASM code) to be used by more
programmers.
Let’s skip down to the top part of the Assembly code
for our object. This provides the connection to the
variables we’ve established above:
dat
org 0
entry mov tmp1, par
rdlong ms001, tmp1
add tmp1, #4
mov cmdpntr, tmp1
add tmp1, #4
mov pinpntr, tmp1
add tmp1, #4
mov pulsepntr, tmp1
add tmp1, #4
mov timepntr, tmp1
As a reminder, when we launch the Assembly code
into its own cog we pass the address of mstix in the par
register. As mstix is the first in our list of object variables,
we can use it as an anchor point.
The PASM code starts by copying par into tmp1 so we
can modify it to point to the other variables. Tmp1 now
holds the address of mstix so we use this with rdlong to
move the number of ticks per milliseconds into the cog
variable, ms001. Yes, the cog does have access to the
clkfreq register but without built-in division, it’s easier to
do the ticks-per-millisecond math in Spin.
If we add four to what’s in tmp1, we’ll have the hub
address of the object variable called cmd, the next
variable in our list. This gets saved into a PASM variable
called cmdpntr. This same process is used to save the hub
addresses for the pin, blink count, and blink timing
variables. With the variable pointers set up, the next part
of our PASM code will wait on and process a command
from the hub:
getcmd rdlong tmp1, cmdpntr wz
if_z jmp #getcmd
checkcmd cmp tmp1, #1 wz
if_e jmp #cmdset
cmp tmp1, #2 wz
if_e jmp #cmdblink
cmddone mov tmp1, #0
wrlong tmp1, cmdpntr
jmp #getcmd
If you’re new to PASM, this is the equivalent of a
stacked IF-THEN structure to process the command. The
first line reads the long at cmdpntr into tmp1. Note that
the Z flag is affected by this instruction. If the command is
zero (no command), the Z flag will be set and the next
line will cause the program to jump right back to the top
to read the command again. This causes the program to
wait for a non-zero command value.
At the label checkcmd, we start looking at the value
passed by the user and dealing with it. There are many
ways to do this and I tend to resort to simple. The cmp
instruction compares what is now in tmp1 with a legal
command value. I prefer this style because it is, in fact,
simple and allows the use of non-contiguous command
values. When the command is equal to the value we’re
checking for, the Z flag will be set (wz must be specified
with cmp to set/clear the Z flag). The if_e (if equal)
condition — when true — causes the program to jump to
the appropriate command handler code. If the command
passed is not known by the program, the code eventually
makes it to cmddone where the hub variable is
overwritten with zero. This allows another command. We
use the same process (clear to zero) at the end of valid
commands.
Back to the Spin code. Let’s look at the Spin interface
for controlling an LED (turning it on or off):
pub set(p, state)
repeat while (cmd <> 0)
pulses := state
pin := p
cmd := 1
Notice that the first line of code in this method
actually checks to see if the PASM cog is busy by looking
at the present hub value of cmd. This will be important in
many applications, especially when the background
process is somewhat involved (e.g., transmitting an IR
code or other signal generation). The next step is to load
up the variables used and as you can see, we’re doing it in
reverse order. This part is really important. Since the top of
the PASM code is just waiting for cmd to change to a non-
zero value, we have to load any variables required by the
background process first.
When the set() method is called, the following (super
duper easy) PASM code is executed:
cmdset rdlong tmp1, pinpntr
mov pinmask, #1
shl pinmask, tmp1
rdlong tmp1, pulsepntr
test tmp1, #1 wc
if_c or outa, pinmask
if_nc andn outa, pinmask
or dira, pinmask
jmp #cmddone
To activate a pin, we need to know what the pin
number is and the state we want to set it to. We read the
pin number from the hub (stored at the address in pinpntr)
into tmp1 and then use that to create a pin mask. We’re
going to read the desired state (0 for off, 1 for on) from
BIT0 of the value stored at pulsepntr.
To check the state, we use the test instruction with a
mask value of 1 (BIT0 only). The test instruction works like
S P I N Z ONE
January 2011 17
Spin Zone - Jan 11.qxd 12/2/2010 8:20 AM Page 17
and but doesn’t affect the value in the destination field
(tmp1 in this case). What it will do, though, is affect flags
at our direction. As we’ve specified modifying the C flag
in the test instruction, the C flag will receive the desired
LED state.
Using conditional instructions with the C flag, we can
write a “1” to the outa bit for the pin when it’s supposed
to be on (high) or zero when it’s off (low). If you’re brand
new to PASM, you may be wondering what happens
when a condition is false. That instruction simply acts like
a nop and does nothing (except consume one instruction
cycle). By using or with the pin mask, we can write a “1”
to the desired bit without affecting the others; by using
andn, we can write a “0” to the desired bit without
affecting the others. Note that in either case we always
write a “1” to the pin’s bit in the dira register to make it
an output.
Now, if a program was doing a calculation or waiting
to get a value back from an external device, we would
write the result back to the hub at a location known by
the Spin interface. Once the result — if there is one — has
been written to the hub, we can clear the command value
and allow another to be passed. As in the Spin interface,
the command variable in the hub is the last thing to be
modified.
You should be able to analyze
and understand the command for
blinking an LED (cmd = 2) with no
trouble now. Remember to download
the commented listing from Nuts &
Volts website. It includes a demo
code that puts the object through its
paces and will allow you to
experiment.
IT’S A NEW YEAR,
IT’S TIME TO PLAY!
I know, I know, blinking LEDs is
boring. (For me, too, believe me.) But
so is going to the gym and lifting
weights to get trim and healthy, yet
most of us do it. I ask you to be kind
to yourself and play with this
program until the interface makes
sense and you can make it bend to
your will. We’re going to do some
really fun projects this year and I
want you to be able to modify them
as your needs differ from mine. For
that to happen, though, you need
this foundation. Okay? Okay. Go
have fun!
Until next time, keep spinning
and winning with the Propeller! NV
18 January 2011
JON “JONNYMAC”
WILLIAMS
jwilliams@efx-tek.com
PARALLAX, INC.
www.parallax.com
GADGET GANGSTER
Propeller Platform kits
and accessories
www.gadgetgangster.com
Spin Zone - Jan 11.qxd 12/2/2010 8:21 AM Page 18
www.downmagaz.com
January 2011 19
Page 19 Jan11.qxd 12/6/2010 1:50 PM Page 19
Well, it's another New Year, and there no better time for that ulti-
mate resolution… taking better care of yourself. And there's no better
way to do that then to be "heart smart" with our ECG1C Electrocardiogram
Heart Monitor! Not only will building an actual ECG be a thrill, but you'll get hands-
on knowledge of the relationship between electrical activity and the human body.
Each time the human heart beats, the heart muscle causes small electrical changes
across your skin. By monitoring and amplifying these changes, the ECG1C detects
the heartbeat and allows you to accurately display it, and hear it, giving you a win-
dow into the inner workings of the human heart and body!
Use the ECG1C to astound your physician with your knowledge of ECG/EKG sys-
tems. Enjoy learning about the inner workings of the heart while, at the same
time, covering the stage-by-stage electronic circuit theory used in the kit to monitor
it. The three probe wire pick-ups allow for easy application and experimentation
without the cumbersome harness normally associated with ECG monitors.
The documentation with the ECG1C covers everything from the circuit
description of the kit to the circuit description of the heart! Multiple
“beat” indicators include a bright front panel LED that flashes with the
actions of the heart along with an adjustable level audio speaker output
that supports both mono and stereo hook-ups. In addition a monitor
output is provided to connect to any standard oscilloscope to view the
traditional style ECG/EKG waveforms just like you see in a reall ER or on
one of the medical TV shows! See the display above? That’s one of our engineers, hooked up to the ECG1C
after an engineering meeting! (We were all surprised it wasn’t flat lined!)
The fully adjustable gain control on the front panel allows the user to custom tune the differ-
ential signal picked up by the probes giving you a perfect reading and display every time! 10
hospital grade re-usable probe patches are included together with the matching custom case
set shown. Additional patches are available in 10-packs. Operates on a standard 9VDC bat-
tery (not included) for safe and simple operation. Note, while the ECG1C professionally
monitors and displays your heart rhythms and functions, it is intended for hobbyist usage
only. If you experience any cardiac symptoms, seek proper medical help immediately!
✔ Visible and audible display of your heart rhythm!
✔ Bright LED “Beat” indicator for easy viewing!
✔ Re-usable hospital grade sensors included!
✔ Monitor output for professional scope display
✔ Simple and safe 9V battery operation
ECG1C Electrocardiogram Heart Monitor Kit With Case & Patches $44.95
ECG1WT Electrocardiogram Heart Monitor, Factory Assembled & Tested $89.95
ECGP10 Electrocardiogram Re-Usable Probe Patches, 10-Pack $7.95
Pocket Audio Generator
A perfect test source for stereo line inputs on
any amplifier or mixer. Provides 50Hz, 100Hz,
1kHz, 10kHz, & 20kHz tones, plus 32 bit digi-
tal pink noise. Great to help you identify
cables or left/right reversals! Stereo RCA line
level outputs. Uses 2xCR2025, not included.
K8065 Pocket Audio Generator Kit $29.95
Pocket Vu Meter
Hand held audio level meter that fits in your
pocket! Built-in mic picks up music and audio
and displays it on an LED bargraph. Includes
enclosure shown. Runs on one 3V Li-Ion but-
ton cell, not included. If you ever wanted an
easy way to measure audio levels, this is it!
MK146 Pocket Vu Meter Kit $8.95
Mini LED Light Chaser
This little kit flashes six high intensi-
ty LEDs sequentially in order. Just
like the K8032 to the right does with
incandescent lights. Makes a great
mini attention getter for signs, model trains, and even
RC cars. Runs on a standard 9V battery.
MK173 Mini LED Light Chaser Kit $15.95
Running Light Controller
Controls and powers 4 incandescent
lights so they appear to “travel” back
and forth (Like the hood on KITT!).
Great for the dance floor or promo-
tional material attention getters,
exhibits, or shows. Runs on 112-240VAC.
K8032 4-Channel Running Light Kit $38.95
Digital Voice Changer
This voice changer kit is a riot! Just
like the expensive units you hear the
DJ’s use, it changes your voice with a multitude of
effects! You can sound just like a robot, you can even
ad vibrato to your voice! 1.5W speaker output plus a
line level output! Runs on a standard 9V battery.
MK171 Voice Changer Kit $14.95
Steam Engine & Whistle
Simulates the sound of a vintage steam
engine locomotive and whistle! Also pro-
vides variable “engine speed” as well as
volume, and at the touch of a button the
steam whistle blows! Includes speaker.
Runs on a standard 9V battery.
MK134 Steam Engine & Whistle Kit $11.95
Laser Trip Senser Alarm
LTS1 Laser Trip Sensor Alarm Kit $29.95
Liquid Level Controller
Not just an alarm, but gives you a
LED display of low, middle, or high
levels! You can also set it to sound
an alarm at the high or low condi-
tion. Provides a 2A 240VAC rated
relay output. Runs on 12-14VAC or 16-18VDC.
K2639 Liquid Level Controller Kit $21.95
Electrocardiogram ECG Heart Monitor
True laser protects over 500
yards! At last within the
reach of the hobbyist, this neat kit uses a standard
laser pointer (included) to provide both audible and
visual alert of a broken path. 5A relay makes it simple
to interface! Breakaway board to separate sections.
One of our engineers/guinea
pigs, checking his heart!
Beginners To Advanced... It’s Fun!
For over 3 decades we’ve become famous for making
electronics fun, while at the same time making it a
great learning experience. As technology has changed
over these years, we have continued that goal!
PL130A Gives you 130 different electronic projects
together with a comprehensive learning manual
describing the theory behind all the projects.
PL200 Includes 200 very creative fun projects and
includes a neat interactive front panel with 2 controls,
speaker, LED display and a meter.
PL300 Jump up to 300 separate projects that
start walking you through the learning phase of digital
electronics.
PL500 The ultimate electronics lab that includes
500 separate projects that cover it all, from the basics
all the way to digital programming.
SP3B Whether young or old, there’s always a
need to hone your soldering skills. Either learn from
scratch or consider it a refresher, and end up with a
neat little project when you’re done!
SM200K Move up to Surface Mount Technology
(SMT) soldering, and learn exactly how to solder
those tiny little components to a board!
AMFM108K We not only take you through AM and FM
radio theory but we guide you through IC’s. When
you’re done you’ve built yourself an IC based AM/FM
radio that works great!
KNS10 With a reversible PEM fuel cell that com-
bines electrolysis and power conversion into a single
device you end up building your own fuel cell car!
Learn tomorrows technology today!
KNS11 Learn alternative fuel technology while
you build your own H-Racer car and refueling station!
KNS13 Convert ethanol alcohol to run a PEM fuel
cell and watch it all work in front of your eyes!
KNS1 A great beginner’s kit for the dinosaur
enthusiast in the family, young and old! A wooden
hobby kit that teaches motor and gear driven opera-
tion that requires no soldering.
PL130A 130-In-One Lab Kit $39.95
PL200 200-In-One Lab Kit $69.95
PL300 300-In-One Lab Kit $89.95
PL500 500-In-One Lab Kit $219.95
SP1A Through Hole Soldering Lab $9.95
SM200K SMT Practical Soldering Lab $22.95
AMFM108K AM/FM IC Lab Kit & Course $34.95
KNS10 Fuel Cell Car Science Kit $82.95
KNS11 H-Racer & Refueling Station Kit $144.95
KNS13 Bio-Energy Fuel Cell Kit $129.95
KNS1 Tyrannomech Motorized Kit $17.95
✔ Learn and build!
✔ 130, 200, 300, & 500 in one electronic labs!
✔ Practical through hole and SMT soldering labs!
✔ Integrated circuit AM/FM radio lab!
✔ Fuel Cell, Solar Hydrogen, and Bio-Energy labs!
✔ Beginner’s non-soldering kits!
The Learning
Center!
PL300
PL200
PL130A
AMFM108K
SP3B
SM200K
KSN10
KNS13
KNS1
KNS11
✔ Build It!
✔ Learn It!
✔ Achieve It!
✔ Enjoy It!
Follow Us and SAVE $$
Follow us on your favorite network site and
look for a lot of super deals posted frequently...
exclusively for our followers!
Look for the QR tag like this
throughout our catalog and
print ads. Use the Tag app in
your smart phone to automati-
cally get more information for
that specific product, or in this
case, it will take you right to
www.ramseykits.com!
201101.qxd 12/7/2010 9:40 AM Page 20
www.downmagaz.com
Get the brand new 2011 Ramsey Hobby
Catalog today! Filled with some of the
neatest goodies around! Order yours
today... Or download the PDF at
ww.ramseykits.com/catalog!
RAMSEY ELECTRONICS, LLC
590 Fishers Station Drive
Victor, NY 14564
(800) 446-2295
(585) 924-4560
Prices, availability, and specifications are subject to change. We are not responsible for typos, stupids, printer’s bleed, or
New Year’s morning headaches! Best 2011 wishes to Robin, even though she made me get this ad copy done in December,
seriously cramping my holiday shopping! Visit www.ramseykits.com for the latest pricing, specials, terms and conditions.
Copyright 2011 Ramsey Electronics, LLC...so there!
800-446-2295
www.ramseykits.com
Vintage Battery Eliminator
Collectors come across some great
deals on antique battery-powered
radios, but how to power them is a
real problem. Many classic radios
operated on batteries only, and in
many cases a series of three batteries for
each radio were required!
The new ABCE1 Battery Eliminator gives you an easy
way to replace all these batteries with a simple house-
hold AC power connection and resurrect your vintage
antique radios! Provides “A” filiment, “B”
plate, and “C” control grid supplies,
which are all isolated from
each other. Complete with
aluminum case. Runs on
110-240VAC.
ABCE1 Vintage Radio Battery Elim Kit $199.95
Digital Message System
The third generation of
Ramsey digital voice storage
kits! We started with the lat-
est digital voice storage technol-
ogy. It provides up to 8 minutes of digital storage at a
frequency response up to 3.5 KHz. (Total message
time and frequency response is dependant on selected
internal sampling rate.) Once recorded, messages are
available for playback on-demand or automatic contin-
uous looping. Standard RCA unbalanced line level
output is provided for easy connection to any amplifi-
er, amplified speaker, mixer, or sound system. In addi-
tion, a standard 4-8 ohm speaker output is provided to
directly drive a monitor speaker. Can be remote con-
trolled via 3-wire BCD with our interface options.
Check www.ramseykits.com for all options!
DVMS8 Digital Voice Message 8Ch Kit $99.95
DVMS8WT Assembled DVMS8 $149.95
Ultimate 555 Timers
This new series builds on
the classic UT5 kit,
but takes it to a
whole new level!
You can configure
it on the fly with easy-
to-use jumper settings, drive
relays, and directly interface all timer functions with
onboard controls or external signals.
All connections are easily made though terminal
blocks. Plus, we've replaced the ceramic capacitor of
other timer kits with a Mylar capacitor which keeps
your timings stable over a much wider range of volt-
ages! Available in through hole or surface mount ver-
sions! Visit www.ramseykits.com for version details.
UT5A Through Hole 555 Timer/Osc Kit $24.95
UT5AS SMT 555 Timer/Osc Kit $26.95
Passive Aircraft Monitor
The hit of the decade! Our patented receiver
hears the entire aircraft band without any tun-
ing! Passive design has no LO, therefore can
be used on board aircraft! Perfect for air-
shows, hears the active traffic as it happens!
Available kit or factory assembled.
ABM1 Passive Aircraft Receiver Kit $89.95
Voice Activated Switch
Voice activated (VOX) provides a
switched output when it hears a
sound. Great for a hands free PTT
switch or to turn on a recorder or light!
Directly switches relays or low voltage loads up to
100mA. Runs on 6-12 VDC.
VS1 Voice Switch Kit $9.95
OBDII CarChip Pro
The incredible OBDII plug-in monitor
that has everyone talking! Once
plugged into your vehicle it monitors
up to 300 hours of trip data, from speed, braking,
acceleration, RPM and a whole lot more. Reads and
resets your check engine light, and more!
8226 CarChip Pro OBDII Monitor-Asmb $99.95
RF Preamplifier
The famous RF preamp that’s been
written up in the radio & electronics
magazines! This super broadband preamp
covers 100 KHz to 1000 MHz! Unconditionally stable
gain is greater than 16dB while noise is less than 4dB!
50-75 ohm input. Runs on 12-15 VDC.
SA7 RF Preamp Kit $19.95
Touch Switch
Touch on, touch off, or momentary
touch hold, it’s your choice with this
little kit! Uses CMOS technology.
Actually includes TWO totally separate touch circuits
on the board! Drives any low voltage load up to
100mA. Runs on 6-12 VDC.
TS1 Touch Switch Kit $9.95
Doppler Direction Finder
Track down jammers and hidden
transmitters with ease! 22.5 degree
bearing indicator with adjustable
damping, phase inversion, scan and
more. Includes 5 piece antenna kit.
Runs on 12VDC vehicle or battery power.
DDF1 Doppler Direction Finder Kit $169.95
Mad Blaster Warble Alarm
If you need to simply get atten-
tion, the “Mad Blaster” is the
answer, producing a LOUD ear
shattering raucous racket! Super for
car and home alarms as well. Drives
any speaker. Runs on 9-12VDC.
MB1 Mad Blaster Warble Alarm Kit $9.95
Laser Light Show
Just like the big concerts, you
can impress your friends with
your own laser light show!
Audio input modulates the
laser display to your favorite music!
Adjustable pattern & speed. Runs on 6-12VDC.
LLS1 Laser Light Show Kit $49.95
Water Sensor Alarm
This little $7 kit can really “bail you out”!
Simply mount the alarm where you want to
detect water level problems (sump pump)!
When the water touches the contacts the
alarm goes off! Sensor can even be remotely
located. Runs on a standard 9V battery.
MK108 Water Sensor Alarm Kit $6.95
USB DMX Interface
Control DMX fixtures with your PC via
USB! Controls up to 512 DMX channels
each with 256 different levels! Uses
standard XLR cables. Multiple fixtures
can be simply daisy chained. Includes Light Player
software for easy control. Runs on USB or 9V power.
K8062 USB DMX Interface Controller Kit $67.95
HV Plasma Generator
Generate 2” sparks to a handheld
screwdriver! Light fluorescent tubes
without wires! This plasma genera-
tor creates up to 25kV at 20kHz from a
solid state circuit! Build plasma bulbs from
regular bulbs and more! Runs on 16VAC or 5-24VDC.
PG13 HV Plasma Generator Kit $64.95
Air Blasting Ion Generator
Generates negative ions along with a
hefty blast of fresh air, all without any
noise! The steady state DC voltage
generates 7.5kV DC negative at 400uA,
and that’s LOTS of ions! Includes 7 wind
tubes for max air! Runs on 12-15VDC.
IG7 Ion Generator Kit $64.95
Speedy Speed Radar Gun
Our famous Speedy radar gun
teaches you doppler effect the
fun way! Digital readout dis-
plays in MPH, KPH, or FPS. You
supply two coffee cans! Runs on
12VDC or our AC125 supply.
SG7 Speed Radar Gun Kit $69.95
Tri-Field Meter Kit
“See” electrical, magnetic, and RF fields as
a graphical LED display on the front panel!
Use it to detect these fields in your
house, find RF sources, you name it.
Featured on CBS’s Ghost Whisperer to
detect the presence of ghosts! Req’s 4 AAA batteries.
TFM3C Tri-Field Meter Kit $74.95
USB Experimenter’s Kit
Get hands-on experience devel-
oping USB interfaces! 5 digital
inputs, 8 digital outputs, 2 analog
I/O’s! Includes diagnostic software and DLL for use
with Windows based systems. The mystery is solved
with this kit!
K8055 USB Experimenter’s Kit $49.95
Tickle-Stick Shocker
The kit has a pulsing 80 volt tickle
output and a mischievous blink-
ing LED. And who can resist a
blinking light and an unlabeled
switch! Great fun for your desk,
“Hey, I told you not to touch!” Runs on 3-6 VDC.
TS4 Tickle Stick Kit $12.95
Retro Nixie Tube Clock
Genuine Nixie tubes popular in
the 50’s brought back in one of
the neatest digital clocks around
today! Hand made teak maple base, 12/24 hour for-
mat, soft fade-out, auto-dim, and a crystal time base at
20ppm! Tube kits also available.
IN14TM Teak Maple Nixie Clock Kit $329.95
UT5A
UT5AS
3-In-1 Multifunction Lab
The handiest item for your
bench! Includes a RoHS
compliant temp controlled
soldering station, digital mul-
timeter, and a regulated lab power supply! All in one
small unit for your bench! It can’t be beat!
LAB1U 3-In1 Multifunction Solder Lab $134.95
Electret Condenser Mic
This extremely sensitive 3/8” mic
has a built-in FET preamplifier! It’s
a great replacement mic, or a perfect
answer to add a mic to your project.
Powered by 3-15VDC, and we even include coupling
cap and a current limiting resistor! Extremely popular!
MC1 Mini Electret Condenser Mic Kit $3.95
Sniff-It RF Detector Probe
Measure RF with your standard
DMM or VOM! This extremely sensi-
tive RF detector probe connects to
any voltmeter and allows you to
measure RF from 100kHz to over 1GHz! So sensitive it
can be used as a RF field strength meter!
RF1 Sniff-It RF Detector Probe Kit $27.95
Broadband RF Preamp
Need to “perk-up” your counter or
other equipment to read weak sig-
nals? This preamp has low noise and
yet provides 25dB gain from 1MHz to well
over 1GHz. Output can reach 100mW! Runs on
12 volts AC or DC or the included 110VAC PS. Assmb.
PR2 Broadband RF Preamp $69.95
201101.qxd 12/7/2010 9:43 AM Page 21

Cat 5 Cable Tester

Low Battery Circuit

Model Railroad Sequencer



CAT 5 CABLE TESTER
Q
I do quite a bit of CAT-5/6
cable installations for
telephone and data
networks. Although I teach
my crew to be very careful when
attaching a RJ-45 plug or jack,
invariably we end up with a few
cables with crossed, open, or shorted
circuits.
There are quite a number of
LAN/telephone circuit testers on the
market which are able to identify
which pair or wire is shorted,
crossed, or open, but the biggest
problem and time waster is
knowing which “end” needs to be
fixed. One of Murphy’s Laws states
that we will spend 20 minutes
going to and inspecting the wrong
end. Sometimes it’s so difficult to ID
the conductor colors in a plug that
we end up cutting off and
Q
&
A
■WITH RUSSELL KINCAID
WHAT’S UP:
Join us as we delve into the
basics of electronics as applied
to every day problems, like:
In this column, I answer questions about all
aspects of electronics, including computer hardware,
software, circuits, electronic theory, troubleshooting,
and anything else of interest to the hobbyist. Feel
free to participate with your questions, comments,
or suggestions.Send all questions and comments to:
Q&A@nutsvolts.com
22 January 2011
■ FIGURE 1
Q&A - Jan 11.qxd 12/7/2010 4:44 PM Page 22
www.downmagaz.com
reconnecting both ends. Sometimes the mistake even
gets repeated.
No one seems to make a tester that can ID which
end of the cable needs fixing. It seems to me that a
circuit tester with a little more processing power and
smarts could also determine if, say, wire 1 is on pin 1
at end “A” but on pin 2 at end “B.”
Yes, there are considerations for “cross-over” and
data “A”/“B” circuit connections, but most good
technicians know how to keep that in perspective for
the type of circuit being connected and tested.
A CAT-5/6 cable tester to ID the miswired end
would sure be welcomed and a very worthwhile
project to build. Any help would be greatly
appreciated.
— Vonn Hockenberger
A
You would need a time delay reflectometer
to determine which end has the error; if
there is no time delay, the problem is at the
transmitter end. Even if tests show that pin 1
of end A connects to pin 1 of end B, etc., it could be
that wire 1 of pair 2 has been swapped with wire 1 of
pair 3 on both ends. The nominal impedance of 100
ohms will be off for pair 2 and pair 3, so that has to be
checked. Short circuits are most likely to occur
between adjacent pins but if a microprocessor is used,
it is just as easy to check every pin.
I was intrigued by the problem of a comprehensive
cable test, so I came up with the schematic in Figure
1. There are two tests: a short test where the
microcontroller makes RB0 (pin 6) high and the
other three (RB1, RB2, RB3) low. Q2, Q3, and Q4
are turned on making those three cable pairs low. If
either pin 1 or pin 2 of J2 or J1 is shorted to one of the
low pairs, the collector of Q1 will be low even though
it is not turned on and the connection to RB4 will
register a failed test. This test will not detect a short
between pins 1 and 2, but that will be checked in the
next test.
The second test is a load test where RB0 is
made low and RB1, RB2, and RB3 are high. Q5 and
Q1 are turned on and the transistors in the other
cable pairs are turned off. The Q5 circuit is a
constant current of 10 mA driving pin 2 of J2. This
will develop one volt across R1 in the receiving
termination which is fed through RLY1 to a window
comparator at pins 2 and 10 of IC1. Pins 1 and 17 of
IC1 are the other comparator inputs which are biased
at 0.85 and 1.15 volts, respectively. If the signal is
between 0.85 and 1.15, both comparator outputs are
low and the test is good. If the signal is above 1.15 (open
circuit), D8 is turned on; if the signal is below 0.85 (short
circuit), D7 is turned on. The test stops when a failure
occurs so you can see if it was a load test (D5 lighted) or
a short test (D6 lighted). If I can make it work, I plan to
have a continue button so the operator can check for
more faults.
In the CAT specs, pins 1 and 2, 5 and 4, 3 and 6, 7
and 8 are pairs. I don’t know why it is that way, but you
have to be aware that when pair 3 and 6 is load tested,
RB1 is set low and the circuit returns to pin 6 of J2. When
pair 5 and 4 is load tested, RB2 is low and the circuit
returns to pin 4 of J2.
The program is in Figure 2 and is mostly self-
QUESTI ONS & ANSWERS
January 2011 23
www.nutsvolts.com/index.php?/magazine/article/january2011_QA
'****************************************************************
'* Name : CAT 5/6 CABLE TESTER *
'* Author : RUSS KINCAID *
'* Notice : KINCAID ENGINEERING *
'* Date : 10/20/2010 *
'* Version : 1.0 *
'* Notes : TWO TESTS ARE DONE: A SHORT TEST AND A LOAD TEST *
'* : *
'****************************************************************
REM REM REM REM DEVICE = 16F627A
TRISA = %00101111 '1 = INPUT, 0 = OUTPUT FOR PORT A
REM REM REM REM RA4 IS UNUSED, SET AS OUTPUT. RA5 IS INPUT ONLY BY DESIGN
TRISB = %11110000 '1 = INPUT, 0 = OUTPUT FOR PORT B
CMCON = %0100 'COMPARATORS SET AS TWO INDEPENDENT
REM REM REM REM THE INTERNAL VOLTAGE REFERENCE IS NOT USED
SHORT_TEST:
PORTB = 1 'SETS RB0 HIGH, RB1-3 LOW
IF IF IF IF PORTB.4 = 1 THEN THEN THEN THEN GOTO GOTO GOTO GOTO SHORT2
IF IF IF IF PORTB.4 = 0 THEN THEN THEN THEN LOW LOW LOW LOW PORTA.7 'SHORT INDICATION
GOSUB GOSUB GOSUB GOSUB WAITF
SHORT2:

PORTB = 2 'SETS RB1 HIGH, RB0,2&3 LOW
HIGH HIGH HIGH HIGH PORTA.7 'RESET THE FAULT LED
IF IF IF IF PORTB.5 = 1 THEN THEN THEN THEN GOTO GOTO GOTO GOTO SHORT3
IF IF IF IF PORTB.5 = 0 THEN THEN THEN THEN LOW LOW LOW LOW PORTA.7 'SHORT INDICATION
GOSUB GOSUB GOSUB GOSUB WAITF
SHORT3:

PORTB = 4 'SETS RB2 HIGH, RB0, 1&3 LOW
HIGH HIGH HIGH HIGH PORTA.7
IF IF IF IF PORTB.6 = 1 THEN THEN THEN THEN GOTO GOTO GOTO GOTO LOAD_TEST
IF IF IF IF PORTB.6 = 0 THEN THEN THEN THEN LOW LOW LOW LOW PORTA.7 'SHORT INDICATION
REM REM REM REM CABLE PAIR 4 WAS TESTED AGAINST ALL OTHERS PREVIOUSLY
GOSUB GOSUB GOSUB GOSUB WAITF
LOAD_TEST:

PORTB = 14 'SETS RB0 LOW, OTHERS HIGH
HIGH HIGH HIGH HIGH PORTA.7
PAUSE PAUSE PAUSE PAUSE 10 'TIME FOR COMPARATORS TO SETTLE
IF IF IF IF CMCON.6=0 AND AND AND AND CMCON.7=0 THEN THEN THEN THEN GOTO GOTO GOTO GOTO PAIR2
IF IF IF IF CMCON.6=1 OR OR OR OR CMCON.7=1 THEN THEN THEN THEN GOSUB GOSUB GOSUB GOSUB CHECK
PAIR2:
PORTB = 13 'SETS RB1 LOW, OTHERS HIGH
PAUSE PAUSE PAUSE PAUSE 10
IF IF IF IF CMCON.6=0 AND AND AND AND CMCON.7=0 THEN THEN THEN THEN GOTO GOTO GOTO GOTO PAIR3
IF IF IF IF CMCON.6=1 OR OR OR OR CMCON.7=1 THEN THEN THEN THEN GOSUB GOSUB GOSUB GOSUB CHECK
PAIR3:
PORTB = 11 'SETS RB2 LOW, OTHERS HIGH
PAUSE PAUSE PAUSE PAUSE 10
IF IF IF IF CMCON.6=0 AND AND AND AND CMCON.7=0 THEN THEN THEN THEN GOTO GOTO GOTO GOTO PAIR4
IF IF IF IF CMCON.6=1 OR OR OR OR CMCON.7=1 THEN THEN THEN THEN GOSUB GOSUB GOSUB GOSUB CHECK
PAIR4:
PORTB = 7 'SETS RB3 LOW, OTHERS HIGH
PAUSE PAUSE PAUSE PAUSE 10
IF IF IF IF CMCON.6=0 AND AND AND AND CMCON.7=0 THEN THEN THEN THEN END END END END
IF IF IF IF CMCON.6=1 OR OR OR OR CMCON.7=1 THEN THEN THEN THEN GOSUB GOSUB GOSUB GOSUB CHECK
PORTB = 0
HIGH HIGH HIGH HIGH PORTA.6
HIGH HIGH HIGH HIGH PORTA.7
STOP STOP STOP STOP 'TURN OFF FAULT LEDS, END OF TEST
CHECK:
IF IF IF IF CMCON.6 = 1 THEN THEN THEN THEN LOW LOW LOW LOW PORTA.6 'OPEN CIRCUIT
IF IF IF IF CMCON.7 = 1 THEN THEN THEN THEN LOW LOW LOW LOW PORTA.7 'SHORT CIRCUIT
GOSUB GOSUB GOSUB GOSUB WAITF
HIGH HIGH HIGH HIGH PORTA.7
HIGH HIGH HIGH HIGH PORTA.6 'RESET THE FAULT LEDs FOR THE NEXT TEST
RETURN RETURN RETURN RETURN
WAITF:
WHILE WHILE WHILE WHILE PORTA.5 = 1
GOTO GOTO GOTO GOTO WAITF
WEND WEND WEND WEND
WHILE WHILE WHILE WHILE PORTA.5 = 0
GOTO GOTO GOTO GOTO WAITF 'DON'T PROCEED UNTIL THE FINGER IS OFF
WEND WEND WEND WEND 'THE BUTTON
RETURN RETURN RETURN RETURN
END END END END
■ FIGURE 2
Q&A - Jan 11.qxd 12/2/2010 8:28 AM Page 23
explanatory. I realize that I did not
answer your question but I will think
about a time delay reflectometer and
perhaps have something in a later
issue.
LOW BATTERY CIRCUIT
Q
I am trying to design a low
battery cutoff for a project
that uses 12V SLA (sealed
lead-acid) batteries. One of
the items it is powering will drain the
battery lower than the charger can
recover. I need the unit to cut off
output current when the battery
reaches around 11 volts, then kick
back on when the battery reaches
12V. I tried using simple SPDT relays,
but the cut in/cut out voltage was
too low. Cost and simplicity is a
factor for this, as well. I’d also like
this to be in a module form that I can
bury inside the item, so I don’t want
to have any external switches or
buttons if possible.
— Scott Bradford
A
This circuit (Figure 3) has
hysteresis such that it
switches at 12V and 11V of
the battery.
Computation of the
resistor values is a little
complicated but
straightforward: R1
supplies 5 mA to the
green LED which is
used as a voltage
reference, assumed to
be 2.2V. The voltage
divider, R2, R3,
represents the battery
at Vd; when the battery
is 11 volts, Vd = 1.83V,
and by inspection, when
the battery is 12 volts, Vd = 2V.
Now it is useful to simplify the
circuit as in Figure 4. Rb is the
parallel combination of R4, R6, and
R5, but R5 is large enough to be
neglected which simplifies the
calculation of R4 and R6. Choose Rf
to be one meg, then Rb = 17.3K and
Vbias = 1.86V. Since the LED voltage
is 2.2V, the voltage divider, R4, R6, is
needed to get 1.86V. Now we have
to solve two simultaneous equations
in R4, R6:
R4*R6/(R4 + R6) = 17.3K and
2.2*R6/(R4 + R6) = 1.86
You can solve this with a BASIC
program, or Eureka gives the
solution: R4 = 20.46K, R6 = 111.94K.
Standard 1% values that will work are
20K and 113K.
LED REPLACEMENT FOR
AN INCANDESCENT
LAMP
Q
I want to replace an
incandescent lamp with an
LED. The lamp is obsolete.
What it needs to do is send
light in the 880 nm wavelength to a
photo diode. I tried a lot of different
IR LEDs but I’m still having trouble
getting the LED light source to equal
the incandescent lamp. I tried using
LEDs from 20 mA to 100 mA, and it
still doesn’t work that great. I don’t
get the distance that I need; it needs
to reach about two inches. Also,
what about the viewing angle? Do I
want more or less for longer
distance? I’m guessing less because it
would be more concentrated. The
source voltage is 12V and the LED
has a voltage drop of 1.8V at 100
mA DC.
My understanding is that you get
more power by pulsing the LED than
by using a constant source. Would
that give me a greater distance? Any
help will be appreciated.
— Jeff Miller
A
Your system was designed
to work with a constant
incandescent source, so
how it would respond to
pulses is unknown. The LED can
produce much higher peak power
when pulsed, but the average power
cannot exceed the DC rating of the
device. Narrowing the beam angle
does increase the power and you can
do that optically.
You might be better
advised to change the
sensor to one that is
compatible with the IR
LED. Garage door
systems work over a
distance of 10 feet so
two inches should not
be a problem. I have
had success with
RadioShack
components for a
distance of six inches.
24 January 2011
■ FIGURE 3
■ FIGURE 4
■ FIGURE 5
Q&A - Jan 11.qxd 12/7/2010 11:28 AM Page 24
www.downmagaz.com
What do you know
about the sensor? Do
you know the part
number? How many
leads does it have? Is
it in a TO-92 package
or T-1 3/4 or other? If
you install a 38 kHz IR
receiver and pulse the
LED at 38 kHz, two
inches will be a piece
of cake. RadioShack
part number 276-640
is a three lead receiver
(power, ground, and
output). If your sensor
is two leaded, you will
need to find a source
of 5 VDC to power
the receiver. The
metal standoff of the
RadioShack receiver
may have some
heatsink function, so I would not cut
it off but bend it out of the way and
use a dab of silicone to mount the
receiver.
The phototransistor (RadioShack
276-145) will plug right in the place
of the photodiode. If that doesn’t
work, there is definitely a problem
elsewhere in the receiving circuit. In
that case, I recommend using the
276-640 IC receiver which has a
logic level output. You will need a 38
kHz transmitter; see Figure 5.
MODEL
RAILROAD
SEQUENCER
Q
Love your
previous model
railroad circuits.
My layout has
10 amusement park rides;
each powered with their
own wall wart power
supply. I would like to
build a sequencer that
would turn the rides on
randomly ... like an actual
amusement park. One,
all, or none could be on
at a time. The rides
should run for a fixed
period, like 10-15
seconds per period. Every circuit I
think of does not produce random
results. Any suggestions?
— Dominick Senna
A
The BASIC language
RANDOM command
comes to mind which
implies the use of a
microcontroller. I don’t know how to
randomly change the output ports
because they are not programmable.
I could produce a random BCD code
and use a one of 10 decoder, but
that only turns on one at a time.
Perhaps a loop that turns on different
numbers of rides in a pseudo
random fashion will work; see Figure
6 and the program in Figure 7 (I
went through a number of more
complicated programs before this
one).
The schematic in Figure 6 is
partial; you will have a relay and
varistor on all 10 outputs. The
switches S1, S2, and S3 allow you to
change the cycle time.
The reset button is not
needed; all it does is
restart the sequence. I
was surprised to see that
even though port A uses
only the low two bits,
one or the other or both
are always on. I had
thought that even
though the random
process does not include
zero, those two bits
would be zero a lot of
the time; not so. The
relay is rated at 350 volts,
100 mA which should be
adequate in the primary
circuit. The varistor
protects the relay from
the inductive kick when
it shuts off. NV
QUESTI ONS & ANSWERS
January 2011 25
■ FIGURE 6
'****************************************************************
'* Name : MODEL TRAIN SEQUENCER *
'* Author : Russ Kincaid *
'* Date : 10/26/2010 *
'* Version : 1.0 *
'* Notes :THERE ARE 10 OUTPUTS, RANDOMLY SEQUENCED. THE TIME *
'* :BETWEEN SEQUENCES IS PROGRAMABLE, 5, 10 ,15, OR 20 *
'* :SECONDS.
'****************************************************************
REM REM REM REM DEVICE = 16F627A
CMCON = 7 'DISABLE ANALOG INPUTS
TRISA = %00111100 'RA0, RA1 OUTPUT,RA6, RA7 OUTPUT OTHERS
INPUT
TRISB = 0 'ALL OUTPUTS
WAITE VAR VAR VAR VAR WORD WORD WORD WORD 'WAIT IS A RESERVED WORD, CAN'T BE A
VARIABLE
SEQ VAR VAR VAR VAR BYTE BYTE BYTE BYTE 'MAXIMUM VALUE IS 255
A VAR VAR VAR VAR BYTE BYTE BYTE BYTE
START:
WAITE = 5000 '5 SECONDS
IF IF IF IF PORTA.0 = 0 THEN THEN THEN THEN WAITE = 10000 '10 SECONDS
IF IF IF IF PORTA.1 = 0 THEN THEN THEN THEN WAITE = 15000 '15 SECONDS
IF IF IF IF PORTA.2 = 0 THEN THEN THEN THEN WAITE = 20000 '20 SECONDS

RANDOM RANDOM RANDOM RANDOM SEQ
RANDOM RANDOM RANDOM RANDOM A
PORTB = SEQ
PORTA = A
PAUSE PAUSE PAUSE PAUSE WAITE
GOTO GOTO GOTO GOTO START
END END END END
■ FIGURE 7
Q&A - Jan 11.qxd 12/7/2010 4:49 PM Page 25
26 January 2011
www.noritake-elec.com/y-series.htm
Shop online: noritake-vfd.com/yseries.aspx
2635 Clearbrook Drive
Arlington Heights, IL 60005
(847) 439 - 9020
Y Series VFD Module
• Bright VFD technology
• Brightness boost
• Highlight function
• More characters
• Available in LCD footprints
• Serial and parallel interfaces
• Selectable font sizes
• Custom font table: 224 char.
Various VFD modules available
Star Bright
* Quality Quick Turn
Sheet Metal Products
&
Precision Machined Parts
* No Minimum Quantity
Restrictions
* Quote in 24 Hours
or Less!
* Several Metallic &
Non-Metallic
Materials in Stock
Visit www.iitmetalfab.com
today for your free, no
obligation quote!
Page 26 Jan11.qxd 12/7/2010 11:27 AM Page 26
www.downmagaz.com
A fictional engineer we'll call John Archer spent a decade designing hardware
and writing code for microprocessor-controlled games manufactured by a toy
company. Citing a market for "back to basics" toys, the company president said
he wanted to introduce a new line of simple games that would flash a red LED
when a target was struck by a rubber band, rubber ball, or other reasonably-
safe projectile. The catch: The game should not use a battery or external
source of power. How did Archer solve this very different assignment?
Go to www.Jameco.com/search9 to see if you are correct.
The puzzle was created by Forrest M. Mims III
1-800-831-4242 | www.Jameco.com
Sign up for our e-newsletter
and get a FREE comic book.
www.Jameco.com/adventure1
What is
the missing
component?
F
R
E
E
!
F
R
E
E
!
January 2011 27
Full Page.qxd 12/7/2010 9:50 AM Page 27
P R O D U C T S
NEW
■ HARDWARE
■ SOFTWARE
■ GADGETS
■ TOOLS
28 January 2011
CHIPINO
MODULE
T
he CHIPINO is a Microchip PIC-
based module with the Arduino
connection scheme. The CHIPINO —
developed by the Chipaxe Team —
chipaxe.com matches the board
outline, mounting holes, connector
spacing, and most of the
microcontroller I/O functions found
on the popular Arduino. The
CHIPINO offers PIC users the
opportunity to use existing compiler
and programming tools with all the
shields available to the open source
world of Arduino.
The CHIPINO name comes from
an Italian fishing town in San
Francisco, CA, where fisherman were
asked to “chip in” at the end of the
day from their daily catch. The result
was a community soup (Chipino
soup) everyone could share.
CHIPINO, does this same thing by
offering an open source platform to
build upon and then share
application ideas. CHIPINO is
programmed directly with an open
sourced PICkit 2 or clone
programmer. This programming
method allows a user to plug any
blank PIC16F or PIC18F 28-pin
0.300” pitch into it, and program in
Assembly, BASIC, C, Pascal,
Flowcode, or any other compiler that
supports the PIC. The CHIPINO
comes with a PIC16F886 along with
the Microchip MPLAB IDE and the
HI-TECH C compiler. You also get the
Simple C library from Chuck
Hellebuyck’s future book Beginner’s
Guide to Embedded C Programming
Volume 3 that makes writing C
programs as easy as BASIC or
Arduino. The CHIPINO is offered as
a bare board, a kit of parts, or as a
fully assembled module. Pricing is
$24.95 for a fully assembled module.
Starter kits that include a PICkit 2
clone programmer are also available,
along with a proto-shield that has a
breadboard for building custom
circuitry to interface to the CHIPINO.
RESISTANCE/
CAPACITANCE
DECADE BOX
T
he model RDB-10
from Global
Specialties is a
handheld
resistance decade
box that creates
a specific
resistance value
using a
combination of
switches. Designed
with accuracy to meet
the needs of industry and education
alike, the RDB-10 is a compact,
convenient tool for aiding in
engineering design and testing, as
well as calibration of test equipment.
It offers seven decades of resistance
ranges, from 1 Ω to over 11 MΩ in
one Ω steps. Easy-to-use slide
switches allow for straightforward
addition and subtraction of resistance
values. RDB-10 is a passive device
that requires no
power source. The
unit is housed in a
rugged enclosure
with an impact-
resistant rubber
boot.
T
he model
CDB-10 is a
handheld
capacitance
decade box that
creates a specific capacitance value
using a combination of switches. Also
designed with accuracy for aiding in
engineering design and testing, offers
five decades of capacitance ranges,
from 100 pF to over 11 µF in 100 pF
steps. The CDB-10 has easy-to-use
slide switches and the same rugged
enclosure.
NEW ADDITIONS
TO GEARBOXES
B
aneBots announces new
additions to their highly
successful P60 family of gearboxes.
In addition to the stock gearboxes,
For more information, contact:
Global Specialties
Web:
www.globalspecialties.com
For more information, contact:
CHIPAXE
Web: www.chipaxe.com
or http://chipino.cc
JAN11 - NewProducts.qxd 12/6/2010 3:06 PM Page 28
www.downmagaz.com
literally thousands of custom
configurations will be available
starting in January. Despite their
compact size, these gearboxes pack
a lot into a small package. P60
gearboxes have been applied in an
array of settings, including the
educational, hobby, commercial, and
industrial markets.
With a new total of 34 ratios —
ranging from 3:1 to 672:1 — the
gearboxes can be customized in a
number of ways. Many of the new
options are a result of customer
feedback and requests. The P60
shafts will now be available in 3/8” in
addition to the original 1/2”
diameter, and a hex shaft has also
been added to the line-up. Short,
standard, and long shafts give users
more flexibility in design.
New, multiple mounting patterns
add to the diversity of applications
and ease of use. BaneBots also has
increased the range of motor support
to include industry standard RS-380,
RS-390, RS-395, RS-540, RS-550, and
RS-775 sized motors, as well as
popular hobby motors such as Speed
400 and rock crawler motors. Motors
can be purchased either mounted or
unmounted. Steel ring gear options
give extra strength for those with
more demanding operations, and the
P60 gearboxes can be ordered
greased or ungreased. In the near
future, additional colors will be
available for a customized look, as
well. Another aspect of the P60
gearboxes is that they can be
reconfigured to meet a customer’s
changing needs as a project evolves.
If you own one P60, it is like owning
several. BaneBots has all the gearbox
parts available separately so that the
ratios can be changed without
purchasing a whole new gearbox.
The P60 has always been
designed, manufactured, and
assembled in the US at their Colorado
facility. Components are CNC
machined for tight tolerances and
contain cold rolled steel gears and
hardened 4140 steel carrier plates.
rKEY

ROBUST
CAPACITIVE
SWITCH FOR
INTERACTIVE
DESIGNS
R
ogue Robotics introduces
the new rKEY™ capacitive switch
product series. The rKEY capacitive
switches allow OEM designers and
hobbyists to quickly and easily add
capacitive touch switches to their
projects and products.
The rKEY capacitive switch series
are compact (starting at 2” by 2”
down to 1.25 x 1.25”) footprint
boards, providing an easy-to-use non-
mechanical touch switch for
environmentally sealed environments
and interactive displays such as music
playback stations.
The capacitive switches are self-
calibrating and extremely robust for
harsh environments. The rKEY can be
mounted behind various materials —
plastics, wood, and glass — to a
suggested maximum thickness of
0.4,” and have an operating
temperature range of –40C to +85C.
The rKEY-1.5 has a 1.5” x 1.35”
key area and a 2” x 2” footprint; the
rKEY-1.0 has a 1” x 1” key area and a
1.5” x 1.5” footprint; and the rKEY-
.75 has a 1.35” x1.25” footprint. The
rKEY switch (1.5” x 1.35”) module
retails for $11.99 (qty. 1) and $8.99
each (qty. 100).
■ H A R D W A R E ■ T O O L S ■ G A D G E T S
For more information, contact:
BaneBots
Web: www.banebots.com
January 2011 29
continued on page 49
For more information, contact:
Rogue Robotics
416-707-3745
Email: sales@roguerobotics.com
Web: www.roguerobotics.com
JAN11 - NewProducts.qxd 12/6/2010 3:07 PM Page 29
By Norm Looper
EXPLORE ELECTRONIC
CHAOS
■ FIGURE 1.The completed chaotic oscillator.
Chaos is best viewed as a form of
“constrained randomness” and is all
around us: bubbling cells of hot oatmeal;
the colliding, rapid drips from a faucet;
the unseen vortices of air tumbling off
the back of your sedan; stable patches of
commuter gridlock; and the movement of
monetary “fluids” in distressed financial
markets. Many times the governing
relationships of these fluids will show
domains where they can be chaotic, and
fundamentally unpredictable.
30 January 2011
A Simple Chaotic
Oscillator You
Can Build
You can build a simple, electronically-driven
pendulum that can produce automatic, perpetual chaotic
motions showing no discernable regularities.
Nonetheless, this device (shown in Figure 1) has some
residual order – but we can’t see it readily when plotted
against time. In a future article, we will explore how this
kind of hidden order can be found and displayed.
How The Pendulum Works
Our chaotic pendulum consists of three
subsystems: the mechanical pendulum itself, with a
doughnut-shaped permanent magnet serving as the
plumb bob, mounted on a wooden arm; a power
supply that charges capacitors and powers the
electronics; and the pendulum driver electronics. The
driver electronics detect when the plumb bob is
transiting a central electromagnet, and discharges the
capacitors through this electromagnet to repel the
plumb bob and sustain its motion. “Planetary” or
satellite button magnets can be placed by the
experimenter at a variety of different radii and angles
relative to the central electromagnet to configure the
general size and character of the plumb bob’s chaotic
motion.
Electronic Operation
The Pendulum Power Supply
Refer to the schematic in Figure 2. Transformer T1
supplies a nominal secondary voltage of 28 VAC RMS to
bridge rectifier BR1 which charges capacitor bank (C6, C7,
C8) through power resistors (R13, R14). Resistor R15 and
shunt regulator VR1 provide a (+) five volt regulated rail for
the digital electronics.
The Pendulum Driver Electronics.
Refer to Figures 3.1, 3.2, 4, and 5. Magnetic switch
SW1 detects passage of the plumb bob magnet C over the
center of coil L1. A 1 kHz clocking square wave, CLK, is
applied to CLK input U1-3 only if the switch closes when
capacitors (C6, C7, and C8) are fully charged. CLK is
generated by the U3 relaxation oscillator comprised of U3
(8, 9, and 10), C3, and R5.
If /RESET is high at U1-1 when U1 is clocked at pin 3,
then /Q goes low — this turns off the CLK and also charges
C2 through R3. Together, C2 and R3 create a delay with a
time constant of about 50 milliseconds, after which U2 (3,
Looper - Chaos Pendulum.qxd 12/7/2010 2:25 PM Page 30
www.downmagaz.com
January 2011 31
www.nutsvolts.com/index.php?/magazine/article/january2011_Looper
■ FIGURE 3.1. Logic
section of the pendulum
driver electronics.
U4 (Figure 3.2) displays the versatility of the
TLC555 CMOS timer when U3 is used in the
astable mode — we use the timer to control the
charge and discharge of voltages much greater
than its own operating voltage of (+) five volts.
Two voltage divider sets — (R6, R7) and (R8,
R9) — attenuate VCAP down to the required
trigger level (1.67 volts on U4-2) and threshold
level (3.33 volts on U4-6) for astable operation.
Note that output U4-3, acting through U2-8,
controls the resetting of the flip-flop at U1-1;
this prevents retriggering of the flip-flop from
occurring until storage capacitors (C6, C7, C8)
are fully charged.
As we see in Figures 4 and 5, the VCAP
waveform lags the timer output, Vo, at U4-3 by the
■ FIGURE 3.2.
Timer section
of the pendulum
driver electronics.
■ FIGURE 2. Schematic of the
pendulum power supply.
6) transitions high, turning on MOSFET Q1 and discharging VCAP through solenoid L1. This delay gives the plumb bob C
time to travel off-center so that L1 can give it an optimal sideways magnetic “push.”
Looper - Chaos Pendulum.qxd 12/7/2010 4:36 PM Page 31
How To Make It:
Assemble The
Pendulum Arm
See Figures 6.1 and 6.2 to fabricate the relevant parts.
These involve only simple cuts and a few drilled holes. A
hand vice works well for the drill. Pendulum post I and the
three stanchions, S, use the same dowel stock.
Lightly sand around the bottom circumference of A
and then cement a doughnut magnet C with a 3/8”
diameter hole snugly on to the bottom with general-
purpose cement. Alternatively, a hole for a wood screw
has been provided.
Note: The chain is necessary. Do not use an “S” hook
to connect the pendulum arm to the pendulum cantileve,
since this forces the pendulum into a largely fixed plane of
oscillation.
Cantilever F will form a snug fit
through the hole in slide G, but it will still
be moveable as needed. The thumbscrew
H will self-thread through the soft plastic
of the slide.
32 January 2011
■ FIGURE 6.1. Pendulum arm parts.
■ FIGURE 6.2.The
cantilever slide (G).
50 millisecond delay introduced by R3
and C2. Note also that U2 (11, 12, 13)
provides a short 50 microsecond
“housekeeping” delay to prevent SETD
from setting the flip-flop’s D input (U1-2)
high while /RESET at U1-1 is bringing the
flip-flop out of reset.
■ FIGURE 5.Timing
photograph of the
pendulum driver
electronics.
■ FIGURE 4. Timing diagram of the
pendulum driver electronics.
Looper - Chaos Pendulum.qxd 12/2/2010 8:38 AM Page 32
www.downmagaz.com
Assemble The
Pendulum
Platform
And Base
The following order of
assembly is critical to
obtain a good fit of the
parts because the “egg
shell” plastic platform U is
cut from a fluorescent
light ceiling diffuser and is
injection molded to exact
dimensions. (See Figure
7.1.) Cut platform U from
the diffuser stock as 16 x
16 complete squares using sharp flush-cut pliers.
Fabricate the button magnets as shown in Figure 7.2.
To orient the correct surface of the button magnets
pointing upward, using the bottom of doughnut magnet C,
make sure the button magnets are installed in the cap
plugs so that the top side of each button REPELS the
BOTTOM of magnet C in its mounted orientation.
As shown in Figure 8, drill the base T from pre-cut
hardwood stock. (See the Parts List.)
As shown in Figure 9, slide reducer R on to the
bottom of post I, flange down. Glue post I into the drilled
hole, flush with the bottom of base T. Then slide reducer R
down snuggly on to base T and cement it to T with a
small amount of cement under the flange of R.
Before the glue dries, use a vertical spirit level to make
small adjustments to post I to insure that it is vertical in
two directions. Set it aside to dry in a protected place.
Continuing with Figure 9, insert three wood
stanchions, S, into the corner closed cells of platform U. If
necessary, lightly sand the
stanchions around the top 1/2
inch of their circumferences to
produce a tight but sliding fit.
Bring the top of each stanchion
flush with the top of U. Slide three
reducers, R, on to the three
stanchions.
Slide the entire assembly of
S,U up against post I so that I is
flush with the sides of the open
corner square in platform U.
Visually insure that the perimeter
of platform U is parallel to the
sides of base T. Keep the
stanchions inserted in U, then
carefully lift up each remaining
corner of U and apply ample
wood glue to the bottom of each
stanchion S, reseating the
stanchions firmly onto base T by
pushing down on platform U. Set a few books on the
platform to apply pressure, and allow the assembly to dry.
When dry, attach three feet, V1, to base T by drilling
back through the three stanchion holes in the bottom of
January 2011 33
■ FIGURE 7. 1.
The platform (U).
■ FIGURE 7.2. Button magnet fabrication using cap plugs.
■ FIGURE 8. Drilling the base (T).
Looper - Chaos Pendulum.qxd 12/2/2010 8:38 AM Page 33
platform T, to a total depth of 25 mm (one inch), and
attaching each foot with hardware V2 and V3. Attach a
foot V1 to the bottom of post I also. Apply a small amount
of wood cement neatly to the bottom flanges of each
reducer, R, and seat them firmly on to base T. Wipe away
any excess wood cement immediately with a damp rag.
Wiring The Switch And
Winding The Solenoid
The coil form can be constructed from two PVC
irrigation reducers back-to-back as shown in Figure 10.1
and 10.2. Alternate winding forms are possible, but you
must achieve the specified turns to create an adequate
magnetic field. With an emergent lead length of 250 mm
(10 inches) shown, wrap 500 turns of 32 AWG (or 700
turns of 30 AWG) insulated magnet wire around J and
secure the windings tightly with square-cut masking tape.
Keep the windings approximately uniform. Dress the leads
down and out to the left side of J and secure with PVC
cement.
Cut wires M1 and M2 to 250 mm length using 30
AWG solid wire and strip/sand back the insulation from
one end of each wire about 1/2 inch. Wrap and solder
these ends to the flat ribbon leads of magnetic switch L
(circuit designator SW1), bending the soldered ribbons as
shown in Figures 10.1 and 10.2.
Attach an ohmmeter to the switch leads. Since switch
L (SW1) will be mounted vertically, it is important to
determine which end will activate the switch closure when
34 January 2011
PARTS LIST
DESCRIPTION DESIGNATOR QTY MFG/PART # SOURCE
Mechanical
Plywood Base T, birch, 12 mm x 12" x 12". T 1 Revell SKU 307232
Often stocked,
but can be ordered MI or phone
Platform U, white eggcrate louver U 1 Lithonia Lighting L2GTPLTS 1-800-MICHAELS
643335. H/D: U546021 HD
Post I, 5/8 inch diameter wood dowel I 1 HD; LO; AH
Stanchion S, 5/8 inch diameter wood dowel S 3 Post I mat'l.
Pendulum arm A, 3/8 inch diameter wood dowel A 1 HD; LO; AH
Pendulum cantilever F, 5/16 inch wood dowel F 1 HD; LO; AH
Reducer bushings, irrigation, PVC, Sched. 40, 3/4"x 1/2" R 4 Dura USA D2466 HD; AH; LO
Reducer bushings, irrigation, PVC, Sched. 40, 1/2" x 1/4" J 2 Dura USA D2466 HD; AH; LO
Washer, flat, metal, 8 mm (5/16 inch) diameter V2 4 (any) HD; AH; LO
Wood screw, pan head Phillips, #8 x 1-1/4 inches long V3 4 Crown Bolt 24961 or equiv. HD; AH; LO
Enclosure, aluminum, two pieces, 8 " x 6 " x 3.5" (None) 1 LMB-HEEGER LMB # TF-783 FY
Screw eyes, 1" long x approx. 3/8 " I.D. B, E 2 Crown Bolt #214, or equiv. HD; AH; LO
Cap plugs, Type T, polyethelene. Ask for 10 pcs (None) 8 Size 6-X cap plug
Magnets, round, ceramic, 1/2 inch O.D. (None) 6 RS: Catalog No. 64-1883 RS
Chain, jewelry, fine scale, 244 cm (96 inches) D 1 Hirschberg & Schutz MI or phone
Item No. MM32329-01 908-810-1111
Magnet, ceramic, "doughnut," 3/8 inch I.D., five pack C 1 RS: Catalog No. 64-1888 RS
Magnet, ceramic, round, 1/2 inch O.D., five pack (None) RS: Calalog No. 64-1883 RS
Pipe, PVC, irrigation, x inch O.D. (scrap piece) G
Fuse holder, cartridge, panel mt., #3AG, 1/2 inch dia., 10A/250V FS1 1 DK: F1484-ND; RS: 270-364 or
FY: NTE 74-FH6-8 DK; RS; FY
Fuse, 1/8 A, bayonet (size) F1 1 Various DK; RS
Grommet, black rubber, 3/8" dia. For line and signal wiring (None) 2 Various HD; LO; RS
Line cord, 18 AWG x 3, gray rubber insulation, six feet (None) 1 JA: 38009 JA
Closed end spade lug for safety (green) wire to enclosure SW1 1 RS: 64-043 (10 pieces) RS
Standoffs, hex body, 11/16 long each, with two 4/40 screws
each, four pack T1 4 RS: 176-195 RS
Switch, magnetic, plastic molded (only) SW1 (or L1) 1 SRC Devices Dyad®
DK: 420-1047-ND DK
Fahnestock clips for EG, EH, EI, and EJ connections on Base T 4 EL175Pk/10 (10 pieces) ON
Wire, magnet, 30 AWG. Note 32 AWG is preferred RS: 28-1345 (3 gauges, inc. 30) RS
Transformer, 120 VAC to 24 VAC, with PCB pins T1 1 Tamura 3FS-524 or Microtran
Bumpers, screw, white 22 mm (7/8" diameter), four pack V1 4 Shepherd Hdwr. Products,
■ FIGURE 9.
Assembly of
the base and
platform.
Looper - Chaos Pendulum.qxd 12/2/2010 8:41 AM Page 34
www.downmagaz.com
in close proximity to magnet C. Slowly pass the bottom
face of C over each end of L while watching the
ohmmeter for contact closure. Once established, maintain
this up/down orientation of L while threading leads
through the hole in coil form J. Apply a small amount of
wood cement to the sides of switch mount K and position
the switch in the coil form. Dress the leads down and out
to the bottom left. Secure the leads neatly with PVC
cement.
January 2011 35
■ FIGURE 10.2. Switch and coil fabrication.
■ FIGURE 10.1. Switch and coil fabrication diagram.
No. 9131, or equiv. HD
Bumpers, vinyl, clear, 19 mm (3/4 diameter), 12 pack 4 Shepherd Hdwr. Products,
No.9565, or equiv. HD
Heatsink for TO-220 pkg. Mount w/ silicone grease HS1 1 Jameco Valuepro No. 326596 JA
Flat tie holder, Nylon. Use with #6 mtg. hardware and 4 1/2"
cable ties (None) 2 Richco FTH-13 Series
Ask for samples RI
Thumb screw, #10-32 thread x 3/4" long H 1 (various) HD; AH; LO
Semiconductors, leaded only
CMOS dual type D flip-flop, 14 DIP U1 1 74HC74N; DK: 568-1491-5-ND DK
CMOS quad Schmitt nand, 14 DIP U2, U3 2 74HC132N; DK: 568-1395-5-ND DK
CMOS timer 8 DIP U4 1 LM555; DK: LM555CNNS-ND DK
Transistor, Power MOSFET, E-mode, TO-220 pkg Q1 1 Int'l Rec. IRF 510; JA: 209234 JA
Diode, rectifying, 800 volts PRV CR1 1 General Semi. 1N4006;
DK: 54GICT-ND DK
Voltage reference, five volts, TO-92 VR1 1 LM385Z-ND DK
Rectifier, bridge, 100 PRV, one amp BR1 1 Diodes Inc. DF-M Series;
DK: DF01MDI-ND DK
Passive Components, leaded only
Resistor, carbon film, 49.9K, 1%, 1/4 watt R1, R2, R3,
R4, R5, R6,
R8, R10, R11,
R12 10 Yageo; DK: 49.9KXBK-ND DK
Resistor, carbon film, 6.49K, 1%, 1/4 watt R7 1 Yageo; DK: 6.49KXBK-ND DK
Resistor, carbon film, 7.32K, 1%, 1/4 watt R9 1 Yageo; DK: 7.32KXBK-ND DK
Resistor, 100 ohms, five watts R13, R14 2 Digi-Key; DK: TWM5K100E-ND DK
Resistor, 1.3K ohms, two watts R15 1 Phoenix; DK: PPC1.3K-2CT-ND DK
Capacitors, leaded only
Capacitor, .1 µF C1 1 EPCOS; DK P4910-ND DK
Capacitor, 1 µF C2 1 BC Mono-Kap™;
DK BC1151CT-ND DK
Capacitor, .01 µF C3, C4 2 EPCOS; DK: P4904-ND
Capacitor, .001 µF C5 1 EPCOS; DK P4898-ND
Capacitor, 3300 microF, 50 WVDC, x %, alum. electrolytic C6, C7, C8 3 United Chemi-con;
DK: 565-1118-ND or
Nichicon; DK: 493-1347-ND DK
Source abbreviations:
AH: Ace Hardware stores; DK: Digi-Key at digikey.com; FY: Frye's Electronics; HD: Home Depot; JA: Jameco at jameco.com; LO: Lowes Hardware; MI:
Michaels craft stores at michaels.com; ON: Onlinesciencemall.com; RI: richco-inc.com.
“Things fall apart, the center cannot hold,
Mere anarchy is loosed upon the world.”
— Yeats
Looper - Chaos Pendulum.qxd 12/2/2010 8:42 AM Page 35
■ FIGURE 11. Preparing the enclosure.
Preparing The Enclosure
Drill and prepare the enclosure as shown in Figure 11. If you drill through from the bottom, remember that the hole
locations shown are now reversed. Mount four stand-offs as shown using No. 4-40 screws with star washers under the
heads. Tighten them hard.
Wiring And Installing The Transformer
WARNING: 120 VAC is easily handled safely, but it can penetrate human flesh and can even be lethal if you are
superbly careless. Never modify wiring or insulation with power applied. Failure to follow these wiring instructions
constitutes an improper usage of this project and equipment.
Mount T1 tightly upside-down — with the bobbin seated on electrical tape — with nylon cable ties and cable feet
(Figure 12). Use #6-32 hardware to secure the feet — adhesive feet will break loose! Alternatively, bolted cable clamps
can be used. Thread the power cord through the power grommet. Solder the black wire to the fuse holder FS1, making
sure that FS-1 is placed only in the HOT (black) line. Continue the black wire from the opposite end of FS1 to T1-1. The
NEUTRAL (white) line solders directly to T1-2. Connect
the green safety wire of the line cord to the chassis using
a closed-end spade lug that has internal star burrs.
Proceeding, install fuse F1 and without plugging in
the power, run a continuity check of the primary with an
ohmmeter. The black HOT wiring to EA should connect
to the narrow blade of the wall plug and the white
NEUTRAL wire to EB should connect to the wide blade.
Also check continuity between the wide and narrow
blades. You should see the transformer’s primary winding
resistance of about 75 ohms. Then, remove the fuse
while doing this and observe the primary circuit come
open. Replace the fuse and see the primary resistance
return.
Now, cover T1 pins 1 and 2, and any other exposed
wiring with heat-shrink tubing and/or electrical tape. Solder
T1 secondary pins 6 and 7 together with bare wire.
■ FIGURE 12.Wiring and mounting the circuit board.
36 January 2011
Looper - Chaos Pendulum.qxd 12/2/2010 8:42 AM Page 36
www.downmagaz.com
January 2011 37
Wiring The Circuit Board
A printed circuit board for the pendulum drive circuit is
offered by the author. One simple alternative is to wire the
circuitry on two small prefabricated boards — such as
RadioShack part number 276-150 — joining them together
using Gorilla® glue, working over wax paper. (See Figure
13.) I prefer to solder up this kind of board by soldering
with 30 AWG Kynar™ solid wire wrap wire. Use tweezers.
First, wire only the power supply from BR1 through
VR1, omitting U1, U2, U3, and U4. Temporarily connect the
T1 secondary (pins 5 and 8) to the circuit board at points C
and F, and use a voltmeter to check for (+) 4.8 volts to (+)
5.2 volts between the IC power and ground pins. Then, turn
off the power, and observing electrostatic handling
precautions, install the remaining CMOS components.
Bring out circuit points EG, EH and EI, EJ as two twisted
wire pairs. Use stranded hook-up wire, cut to about a one
meter (approx. three feet) length. Alternatively, ribbon cable can be used. (See Figure 12.)
■ FIGURE 13. Component layout on printed circuit boards.
Final Assembly
Mount the circuit board on the remaining four
standoffs (Figure 12) and route the wire pairs EG, EH
and EI, EJ out of the front grommeted hole in the
enclosure.
Snap the mounting platform U down on to the
stanchions, S, and locate and closely mark the position
in U for the coil assembly (J, K, L). Remove U and
cement the coil assembly (J, K, L) to the marked center
of the grid with silicone rubber. When dry, place four
wood screws through four Fahnestock clips and mount
them loosely in the four holes EG through EJ (Figure
14).
Cut and sand the insulation off of each lead coming
from the coil and switch for about 1/2 inch, such that a
90-degree bend of bare wire will fit flat under its
respective Fahnestock clip — about 1/4 inch below the
mounting screw. Do not wrap the wires around the
screws, since they will “scroll” and break when the screws are tightened. As shown in Figure 14, mount the switch leads
M1 and M2 flat under clips EG and EH, and mount the coil leads under clips EI and EJ. Polarity is not yet important.
Self-thread thumb screw H in the bottom hole of the cantilever slide G and insert pendulum cantilever F through the
hole in G. Place this assembly on top of post I. Hook the pendulum arm A with chain D on to hook E on the cantilever.
The cantilever may now be adjusted in three dimensions by sliding through G, and with the thumb screw H. Adjust it so
that magnet C rests centered on coil J below, and about 1/4” to 1/2” above it. When on target, tighten H.
■ FIGURE 14.Wiring the base (EG, EH, EI, EJ, upper to lower).
The screwdriver is on clip EG.
Testing
Strip and connect the two wire pairs EG, EH and EI, EJ
from the enclosure into the eyes of their respective
Fahnestock clips. Select a length for this wiring which will
facilitate placement of the enclosure (a) under base T; or
(b) beside base T; or (c) removed from the base and
otherwise out of sight.
Refer to the circuit waveforms in Figures 4 and 5. Apply
power and check the power rail for stable, quiet (+) five volt
operation. Using your oscilloscope, hold pendulum magnet
C over switch SW1 and observe the ramp waveform at
trigger U4-2 run freely up and down. Monitor the gate of
Q1 for oscillation. Hold magnet C well away from SW1
and observe U4-2 become static at about (+) 5.1 volts.
IMPORTANT! Solenoid J should push away (i.e.,
repel) magnet C when it is pulsed. If not, reverse the wires
at clips EI and EJ.
Looper - Chaos Pendulum.qxd 12/2/2010 8:43 AM Page 37
Experimental Chaotic
Brain Teasers
The assembled button magnets can now be placed
experimentally in the matrix of platform U to produce
chaotic operation. Note that even symmetrical placements
of the button magnets still produces chaotic behavior due
to the inherent nonlinearities of the magnetic fields
involved. Also, you don’t need many magnets to produce
complex results. To start, try the following placement of
five magnets using the x, y locations as shown in Figure 7,
relative to post I: (5,7), (5,10), (9,5), (9,11), and (12,6).
Research Problem 1. Planetary Orbit Stability In A
Binary Star System. Consider pendulum magnet C as
representing a planet in a binary star system and two
button magnets inserted upside down into the bottom of
platform U as representing two parent stars in slow orbital
motion around each other, and therefore attracting the
planet. Can you nudge the planet into an elliptical or
circular orbit that is stable over several minutes? Question:
Do you think that the orbits of the planets in a binary star
system over very long times are guaranteed to be stable?
Research Problem 2. Static Equilibrium. Using any
number of repelling magnets and with power applied to the
electronics, can you find a button magnet configuration which
will result in the pendulum eventually becoming trapped and
permanently at rest outside of the center of the platform?
Research Problem 3. Periodic Behavior. Using at
least one button magnet, can you find a button
configuration that will result in the pendulum adopting a
constant period of oscillation?
After you try these research problems, come up with
some of your own to test out the theories. It’s a good
thing to bring a little chaos to your life. NV
38 January 2011
For further information, contact nglooper@gmail.com.
Looper - Chaos Pendulum.qxd 12/6/2010 11:27 AM Page 38
www.downmagaz.com
1-800-728-6999 • www.scientificsonline.com
Wonder and Inspiration Delivered–Gifts for rocket scientists of today and tomorrow.
For full descriptions of the products featured here, plus hundreds more visit scientificsonline.com.
DIY Discover Electronics Kit
Everything You Need to
Learn Basic Circuit Design
What are the basic electronic parts? How do
they function? How are they related to one
another? These questions and more can be
answered by spending some time with our
electronics kit. It contains over 130 standard
parts – all of the most common electronics
components, as well as a prototyping breadboard for you to get started on projects
right away. Make a light detector, work with IC chips, create an interactive noise maker
and more. No soldering required, and the included illustrated manual guides you
through each of the projects step-by-step. After you build all of the projects you can
use the parts for your own designs too. Recommended for ages 12 and up.
#31522-28 . . . . . . . . . $49.95
Remote Control Machines Kit
Assemble 10 Different Models Demonstrating Motors
This incredibly fun construction kit walks you
through building your own motorized vehicles
and machines and then control them with a
wireless remote control unit. The unique six but-
ton infrared remote allows you to control three
different motors simultaneously, moving each of
them forward or in reverse, with easy-to-activate
touch sensors. The three motors can be combined to make com-
plex vehicles and machines in numerous configurations limited
only by your imagination. Recommended for Ages 8 and up.
#31520-85 . . . . . . . . . $69.95
Laxman "Inner-tainment" System
Unparalled Experience in Focus and Relaxation
Truly in a class all its own, the Laxman 'Innertainment' System is the next generation
of mind machines. The revolutionary technology combines the most effective light and
sound technology with the features of a state-of-the-art multimedia device. The result
is a sensory phenomenon that simultaneously atunes your brain waves to auditory and
visual stimulation, creating a ground-breaking display of colorful shapes and a sensa-
tion unlike any other.
#31521-51 . . . . . . . . $649.00
Laxman Unit includes Ganzfeld – All Color Open Eye
Goggles, built-in MP3 Player with 1 gig storage with
SD mini slot for additional card (not included),
Headphones, USB Cable, Handbook/Instructions
Manual, Microfiber Cleaning Cloth, Support Disk,
and two AA Batteries.
The Swinging Sticks
Mysterious, Continuous Moving Desk Display
Never ceasing, always swinging, this moving
stick model appears to defy gravity and turn
logic on its head. The constant, fluid motion of
the revolving sticks creates an almost hypnotic
effect that your friends, family, and clients will
want to watch for hours. The perpetual motion
illusion was created by an electrical engineer
and designer to baffle and amaze all onlook-
ers. Ideal for conference rooms, medical
offices, exhibition areas, waiting rooms, dis-
play windows, and foyers, this display provides
sophisticated style and unmatched entertain-
ment. Requires 4 AA batteries (not included).
#30850-66 . . . . . . . . $289.00
Da Vinci Aerial Screw Kit
Reinvent a Fanciful Flight
A precursor of the modern day helicopter, the
Aerial Screw designed by Leonardo da Vinci
was.designed to compress air in order to obtain
flight. Now you can build this model straight
fromDa Vinci's musings and marvel at how
ahead of his time he truly was. Reccomended
ages 8 and up.
#31521-38 . . . . . . . . . $19.95
Superhero
Approved
AS SEEN IN IRON MAN 2
Full Page.qxd 9/29/2010 10:04 AM Page 39
An uninterruptible power supply (UPS) ensures the continuous operation of critical
electronic equipment. They are especially necessary if you live in an area where there
are frequent power failures. They are manufactured to meet a wide range of power
requirements, from backing up your personal computer to keeping your entire home
office (or workshop) going during a power failure. Most UPS systems are designed to
transparently maintain AC power to your equipment. They provide for a smooth transition
from main power to backup power and back again.
There are a number of applications that have relatively low power requirements and run
on DC rather than AC voltage but must also remain operational in the event of a main
power failure. These include small security sensor modules, data acquisition, and status
monitoring devices among others.
40 January 2011
By Philip Kane
Photos by Sarah Kane
T
he block diagram in Figure 1
shows the organization of a
simple DC UPS. It consists of an
unregulated DC source, a backup
power source, switching logic, and a
voltage regulator. The voltage
regulator supplies the application
with regulated DC power. The input
to the voltage regulator normally
comes from the unregulated DC
source. If the main power is
interrupted, then the switching logic
switches the backup power source to
the input of the regulator. When
main power is restored, the
unregulated DC source is switched
back into the circuit.
This article describes
a simple UPS circuit that
you can incorporate into
the design of your own
low power DC project
to ensure continued
operation during short
term power failures.
A SIMPLE DC UPS
■ FIGURE 1
Kane - Simple DC UPS.qxd 12/7/2010 2:26 PM Page 40
www.downmagaz.com
January 2011 41
www.nutsvolts.com/index.php?/magazine/article/january2011_Kane
Circuit Operation
The 7805 is a standard linear 5V regulator. It receives
input from either the main power source Vs or the backup
source Vbb.
Vbb is provided by either alkaline or non-rechargeable
lithium batteries. To determine the maximum and
minimum values for Vbb, you must consider the forward
voltage drop across D1 and D2, as well as the specified
minimum input voltage for the 7805, which is 7V.
Let’s assume that the forward voltage drop for D1 and
D2 is 1V. If Vs is 9V, then the voltage at the cathode of
D2 (and also the input to the regulator) is 8V. Therefore,
Vbb can’t be greater than 9V if D2 is to remain reverse-
biased. In order to ensure that if Vs fails, the input to the
7805 will be at least equal to the specified minimum, Vbb
can’t be less than 8V. If Vs were higher — say 12V — then
there would be a wider range for Vbb (8V to 12V).
The 7805 will provide a regulated 5V output for any
input voltage from its specified maximum and minimum
input voltages. Choosing a value for Vbb that is close to
the minimum input voltage can help to extend battery life
in situations where Vs may frequently fall between its
normal level and the 7805’s minimum input voltage.
However, over time, Vbb will fall below its nominal value.
If you choose Vbb at or close to its minimum possible
value, then this will shorten its usable life. A good choice
for Vbb will be a compromise between the specified
maximum and minimum values.
Two factors to consider when choosing D1 and D2
are the required load current and the leakage current. If —
as in this case — you’re using non-rechargeable lithium or
alkaline batteries, you should choose a diode with low
leakage current.
We used a 1N5400 diode in our prototype. This
diode has a specified maximum reverse (leakage) current
of 5 µA at 50V DC (reverse voltage). Its forward current
rating is 3A which is more than adequate to deal with the
1.5A maximum output current of the 7805.
About the
Circuit
The circuit shown in
Figure 2 is a UPS intended
for low power applications.
It is essentially a linear
regulator with battery
backup. It provides a
regulated 5V DC from an
unregulated DC input of at
least 9V.
LED1 is the main power indicator. It remains on as long as the regulator is being supplied by the main power source.
LED2 is the output power indicator. Taken together, LED1 and LED2 are used to determine the status of the UPS.
Diode D1 isolates the main power source from the backup circuit, while diode D2 comprises the switching logic that
will be described later. Capacitors C1, C2, C3, and IC1 form the linear regulator section of the circuit. The battery backup
feature can be eliminated from the circuit via switch S1. Note that S1 and S2, as well as LED1 and LED2 — while useful
for testing the UPS prototype — are optional and need not be included in your application.
Construction
If you intend to use this as a stand-
alone power supply, the entire prototype
circuit can be assembled on a piece of perf
board using point-to-point wiring. Mount
the 7805 on a heatsink.
If you intend to incorporate the UPS
circuit into your own application, then the
backup battery configuration will be a
significant factor in your choice of an
enclosure.
PARTS LIST
ITEM DESCRIPTION
C1 1,000 µF electrolytic capacitor
C2, C3 0.1 µF capacitor (polyester or mylar)
D1, D2 1N5400 diode or any diode with a
maximum forward current rating of at least 1.5A
and low reverse leakage current
IC1 LM7805 (or equivalent) 5V regulator
LED1, LED2 Light emitting diode (2 mA)
R1, R2 330 ohm resistor
S1, S2 SPST switch (optional)
■ FIGURE 2
Kane - Simple DC UPS.qxd 12/2/2010 10:53 AM Page 41
42 January 2011
Before powering up the
circuit, check all connections.
Make sure that you have a DC
adapter that can deliver the
required maximum current at
the required input voltage. Use
a fresh battery. With the
backup battery out of the
circuit, check out the circuit as
follows:
• Set S1 and S2 to their open
(off) positions.
• Connect the DC adapter to
the UPS and plug it into the
wall outlet.
- Close S1. Both LED
indicators should be on.
If neither LED is on, then
suspect the adapter and
check the voltage across the input to the UPS.
Note: The voltage measured at the adapter output
when it is not under load will most likely be higher
than the rated voltage at the specified load current.
For example, the output of the nine volt adapter
that I used was 11.2 volts.
- If LED1 is on and LED2 is off, first check the UPS
output voltage. If the UPS output voltage is okay,
then check LED2 and its limiting resistor. If there is
no UPS output voltage, then measure the voltage
on the input side of the 7805 regulator. If there is
no regulator input voltage, then suspect D1.
Otherwise, suspect the 7805.
- If LED1 is off and LED2 is on, then check the wiring
for LED1 and its limiting resistor.
• Measure the current between the anode of D2 and
ground. It should not exceed the specified leakage
current for the diode you have chosen.
• Verify that the regulator portion of your circuit is
operating correctly by varying the UPS output load and
measure the output voltage. The output voltage should
remain relatively constant. Be careful not to exceed the
7805 maximum current limit.
• With S1 still closed, place the backup battery in the
circuit.
• Close switch S2 and place S1 in the open (off) position
(or remove the adapter from the wall) to simulate a
power failure. LED1 should go off. LED2 should
remain on.
- Measure the output voltage. It should still be at the
regulated level.
The configuration of LED1 and LED2 indicates the
status of the UPS and the condition of the main power
line. Assuming both S1 and S2 are closed, the status of
the UPS is shown in Table 1.
Conclusion
There are obviously a number of improvements
that you can make to the basic circuit presented here.
You can replace the standard 7805 with a variable
voltage, low dropout (LDO) regulator. The lower minimum
input voltage of the LDO would extend the range of
Vbb. Additionally, it can be configured for a range of
output voltages. For example, you could use the same
part to build a nine volt UPS to power a DC appliance
or to design a five volt UPS into your next project.
Another possible improvement would be to replace
the linear regulator with the more efficient switching
regulator. NV
LED1 LED2 Condition
Off Off
Main power off. No backup battery
or low backup battery.
Off On
Main power failure.
UPS in backup mode.
On Off
Main power on. However, UPS has
apparently failed. Possible causes
include bad battery, open diode, bad
regulator, or bad indicator LED2.
On On
Main power on.
UPS operating properly.
Table 1: UPS status conditions assuming switches
S1 and S2 are closed.
Prototype Checkout
and Troubleshooting
Kane - Simple DC UPS.qxd 12/2/2010 10:54 AM Page 42
www.downmagaz.com
HOW TO ORDER
Order Value Cost
$25 - $49.99 $7.50
$50 - $99.99 $20
$100 - $199.99 $40
$200 - $499.99 $60
$500+ $75
Note: Products are dispatched from Australia, so
local customs duty & taxes may apply.
Prices valid until 31/1/2011
WEB: www.jaycar.com
PHONE: 1-800-784-0263*
FAX: +61 2 8832 3118*
EMAIL: techstore@jaycar.com
POST: P.O. Box 107, Rydalmere NSW 2116 Australia
• ALL PRICING IN US DOLLARS
• MINIMUM ORDER ONLY $25
Max weight 12lb (5kg).
Heavier parcels POA.
Minimum order $25.
*Australian Eastern Standard Time
(Monday - Friday 09.00 to 17.30 GMT + 10 hours)
Note: 10-14 days for air parcel delivery
POST & PACKING CHARGES
Order onl i ne: www. j aycar. com
KC-5489 $65.25 plus postage & packing
Host your own website on a common SD/MMC card with
this compact Web server In a Box (WIB). Connecting to
the Internet via your modem/router, it features inbuilt
HTTP server, FTP server, SMTP email client, dynamic DNS
client, RS232 serial port, four digital outputs and
four analogue inputs. Requires a SD memory
card, some SMD soldering and a 6-9VDC
adaptor. Kit includes PCB, case and
electronic components.
• PCB Dimensions:
123 x 74mm
SD/MMC CARD WEBSERVER IN A BOX
KC-5399 $24.50 plus postage & packing
A power boost for your USB port!
If you have a lot of peripheral devices running from your
computer, they may be trying to draw more current than
your USB port can provide. This project will allow full
current draw no matter how many peripheral devices you
are running. It uses an external
power supply to tap into the
existing line, effectively boosting
the available current. Kit supplied
with PCB, case with silk screened
and punched panels, and all
electronic components.
USB POWER INJECTOR
KC-5323 $17.50 plus postage & packing
This quick and easy kit plugs into your motherboard to
provide IR support for external devices such as notebook
computers, PDAs, digital cameras, data samplers - and the
list goes on!
• Kit includes PCB and all
specified electronic
components
PC INFRARED TRANSCEIVER KIT
WIND AND SOLAR POWERED RC CARS
FRONT END PRE-AMP FOR PC SOUND CARDS
Remote Control Digital Timer Kit
KC-5496 $25.00 plus postage & packing
Remote-controlled digital timer with a bright 20mm-high
7-segment red LED display. It can count up or down from
one second to 100 hours in 1-second increments. Its timing
period can either be set and controlled using the remote
control or it can be automatically controlled via external
trigger/reset inputs. An internal relay and buzzer activate
when the unit times out. The relay contacts can be used to
switch devices rated up to 30VDC or 24VAC and the
project can be powered from a plugpack
or a battery. Short form kit only
- you'll need to add your own
universal remote, power supply
and enclosure.
• 9-12VDC @300mA
• PCB and components
High Power Ultrasonic Cleaner Kit
KC-5499 $124.50 plus postage & packing
Most people would know that you can get small ultrasonic
cleaners for jewellery and similar small items, so why not
a much larger version? It would be ideal for cleaning
automotive and other mechanical parts, fabrics which
can't be machine washed, ornate bric-a-brac and a host of
other hard-to-clean items. You can use a variety of
receptacles for a tank, such as an old cistern or laundry
tub. It can also be used with solvents such as kerosene or
just water and detergent. The kit includes the transducer,
case, cable and electronics and can be powered from a
2.5A 12VDC plugpack. Everything is included in the kit
except for a housing for the transducer and sealant. For
sealant you can use any neutral cure silicone suitable for
wet areas. You'll also need epoxy resin such as Araldite or
JB Weld, and for a housing, a short piece of 65mm PVC
plumbing pipe and a drain, waste and vent end cap
available from any plumbing supplier will do the job.
Power requirements:12V, 2.5A
Transducer voltage: 250VAC square wave
Frequency range: Main mode
19kHz to 42kHz
Timeout adjustment: 30s to 10m
Includes:
• PCB and components
• Powered by 12VDC
KA-1811 $21.75 plus postage & packing
Turn your computer into an oscilloscope, audio monitor or spectrum analyser! Plug the kit
into your computer's soundcard and by using software available over the Internet, measure
or monitor just about any audio signal. Most PC sound card inputs have a limited dynamic
range, relatively low input impedance and poor overload protection - this kit will eliminate
these limitations and allow tiny signals, like those from op-amps, to be measured without
degradation. Power is derived from the soundcard's D15 Joystick output socket.
• Kit includes case, silk-screened front panel, PCB, and all electronic components
• Optional CRO probe to suit - use our QC-1902 $25.00
• Or use it for amplifying a high quality microphone for sampling
KJ-8838 & KJ-8839 $31.25 each plus postage & packing
These mini remote controlled cars will surely entertain and educate
curious minds about the concept of wind and solarpower. The
kits are very simple to build and come with a manual that
provides construction details and explains how
alternative energy can generate electricity.
Car size: 60(L) x 30(W)mm
KJ-8838 - Wind Powered
KJ-8839 - Solar Powered
KC-5361 $40.00 plus postage & packing
Program both the microcontroller and
EEPROM in the popular gold, silver
and emerald wafer cards. Card used
needs to conform to ISO-7816
standards. Powered by 9-12 VDC wall
adaptor or a 9V battery. Instructions
outline software requirements that
are freely available on the internet.
Kit supplied with PCB, wafer card
socket and all electronic components.
• PCB measures: 141 x 101mm
Jaycar Electronics will not accept responsibility for
the operation of this device, its related software,
or its potential to be used for unlawful purposes.
FULL FUNCTION SMART CARD
READER / PROGRAMMER KIT
KIT OF THE MONTH
Ultrasonic Antifouling Kit
KC-5498 $155.70 plus
postage & packing
Many of you know that you
can buy $3-8,000 imported
marine growth electronic
antifouling systems. Jaycar,
with Silicon Chip have developed
a similar system based on this technology and
information in the public domain. This project uses
the same ultrasonic waveforms and virtually identical
ultrasonic transducers mounted in sturdy
polyurethane housings. By building yourself (which
includes some potting) you save a fortune! Standard
unit consists of control electronic kit and case,
ultrasonic transducer, potting and gluing components
and housings. Research reveals only one transducer is
needed for boats under 32ft. Basically all parts
supplied in the project kit including wiring.
• 12VDC
• Suitable for power or sail
• Could be powered by a solar panel/wind generator
• Price includes epoxies
NEW YEAR - NEW KITS!
BEST SELLER
Happy New Year From
the JAYCAR Team
Nuts & Volts January 10 6/12 9am 6/12/10 9:56 AM Page 43
We have a lot to cover, so this first article will show
how to use the Rabbit module to do the basic functions for
this project (or others). Next month, we’ll talk more about
the sprinkler-specific aspects of the design. Software is
covered in a comprehensive file included in the downloads.
The Wi-Fi Module
Rabbit’s Wi-Fi module has five general-purpose eight-bit
I/O ports. The module uses some of the bits of some of the
ports for Wi-Fi and other functions. If you read the
documentation very carefully, you will find that all bits of
Port A are available for your use. The same is true of Port
D. Certain bits of Ports B and C have other duties that you
can work around if necessary.
Rabbit’s documentation states that RCM5450W ports
can source or sink 24 mA and are guaranteed to swing an
output voltage of 2.0V (0.4V low, 2.4V high). We will use
these specifications in designing an appropriate relay driver
circuit.
Control by Relay
Almost every project needs to control something. The
module needs to be able to turn on motors, energize
circuits, or actuate solenoids like the ones inside the 24
●●●●
BUILD A WI-FI
SPRINKLER
SYSTEM
By Bob Colwell
■ FIGURE 1.
Rabbit Semiconductor
RCM5450W Wi-Fi module.
44 January 2011
Part 1
I have a lot of projects I want to work on. They all have certain
things in common, such as they need a control module that
speaks 802.11a/b/g fluently, they are physically small, are low
power with lots of I/O port bits, come with a large sample code
library, and don’t cost much. One particular project is my Wi-Fi
sprinkler system that exemplifies these aspects. The Wi-Fi sprinkler
uses a module from Rabbit Semiconductor to control a set of 16
relays, Wi-Fi to connect it to my home network (so I can use my
iPod in my yard to turn water zones on and off), an Internet
connection, plus an internal real-time clock so the module knows
the day of the week, day of the month, and time of day. There’s
also an interface to a standard 2x16 LCD display module. I’ve
included a labeled “pin field” that brings the Rabbit module
pinouts to a set of 50 stakes, to make it easy to connect scopes
and logic analyzers to aid in software debugging.
Colwell - WiFi Sprinkler System - Part 1.qxd 12/7/2010 2:23 PM Page 44
www.downmagaz.com
VAC water valves used in yard
sprinkling systems. We can get 24
VAC from a transformer, and
because we won’t turn on multiple
zones at once, the current
requirements are a trivial 75 mA.
Now, we just need a way to control
this electrical current to each
zone’s sprinkler valve. Triacs would
work, but relays are cheap and easy
to understand.
A relay is a magnetically
controlled switch. Relay coil current
causes a magnetic field that pulls
on the switch and closes it. If you
turn off the coil current, the
magnetic field collapses and a
spring pulls the relay switch open
again. Coil actuation current is controlled by a simple
transistor driver circuit, and the transistor is driven directly
by the Wi-Fi module’s processor.
Relays and Their Drivers
With enough Rabbit port bits, we could just assign one
bit to each relay (16 in all) and then ensure that the C code
never drives more than one bit low at any given time. I
tried that first, but after some misadventures using port bits
that were already allocated to the Wi-Fi functions, I
simplified the code by taking advantage of the one-zone-at-
a-time rule. I put a latched 4:16 CD4515 decoder chip in
the circuit, whose inhibit bit was controlled by another port
output bit. I now had the flexibility to also handle the LCD
interface. When the chip is first powered up, the CD4515’s
internal four-bit latch holds a random number, and the
corresponding Y output will want to go active. For our Wi-
Fi Sprinkler system, uncontrolled water would briefly flow.
This prospect of wet mayhem is averted by the active-high
4515 Inhibit input. Until a Rabbit bit is set as an output, an
internal pullup resistor holds the wire at logic-high. This
makes PD 7 (see Figure 3) appear to be high, inhibiting the
4515 from selecting any of its 16 outputs during
initialization.
Figure 3 shows the basic transistor relay driver circuit.
When transistor Q1 is on, current is permitted to pass from
Q1’s emitter through the transistor to its collector and then
down through the coil, energizing it so that a magnetic field
is formed around the coil. This magnetic field pulls on the
switches shown as Relay 1.2 and Relay 1.3, flipping those
switches from their normally open state to a closed state,
thus connecting pin 3 to pin 4, and pin 8 to pin 7. When
Q1 is off, no coil current flows, and the relay’s switch
defaults to the upper connections (3 to 2, and 8 to 9). This
project would work fine with only a single-throw single-pole
relay, but these DPDT subminiature relays were cheap and
small, and I figured as long as there were two contacts, why
not gang them and cut the load current through each by
half? That’s why they’re paralleled in this design.
The value of R1 must satisfy two constraints: keep the
transistor off if the port output is high or not yet configured,
and fully saturate the transistor otherwise. The manufacturer
says their 5V relay coils are 178 ohms. A fully-on transistor
exhibits an emitter-to-collector drop of approximately 0.1V.
The coil current will be (5 – 0.1)V / 178 ohms, or
approximately 28 mA. Typical transistor beta, or gain,
would be around 100, so we need at least 1/100th of 28
mA in the transistor’s base to get that collector current, or
0.28 mA. Let’s round up to 0.5 mA of base current.
The base resistor R1 will have 0.5V on one end and
+5V minus the 0.7V emitter/base drop on the other end.
So, R = E/I = (5 – 0.7 – 0.5 volts) / 0.0005 amps = 7,600
ohms. I rounded that up to a convenient value of 10K.
What’s that diode for? When the coil is energized, its
January 2011 45
■ FIGURE 2. Block diagram of the Rabbit RCM5450W module.
Why Rabbit and not Arduino?
I chose a Rabbit Semiconductor RCM5450W module
for this project because I liked its features: it had a lot of
I/O ports, it came with a large library of sample C code
for doing all of the things I expected to do in this
project, and Rabbit supplies a C compiler and
development board for it. All I had to do was write the C
code that would control the relay transistor drivers, plus
the HTML that would run the Wi-Fi module’s website.
(That “all I had to do” was partly tongue-in-cheek; the
code ended up being more of a challenge than I had
expected. Isn’t that true of most code, though?) The
802.11a/b/g wireless functionality was supplied by Rabbit
— I changed the IP address to something suitable for my
network; I set the wireless WEP key and network name
to what I have at home; and added my code to Rabbit’s
sample code.
The RCM5450W modules aren’t exactly cheap but
they have 1 MB of Flash memory for the C code we will
compile and download (of which my current download
image uses 300K) and a relatively fast processor at 74
MHz (compared to Arduino’s 16 MHz). If I were starting
this project over today, I would look into the Arduino,
but after a couple of years of experience I’m pretty
happy with the Rabbit.
Colwell - WiFi Sprinkler System - Part 1.qxd 12/6/2010 11:01 AM Page 45
magnetic field is holding the relay’s switch contacts closed.
When the coil current is cut off, that magnetic field
collapses. As it does, it induces current in the coil which
causes a reverse voltage to appear across the relay’s coil.
The magnitude of that voltage is proportional to how
quickly the field collapses, and can be quite large. The
diode provides a low impedance path into which the
magnetic field’s induced current can discharge.
The Wi-Fi Module Interface
There are 50 pins in the Rabbit module’s connector. In
the schematic in Figure 3, I chose to bundle all 50 into one
bus — the “RCM5450_bus” — for the sake of easy and clear
documentation.
One thing to beware: For some reason, Rabbit labels
all the pins on one side of the module connector as even,
and the other side carries all the odd pins. If you’re used to
normal IC package numberings, you’ll be expecting the
numbers to start with pin 1 at one corner, and sequentially
number the rest around the package in a counterclockwise
direction (looking down at the part).
Per Rabbit’s documentation, there is a 3V battery
backup connected through a 2.2K resistor. U51 is a
standard decoupling capacitor. S1 is a momentary contact
reset switch, and R34 pulls the reset pin to an inactive high
level when S1 is not active. Two corner pins — 2 and 50 —
are grounds, and pin 1 supplies +3.3V to the module.
If you are not familiar with “bus-style” schematics, that
thick blue line that all of the pins seem to “connect to”
does not imply that all of the signals are somehow
connected together into one big fat (useless) blue wire.
That thick blue line is just a convenient way of grouping all
of the signals at the interface of the RCM5450W module
so that we can pick out subsets of them for various uses in
other schematic pages.
Interfacing to the
Relay Drivers
Earlier I said we would take advantage of the fact that
we will never want more than one zone on at a time.
Here’s where we do that — in the circuit that translates the
module’s port outputs into the 16 transistor relay driver
signals.
The CD4515 chip is a 4:16 decoder with an output
inhibit, plus a four-bit latch on its inputs. The 4515’s four
select inputs — A, B, C, and D — pick one of the 16 Y
output pins to assert. I’m going to call this four-bit input
“DCBA,” because D is the most significant bit, and A is the
least significant. If only the B bit is high and the other three
are low, I’ll show that as 0010, and it corresponds to a
binary 2, meaning the Y2 output would be asserted. All
non-selected outputs will remain high. Note that the Y
■ FIGURE 3. Rabbit controller board schematic.
46 January 2011
Colwell - WiFi Sprinkler System - Part 1.qxd 12/7/2010 10:05 AM Page 46
www.downmagaz.com
equals 6), thus Y6 will be low and all other Y outputs will
be high. Also note that it is literally impossible to activate
more than one zone at a time because the 4515 will only
ever precisely do one of two possible things: it will assert
no zones if the inhibit input is asserted, or it will assert
whichever Y output corresponds to the four-bit pattern in
its internal latch.
What’s the purpose of the four-bit latch? Notice that I
have used four of the PA bits from the RCM5450W
module’s Port A. I will also use those same bits to convey
data to and from the LCD module. The 4515 lets me write
the four bits into its internal latch; once the PA bits have
been written into that latch, I can reuse PA bits for other
things, such as changing the display on the LCD module so
that the clock remains accurate.
I’m using PD5 as the latch enable. The protocol here is
simple: To enable relay X, write the RCM5450W Port A bits
3:0 with the value of X. Then, write Port D bit 5 (which is
normally a 0) to a 1, and then back to a 0. That causes the
latch to open which passes X through to the 4:16 decoder,
and then causes the latch to close which causes the latch
to remember that value of X until next time.
Meanwhile, PD7 has been held inactive all this time, so
no Y outputs of the 4515 are asserted, and no relays are
yet activated. Once the four-bit value is sent on Port A bits
3:0 and latched by pulsing PD5, we can de-assert the
4515’s “INHIBIT” input by writing PD7 to zero, and keep it
low for the duration of the sprinkling desired.
Interfacing to the LCD Module
The only semi-tricky part of interfacing to the LCD
module is to find a way to accomplish that interface
without interfering with the relay interface. Previously, I
showed how the relay interface was
done, using Port A bits 3:0 and Port D
bits 5 and 7. If Port D bit 7 is high,
then you can do anything you want to
the Port A bits. The relays won’t see it
because the 4515 chip’s outputs will
not be enabled.
So, to interface to the LCD
module, I used all eight Port A bits,
plus some Port D bits for the three
LCD control signals RS, E, and R/W.
Note that the Port D control bits I
chose were not the same ones I used
for relay interfacing. The LCD module
listens to Port D bits 2:0, plus bit 6 to
control the LCD module backlight; the
relay interface uses Port D bits 5 and
7. There are 16 pins on the LCD
module. Pins 1 and 16 are grounded,
and pin 2 supplies +5V. Pin 3 is a
voltage between 0 and +5V - this
voltage sets the display's contrast.
I assigned three Port D signals to
control the LCD module: Port D bits 0, 1, and 2. PD0 is the
module's RS bit, PD1 is R/W, and PD2 is the Enable bit.
The particular module I used has a switchable
backlight, so I provided a transistor “relay driver” circuit to
turn the backlight on and off. The only new element here is
an additional resistor in the emitter leg of U8 which is there
to limit the LED current for the LED backlight. LEDs drop
approximately 2V while illuminated, and should be limited
to less than 20 mA to avoid burnout; 5V – 2V – 0.1V
(emitter-collector drop when transistor is on and saturated)
= 2.9V. E=IR, so R = 2.9 volts/0.020 amps = 145 ohms. I
upped this to 180 ohms for a safety margin. The base
resistor limits the base current and was determined along
similar lines. When the transistor is on, we want 20 mA in
the collector, so we need at least 1/100th that much in the
base, or 0.0002 amps. The transistor’s emitter lead is at 5 –
2.9 = 2.1V. The emitter/base junction is 0.7V, so there are
2.1 – 0.7 volts at the base and 0.5V at the other end of
the resistor which leaves 0.9V across the base resistor.
Therefore, R = 0.9 volts/0.0002 amps = 4,500 ohms
which I rounded up to 4.7K.
■ FIGURE 4.
Rabbit RCM5450W
module mounted on
1/4” spacers.
January 2011 47
Colwell - WiFi Sprinkler System - Part 1.qxd 12/6/2010 5:16 PM Page 47
Power
There are three separate power supplies in this project:
+3.3 VDC, +5 VDC, and 24 VAC. The +3.3V is for the
Rabbit module; +5V is for the subminiature relays; and 24
VAC for the sprinkler valves. I found a cheap switching
power supply for the +3.3 VDC and +5 VDC, and a 24
VAC transformer. Because four-pin power connectors are
ubiquitous from their use in personal computers, I used one
in this project. The two capacitors smooth DC ripple from
the supplies and minimize problems from inductance in the
wires of the four-wire cable coming from the power
supplies. Notice that although two wires of the four-wire
power cable are ground wires, I take care here to keep
them electrically separated from one another. To
accomplish this, they have different names. The noisy,
relatively high current relay coil ground returns are labelled
“Relay GND,” while the Wi-Fi module and other logic use
the “GNDDIGITAL” ground return. Only at the other end
of the four-wire power cable do these ground wires get
connected together.
The basic problem of sharing current paths is that these
paths are not perfect. Even fat ground traces have small but
not inconsequential resistance (R) and inductance (L), and
the longer the shared path, the higher the induced noise
from changes in current. By minimizing the sharing of any
current paths between the coils and the logic, there is
much less shared R and L and therefore much less induced
noise seen by the logic. NV
www.nutsvolts.com/index.php?/magazine/article/january2011_Colwell
Pre-Assembled Board
Available for 8, 14, 18, 28,
and 40-pin PIC
®
MCUs
2-line, 20-char LCD Module
9-pin Serial Port
Sample Programs
Full Schematic Diagram
Pricing from $79.95 to $199.95
PICPROTO

Prototyping Boards
Double-Sided with Plate-Thru Holes
Circuitry for Power Supply and Clock
Large Prototype Area
Boards Available for Most PIC
®
MCUs
Documentation and Schematic
Pricing from $8.95 to $19.95
LAB-X Experimenter Boards
See our full range of products, including
books, accessories, and components at:
www.melabs.com
USB Programmer for PIC
®
MCUs
(as shown)
$89.95
RoHS
Compliant
Programs PIC
MCUs including
low-voltage (3.3V)
devices
Includes
Software for
Windows
98, Me, NT,
XP, and Vista.
With Accessories for $119.95:
Includes Programmer, Software, USB Cable,
and Programming Adapter for 8 to 40-pin DIP.
for PIC
®
Microcontrollers
Professional Development Tools microEngineering Labs, Inc.
www.melabs.com 888-316-1753
PICBASIC PRO

Compiler
PICBASIC PRO

Compiler $249.95
Bridges the gap between ease of
use and professional level results.
The simplicity of the language
allows both hobbyist and
engineer to master it quickly, but
the engineer appreciates what’s
happening under the hood. This is a true
compiler that produces fast, optimized machine
code that's stable and dependable.
Supports:
More than 300 PICmicro
®
Microcontrollers
Direct Access to Internal Registers
In-Line Assembly Language
Interrupts in PICBASIC and Assembly
Built-In USB, I2C, RS-232 and More
Source Level Debugging in MPLAB
1-9 10+
8 POS DIP (V17DÌP8SS) .90 .85
ToggIe Mini SPDT (17TOGSD-M) 1.40 1.20
ToggIe Mini DPDT (17TOGDD-M) $1.55 1.35
http://www.eIexp.com
emaiI: eIectron@eIexp.com
365 BIair RoadªAveneI, NJ 07001
In NJ: 732-381-8020
FAX: 732-381-1006
MORE
Low-Priced
Items In Our
FREE
350+ Page
Catalog
0603WLC100
#1 BEST SELLING
STATION
MODEL WLC 100
SOLDERING STATION
SWITCHES
1-9 10-99 100+
Cermet (STS Series) 85¢ 75¢ 65¢
MuItiturn (MTT Series) 85¢ 75¢ 55¢
PaneI Mount (PMA Series) $1.15 80¢ 70¢
Standard Values Available
POTENTIOMETERS
800-972-2225
TERMS: M/n. $20 + sh/pp/ng. Schaa/ Parchase Orders, VISA/ MC, Maney Order, Prepa/d. NO PERSONAL CHECKS, NO COD. NJ Res/dents: Add 7% Sa/es Tax.
Visit Our Website At http://www.eIexp.com
$
46
50
DIGITAL
MULTIMETER
MODEL 820B
1-9 . . . . . $7.50
SUPER
ECONOMY
$
6
50
10+
#01DM820B
DC POWER SUPPLIES
MODEL HY3003 - DIGITAL DISPLAY
$
95
00
MODEL HY3003-3 ¬ TRIPLE OUTPUT
$
184
00
Variable output, 0-30 VDC, 0-3 Amp
Two 0-30 VDC, 0-3 Amp variable outputs
plus 5V 3A hxed. Digital Display.
3MHZ SWEEP
FUNCTION GENERATORS
6 Waveform Functions, Int/Ext
Counter, Iin/Iog sweep
MODEL FG-30
$
135
00
(No Digital Display)
MODEL FG-32
(5 Digit Display)
$
195
00
True RMS, digital and bar
graph display, AC/DC Cap, Res,
frequency functions. Ìncludes
software, AC or DC operation.
MODEL DM9803R
$
139
95
BENCH DMM WITH RS232 INTERFACE
OSCILLOSCOPE
MODEL GOS-620
DuaI ChanneI
- 20MHZ
(INCLUDES PROBES)
$
305
00
SOUND SENSOR CAR
REQUIRES SOLDERING
$
9
95
#3221881
Reverses
direction
whenever it
detects noise,
or touches an
obstacle.
$
6
50
#060509
HIGH PERFORMANCE
3-WIRE IRON
ALLIGATOR LEADS
SET OF 10
$
3
50
32 Ranges - 3
1
/2 Digit
$
33
95
AC/DC VoIt/Current, Res. Cap.,
Frequency. Rubber HoIster IncIuded
MODEL MY-64
DIGITAL MULTIMETER
ROTARY TOOL KIT
Variable speed tool (37,000
RPM) with accessory kit in a
hard plastic carry case.
#29DR101
$
35
95
48 January 2011
Colwell - WiFi Sprinkler System - Part 1.qxd 12/6/2010 11:03 AM Page 48
www.downmagaz.com
QUICKTURN
PROTOTYPES IN
AS LITTLE AS
24 HOURS
S
unstone Circuits has enhanced
their services by offering
prototype delivery within 24 hours
on all four-layer boards ordered
within their PCBexpress® quickturn
product line.
Sunstone’s PCBexpress®
quickturn with predefined capabilities
offers the best value for up to 100
pieces per order. By using this PCB
design service, customers can now
shave two days from the standard
three-day lead time.
Customers are increasingly using
multilayer board designs during the
initial prototyping phase to
dramatically shorten design-time and
save project dollars. This technique
works particularly well when high-
speed design work may be a factor in
the actual schematic.
This improved lead-time also
comes with enhanced DFM rules
which reduces the risk of design
mistakes. When a prototype is meant
to prove a concept or demonstrate a
solution, adding layers to the design
isn’t that risky; risk it mostly a factor
when engineers design on the border
of the fabricator’s limitations. This
service now allows designers the
ability to optimize their time by
saving the ‘tight-routing’ elements for
when prototypes become production
ready. This equates to fewer
prototype spins which consequently
means reduced costs on PCB
components, assembly, and labor.
SHOWCASE
SHOWCASE
Open Source Hardware
Arduino Duemilanove
Arduino MEGA
Freeduino - Seeeduino
Arduino Shields - Ethernet -
XBee
Zeroplus LAP-C 16032
Logic Analyzer
16-channel - 100MHz - USB 2.0
SPI - i2c - UART - 7-segment
2 free additional protocols
d
2
2.0
t
http://www.NKCelectronics.com l
Rigol DS1052E DSO
50MHz - up to 1GSa/s
1 Meg mem - TFT LCD - USB
Advanced triggering: Edge,
Pulse, Video, Slope, Alt
continued from page 29
Dealers Wanted
MIAC is an industrial grade PICmicro controller which
retails at $180. Features include direct USB download, 8
analog/digital inputs, 4 relays, 4 motor outputs, integrated
CAN bus and a free copy of Flowcode V3. We are looking
for commercial partners for MIAC – if you are interested
then please call us in the UK on +44 1422 252380.
www.robotpower.com
Phone: 253-843-2504 s sales@robotpower.com
Dalf - $250
Extreme Motor
Speed Control!
Scorpion Mini - Single 6A H-bridge - R/C interface
Scorpion XL/XXL - Dual 13A/25A H-bridge - R/C
>> Also H-bridges, gearmotors, plans, schematics <<
1.25“x .5“
$29.99
1.6“ x 2.7“
$119.99
Powerful!
MADE IN
THE USA
6 Closed-loop control of two axes
6 Full PID position/velocity loop
6 Trapezoidal path generator
6 Giant Servo Mode!
6 Windows GUI for all features
6 www.embeddedelectronics.net
B
o
ts
IQ
F
a
o
v
r
ite
For more information, contact:
Sunstone Circuits
Web: www.Sunstone.com
If you have a new product, please
email a short description and a
photo of your product to:
newproducts@nutsvolts.com
SHOW US WHAT
YOU’VE GOT!
JAN11 - NewProducts.qxd 12/6/2010 3:08 PM Page 49
50 January 2011
PROBLEME MIT DER ANZEIGE
DER ZEIT
My problems with displaying time started all of this
confusion. Our goals this month are to write drivers for
the EA DOGM162L-A LCD and the PIC18F47J53’s
hardware RTCC (Real Time Clock Calendar). The EA
DOGM162L-A is based on the Sitronix ST7036 Dot Matrix
LCD controller/driver. New
number, same commands
and mechanics as the
ST7036 is HD44780
compatible.
The ST7036 datasheet
offers an example
initialization code snippet
that is based on the saintly
8051 microcontroller. As you
can see in Listing 1, the EA
DOGM162L-A 8051 SPI
initialization source code is
written in assembler.
However, we can easily pick
out the timing calls and
ST7036 register values which
are all we’re interested in
anyway. The problem is that
these timings don’t work
with an EA DOGM162L-A
being driven by our
(Universal Storage Control
Module) USCM-47J53. With
that, the search for answers begins.
After some exhaustive research, I ended up back in
the DOWNLOAD area of the EA DOGM162L-A website.
There’s a download item there that I have been purposely
avoiding. The downloadable serial source code driver is
written in German and targets AVR microcontrollers. The
AVR part of the code doesn’t bother me as I know that I
can easily port AVR mnemonics to PIC speak. Another
problem with the German SPI driver source code can be
seen in Listing 2. Notice that
there are no carriage return
and line feed characters in
the listing. As Scooby would
say, “WRUT WRO!”
Fortunately, keys in the
German language listing
such as mS(50), us(50), void,
parenthesis pairs, and some
English wording caught my
eye. So, I dumped the
contents of Listing 2 into a
NoteTab editor session and
went to work. I began to try
to add carriage returns and
line feeds that would make
the jungle of characters in
Listing 2 look like classic C
source code. I also used
TIME FOR SOME RTCC TRANSLATING
DESIGN
■BY FRED EADY
CYCLE THE
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
Sprechen sie Deutsch? I don’t, but I had to perform some cross-language
code translation to gain the information necessary to write the code for this
month’s project. My cross-language translating does not involve BASIC to C.
I’m talking about German to English source code translation.
Achtung is about all of the understandable German I can utter. However, I did
manage to wade through some German source code and force my EA
DOGM162L-A to speak English. Once we are able to get the dog to bark, we
can start teaching it new tricks.
INITIAL_START:
CALL HARDWARE_RESET
CALL DELAY40mS
MOV A,#38H ;FUNCTION SET
CALL WRINS_NOCHK ;8 bit, N=1,5*7dot
CALL DELAY30uS
MOV A,#39H ;FUNCTION SET
CALL WRINS_NOCHK ;8 bit,
N=1,5*7dot,IS=1
CALL DELAY30uS
MOV A,#14H ;bias
CALL WRINS_NOCHK
CALL DELAY30uS
MOV A,#78H ;Contrast set
CALL WRINS_NOCHK
CALL DELAY30uS
MOV A,#5EH ;Power/ICON/Contrast control
CALL WRINS_NOCHK
CALL DELAY30uS
MOV A,#6AH ;Follower control
CALL WRINS_NOCHK
CALL DELAY200mS ;for power stable
MOV A,#0CH ;DISPLAY ON
CALL WRINS_NOCHK
CALL DELAY30uS
MOV A,#01H ;CLEAR DISPLAY
CALL WRINS_NOCHK
CALL DELAY2mS
MOV A,#06H ;ENTRY MODE SET
CALL WRINS_NOCHK ;CURSOR MOVES TO RIGHT
CALL DELAY30uS
■ LISTING 1. I figured
since this code was part
of the ST7036 datasheet, it
was gospel. After all, the
timings match the datasheet
declarations.
Design Cycle - Jan 11.qxd 12/6/2010 5:17 PM Page 50
www.downmagaz.com
semi-colons and C comment slashes (//) to delineate lines
of Germanic source code. C source lines that began with
warten or warte and ended with a semi-colon followed by
a comment became prime targets as each source line
contained a timing value. Consider this line of C source
that I gleaned from the mass listing:
warten_ms(50); // mehr als 40ms
According to the Listing 1 initialization source code, a
40 mS delay must be observed following a hardware reset.
Mehr als is German for more than and warten means wait.
So, the comment tells us to wait in excess of 40 mS and
that advice is heeded by 10 mS in the actual code. The
mnemonics shown in Listing 1 instruct us to delay for 40
mS. If you compare the timing marks of Listing 1 with
Listing 2, you won’t get very far. So, I’ve included this
code snippet, which reads just a bit better than Listing 2:
void ST7036_init(void)
{
Set_Bit(ST7036_CLK);
Set_Bit(ST7036_CSB);
ST7036_reset();
warten_ms(50); // mehr als 40ms
ST7036_write_command_byte( 0x38 );
// Function set; 8 bit Datenlänge, 2 Zeilen
warten _us(50); // mehr als 26,3µs
ST7036_write_command_byte( 0x39 );
// Function set; 8 bit Datenlänge, 2 Zeilen,
// Instruction table 1
warte_us(50); // mehr als 26,3µs
warten ST7036_write_command_byte( 0x1d );
// Bias Set; BS 1/5; 3 zeiliges Display /1d
warte_us(50); // mehr als 26,3µs
warten ST7036_write_command_byte( 0x7c );
// Kontrast C3, C2, C1 setzen /7c
warte_us(50); // mehr als 26,3µs
warten ST7036_write_command_byte( 0x50 );
// Booster aus; Kontrast C5, C4 setzen /50
warte_us(50); // mehr als 26,3µs
warten ST7036_write_command_byte( 0x6c );
// Spannungsfolger und Verstärkung setzen /6c
warte_ms( 500 ); // mehr als 200ms warten !!!
ST7036_write_command_byte( 0x0f );
// Display EIN, Cursor EIN, Cursor BLINKEN /0f
warte_us(50); // mehr als 26,3µs
warten ST7036_write_command_byte( 0x01 );
// Display löschen, Cursor Home
warte_ms(400); //
ST7036_write_command_byte( 0x06 );
// Cursor Auto-Increment
warte_us(50); // mehr als 26,3µs warten }
The EA DOGM162L-A’s CLK and CSB pins are driven
to their inactive states and an ST7036 hardware reset is
initiated. After the mandatory greater than 40 mS delay,
the ST7036 initialization sequence begins. As you can see,
the ST7036_init function follows along just like the
example code in Listing 1. Let’s apply these German
timings and register settings to our USCM-47J53 SPI driver
code.
CODING THE EA DOGM162L-A DRIVER
Before we can deliver bytes to the EA DOGM162L-A’s
SI pin, we must establish a Master SPI portal at the USCM-
47J53 end of the proposition. To bring a Master SPI portal
to life, we must first assign the SPI clock and data lines to
appropriate pins on the PIC18F47J53. To begin the Master
SPI portal initialization process, the peripheral pin select
feature of the PIC18F47J53 must be unlocked which
enables us to associate PIC18F47J53 Master SPI functions
with multi-purpose PIC18F47J53 I/O pins:
//Initialize the SPI
// UnLock Registers
EECON2 = 0x55;
EECON2 = 0xAA;
PPSCONbits.IOLOCK = 0;
// Unlock ends
// Pin Remapping
RPOR6 = 10;
//RP6 (RB3) as SDO2 (output pin)
RPOR13 = 11;
//RP13 (RC2) as SCK2 (output pin)
RPINR21 = 23;
//RP23 (RD6) as SDI2 (input pin)
// Pin Remapping ends
// Lock Registers
EECON2 = 0x55;
EECON2 = 0xAA;
PPSCONbits.IOLOCK = 1;
// Lock Registers ends
If you’re just joining us, we revealed the magic behind
the SPI remapping process in the previous Design Cycle.
Basically, remappable peripherals are selected via values
placed in the peripheral pin select register set.
Once the Master SPI portal I/O pins are established,
we must adjust their directions. For instance, CSB is an EA
DOGM162L-A input pin and a corresponding output pin
must be configured at the USCM-47J53 end. The coded
pin assignments are echoed in Schematic 1:
#define EACSB PORTCbits.RC7
//EA DOGM162L-A CSB pin
#define EARS PORTDbits.RD4
//EA DOGM162L-A RS pin
#define EARESET PORTDbits.RD5
//EA DOGM162L-A RESET pin
#define OUTPUT_PIN 0
#define INPUT_PIN 1
TRISCbits.TRISC7 = OUTPUT_PIN; //CSB
■ LISTING 2. When I picked out the words Cursor
BLINKEN, I knew that I could make some sense of this
jumble of German-English source code.
January 2011 51
D E S I GN C YC L E
www.nutsvolts.com/index.php?/magazine/article/january2011_DesignCycle
/* ——————————————————————————————————- Sample
code for driving ST7036 on ELECTRONIC ASSEMBLY’s
DOG-Series (tested on ATmega8, EA DOGM163, AVR-
GCC) *** NO FREE SUPPORT ON THIS PIECE OF CODE
*** if you need an offer: mailto:
programmer@demmel-m.de ——————————————————————————
————————- */ //Serieller Betrieb von EA
DOGModulen mit dem ST7036 #define ST7036_SI
As_(PORTD, 5) #define ST7036_CLK As_(PORTC, 4)
#define ST7036_CSB As_(PORTD, 2) #define
ST7036_RS As_(PORTD, 3) #define ST7036_RESET
As_(PORTB, 1) /* ein Byte in das ???-Register
des ST7036 senden */ void ST7036_write_byte(
char data ) { signed char u8_zahl
Design Cycle - Jan 11.qxd 12/2/2010 11:14 AM Page 51
52 January 2011
TRISDbits.TRISD4 = OUTPUT_PIN; //RS
TRISDbits.TRISD5 = OUTPUT_PIN; //RESET
TRISBbits.TRISB3 = OUTPUT_PIN; //SDO2
TRISCbits.TRISC2 = OUTPUT_PIN; //SCK2
TRISDbits.TRISD6 = INPUT_PIN; //SDI2
As you can see, we also matched up the EA
DOGM162L-A’s control lines (CSB, RS, and RESET) with
the appropriate PIC18F47J53 I/O pins and defined their
data directions. The EA DOGM162L-A CSB pin resets the
EA DOGM162L-A’s internal SPI bit counter on its falling
edge. As far as the RS pin is concerned, it performs the
same command/data identification function as it does in
parallel mode.
The EA DOGM162L-A’s RESET pin does exactly what
you think it does. It can be tied directly to VDD. However,
if we want the USCM-47J53 to issue a hardware reset to
the ST7036 — and we do — we must tie the its RESET line
to VDD by way of a pull-up resistor and assign a
PIC18F47J53 I/O pin to the RESET function. Again,
Schematic 1 reflects the EA DOGM162L-A RESET pin
circuitry.
Normally, we would stuff the bits directly into the SPI
SFR (Special Function Register) to initialize and configure
the PIC18F47J53’s Master SPI portal. The Microchip C18
C compiler comes equipped with library routines that take
some of the bit twiddling tedium out of configuring PIC
peripherals. For instance, by simply including spi.h, we can
open and configure the SPI2 Master portal with this self-
commenting line of code:
OpenSPI2(SPI_FOSC_64, MODE_11, SMPEND);
The first argument of the OpenSPI2 library function
sets the SPI clock speed. The SPI clock could be set up to
run faster but through experimentation, I found that a SPI
SCLK line clocked at Fosc/64 works best with the USCM-
47J53’s clocking system. The MODE selection indicates
that the SCLK rest (inactive) polarity is logically high and
that data is transferred on the active to inactive edge of
SCLK. SMPEND (sample input at the end of data output
time) is just a place holder here as the EA DOGM162L-A
doesn’t send any data in the SPI clock stream back to the
Master SPI device.
Judging by the listings we’ve studied, it’s pretty
obvious that we’ll need to code some delay routines. If we
were writing our EA DOGM162L-A driver code using CCS
C, that’s a no-brainer as the CCS C compiler has built-in
delay functions. The same holds true for the Microchip
compiler. However, to take advantage of the C18 C
compiler delay routines, we must include TimeDelay.h.
Once we have the delay routines in place, we can call
upon their functionality like this:
Delay10us(5) = delay for 50uS
DelayMs(5) = delay for 5mS
At this point, we have control of the PIC18F47J53’s
Master SPI portal and as Mick Jagger would say, “Time is
on our side. Yes it is.” At this point, we can assemble our
EA DOGM162L-A SPI driver routines.
CODING THE EA DOGM162L-A
SPI DRIVER
Basically, we need to send commands and data to the
EA DOGM162L-A’s SI pin via the PIC18F47J53’s Master
SPI portal SDO2 pin. Much of our coding work has been
done for us within the C18 SPI library. However, to
activate the LCD, there are procedures that must be
followed in order within our EA DOGM162L-A SPI driver
routines.
No matter if the SPI bit stream is carrying a command
or byte of data, the EA DOGM162L-A’s CSB pin must be
EDTP microSD INTERFACE CARD
SDO = MISO
SDI = MOSI
NOTE:
1. THE SLAVE SPI DEVICES ARE LABELED IN THE PERSPECTIVE OF THE PIC18F47J53.
GATE
CS
SDO
SDI
3V3
SDI SWITCHED_3V3
VBUS
EN
SCK
S
C
K
SDO
C
S
IN
RESET
SDO
CLK
RS
CSB
CSB
RS
RESET
3V3
3V3
VBUS
3V3
3V3
3V3
3V3
3V3
3V3
3V3
3V3
3V3
microSD CONNECTOR
1
2
3
4
5
6
7
8
LCD1
EA DOGM162E-A
21
22
23
24
25
26
27
2
8
2
9
3
0
3
1
3
2
3
3
3
4
3
5
3
6
3
7
3
8
3
9
40
1
2
19
20
CAP1N
CAP1P
PSB
VOUT
VIN
VDD
VSS
D
7
D
6
D
5
D
4
D
3
D
2
D
1
D
0
E R
/
W
C
S
B
R
S
RESET
A1+
C1-
C2-
A2+
C6
20pF
Y1 12 MHz
C3
100nF
C13
100nF
U1
PIC18F47J53
1
2
3
4
5
6
7
8
9
10
11
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
23
24
25
26
27
28
29
30
31
32
33
3
4
3
5
3
6
3
7
3
8
3
9
4
0
4
1
4
2
4
3
4
4
RC7/RP18
RD4/RP21
RD5/RP22
RD6/RP23
RD7/RP24
VSS1
VDD1
RB0/RP3
RB1/RP4
RB2/RP5
RB3/RP6
N
C
N
C
R
B
4
/
R
P
7
R
B
5
/
R
P
8
R
B
6
/
R
P
9
R
B
7
/
R
P
1
0
M
C
L
R
R
A
0
/
R
P
0
R
A
1
/
R
P
1
R
A
2
R
A
3
VDDCORE/VCAP
RA5/RP2
RE0
RE1
RE2
VDD2
VSS2
OSC1
OSC2
RC0/RP11
NC
N
C
R
C
1
/
R
P
1
2
R
C
2
/
R
P
1
3
V
U
S
B
R
D
0
R
D
1
R
D
2
/
R
P
1
9
R
D
3
/
R
P
2
0
R
C
4
/
D
-
R
C
5
/
D
+
R
C
6
/
R
P
1
7
C14
1.0uF
C15
1.0uF
EXT-5V0
1
2
MINI-B USB RECPT
1
2
3
4
5
6
1
2
3
4
5
6
R1
10K
Y2 32.768 KHz
C9
12pF
C2
100nF
R3
1.5K
C5
100nF
R2
10K
C7
20pF
R1
10K
C1
100nF
C4 100nF
R5
470
U1
MC74VHC1GT125DT
2
4
5
3
1
LED1
BLUE LED
C11
4.7uF
C8
12pF
R6
10K
C2
100nF
C10
4.7uF
C12
1uF
Q1
DMP2123L
VR1 TC1262-3.3
1 3
2
IN OUT
C
O
M
R4
100K
C1
10uF
ICSP
1
2
3
4
5
6
R2
100
■ SCHEMATIC 1. As Wernher von Braun
would have said, “Kein Hexenwerk hier.”
(No rocket science here.)
Design Cycle - Jan 11.qxd 12/7/2010 5:38 PM Page 52
www.downmagaz.com
driven low before any bits are clocked out of the Master
SPI portal’s SDO2 pin. Once the EA DOGM162L-A’s bit
counter is reset by the falling edge of the CSB signal, the
RS pin must be conditioned to inform the EA
DOGM162L-A about the type of data it is about to
receive. A command is transmitted when the EA
DOGM162L-A’s RS pin is driven logically low. Data is
clocked out of the SDO2 pin when the EA DOGM162L-
A’s RS pin is driven logically high. With that, we can code
the following core driver routines:
//***********************************************
//* SEND LCD COMMAND VIA SPI
//***********************************************
void spi_cmd(char cmd)
{
EACSB = 0;
EARS = 0;
WriteSPI2(cmd);
EACSB = 1;
DelayMs(2);
}
//***********************************************
//* SEND LCD DATA VIA SPI
//***********************************************
void spi_data(char data)
{
EACSB = 0;
EARS = 1;
WriteSPI2(data);
EACSB = 1;
DelayMs(2);
}
Note that the CSB pin’s fall to logically low and rise to
logically high encapsulate the bit transmission in both the
command and data transmission routines. The WriteSPI2
function is provided by the C18 SPI library, which we
included into our application (#include “spi.h”). The
inclusion of the C18 delay library routines (#include
“TimeDelay.h”) takes care of the 2 mS delays at the end of
each of our bit transfer routines.
The spi_data and spi_cmd functions form the basis for
our EA DOGM162L-A SPI driver set. For instance, our
little spi_cmd function is the pivot point for our spi_gotoxy
driver function:
void spi_gotoxy( char x, char y)
{
// where x = lcd row (1,2,3,4) and
// y = column (1 thru 20)
char address;
switch (x)
{
case 1:
address = 0; //line 1
break;
case 2:
address = 0x40; //line 2
break;
case 3:
address = 0x14; //line 3
break;
case 4:
address = 0x54; //line 4
break;
default:
address = 0;
}
address += (y-1);
spi_cmd(0x80|address); //set DDRAM address
}
It’s like the old axiom that states “Where there’s
smoke, there’s fire.” In our case, “Where there’s a
function, there’s a macro.” We can spin the spi_gotoxy
driver and spi_cmd functions into a trio of EA
DOGM162L-A driver macros:
#define lcdcls spi_cmd(0x01)
//clear the LCD macro
#define line1 spi_gotoxy(1,1)
//goto line 1 LCD macro
#define line2 spi_gotoxy(2,1)
//goto line 2 LCD macro
The USCM-47J53 operates in a round-robin
environment. That means that the PIC18F47J53 is
servicing a USB port as well as the EA DOGM162L-A
LCD, plus other various tasks. So, we have to build our EA
DOGM162L-A driver to step into and step out of the
round-robin queue as quickly as possible. To accomplish
this, we will use an LCD text holding area (LCDText[]) that
is emptied only when its turn comes around in the queue.
The text holding area is a simple ASCII array that is loaded
by the user and dumps its text to the EA DOGM162L-A
with a cue from the update flag:
void spi_update(void)
{
char i, j;
// Go home
line1;
// Output first line
for(i = 0; i < 16u; i++)
{
// Erase the rest of the line if a null
// char is encountered (good for printing
// strings directly)
if(LCDText[i] == 0u)
{
for(j=i; j < 16u; j++)
{
LCDText[j] = ‘ ‘;
}
}
spi_data(LCDText[i]);
}
// Set the address to the second line
line2;
// Output second line
for(i = 16; i < 32u; i++)
{
// Erase the rest of the line if a null
// char is encountered (good for printing
// strings directly)
if(LCDText[i] == 0u)
{
for(j=i; j < 32u; j++)
{
LCDText[j] = ‘ ‘;
}
}
spi_data(LCDText[i]);
}
flags.update = 0;
}
January 2011 53
D E S I GN C YC L E
Design Cycle - Jan 11.qxd 12/2/2010 11:16 AM Page 53
The spi_update function is a modified version of the
generic parallel LCD driver that comes with the Microchip
application libraries. The results of the modified version
are the same as the original routine with the exception of
the bits being driven over a SPI portal via our spi_data
routine. Here’s all we need to do to put a message on the
EA DOGM162L-A glass:
//Display Character position
12345678123456781234567812345678
char lcdmsg_dc[] =
“ DESIGN CYCLE SPI LCD Driver “;
for(x=0;x<sizeof(lcdmsg_dc);++x)
LCDText[x] = lcdmsg_dc[x];
flags.update = 1;
The dog is barking and standing on its hind legs in
Photo 1. Note that the spi_update driver routine
automatically divides the LCDText array contents into a
pair of 16 character lines. The USB connection is a bit
more than a power source as the USCM-47J53 has
enumerated and clocked in as a HID class device with the
host laptop.
TIME IS ON MY SIDE
The PIC18F47J53 is equipped with a full-monty RTCC.
In addition to keeping time and date, the PIC18F47J53’s
RTCC contains alarm capability. All we need to make the
PIC18F47J53’s real-time clock calendar tick is a clock
source and a little bit of code.
The USCM-47J53 has pad area to support a Fox
FX135 SMT 32.768 KHz crystal. The FX135 is the missing
link in the PIC18F47J53’s TIMER1 oscillator chain. The
ticks generated by the TIMER1 oscillator produce time
keeping in years, months, days, day of the week, hours,
minutes, seconds, and half seconds. The trick is loading
the date/time registers and picking out the date/time data
that your application requires.
The PIC18F47J53 datasheet is rather detailed when it
comes to the description of the operation of the real-time
clock calendar. However, it all boils down to a few “must
do” operations and an understanding of where the
time/date data resides. One other important fact you need
to know is that the time/date data is stored within the
RTCC as BCD digits.
Two bits form a pointer to the date/time data within
the RTCC. Table 1 is representative of how the date/time
data is arranged. To write to the HOURS byte, set the
RCTPTR bits to 01 and load the data to RTCVALL.
Whether you use the WEEKDAY byte or not, you must
write to it if you want the RTCC innards to automatically
move to the SECONDS byte. Otherwise, you would have
to reload the RTCPTR bits to point at the byte set you
desire to manipulate. The RCTPTR bit set will decrement
after every access to the RTCVALH register. Once the
RCTPTR bits reach 00, they will stay there until the user
resets them. Writes to the date/time array are controlled
by the RTCWREN bit which must be set to allow writes to
the date/time array.
Configuring the PIC18F47J53’s RTCC begins with the
configuration fuse settings:
#pragma config RTCOSC = T1OSCREF
//RTCC uses T1OSC/T1CKI as clock
Our application employs the preferred external
32.768 kHz crystal controlled clock. However, the
PIC18F47J53’s internal RC clock can also be used as a
timing source. In that we’re using the Timer1 oscillator
option, we must also make sure that Timer1 is activated:
// Initialize the RTCC
T1CONbits.TMR1CS1 = 1; //clock source is
//T1OSC
T1CONbits.TMR1CS0 = 0; //
T1CONbits.T1OSCEN = 1; //power up the T1OSC
//crystal driver
T1CONbits.TMR1ON = 1; //start TIMER1
The next step in getting the RTCC up and running
involves unlocking the date/time array for write
operations. The PIC18F47J53 datasheet provides a
recommended method that involves writing a 0x55/0xAA
sequence before setting the RTCWREN write lock bit:
EECON2 = 0x55;
EECON2 = 0xAA;
RTCCFGbits.RTCWREN = 1;
With the write lock removed, we can now enable the
RTCC and write to the date/time array:
■ PHOTO 1. The USCM-47J53 is running in USB HID mode
and has enumerated with the Lenovo laptop host. Thus,
we could spin up some laptop-side and USCM-47J53-side
code to display characters under the control of incoming
HID report packets.
54 January 2011
Design Cycle - Jan 11.qxd 12/2/2010 11:16 AM Page 54
www.downmagaz.com
RTCCFGbits.RTCEN = 1;
RTCCFGbits.RTCPTR1 = 0;
RTCCFGbits.RTCPTR0 = 1;
RTCVALL = 0x23; //HOURS
RTCVALH = 0x00; //WEEKDAY
RTCVALL = 0x59; //SECONDS
RTCVALH = 0x59; //MINUTES
Note that I have set the RTCPRT bit pair to point at
the WEEKDAY/HOURS registers. When we pass by the
MINUTES set instruction, the date/time array holds time
data only with a value of 23:59:59. The WEEKDAY value is
set for Sunday (0). It is recommended that we write lock
the date/time array after finishing the required write
operations:
EECON2 = 0x55;
EECON2 = 0xAA;
RTCCFGbits.RTCWREN = 0;
prev_secs = 0x30;
The clock is running. We can pipe the time to our EA
DOGM162L-A LCD using our spi_update function
coupled with a new function that retrieves and converts
the raw date/time for use by the LCD:
void get_bcd(unsigned char data)
{
hibyte = ((data & 0xF0) >> 4) + 0x30;
lobyte = (data & 0x0F) + 0x30;
}
All we need to do is add 0x30 to each RTCVAL to
convert the RTCC’s BCD data to display-able ASCII. To
display the time every second, I’ve added the prev_secs
variable. The prev_secs value is compared to the latest
retrieved SECONDS value with every pass through the
round-robin task queue. When the values don’t match, the
spi_udate function is triggered and all of the date/time
information that has been stuffed into the LCDText array is
displayed. Let’s walk through the process beginning with
setting the RTCPTR pointer bits:
RTCCFGbits.RTCPTR1 = 0; //point to HOURS
RTCCFGbits.RTCPTR0 = 1;
Using our new get_bcd driver function, we are in the
position to access and read the HOURS value:
get_bcd(RTCVALL); //get HOURS
LCDText[0] = hibyte;
LCDText[1] = lobyte;
LCDText[2] = ‘:’;
The HOURS bytes are read and stuffed into the
LCDText array. Rather than reload the RTCPTR bits, we’ll
read the WEEKDAY value and simply ignore it:
get_bcd(RTCVALH); //get WEEKDAY and ignore
Reading the WEEKDAY automatically decrements
the RTCPTR bit pair and places us in the position to
read the SECONDS value. Note that we “ignored” the
WEEKDAY value by not saving the value into the
LCDText array.
Following the SECONDS value acquisition, we
perform the display test on the 1’s value of the SECONDS
ASCII bytes. If the values don’t match, the time will be
updated on the LCD in the next round-robin task pass.
Meanwhile, we stuff the current SECONDS value into the
LCDText array for display:
get_bcd(RTCVALL); //get SECONDS
if(prev_secs != lobyte)
{
prev_secs = lobyte;
flags.update = 1;
}
LCDText[6] = hibyte;
LCDText[7] = lobyte;
LCDText[5] = ‘:’;
Since we obtain the SECONDS value before we
acquire the MINUTES value, we must adjust the position
of the MINUTES and SECONDS values in the LCDText
array. This is easily done with the LCDText array pointer
values:
get_bcd(RTCVALH); //get MINUTES
LCDText[3] = hibyte;
LCDText[4] = lobyte;
We can use the second line of the LCD to display
anything we wish. In this instance, I’ve elected to clear the
rest of the LCD by writing NULL characters to the
remaining DDRAM locations:
for(y=8;y<33;++y) //clear the rest of the LCD
LCDText[y] = 0;
On the next pass through the ProcessIO function, the
state of the update flag will determine if a new time value
will be displayed on the EA DOGM162L-A’s glass:
if(flags.update)
{
spi_update();
}
YET IT IS
Photo 2 is proof that we followed the rules of the
January 2011 55
D E S I GN C YC L E
■ TABLE 1. The trick is to set the RT CPTR value and load
or read the least significant byte first.
Design Cycle - Jan 11.qxd 12/2/2010 11:16 AM Page 55
RTCC to the letter. The application frameset we’ve used
today is based on the HID model. We can just as easily
run the EA DOGM162L-A and USCM-47J53 as a CDC
device which forces the USCM-47J53’s USB portal to
emulate a standard RS-232 portal. Taking it one step
further, the microSD card can be activated for instant
mass data storage capability.
I’ll end this edition of Design Cycle with the bridge
of Mick’s song ... hopefully, “You’ll Come Running Back“
for more next month. NV
Mouser Electronics
EA DOGM162L-A
www.mouser.com
Microchip
Microchip C18 C Compiler
Microchip Application Libraries
PIC18F47J53
www.microchip.com
EDTP Electronics, Inc.
USCM-47J53
www.edtp.com
SOURCES
Fred Eady can be reached at fred@edtp.com.
56 January 2011
■ PHOTO 2. The high intensity light emitted by my Flash
boxes wiped out the display pixels and so did the standard
camera flash. Fortunately, the camera is fast enough to catch
the pixels before they disappear. What you see here is the
display rolling over between 32 and 33 seconds
just as the flash popped.
Design Cycle - Jan 11.qxd 12/6/2010 11:16 AM Page 56
www.downmagaz.com
January 2011 57
Page 57 Jan11.qxd 12/6/2010 3:24 PM Page 57
58 January 2011
Recap
Last month, we learned more about SPI
(Serial Peripheral Interface) and how to use
it with the AVR Butterfly’s 4 Mbit DataFlash.
I ended that article with the promise that
this month we would use the Butterfly
DataFlash in a data logger application.
However, then reality smacked me up side
the head and I realized that we were getting
into fairly complex stuff without having
discussed some of the background concepts
we will need to understand to keep from
getting too confused.
A data logger uses just about everything
that a microcontroller can do. We will be
using the DataFlash to log the data, the hardware SPI to
talk to the DataFlash, the USART to talk with a PC, one of
the timers for a real time clock, the ADC for light,
temperature, and voltage sensors, and other things that
escape me at the moment. The point is that without some
higher level of organization, this project will get out of
hand. So, this month we will begin to build resources that
we will use later to make that promised data logger.
I Left It Around Here Somewhere ...
Up to now, we’ve been pretty much dealing with only
a few things at a time. For instance, when we examined
AVR memory we divided it up into five articles where we
learned about each type of memory and wrote some
code that let us use each type. In the last two articles, we
learned to access external memory in the Butterfly’s Atmel
DataFlash using the SPI bus (with hardware and software
versions — and as a side benefit, we built a new light
chaser LED project that had nothing to do with memory).
So now, with all these great simple projects under your
belt, you can easily recall all that you learned and
immediately write the code — right? Well, if you can,
you’ve got a better memory than I do.
I wrote the stuff and can’t rewrite it from memory, and
to make matters worse, I often can’t even find where I left
the working code. Smiley’s Workshop is like a typical real
workshop: It is very messy. In a real workshop, you’ll be
puttering along with a project and remember that you need
to use a widget similar to one you built a few month’s ago,
so you go looking for it and hours later you find it under a
pile of other widgets gathering dust in a corner. [And, yes
the laws of nature work here — it really is the last place you’d
think to look.] So you dust it off, build a copy of it, attach
it to your project, and then realize AGAIN that for the next
step you need another widget just like one you built several
months ago. And darned, if you didn’t see it when you
were looking just now ... but where? And off you go again.
AVR_Toolbox
What we really need is a well organized toolbox for
#30
Follow along with this
series! Joe’s book & kits
are available at
www.nutsvolts.com
by Joe Pardue
■ FIGURE 1. AVR_Toolbox.
AVR_Toolbox —
Documentation and
Libraries
Smileys Workshop 30 - Jan 11.qxd 12/2/2010 11:25 AM Page 58
www.downmagaz.com
all our stuff. Please note that I said ‘we’ — yes, you and
me! Because of the miracle of the Internet, we will be
able to use the same toolbox. The AVR_Toolbox
(metaphorically shown in Figure 1) is an open source
project hosted on Google Code [http://code.google.
com/p/avrtoolbox/] where you will be able to access all
sorts of AVR tools discussed in Smiley’s Workshops.
Anyone can download the code and since this is a “we”
project, if you want to participate (and aren’t crazy), I’d be
happy (even grateful) for your help. I especially need
feedback on typos and bugs, so if you see any problems,
be sure and post something in the ‘issues’ page.
AVR_Toolbox is a work in progress and always will be. We
expect to get better with time; likewise, we expect our
tools to get better.
Documenting With Doxygen
Doxygen [http://www.stack.nl/~dimitri/doxygen/] is a
software documentation system that helps you write
comments in your source code that can be scanned to
produce documents in a variety of formats; most relevant
here are HTML (shown in Figure 2) and Windows Help
files (.html and .chm). Doxygen can do a lot of stuff and
the AVR_Toolbox documentation is only one way to do
things — one way that might evolve over time as we learn
more about it.
One good reason to use doxygen is that it allows us
to keep the documentation in one place tied directly to
the source code. If we change the code, we’ve got the
documentation right there in the code, making it easy to
change it also. If you keep your documents in a separate
manual and you make a change in the code, you’ll write a
note to yourself to remember to change the manual and
then (if you’re like me) you’ll lose the note. With doxygen,
you can even keep a to-do list directly linked to the code
(shown in Figure 8).
Since we discussed the SPI last month, we will
convert those functions into a library that we will
document with doxygen to illustrate the principles
involved. First, we create the documentation for our main
page using the doxygen \mainpage directive:
/*!
\image html AVR_Toolbox.gif
<center>Visit us at: http://www.smileymicros.com
</center>
\mainpage SPI (Serial Peripheral Interface)
This code was designed to allow the user to
create multiple SPI links using either bit-
banged software or regular AVR hardware SPI.
The user first selects a SPI number from a list
that can be expanded as needed:
#define SPI0
//#define SPI1
//#define SPIx // place holder
After selecting and SPI number, then the user
selects either software or hardware for that
number:
//#define SPI0_SOFT
#define SPI0_HARD
The user accesses the following functions:\n
void spi0_init_master(void);\n
uint8_t spi0_master_rw8(uint8_t to_slave);\n
uint16_t spi0_master_rw16(uint16_t to_slave);\n
Which are alia’s for the software or hardware
version.
This code was tested for SPI0 in both software
and hardware modes on the ATmega169, ATmega328,
and ATmega644 (TODO)
\todo 1. Test it for the ATmega644.
\todo 2. Retest with the Arduino board.
\todo 3. Improve the comments before letting
this puppy loose!
\author Joe Pardue
\date October 29, 2010
*/
Doxygen will find this section and turn it into an html
file that looks like Figure 2.
The first thing to notice about the code is that the
section we want doxygen to look at is delimited with /*!
and */. Most of the doxygen commands use a backslash
(‘\’) character such as \mainpage. There are many
doxygen commands, but we will only use a small subset
of them to keep things simple. [The source code file is in
the Workshop30.zip available from Nuts & Volts.]
Using Doxygen
After you install doxygen, you will find doxywizard.exe
January 2011 59
SMILEY’S WORKSHOP ☺
■ FIGURE 2. Doxygen generated HTML main page.
Smileys Workshop 30 - Jan 11.qxd 12/2/2010 11:26 AM Page 59
60 January 2011
in the bin file. This application provides a GUI front-end
for doxygen that helps simplify using it. Open it and fill
out the project information as shown in Figure 3. In our
case, we will be creating html documentation for the SPI
functions in doxygen_test [in Workshop30.zip].
Click Next and set the mode as shown in Figure 4.
Click Next again, and set the output as shown in Figure 5.
Click Next, but skip the Diagrams and you get what
you see in Figure 6 where you will click on the ‘Run
doxygen’ and doxygen will generate your html files. Clicking
on ‘Show HTML output’ will open your default browser
with the files as shown in Figure 2. After you have finished
playing with doxygen and are ready to close it, it will ask if
you want to save the configuration file ‘Doxyfile’ – which
you do. So, save it along with the rest of your project and
then if you want to change anything, the next time you
run doxygen you can use the File menu to open the
existing Doxyfile, and save time filling in the wizard boxes.
Looking At The Doxygen
Generated Output
Quite frankly, I was shocked the first time I ran
through this because the doxygen generated output
document looks surprisingly good. It makes you want to
go back to the code and spiff it up a bit just so it won’t be
embarrassed to be seen with such classy documentation.
You’ve seen the main page in Figure 2, so play with it a
bit to see what you’ve really got. In the frame on the left,
click on the SPI file and you’ll see the functions listed as
■ FIGURE 5. Doxywizard output.
www.nutsvolts.com/index.php?/magazine/article/january2011_SmileysWorkshop
■ FIGURE 3. Doxywizard project. ■ FIGURE 4. Doxywizard mode.
■ FIGURE 6. Doxywizard run.
Smileys Workshop 30 - Jan 11.qxd 12/2/2010 11:27 AM Page 60
www.downmagaz.com
shown in Figure 7. Click on the Todo List and you’ll get
what’s shown in Figure 8.
As we progress with developing our AVR Tools library,
we will add a few more doxygen features to the process,
keeping in mind that our goal is to make the code
documenting process as simple and easy as possible so
we will use it, but with just enough features to make the
output really useful.
Converting To The HTML
Help .chm File
You will notice that the HTML output is about 40 files
and that you need to click on index.html to open the
browser to access them. You can convert these files into a
single compressed HTML (.chm) file (such as the typical
Microsoft Help file shown in Figure 12).
Set Doxygen to prepare the HTML output for
compressed HTML (.chm) by selecting what’s shown in
Figure 9, then run it to create the file.
Download Microsoft HTML Help Workshop from
http://msdn.microsoft.com/en-us/library/ms669985.aspx.
Open HTML Help Workshop and click ‘File\Open,’ then
browse to select the index.hhp generated by Doxygen
which will fill out the IDE as shown in Figure 10.
Click on the ‘Compile HTML file’ button as shown
in Figure 11. The results will be
index.chm. Change the name to
doxygen_test.chm and click on it
to reveal the help file shown in
Figure 12.
You will probably want to
January 2011 61
SMILEY’S WORKSHOP ☺
■ FIGURE 8. Doxygen generated Todo list.
■ FIGURE 9. Doxywizard output compressed HTML.
■ FIGURE 10. HTML Help Workshop.
■ FIGURE 7. Doxygen generated SPI function.
■ FIGURE 11.
Compile HTML file.
Smileys Workshop 30 - Jan 11.qxd 12/2/2010 11:28 AM Page 61
62 January 2011
expand this to full
screen. This has the
same information in
it as the HTML files
generated earlier,
but it is now all in
one file (half the
size of the original
html) and the Help
format provides
some search
options not
available viewing
the HTML version
in a browser.
You now have
one simple way to
generate
documents for your source code and you have an
introduction to a tool (doxygen) that has many other
features you may want to explore.
Libraries
It might seem logical to keep a bunch of related
functions in a single text file like we do with SPI.c that
we used for our doxygen test. However, there is a
problem with this in that when we write a program that
only uses a few of the SPI functions, if we include the
entire SPI.c file, the compiler will create a single object
module for it and all the functions whether used or not
will get linked into our program, increasing our code
size unnecessarily. We don’t want that. We want to
■ FIGURE 12. Doxygen_test compressed HTML Help file. ■ FIGURE 13. Add the .c files.
■ FIGURE 16. Find the Command Prompt.
■ FIGURE 14. Individual
functions as .c files.
■ FIGURE 15. Verify that you’ve created the objects.
Smileys Workshop 30 - Jan 11.qxd 12/2/2010 11:29 AM Page 62
www.downmagaz.com
keep the code as small as possible and only link to the
functions we will use. In order to do this, we will put
each function into a separate file and compile each
function into an object module that we will then put in a
library. The linker will scan the library to find only the
functions that are used in the code. Since we are going
to be using the AVR Butterfly for our data logger, we will
use a Butterfly specific subset of the SPI functions
discussed last month, and put them into a special Butterfly
SPI library.
Let’s do this cookbook style. First, we extract the SPI
functions that we want to use with the Butterfly into four
separate .c files: spi0_init_master.c, spi0_master_rew16.c,
spi0_master_rw8.c, and spi0_SS.c.
Then, we add them to an AVRStudio
project SPI_Library as shown in
Figures 13 and 14.
Next, we add the main.c file that,
in this case, does nothing:
int main()
{
// Do nothing since this
program
// is just to create the
objects
}
Run the compiler and you will
generate the object modules for each
of the .c files that will be located in
the \default directory as shown in
Figure 15.
You will find the library builder —
avr-ar.exe — in the WinAVR bin
directory (in my case, C:\WinAVR-
20090313\bin\avr-ar.exe). To use
this, you must first find the
‘Command Prompt’ by browsing to
the Windows Accessories directory
as shown in Figure 16, then open it
as shown in Figure 17.
The library creation program
requires a long and difficult to type
command line. Don’t try to type your commands into
the Command Prompt since (if you are like me) you
will never get it right. Use Notepad to input the
command string shown below, then copy and paste it
to the cmd window. Assuming that our object files are
in ‘C:\SPI_library\,’ the following string will create our
library:
January 2011 63
SMILEY’S WORKSHOP 
■ FIGURE 17. Run avr-ar in the Command Prompt.
Mini USB PIC Programmer with ZIF Socket
UK1133
Optional LCD Module: $17.95
Assembled: $49.95
www.canakit.com
www.canakit.com
1•888•540-KITS (5487)
FM Transmitters Timers Audio Amplifiers Motor Controllers • • • • Custom Designs
.95
$59
.95
$34
CK1301
50A Digital PWM Motor Speed Controller
ASSEMBLED
4-Port USB Relay Controller with
6-Channel Analog/Digital Interface
UK1104
SAVE 15% !!!
COUPON CODE NV201002
.95
$59
ASSEMBLED
Arduino
Duemilanove
.95
$29
■ FIGURE 18. Project Options.
Smileys Workshop 30 - Jan 11.qxd 12/7/2010 11:32 AM Page 63
avr-ar rcs
C:\SPI_library\libButterflySPI.a
C:\SPI_library\default\spi0_init_master.o
C:\SPI_library\default\spi0_master_rw8.o
C:\SPI_library\default\spi0_master_rw16.o
C:\SPI_library\default\spi0_SS.o
NOTE that this must all be on one line and is shown
here on several lines since it would be too wide otherwise.
Make sure there is a single space between each item.
Copy and paste it as shown in Figure 17. Push the ENTER
button on your keyboard and if it runs okay, you don’t get
any messages, so you’ll want to look in the SPI_library
directory and make sure that libButterflySPI.a is really there.
Using libButterflySPI.a
Let’s test this by copying the DataFlashTest project
from last month’s workshop to a new SPI_Library_Test
directory so that we can test known good code with the
new library [source is in Workshop30.zip]. This works
pretty much like last month’s DataFlash program except
that in the SPI subdirectory, we delete the SPI.c file and
copy/paste libButterflySPI.a to replace it. Next, we open
the AVRStudio Project menu and select the Project
Options. Click on the libraries icon to open the window
shown in Figure 18.
In the upper part of this window, click on the little
folder icon (left of the red X) and navigate to the SPI
folder. It will show SPI\ in the upper text box and it will
also locate the libButterflySPI.a file and show it in the
‘Available link Objects:’ list. Highlight the library, then click
the ‘Add Object’ button to add it to the ‘Link with these
objects’ list. Click okay and compile the project. It should
compile okay and function exactly like it did when you
used the SPI.c file. So it works the same, what did we gain
with all this rigmarole? The main thing, as mentioned
above, is that now the project will
only use (compile in) the functions
that you actually need and not clutter
things up with unnecessary functions.
Wrap-Up
Now we know a good way to
document our software and a way to
create libraries. We can document
and create libraries for all those
Butterfly goodies that we’ll want to
use in our data logger. If you just
can’t wait and want to get a good leg
up on C and the AVR (while helping
support your favorite magazine and
technical writer), buy my C
Programming book and Butterfly
projects kit through the Nuts & Volts
website. Next month — if all goes
well — we will continue with
AVR_Toolbox by making it an open
source project. NV
64 January 2011
TCPmaker for control over the Web

Easy as 1-2-3:
1. Defne Your Data, with variable names that
YOU create.
2. Lay Out Your Content (with gorgeous
web-ready screen controls that you can grab
on to) using TCPmaker’s drag & drop Visual
Page Designer.
3. Generate Your Code, for all Microchip C
compilers, to “wire it all together.”
NO PC PROGRAMMING AT ALL – just point your
web browser at your device!
www.tracesystemsinc.com
888-474-1041
From the makers of HIDmaker FS: m the makers of HIDmaker FS: om
Simple Upgrade Management System
Low cost integrated system manages upgrades
across diferent processors & connectivity types:
> Lets your end users upgrade your PIC
frmware safely, simply, and securely.
> Automatically delivers upgrade by email.
> Simple for non-technical end users.
> Encrypted system protects your frmware
from theft or from being programmed into the
wrong device.
> Grows with your product line: for a new
product w/ diferent processor or connectivity
type, just add another SUMS bootloader.
Smileys Workshop 30 - Jan 11.qxd 12/7/2010 11:37 AM Page 64
www.downmagaz.com
MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.
NO MINIMUM ORDER • All Orders Can Be Charged to Visa, Mastercard, American Express or Discover • Checks and Money Orders Accepted by Mail • Orders
Delivered in the State of California must include California State Sales Tax • NO C.O.D • Shipping and Handling $7.00 for the 48 Continental United States - ALL
OTHERS including Alaska, Hawaii, P.R. and Canada Must Pay Full Shipping • Quantities Limited • Prices Subject to change without notice.
MAIL ORDERS TO:
ALL ELECTRONICS CORP.
14928 OXNARD ST., VAN NUYS, CA 91411-2610
FAX (818) 781-2653 • INFO (818) 904-0524
E-MAIL allcorp@allcorp.com
Shop ON-LINE www.allelectronics.com
ORDER TOLL FREE
1-800-826-5432
QUALITY Parts
FAST Shipping
DISCOUNT Pricing
CALL, WRITE, FAX or E-MAIL
for a FREE 96 page catalog.
Outside the U.S.A. send $3.00 postage.
ALL
ELECTRONI CS
ALL
ELECTRONI CS
C O R P O R A T I O N
VIBRATING MINI-MOTOR
$
1
25
each
Designed to vibrate in cell phones
or pagers, this tiny 1.5-4.5Vdc
motor has an offset weighted shaft. Overall
length, including terminals and shaft, 18mm.
Body is 4.5mm x 5.5mm x 11mm long.
Flat, surface-mount solder tabs.
CAT# DCM-382
10 for $1.10 each • 100 for 95¢ each
40 CHARACTER X 2 LINE
LCD W/ LED BACKLIGHT
#UMSH-
3077JD-
YG. STN
Transflective LCD. Yellow-green
LED backlight. Module size: 182 x 33.5 x
13.6mm. Viewing area: 154.4 x 16.5mm.
Character size: 3.2 x 5.55mm
CAT# LCD-3077
10 for $7.50 each
$
8
50
each
Provides seven
additional USB 2.0
ports to your PC or
Mac, to connect digital
cameras, external hard
drives, flash drives, and
printers. One upstream and
seven downstream ports.
Hot-swappable and plug-
and-play connections.
CAT# USB-71
7-PORT USB HUB
$
10
95
each
MICROMINIATURE
12 VDC SPDT RELAY
Fujitsu #FBR21D12. 7.5 x 10 x
10mm high. 12VDC 534 Ohm coil.
SPDT contacts rated 1A @ 24Vdc, 0.5A
@120VAC. Maximum carry current, 2A.
Note: PC leads are not stiff. Not suitable for
automatic insertion. CAT# RLY-616
80
¢
each
10 for 65¢ each
100 for 50¢ each
RED ARROW LED TRAFFIC
LIGHT, 120 VAC, USED
iPOD MINI BATTERY
XLR CABLE CONNECTOR,
3-POLE FEMALE
12" diameter LED Arrow
traffic signal. Bright,
attention-getting
display with more than
100 LEDs operates on
120 Vac, 6.1VA. 12" dia. x
1.5" red lens. 6" overall depth.
Includes rubber mounting gasket. 36" leads.
Removed from service in good, working con-
dition. May be scuffed.
CAT# RTL-1 $
16
00
each
10 for $14.00 each
3.7V 550 mAh Li-Polymer
rechargeable iPod Mini battery.
33 x 40 x 4.5mm overall. Built-in
charge control board with 10K
NTC. Three 38mm leads with
female connector
CAT# LBAT-54
$
5
00
each
21MM PIEZO ELEMENT
50mm wire leads.
CAT# PE-56
$
1
00
each
10 for 85¢ each
Neutrik # NC3FX.
CAT# XLR-3FX $
3
00
each
25 for $2.65 each
SATELLITE SPEAKERS
W/ BRACKETS
Compact, wall-mount
satellite speakers. Mid to
high-range 4Ω shielded drivers
with 2" diameter, soft-edge
cones. Matte-black, sealed
cabinet. Each speaker is
2.9" square x 4.4" long.
Adjustable wall-mount swivel
bracket with each speaker.
CAT# SK-331
20 pairs for $8.00 per pair
$
9
00
per pair
1.4" ALLIGATOR CLIPS
1.4" (35mm) uninsulated clips.
20 per package.
CAT# ALG-27 $
3
00
per pk
5 packs for
$2.40 each
PRECISION GEARHEAD
MOTOR, USED
Pittman
# GM8712F191 /
PM3662. 96:1 gear ratio.
Rated 19.1Vdc. 80 RPM @
19vdc, 100mA (no-load). 56 RPM @ 12Vdc
(no-load). 35mm diameter gearhead.
30mm diameter motor. Overall length of motor
and gearhead, 75mm. 4.5mm diameter x
20mm long shaft. Three mounting holes on
face of motor. Prepped with 17mm diameter
metal gear, collar and mounting plate.
Removed from working equipment in
very-clean condition.
CAT# DCM-518 $
15
00
each
VTL5C1 OPTOISOLATOR /
OPTOCOUPLER
Perkin Elmer VTL5C1.
100dB dynamic range,
fast response time,
very high dark resistance.
8 x 10 x 12mm long. Wire leads.
CAT# VTL5C1
$
2
00
each
12DB, SINGLE-OUTPUT
VIDEO AMPLIFIER
50-900MHz.
VHF/FM/UHF amplifier.
Operates on 120Vac.
CAT# AMP-612
$
8
50
each
January 2011 65
Full Page.qxd 12/7/2010 9:56 AM Page 65
WWW.POLOLU.COM
w w w . A t r i a T e c h n o l o g i e s . c o m
ATRIA Technologies Inc
Microcontroller Boards
GREAT for Breadboards, Home Projects, Experi-
ments, Test Fixtures, Prototypes, Labs and more.
Microcontrollers, Communications, Display, Power.
BASIC ON BOARD Eliminates development tools
AM/FM Broadcasters • Hobby Kits
Learnng Kits • Test Equipment
...AND LOTS OF NEAT STUFF!
ELECTRONET
For the ElectroNet online, go to
www.nutsvolts.com
click Electro-Net
66 January 2011
Electronic Parts & Supplies
Since 1967
Looking for solar
stuff and kits?
www.nutsvolts.com
Electronet Jan11.qxd 12/6/2010 4:47 PM Page 66
www.downmagaz.com
M
y goal was to create an affordable near space flight
computer that was still worth flying into near space.
The most affordable PICAXE capable of meeting this need
was the PICAXE-28X1. This PICAXE has 2 Kb of memory
and up to 12 inputs and 17 outputs (depending on its
configuration settings). Of its
inputs, four of them can digitize
analog sensor voltages in the
name of science. However, it
wasn’t the PICAXE’s large
number of inputs and outputs
that sold me; it was its
hardware serial input. HSERIN is
a background command that
permits the PICAXE to read
serial data into its scratch pad
while it operates the rest of the
mission. GPS data is constantly
read into memory for
processing at a later time. So,
now with a microcontroller
selected, it’s time to design a
flight computer around it.
THEORY OF
OPERATION
First, there are power
supplies, power switches, and
power indicators for both the logic and servos. Separating
servo power from the rest of the flight computer ensures
the servos can’t brown-out the flight computer should they
seize up in near space or the battery goes weak. The
power switches and indicators are routed (by cables) to
the exterior of the airframe. By
placing them on the airframe,
launch crews switch the near
spacecraft on and off without
opening up the near spacecraft.
In addition to the power
switches and indicators, the
Commit Pin and programming
port are also routed to the
airframe. The Commit Pin
prevents (if written into the
flight program) the UltraLight
from recording data while still
on the ground. The
programming port is a female
DB-9 connector and permits
sensors to be tested and the
flight program updated without
SPACE
■ BY L. PAUL VERHAGE
APPROACHING THE FINAL FRONTIER
NEAR
THE NEARSPACE ULTRALIGHT —
THE EVERYMAN’S
FLIGHT COMPUTER
Since 1996, I’ve made about one dozen flight computers for near spacecraft.
These flight computers combined an APRS tracker with a programmable
microcontroller and allowed me to follow the near spacecraft, and the near
spacecraft to autonomously operate experiments. With the advent of the Tiny
Track 3 by Byonics and the PICAXE-28X by Revolution, a very capable flight
computer has become affordable to those wishing to start a near space
program. It’s a match made in near space.
■ The NearSpace UltraLight is a
plug and play flight computer.
Just plug in the GPS receiver
and you’re ready for a near space
mission. The UltraLight has four
analog channels, three digital
channels, two servo channels,
and two camera channels.
January 2011 67
NearSpace - Jan 11.qxd 12/2/2010 4:43 PM Page 67
opening the airframe. There are two additional LEDs on
the airframe. These indicate when the GPS has a lock and
when the flight computer is transmitting a position report.
It’s more convenient if the flight computer’s I/O
provides not only access to the PICAXE, but also provides
power to all experiments plugged into them. The
UltraLight uses the three-pin servo standard for all its I/O
channels. Therefore, each channel in the I/O has a
connection directly to the PICAXE, +5 volts, and ground.
The I/O channels on the UltraLight are grouped into
four ports based on their function. First, there’s the Analog
Port of four channels. The Analog Port digitizes sensor
voltages with a precision of either eight or 10 bits. The
second port is the Digital Port with its three channels.
This is where sensors that produce ON/OFF signals connect
to the flight computer. A good example is the Geiger counter;
it produces a pulse (0 to 5 volts) upon the detection of a
cosmic ray. The third port is the Servo Port. It controls the
positions of two servos. Servos are useful in near space to
position experiments, like cameras, and to release dropsondes.
The final port (and different from the others) is the
Camera Port which operates the shutters of two cameras.
The Camera Port can control two different styles of
cameras. First are the traditional cameras with modified
shutters. These are cameras in which a cable has bypassed
the camera’s shutter button. Once bypassed, the cameras
depend on the flight computer’s relays to trigger their
shutters. Alternatively, if a camera’s power switch has also
been bypassed, the two channels of the Camera Port can
power on and off a camera and trigger its shutter.
The second type of camera that the UltraLight can
operate is a Canon camera running the USB remote.
■ The schematic of the NearSpace UltraLight.
www.nutsvolts.com/index.php?/magazine/article/january2011_NearSpace
■ The back of this DB-9 has solder cups that allow wires
to be soldered directly to the connector.
68 January 2011
NearSpace - Jan 11.qxd 12/2/2010 4:43 PM Page 68
www.downmagaz.com
These cameras use a CHDK script to sense a +5V signal in
their mini USB. Usually, the script causes the camera to
take a picture, but other features can be coded into the
camera’s script. Finally, note that the Camera Port is not
just for cameras. Any device requiring a switch closure or
a five volt signal to operate can replace a camera.
The tracker half of the UltraLight is a Tiny Trak 3 by
Byonics. Byon Garrabrant has obviously put a lot of care
into the design of the Tiny Trak 3. It’s a bullet-proof,
transmit only terminal node controller (TNC) that takes
GPS data, reformats it for APRS, and then keys the radio
and sends the appropriate tones. Since the PICAXE and
Tiny Trak 3 run parallel to each other, only a failure of the
GPS or main power is going to bring the mission to an
early end. So, don’t worry if you made an error in your
flight code; you’ll get your near spacecraft back to fly
another day. The 2N3904 transistor between the Tiny Trak
and the transmitter inverts the press-to-talk signal from the
Tiny Trak. This is necessary to properly key up the BM1HT
transmitter. The radio is transmit-only wide band FM and
produces a 400 mW signal. The near spacecraft’s antenna
attaches to the SMA connector next it.
There are two other ICs onboard the UltraLight. The
first is a 24LC256 (or other similar IC) with a 32 Kb
memory (operating over an I
2
C network) for storing flight
data. Since the Tiny Trak 3 is not used to telemeter
science data, that data is stored onboard the flight
computer and downloaded after recovery. This ensures
your mission data is clean — you don’t have to edit out
90% of the position reports in an APRS log just to get
your science results. The last IC is the MAX232. This IC
inverts the GPS data for the PICAXE-28X1. Without this
inversion, the flight computer is not able to take
advantage of the HSERIN command.
You should be getting the impression the NearSpace
UltraLight is a basic near space flight computer, but still very
capable. Those groups new to the near space field will find
that the UltraLight makes a perfect first flight computer.
CONSTRUCTING THE ULTRALIGHT
Start by acquiring the components listed in the
Parts List.
Once you
acquire the parts for
your UltraLight,
make a single-sided
PCB from the
pattern available in
the download on the Nuts & Volts website.
There’s nothing tricky about assembling the UltraLight.
Begin with the jumper wires, resistors, and diodes. Note
there’s one jumper wire beneath the male DB-9 connector
(the diagram illustrates it as the wire peeking out from
under, at the bottom-left of the connector). Next, add the
capacitors. Use tantalum capacitors as they are sealed and
can’t leak under a vacuum. All seven capacitors are
polarized; check the diagram for their correct orientation.
The 2N3904 transistor is next. Use IC sockets, including
one for the transmitter. The transmitter socket consists of
■ Two down and
seven more to go. It
makes installing the
DB-9 into the PCB
easier if the cut
resistor leads are not
all the same length.
So, don’t trim them
until after you’ve
soldered the DB-9 to
the UltraLight PCB.
■ The parts placement for the NearSpace UltraLight
by NearSys.
January 2011 69
NE A R S PAC E
■ This is what the mounted male DB-9 will look like on
your UltraLight flight computer.
NearSpace - Jan 11.qxd 12/2/2010 4:44 PM Page 69
two single-row receptacles. Remove the 10th pin from one
end of the 20-pin receptacle and slice it into two pieces
through the empty socket. Repeat this a second time and
you’ll have two single-row receptacles, nine pins long.
Although not electrically necessary, sand the cut ends of
the receptacles to make the radio socket look nice. Now,
plug these receptacles into the transmitter, plug the
receptacles into the PCB, and just solder the end pins to
70 January 2011
Parts List
• Radiometrix BI1HT FM transmitter *
• PICAXE-28X1 microcontroller
• Tiny Trak 3 microcontroller **
• 24LC256 32 Kb memory
• MAX232 RS-232 signal inverter
• 28-pin DIP socket (300 mils wide)
• 8-pin DIP socket (300 mils wide)
• 16-pin DIP socket (300 mils wide)
• 18-pin DIP socket (300 mils wide)
• (4) LEDs (different colors are nice, but not required)
• LM2940 voltage regulator (TO-220)
• 2N3904 NPN transistor
• 100 µF tantalum capacitor (6.3V)
• 22 µF tantalum capacitor (6.3V)
• (5) 1 µF tantalum capacitor (6.3V)
• Ceramic resonator (10 MHz)
• (4) 680 ohm resistors (1/4W)
• 1K resistor (1/4W)
• 2K resistor (1/4W)
• 3K9 resistor (1/4W)
• (3) 4K7 resistor (1/4W)
• 8.2K resistor (1/4W)
• 10K resistor (1/4W)
• (2) 330 resistor (1/4W)
• (2) 22K resistor (1/4W)
• DB-9 (male)
• DB-9 (female)
• One row receptacle (20 pins)
• Right angle header (two pins)
• Shorting block
• 2 x 3 pin header
• (3) AAA battery holder
• 9V battery snap
• SMA connector (145374 from Jameco)
• SMA cable (three feet long)
• Piezo beeper or alarm
• (2) 1N4001 diode
• (3) Sub-miniature toggle switches (SPST or SPDT)
• (2) Reed relay (RadioShack 5V reed relay)
• 3 x 3 pin receptacle
• 3 x 4 pin receptacle
• 3/16” plastic tube 2” long
• (4) #4-40 bolts 1/2” long
• (4) #4-40 nylock
• Hook-up wire (at least 17 feet of #24 AWG stranded)
• 12 gauge solid wire 40” long
* Depending on your location and the frequency of the radio you
purchase, you may need to be a licensed amateur radio operator
to use this flight computer. You can order the radio through
Lemos International, www.lemosint.com.
** Available as a chip from Byonics, www.byonics.com.
NearSpace - Jan 11.qxd 12/2/2010 4:45 PM Page 70
www.downmagaz.com
the PCB. Now that the receptacles are properly aligned
with the transmitter, carefully remove it and finish
soldering the other receptacle pins to the PCB. You can
solder the transmitter directly to the PCB, but you won’t
be able to switch out the transmitter if you want to
change the frequency of your UltraLight flight computer at
some later time.
On the left side of the flight computer PCB are the
I/O ports. The analog and digital ports both use
receptacles. I use three-pin wide receptacles when
possible and cut them to length. When I can’t find three-
pin wide receptacles, I use a combination of one-pin wide
and two-pin wide receptacles and
solder them next to each other. It’s a
good idea to insert a three-pin
header into the receptacles before
soldering them. That way, their
openings will properly align for
sensors. The servo port is a 2 x 3 pin
header. I use a longer two-pin wide
header and snap it between the third
and fourth pairs of pins.
Next, solder the voltage regulator
and the SMA antenna connector.
Then, solder the male DB-9
connector for the GPS. There are two
variations of DB-9 connectors. The
first type has nine wire pins sticking
out of the back and will solder
directly to the UltraLight PCB. The
second type has solder cups on the
back like the one shown here, and
must be prepped before it can be
soldered to the PCB.
This type of DB-9 connector is
still simple to solder to the PCB, but
needs wires soldered to it first. Use
cut resistor leads for the wires. The
first step is to tin each solder cup. So,
heat each cup and apply a thin
coating of solder to the inside of the
cup. Then, hold (with tweezers or
needle-nose pliers) a cut resistor lead
to the cup and heat the lead and cup
with a well tinned soldering iron. As
soon as the solder melts, press the
cut resistor lead into the pool of
molten solder and hold it steady as
the solder cools. Repeat this for the
remaining eight solder cups in the
back of the DB-9.
Insert the DB-9 into the PCB by
working each lead into its respective
hole. You may have to wiggle things
around a little and use a pair of
tweezers on particularly stubborn
leads. Once all the leads are in place,
press the DB-9 firmly into the PCB
and then solder the leads. Cut two pieces of plastic tubing
long enough to fit between the wings of the DB-9 and the
PCB. Slip the pieces between the DB-9 wings and the PCB,
and then bolt the DB-9 to the PCB with #2-56 bolts and
nylocks (nylon lock nuts). Don’t use regular machine nuts,
as they will eventually come loose. It’s really bad news if a
metal nut comes loose and shorts out a trace underneath
the UltraLight flight computer while it is in near space.
That completes the assembly on the PCB. The next
step is all the cabling and we’ll handle that next time.
Onwards and Upwards,
Your near space guide NV
January 2011 71
NE A R S PAC E
NearSpace - Jan 11.qxd 12/6/2010 9:13 AM Page 71
The Nuts & Volts WEBSTORE
ELECTRONICS
For a compl et e pr oduct det ai l vi si t our webst or e! !
TEARDOWNS
by
Bryan Bergeron
Learn How Electronics Work by
Taking Them Apart
Amp up your
knowledge of
electronics by
deconstructing
common devices and
analyzing the revealed
components and
circuitry. Teardowns:
Learn How Electronics
Work by Taking Them
Apart contains 14
projects that expose
the inner workings of household appliances,
workbench measuring instruments, and
musical equipment. Discover how resistors,
capacitors, sensors, transducers, and
transistors function in real circuitry.
Reg $24.95 Sale Price $21.95
PICAXE Microcontroller Projects
for the Evil Genius
by Ron Hackett
This wickedly
inventive guide shows
you how to program,
build, and debug a
variety of PICAXE
microcontroller
projects. PICAXE
Microcontroller Projects
for the Evil Genius gets
you started with
programming and I/O interfacing right away,
and then shows you how to develop a
master processor circuit.
$24.95
Programming PICs
in Basic
by Chuck Hellebuyck
If you wanted to learn
how to program
microcontrollers, then
you've found the right
book. Microchip PIC
microcontrollers are
being designed into
electronics throughout
the world and none is
more popular than the
eight-pin version. Now
the home hobbyist can
create projects with these little
microcontrollers using a low-cost
development tool called the CHIPAXE
system and the BASIC software
language.Chuck Hellebuyck introduces
how to use this development setup to
build useful projects with an eight-pin
PIC12F683 microcontroller. $14.95
30 Arduino Projects for the
Evil Genius
by Simon Monk
30 Ways to Have Some
Computer-Controlled Evil Fun!
Using easy-to-find
components and
equipment, this
do-it-yourself book
explains how to
attach an Arduino
board to your
computer, program
it, and connect
electronics to it to
create fiendishly fun
projects. The only limit is your imagination!
$24.95
Electronics Explained
by Louis Frenzel
The New Systems Approach to
Learning Electronics
Don't spend time read-
ing about theory, com-
ponents, and old ham
radios - that's
history! Industry
veteran, Louis Frenzel,
gives you the real
scoop on electronic
product fundamentals
as they are today.
Rather than tearing
electronics apart and
looking at every little
piece, the author takes a systems-level view.
For example, you will not learn how to
make a circuit but how a signal flows from
one integrated circuit (IC) to the next, and
so on to the ultimate goal.
$29.95
HTML: A Beginner's Guide
by Wendy Willard
Essential HTML Skills Made Easy!
Create highly
functional, impressive
websites in no time.
Fully updated and
revised, HTML: A
Beginner's Guide, Fourth
Edition explains how to
structure a page, place
images, format text,
create links, add color,
work with multimedia,
and use forms.You'll also go beyond the
basics and learn how to save your own web
graphics, use Cascading Style Sheets (CSS),
create dynamic web content with basic
JavaScript, and upload your site to the web.
By the end of the book, you'll be able to
build custom websites using the latest
HTML techniques.
$29.95
Switchmode Power Supply
Handbook 3/E
by Keith Billings, Taylor Morey
The definitive guide to switchmode
power supply design
— fully updated.
This comprehensive
volume explains common
requirements for direct
operation from the AC
line supply and discusses
design, theory, and
practice. Engineering
requirements of
switchmode systems and
recommendations for
active power factor
correction are included.This practical guide
provides you with a working knowledge of
the latest topologies, along with step-by-step
approaches to component decisions to
achieve reliable and cost-effective power
supply designs. $125.95*
Master and Command C
for PIC MCUs
by Fred Eady
Master and Command
C for PIC MCU,Volume
1 aims to help
readers get the most
out of the Custom
Computer Services
(CCS) C compiler for
PIC microcontrollers.
The author describes
some basic compiler
operations that will help programmers,
particularly those new to the craft
create solid code that lends itself to easy
debugging and testing. As Eady notes in his
preface, a single built-in CCS compiler call
output_bit can serve as a basic aid to let
programmers know about the "health" of
their PIC code.
$14.95
72 January 2011
Build Your Own
Electronics Workshop
by Thomas Petruzzellis
BUILD YOUR OWN
DREAM
ELECTRONICS LAB!
This value-packed
resource provides
everything needed to
put together a fully
functioning home
electronics workshop!
From finding space to
stocking it with
components to putting the shop into
action -- building, testing, and
troubleshooting systems. This great book
has it all! And the best part is, it shows you
how to build many pieces of equipment
yourself and save money, big time!
Reg Price $29.95
Sale Price $24.95
NV Webstore Jan 2011 working.qxd 12/7/2010 2:31 PM Page 72
www.downmagaz.com
CD ROM SPECIALS BOOK & KIT COMBOS
Or CALL 1-800-783-4624 today!
Order online @www.nutsvolts.com
January 2011 73
From the
Smiley Workshop
An Arduino
Workshop
by Joe Pardue
The book An Arduino Workshop and the associated hardware projects
kit bring all the pieces of the puzzle together in one place. With this,
you will learn to: blink eight LEDs (Cylon Eyes); read a pushbutton and
8-bit DIP switch; sense voltage, light, and temperature; make music on
a piezo element; sense edges and gray levels; optically isolate voltages;
fade an LED with PWM; control motor speed; and more!
An Arduino Workshop Combo
Reg Price $ 124.95 Subscriber’s Price $119.95 Plus S/H
From the
Smiley Workshop
C Programming for
Microcontrollers
by Joe Pardue
Do you want a low cost way to learn C programming for
microcontrollers? This 300 page book and software CD show you how
to use ATMEL’s AVR Butterfly board and the FREE WinAVR C compiler
to make a very inexpensive system for using C
to develop microcontroller projects.
Combo Price $99.95 Plus S/H
Book $44.95
Kit $66.95
This great little
book is a concise
all-purpose
reference
featuring
hundreds of
tables, maps,
formulas,
constants, and
conversions.
AND it still fits in
your shirt pocket!
O
nl
O
nl
y y
$12.95!
$12.95!
This lab — from the good people at GSS Tech
Ed — will show you 40 of the most simple and
interesting experiments and lessons you have
ever seen on a solderless circuit board. As you
do each experiment, you learn how basic
components work in a circuit. Along with the
purchase of the lab, you will receive a special
password to access the fantastic online
interactive software to help you fully
understand all the electronic principles. For a
complete product description and sample
software, please visit our webstore.
Reg Price $79.95 Subscriber’s Price $75.95
NV Webstore Jan 2011 working.qxd 12/7/2010 2:32 PM Page 73
WE ACCEPT VISA, MC, AMEX, and DISCOVER. Prices do not include
shipping and may be subject to change.
74 January 2011
The Amateur Scientist 3.0
The Complete Collection
by Bright Science, LLC
There are 1,000
projects on this CD,
not to mention the
additional technical
info and bonus
features. It doesn’t
matter if you’re a
complete novice
looking to do their
first science fair
project or a super
tech-head gadget
freak; there are
enough projects on the single CD-ROM to
keep you and 50 of your friends busy for a
lifetime!
Reg Price $26.95
Sale Price $23.95
Or Order online @www.nutsvolts.com
CALL 1-800-783-4624 today!
N
o
N
o
w

w

a
v
a
ila
b
le
!
a
v
a
ila
b
le
!
A
s
s
e
m
b
le
d

A
s
s
e
m
b
le
d

b
o
a
r
d
s
!
b
o
a
r
d
s
!
rCube Talking Alarm Clock Kit
As seen on the
May 2009 cover
Available in blue, black, red, and green.
All components are pre-cut and pre-bent
for easier assembly and the
microcontrollers are pre-programmed with
the software. Kits also include PCB, AC
adapter, and instructions on CD-ROM.
Subscriber’s Price $49.95
Non-Subscriber’s Price $54.00
Transistor Clock Kit
PROJECTS
Piezoelectric Film Speaker Kit
Garage Door Alarm PCB & Chips Magic Box Kit
As seen on the
April 2007 cover
This unique DIY construction project
blends electronics technology with
carefully planned handcraftsmanship.
This clever trick has the observer remove
one of six pawns while you are out of the
room and upon re-entering you indicate
the missing pawn without ever
opening the box.
Includes an article reprint.
Subscriber’s Price $39.95
Non-Subscriber’s Price $45.95
As seen in the November 2010 issue.
Is Your Garage Door Open?
This project uses the latest in wireless
technology, and is a fun and easy project to
build.We provide the difficult parts: the
transmitter and receiver PCBs with their
matching programmed MCUs.The other
components can be fould at your favorite
parts house.
Includes an article reprint.
Subscriber’s Price $29.95
Non-Subscriber’s Price $31.95
Ready to move on from 8-bit to 16-bit
microcontrollers? Well, you’re in luck!
In the December 2009 Nuts & Volts issue,
you’re introduced to
“the 16-Bit Micro Experimenter.”
The kit comes with a CD-ROM that
contains details on assembly, operation,
as well as an assortment of ready-made
applications. New applications have been
added since inception.
Subscriber’s Price $59.95
Non-Subscriber’s Price $55.95
As seen in the
November issue,
here is a great
project to amaze
your friends and to
demonstrate a
unique way of
producing sound.
Kit contains one
piece of piezoelec-
tric film, speaker film stand, PCB, compo-
nents, audio input cable, and construction
manual. All you’ll need to add is a battery
and a sound source.
For more info, please visit our website.
Subscriber’s Price $69.95
Non-Subscriber’s Price $74.95
Mini-Bench Supply Complete Kit The Mini Kit
A small power
supply with +5V,
+12V, and -12V
outputs is a handy
thing to have
around when you’re
breadboarding
circuits with
both op-amps and
digital ICs.
Kit includes: Enclosure box, accessories,
DC-to-DC converter kit, switching
regulator kit, and article reprint.
For more information, please see the
“feature article section” on the top right
side of the Nuts & Volts website.
Subscriber’s Price $76.95
Non-Subscriber’s Price $83.95
16-Bit Micro Experimenter Board
The best
experiment yet
for the 16-Bit
Experimenter
Board.
Adding this Mini Kit
to your Experimenter
Board will enhance
the Experimenter.The Mini Kit is a user
interface with a rotary encoder using the
PIC24F timer peripheral set and its
interrupt capability.
For more information, see the
December 2010 issue
Assembled units also available.
Subscriber’s Price $36.95
Non-Subscriber’s Price $39.95
N N
E E
W!
W!
If you like electronic puzzles, then this kit
is for you! There are no integrated
circuits; all functionality is achieved using
discrete transistor-diode logic. The PCB is
10”x11” and harbors more than 1,250
components! For more info, see the
November 2009 issue.
Reg $225.95
Sale Price $199.95
S
a
l
e
!
S
a
l
e
!
NV Webstore Jan 2011 working.qxd 12/7/2010 2:34 PM Page 74
www.downmagaz.com
The Nuts & Volts WEBSTORE
Green Lighting
by Brian Clark Howard, Seth
Leitman, William Brinsky
Flip the switch to
energy-efficient lighting!
This do-it-yourself
guide makes it easy
to upgrade
residential and
commercial lighting
to reduce costs and
environmental impact
while maintaining or
even improving the
quality of the lighting.
Filled with step-by-step instructions and
methods for calculating return on
investment, plus recommended sources
for energy-efficient products.
$24.95
50 Green Projects for the
Evil Genius
by Jamil Shariff
Using easy-to-find
parts and tools, this
do-it-yourself guide
offers a wide variety
of environmentally
focused projects you
can accomplish on
your own. Topics
covered include
transportation,
alternative fuels, solar,
wind, and hydro power, home insulation,
construction, and more. The projects in
this unique guide range from easy to
more complex and are designed to
optimize your time and simplify your life!
$24.95
Wind Turbine Installation
DVD
Manuals can sometimes
be confusing, especially
for people who learn
by seeing how things
work. So, this DVD
takes the viewer
step-by-step through
the entire installation
process, from choosing
a site, to running wire,
assembling the tower,
and finally using a winch for the final lift.
This is a must-watch for anyone planning
on installing a wind turbine who wants to
learn the process and the proper
techniques for a safe and
successful installation.
$19.95*
Solar Energy Projects for the
Evil Genius
by Gavin D J Harper
Let the sun shine on
your evil side — and
have a wicked
amount of fun on
your way to becom-
ing a solar energy
master! In Solar
Energy Projects for the
Evil Genius, high-tech
guru Gavin Harper
gives you everything
you need to build more than 30 thrilling
solar energy projects.You'll find com-
plete, easy-to-follow plans, with clear dia-
grams and schematics, so you know
exactly what's involved before you begin.
$24.95
ALTERNATIVE ENERGY
SECTION
At t ent i on Subscr i ber s ask about your di scount on pr i ces mar ked wi t h an *
The Complete Idiot’s Guide to
Solar Power for Your Home
by Dan Ramsey / David Hughes
The perfect
source for solar
power — fully
illustrated. This
book helps
readers under-
stand the basics of
solar power and
other renewable
energy sources,
explore whether
solar power
makes sense for them, what their options
are, and what’s involved with installing
various on- and off-grid systems.
$19.95
Solar Hydrogen Education Kit
The Hydrocar is used in a couple of great
projects from the series of articles by John
Gavlik, "Experimenting with Alternative
Energy." In Parts 10 and 11, he teaches you
the operation of the Polymer Electrolyte
Membrane "reversible" fuel cell.
For kit details and a demo video,
please visit our webstore.
Subscriber’s Price $79.95
Non-Subscriber’s Price $84.95
Hydrocar Kit Windpitch Kit
The WindPitch Wind Turbine Kit is a
miniature real-working wind turbine and is
one of the great projects from the series of
articles by John Gavlik,
"Experimenting with Alternative Energy."
In Parts 8 and 9, he teaches you how to
produce the most power by evaluating
the pitch (setting angle) of the
profiled blades. For kit details,
please visit our webstore.
Subscriber’s Price $84.95
Non-Subscriber’s Price $89.95
N N
E E
W
!
W
!
January 2011 75
The Solar Hydrogen Education Kit includes
a solar cell, a PEM reversible fuel cell,
oxygen and hydrogen gas containers, and
more! The set only needs pure water to
create hydrogen and produce electricity.
Perfect for science labs, classroom use, or
demonstration purposes.
Subscriber’s Price $56.95
Non-Subscriber’s Price $59.95
N N
E E
W
!
W
!
NV Webstore Jan 2011 working.qxd 12/7/2010 2:34 PM Page 75
76 January 2011
R E A D E R - T O - R E A D E R
TECHFORUM
>>> QUESTIONS
75 ohm Coax Connections
Seems like I always have reliability
issues with 75 ohm coax connections.
I’m certain the problem is the
center conductor. I have roughed it up
with serrated pliers, bent the end a
little, etc., but still have a problem.
I’m thinking about applying solder
paste to the end, to maybe seal out
oxygen, and the little solder balls make
the connection.
All the quality parts/crimps are
just not reliable.
#1111 Frederick M. Raposa
Vallejo, CA
Electric Fence
I need to show when an electric
fence (6 KVa to 16 KVa) is active by
flashing a simple LED with every pulse.
Ideally, the circuit would simply attach
between high V and ground strands of
the fence. A perfect solution would be
able to cope with an inadvertent
reverse connection.
It would be good to be able to use
multiple such devices at regular
intervals along the fence. I am looking
for lowest cost/complexity.
#1112 Kevin Dickinson
Australia
[#9108 - September 2010]
Voltage Dropping
I have two circuits in the same
enclosure: one works on 12 VDC and
the other on 9 VDC. I have a 12 VDC
transformer for one, but need to lower
the output to 9 VDC for the other. I
tried with resistors to lower the voltage
to 9 VDC with no success.
No mention was made of the
current requirements, but if they aren't
too demanding you can get 9 VDC
quite easily from the 12 VDC using a
three-terminal regulator such as the
7809, plus a small capacitor (0.01 µF)
on the output. Use the 7809 for up to
1A with a heatsink. For lower currents
(up to 100 mA), you might get by with
the 78L09. Alternatively, you can use
diodes in series to give you your
voltage drop. Depending on the type
of diode used, four to six in series
should be sufficient. If your circuit
does not already include one, add a
capacitor to ground after the last
diode for filtering. An electrolytic with
few to a few hundred µF (depending
on the current) should be sufficient.
Bryan Suits
Houghton, MI
[#10101 - October 2010]
Reactive Transformerless
Power Supply
How does one calculate the value
for the reactance capacitor in an AC to
DC reactive power supply so as not to
over-work the zener diode? I‘ve used
from .68 µf to 4.7 µf for various
voltages out, but it has always been
trial and error.
#1 Before starting, some advice:
These supplies have no isolation from
the line and should only be used to
power loads that are completely
isolated from the user. Have the
bridge rectifier end of the supply
connected to the neutral side of the
line. Use an isolation transformer
when testing the circuit; be careful
even with the isolation transformer,
there are still lethal voltages present. It
is strongly advised to include a fuse in
series with the limiting capacitor or
use "across the line" capacitors — also
called "X" capacitors.
A very good approach is to start
from the output and work back to the
source. Determine the maximum
output current desired. Add 3 to 5 mA
for the zener, to keep it at the zener
voltage even at full load. This is the
average current needed out of the full-
wave bridge rectifier feeding the
zener. Subtract the zener voltage plus
two diode drops from the minimum
line voltage; I usually use 105 or 106V.
For example, a 12V zener plus 1.4V
(that is, two times 0.7V) from 105V
leaves 91.6V across the capacitor.
The average current is about 90%
of the RMS current, so multiply
average current by 1.111 to get
the RMS current in the capacitor.
The equivalent reactance Xc =
Vcapacitor/Irms. At 60 Hz, we know
that Xc = 1/377C, so C = 1/377Xc. Or,
C = Iav x 1.111/(377 x Vcapacitor).
Using our 12V example and a 20
mA maximum load current, we get Iav
= 20+3 = 23 mA and Irms = 25.553
mA. Using Iav and Vcapacitor in the
formula, C = ~0.74 µF. Note that this
makes no allowances for capacitor
tolerance. A "turnkey" solution would
add 10% for capacitors with a 10%
tolerance, so all values would work. In
this case, the nearest standard value
would be 0.82 µF. If a one-off circuit is
built, one can select a capacitor or
parallel combination very close to the
desired value and the worst case
current at high line voltage will be a
bit less. Also, the zener losses at
minimum load will be less.
Next, the zener wattage has to be
determined. This one assumes all
tolerances and line voltage go to the
worst case: capacitor is 0.82+10%;
line voltage is ~10% high; and load
current is at minimum. For the
example, assume .902 µF, 130V and
minimum load current is 5 mA.
All questions AND answers are submitted
by Nuts & Volts readers and are intended
to promote the exchange of ideas and
provide assistance for solving technical
problems. Questions are subject to
editing and will be published on a
space available basis if deemed suitable
by the publisher. Answers are submitted
by readers and NO GUARANTEES
WHATSOEVER are made by the publisher.
The implementation of any answer printed
in this column may require varying degrees
of technical experience and should only be
attempted by qualified individuals.
Always use common sense and good
judgment!
>>> ANSWERS
TechForum.qxd 12/7/2010 2:06 PM Page 76
www.downmagaz.com
Icapacitor is 91.6 x 377 x 0.902 µF
=~31.15 mA RMS. This is an average
current of ~28 mA, so the zener is
drawing 28 mA - 5 mA =23 mA and
dissipates 12V x 23 mA = 0.276W. A
conservative choice is to keep the
actual power in the zener at half of the
zener's rating. That would suggest a
1/2W zener for this example.
A capacitor will go across the
zener to reduce ripple voltage to an
acceptable level; a good place to start
for this example might be 150 or 220
µF at 20 or 25V. (It's good practice to
derate capacitors, too — run them at
no more than 2/3 of their rating.)
Lastly, add a surge limiter in series
with the capacitor; 47 ohms, 1/2W is
a good starting point. This limits peak
currents in the capacitor and diodes
during turn-on and when line
transients occur.
J Wexler
via email
#2 There are two relatively easy
ways to approach this issue. The first
one involves determining the
capacitive reactance from frequency
(60 Hz) and capacitance (the ARRL
Handbook has a handy nomograph).
Then, use Ohm’s Law to calculate the
current flowing in the AC and DC
loop. The AC loop current needs to
match max DC load plus knee current
of the zener diode. The difference
between max DC and min DC load
added to the knee current needs to be
smaller than the current handling
capability of the zener. The easier way
is to model the circuit on a circuit
simulator such as LT Spice IV. This will
produce start-up curves, maximum
currents, etc., and you can look at all
the voltages, voltage differentials, and
currents at any moment in time by
clicking on it. Figure 1 shows the
principle.
Walter Heissenberge
Hancock, NH
#3 If a zener diode regulator is
unloaded as in
Figure 2, all the
current will pass
through the zener
diode instead of the
load plus zener. This
is the worst possible
case that needs to
be designed for, and
is less complicated
than the case where
some current passes
through the load,
some through the
zener. The power
rating of the zener diode must not be
exceeded by zener voltage times
zener current. For a given zener diode
voltage, I = P/V. For example, a 5.1V
half watt zener may safely pass a
current of I= 0.5/5.1= 0.098A = 98
mA. (To be conservative, you might
want to cut that in half.)
Reference [1] gives an equation
for the RMS short circuit current
drawn by capacitor C in terms of RMS
line voltage, frequency, and capacitor
C for a half-wave configuration as
shown in the figure. Reference [2]
gives a similar equation for the full-
wave circuit. By short circuit, we mean
that the zener diode is replaced by a
short circuit. For the moment, we will
simplify the problem by assuming that
a zener draws the same current as the
short circuit.
For the full-wave circuit,
substituting 50 mA (about half of the
98 mA), 120V, and 60 Hz; and solving
for C, we get C = 1.23 µF.
Selecting a 1 µF standard
value, re-solving the full-
wave equation for current,
we get I = 40.7 mA for
short circuit current. A 5.1V
zener diode will draw less
current due to the 5.1V
zener voltage subtracting
from the line voltage.
A more exact solution
involves replacing V in the
equations by (V-Vz) to
correct for the voltage dropped across
the zener. You can also subtract off
the forward rectifier voltage drop.
However, the (V-Vz) only improves the
accuracy of the calculation by about
12/120 = 10% for a 12V supply,
5/120 = 4% for a 5V supply.
Considering the poor tolerance on
capacitors, the effort is not warranted
for 12V or lower supplies.
The filter capacitor in parallel with
the zener diode can be an electrolytic
type in the range of 220 µF to 1,000
µF according to reference [1].
Guidance on calculating the value
with respect to ripple voltage is given
in the references. Not shown in the
figure, reference [1] recommends a
100 ohm resistor in series between the
output filter capacitor and zener
diode. Both of the references can be
found by seaching for the title on the
Internet.
Practical considerations: Type X2
>>>YOUR ELECTRONI CS QUESTI ONS ANSWERED HERE BY N&V READERS
January 2011 77
Send all questions and answers by email to forum@nutsvolts.com
Check at www.nutsvolts.com for tips and info on submitting to the forum.
Figure 1
I
HW
= 2•√2•V• C• f
Where:
V = RMS input voltage
C = Capacitance in Farads
f = frequency
I
HW
= halfwave short circuit current
I
FW
= 2•√2•V• C• f
I
FW
= fullwave short circuit current
V
V
C
C
Figure 2
TechForum.qxd 12/7/2010 2:06 PM Page 77
capacitors are recommended for C by
reference [1]. They will have an AC
voltage rating. If using a capacitor with
only a DC rating, select a 330 VDC
capacitor for use with 120 VAC.
Reference [2] recommends ceramic
or film capacitors. Safety regulations
require a 470K ohm or other
appropriate resistor in parallel with C
for a one second or less discharge
time. Do not connect any line
operated test equipment to this circuit
unless using an isolation transformer.
Reference [2] recommends a
resistor in series with C to limit power-
on surge current to 10x normal
current. That is, set R = 0.10*Xc, where
Xc = 1/(2*pi*f*C). This is mandatory
when powering LEDs from an
unfiltered supply. Do not use this
circuit with high brightness LEDs. They
cannot withstand the surge current
even with the limiting resistor.
Safety: Let me quote reference
[1]. "WARNING: As with all circuits
powered directly from the AC power
line, a potentially lethal shock hazard
exists. Be sure to observe correct
power-line polarit y. An isolation
transformer is recommended when
working on or testing the circuit.
Follow all local electrical codes."
References:
[1] Brian King and Robert Kollman,
"Simple Off-Line Power Supply
Minimizes Costs", pp 69, Electronic
Design, 02.02.04.
[2] Nathan O Sokal, et. al., "Step-
down rectifier makes a simple DC
power supply," pp 169, EDN, April 9,
1998.
Dennis Crunkilton
Abilene,TX
[#10102 - October 2010]
Ping Tester
I work in large building complexes
and need to "ping" devices several
floors away or in the next building. I
typically use a laptop, but it's difficult
to hold or set down while in riser or
mechanical rooms. There are cable
testers with ping functionality but they
are costly. It would be a neat project to
build a ping tester using one of the
widely available development boards
and microcontrollers. There are so
many choices I don't know where to
start. Could someone point me in the
right direction?
Construction of a battery
powered "ping tool" would be a great
project to undertake. There are many
good serial-to-Ethernet converter
solutions out in the world but none
appear to offer raw IP-level packet
generation, which is what you'll need
to play in the ICMP game to
implement ping. I recommend you
start with a Luminary LM3S6965
development board. They have a
ridiculously powerful 32-bit Cortex-
M3 CPU onboard along with 10/100
Ethernet, OLED display, and some
pushbuttons. The board runs $70 from
Digi-Key and comes in many flavors; I
found the Keil IDE to be top-notch.
Entering the target IP address may
be cumbersome so I propose the
following software structure: After
booting, use DHCP to obtain an IP
address and then repeatedly scan the
subnet looking for responders to your
ping command. Continually update an
internal list of responses (and age out
the non-responders) so that a real-time
display of the subnet can be shown.
It would be easy then to use the
pushbuttons to slide your display-sized
window through the list.
Dan Danknick
Santa Ana, CA
[#10104 - October 2010]
Resistance Inverter/Converter
I installed a dash from a Buick into
a Winnebago. The gas gauge in the
new dash requires 242 ohms for a
full and 42 for an empty reading. The
Winnebago sending unit gives a 10
ohms full and 180 ohms empty resist-
ance reading. I need help in designing
a circuit to do this conversion.
#1 I think the easiest way to solve
your gas gauge problem will be to get
a sender from the proper model Buick.
Either a new one or from a salvage
yard. You then need to remove the
sender from the Winnebago and
replace the potentiometer on it, with
the one from the Buick sending
unit. That should work and should
be doable. At the worst case, you
might need to open the case of
the potentiometer and swap the
resistance element if the assembly
does not mount the same way. Test
the gauge readings before reinstalling.
You may need to slightly alter the
connections at the potentiometer to
get Full and Empty in the correct
direction. Possibly adjust the float arm
as well for Full and Empty.
Bruce Bubello
Wayne, NJ
#2 Convert the variable resistance
to current, scale, invert, shift, and
amplify. Then, reconvert to a current.
Op-Amp Handbooks — the Burr-Brown
Handbook reissued by Texas
Instruments — and early National
R E A D E R - T O - R E A D E R
TECHFORUM
78 January 2011
Figure 3
TechForum.qxd 12/7/2010 2:06 PM Page 78
www.downmagaz.com
Semiconductor Appnotes are all
available on the web and can serve as
good references). Figure 3 shows a
possible approach. A zener stabilizes
the supply voltage and provides two
reference voltages: one for the
constant current source of about 262
mV and a higher one of 1.05V. This will
yield a current of 1.2 to 6.2 mA
injected into the inverting input of
OP2. The current through R5 serves as
an offset adjustment (current) and is
constant. The difference in currents
needs to be provided through R8. In
short, OP2 sums up three currents
through R5, R8, and the collector of T1
so that they are zero. The result is an
inverted voltage output against 12V. A
resistor in series with AM1 reconverts
into a current. You may need to adjust
the values of R5, R8, and R7. A buffer
is required on OP2's output if higher
currents are necessary.
Walter Heissenberger
Hancock, NH
In regards to John Hobday's query
about hum detection in the
September ‘10 issue, I have recently
suffered from the same problem — a
low-level pervasive 50 Hz-ish hum (our
mains frequency as I'm in the UK too)
which was only audible inside the
house. I located it to an area of interior
hollow plasterboarded wall which
could conceivably contain a central
heating pump. We don't have
cellars/basements in the UK — unlike
many US homes — and sometimes
people do the weirdest things to make
upgrades fit.
Anyway, I was about to reluctantly
tear into this plasterboarded wall
when I decided to just turn off all
building power to try to isolate exactly
which circuit was causing the noise.
Perhaps I could just turn that circuit off
and deal with it when I had more time
and enthusiasm? (If you have a good
day in the UK summer, make the most
of it — they're that rare.) But with no
result!!??? The problem was not
electrical in nature, but had a more
down to earth solution. The 50 Hz
was a red-herring. It was all down to
plumbing. By law, in the UK, all
outside taps have to have an integral
non-return valve built into them. My
outside tap (over a room away) was
weeping very slowly, and this small
plastic valve was chattering at 50 Hz.
It wasn't audible at the tap but the
effective water hammer only became
noticeable at this hollow wall which
must have acted as a resonator into
the ceiling/floor cavities.
The moral is that a bit of lateral
thinking can save the day, even when
you already 'know' what the problem
is. I would NOT have been pleased to
discover the real cause AFTER tearing
into a perfectly well decorated wall!
Ms. Sally Jelfs
UK subscriber
>>>YOUR ELECTRONI CS QUESTI ONS ANSWERED HERE BY N&V READERS
FrontPanelExpress.com
(206) 768-0602
Q
Cost effective prototypes and production runs
Q Powder-coated finish and panel thickness up
to 10mm now available
Q
Choose from aluminum, acrylic or customer
provided material
Q
1, 3 and 5-day lead times available
Custom Front Panels
& Enclosures
Sample price $57.32 + S&H
FREE
Software
Designed by you using our
FREE software, Front Panel Designer
Best Selection
- lowest prices!
www.saelig.com/scopesnv
We have the widest, unique selection of scopes to suit any budget
and application: low-end PC scope adapters for less than $180 up to
high-end 16-bit 12GHz units. Standalone, remarkably economical
LCD scopes, PC memory-stick-sized scope adapters and “scope-in-a-probe”
models, 7-in-1 toolbox essentials, up to bargain-priced 4-channel
benchtop workhorses with FFT and auto-test capabilities. Also see
our website for a great selection of spectrum analyzers, RF signal
sources, and Waveform Generators not available anywhere else.
888-772-3544
info@saelig.com
NEED A SCOPE?
>>> COMMENTS
January 2011 79
TechForum.qxd 12/7/2010 2:37 PM Page 79
YOUR COMPLETE
SOLUTION!
• PCB Design
• PCB Simulation
• CAD/CAM Menu
121747, Hobby Vers., $175
121743, Pro. Version, $275
www.KELVIN.com
EXCLUSIVE U.S. DISTRIBUTOR
PCB SOFTWARE
DEC EQUIPMENT
WANTED!!!
Digital Equipment Corp.
and compatibles.
Buy - Sell - Trade
CALL KEYWAYS 937-847-2300
or email buyer@keyways.com
HARDWARE
WANTED
ENERGY
SOLUTIONS
MISC SERVICES
SURPLUS
KITS/PLANS
Looking for solar
stuff and kits?
www.nutsvolts.com
CLASSIFIEDS
80 January 2011
• Industrial packaging
• Weather resistant
• Standard ¾” fitting
• $99.95USD qty. 1
MaxSonar
Ultrasonic Ranging is EZ
www.maxbotix.com
• Beam pattern choice
• Real-time calibration
•High acoustic power
• $39.95USD qty. 1
• Power-up calibration
• Smallest MaxSonar
•Low power, 2.5V-5.5V
• $29.95USD qty. 1
XL-MaxSonar-EZ
LV-MaxSonar-EZ
MaxSonar-WR (IP67)
MaxSonar-WRC (IP67)
• Compact packaging
• Weather resistant
• Quality narrow beam
• $99.95USD qty. 1
tix com
(IP67 ( ))
ROBOTICS
COMPONENTS
Nixie Power
www.tayloredge.com/nixie
2-16V In, 4-8W / 150-200VDC Out
0.95" x 0.95" x 0.35"
$9.95 (Shipping included)
New full featured Compiler
Floating Point Coprocessor
www.micromegacorp.com
Extensive floating point support,
GPS input, FFT, 12-bit A/D, matrix
operations, user-defined functions.
uM-FPU V3.1
32-bit IEEE 754
SPI or I2C
DIP-18, SOIC-18
Classifieds Jan11.qxd 12/6/2010 4:52 PM Page 80
www.downmagaz.com
ADvertiser INDEX
■ L O O K F O R ■ S E A R C H F O R ■ F I N D
Find your favorite advertisers here!
Abacom Technologies ...............38
All Electronics Corp. ..................65
AP Circuits ................................57
BaneBots ...................................18
Bitscope ......................................7
Cana Kit Corp. ...........................63
Circuit Specialists, Inc. .........82-83
Command Productions ..............29
Cunard Associates ....................49
Dimension Engineering..............18
Electronix Express ....................48
ExpressPCB ..............................71
Front Panel Express LLC ..........79
Fun Gizmos ...............................49
Global Specialties .....................47
Integrated Ideas & Tech. ...........26
I/O Bridge ..................................19
Jameco ......................................27
Jaycar Electronics......................43
LeCroy..........................................5
Lemos International Co., Inc. ....49
Linx Technologies .....................57
Lynxmotion, Inc. ........................70
Matrix Multimedia.......................49
Microchip .....................................3
microEngineering Labs ..............48
MikroElektronika ..........................4
Mouser Electronics ......................9
NetBurner ....................................2
NKC Electronics ........................49
Noritake .....................................26
PAiA ..........................................57
Parallax, Inc. ...............Back Cover
PCB Pool ...................................19
PolarisUSA Video, Inc. ..............19
Pololu Robotics & Electronics ....56
QKITS ........................................49
Ramsey Electronics, Inc. .....20-21
Robot Power .............................49
Saelig Company, Inc. ................79
Scientifics ..................................39
Solarbotics/HVW .......................38
Surplus Gizmos .........................13
Technological Arts .....................49
Trace Systems, Inc. ..................64
V-Module ...................................64
AMATEUR
RADIO AND TV
PolarisUSA Video, Inc. .........................19
Ramsey Electronics, Inc. ................20-21
V-Module ..............................................64
BATTERIES/
CHARGERS
Cunard Associates ...............................49
BUYING ELECTRONIC
SURPLUS
Jaycar Electronics.................................43
CCD CAMERAS/
VIDEO
Circuit Specialists, Inc. ....................82-83
PolarisUSA Video, Inc. .........................19
Ramsey Electronics, Inc. ................20-21
CIRCUIT BOARDS
AP Circuits ...........................................57
Cunard Associates ...............................49
Dimension Engineering.........................18
ExpressPCB .........................................71
Front Panel Express LLC .....................79
PCB Pool .............................................19
Saelig Company, Inc. ...........................79
V-Module ..............................................64
COMPONENTS
Cana Kit Corp. .....................................63
Electronix Express ...............................48
Fun Gizmos ..........................................49
Jameco ................................................27
Linx Technologies ................................57
Mouser Electronics ................................9
Noritake ................................................26
V-Module ..............................................64
COMPUTER
Hardware
Matrix Multimedia..................................49
Noritake ................................................26
Microcontrollers / I/O Boards
Abacom Technologies .........................38
Bitscope .................................................7
Fun Gizmos ..........................................49
I/O Bridge .............................................19
Matrix Multimedia..................................49
Microchip ................................................3
microEngineering Labs .........................48
MikroElektronika ....................................4
Mouser Electronics ................................9
Parallax, Inc. ..........................Back Cover
Pololu Robotics & Electronics ...............56
Solarbotics/HVW ..................................38
Technological Arts ...............................49
Trace Systems, Inc. .............................64
Software
Matrix Multimedia..................................49
DESIGN/
ENGINEERING/
REPAIR SERVICES
Cana Kit Corp. .....................................63
ExpressPCB .........................................71
Front Panel Express LLC .....................79
PCB Pool .............................................19
Trace Systems, Inc. .............................64
EDUCATION
BaneBots .............................................18
Bitscope .................................................7
Command Productions ........................29
Global Specialties ................................47
I/O Bridge .............................................19
NKC Electronics ...................................49
PAiA .....................................................57
Technological Arts ...............................49
EMBEDDED TOOLS
Mouser Electronics ................................9
NetBurner ...............................................2
ENCLOSURES
Front Panel Express LLC .....................79
Integrated Ideas & Tech. ......................26
KITS & PLANS
Cana Kit Corp. .....................................63
Jaycar Electronics.................................43
NetBurner ...............................................2
NKC Electronics ...................................49
PAiA .....................................................57
QKITS ...................................................49
Ramsey Electronics, Inc. ................20-21
Solarbotics/HVW ..................................38
MISC./SURPLUS
All Electronics Corp. .............................65
Front Panel Express LLC .....................79
Scientifics .............................................39
Surplus Gizmos ....................................13
MOTORS
BaneBots .............................................18
Jameco ................................................27
OPTICS
Noritake ................................................26
PROTOTYPING &
TRAINERS
Global Specialties ................................47
PROGRAMMERS
microEngineering Labs .........................48
MikroElektronika ....................................4
RF TRANSMITTERS/
RECEIVERS
Abacom Technologies .........................38
Linx Technologies ................................57
ROBOTICS
BaneBots .............................................18
Fun Gizmos ..........................................49
Jameco ................................................27
Lemos International Co., Inc. ...............49
Lynxmotion, Inc. ...................................70
Pololu Robotics & Electronics ...............56
Robot Power ........................................49
Solarbotics/HVW ..................................38
SATELLITE
Lemos International Co., Inc. ...............49
SECURITY
PolarisUSA Video, Inc. .........................19
Technological Arts ...............................49
TEST EQUIPMENT
Bitscope .................................................7
Circuit Specialists, Inc. ....................82-83
Dimension Engineering.........................18
Global Specialties ................................47
Jaycar Electronics.................................43
LeCroy ....................................................5
NKC Electronics ...................................49
Saelig Company, Inc. ...........................79
Trace Systems, Inc. .............................64
TOOLS
MikroElektronika ....................................4
NetBurner ...............................................2
WEB SERVICES
I/O Bridge .............................................19
WIRE, CABLE
AND CONNECTORS
Jameco ................................................27
January 2011 81
Index Jan11.qxd 12/7/2010 2:29 PM Page 81
The following
soldering tips are
also available
USB Digit USB Digital S al Storage Oscilloscopes torage Oscilloscopes
* High performance:
* USB connected: Uses USB and supports plug'n play,
with 12Mbp communication speed.
* Best performance for your dollar: Thease units have
many features that are comparable to the high
speedah
stand-alone DSOs. But costs a fraction of the price.
* No external power required: Bus-powered from the
host computers USB port.
* Probes & USB cable included.
* Easy to use: Intuitive and easy to understand.
* Various data formats: Can save wavrfrom in the
following formats: .txt .jpg .bmp & MS excel/word
40MHz DSO-2090 DSO-2090 $169.00 $169.00
www.circuitspecialists.com/DSO-2090
60MHz DSO-2150 DSO-2150 $209.00 $209.00
www.circuitspecialists.com/DSO-2150
100HMz DSO-2250 DSO-2250 $259.00 $259.00
www.circuitspecialists.com/DSO-2250
200MHz DSO-5200 DSO-5200 $299.00 $299.00
www.circuitspecialists.com/DSO-5200
200MHz DSO-5200A DSO-5200A $355.00 $355.00
www.circuitspecialists.com/DSO-5200A
C Ci i r rc cu ui i t tS Sp pe ec ci i a al l i i s st ts s. . c co om m
1 10 00 00 0’ ’ s s o of f I I t te em ms s O On nl l i i n ne e! ! 1 1- - 8 80 00 0- - 5 52 28 8- - 1 14 41 17 7 F Fa ax x: : 4 48 80 0- - 4 46 64 4- - 5 58 82 24 4 S Si i n nc ce e 1 19 97 71 1
C Ci i r rc cu ui i t t S Sp pe ec ci i a al l i i s st ts s, , I I n nc c. .
P Ph ho on ne e: : 8 80 00 0- - 5 52 28 8- - 1 14 41 17 7 / / 4 48 80 0- - 4 46 64 4- - 2 24 48 85 5 / / F Fa ax x: : 4 48 80 0- - 4 46 64 4- - 5 58 82 24 4
P
r
o
b
e
s
P
r
o
b
e
s
I
n
c
l
u
d
e
d
I
n
c
l
u
d
e
d
Specifications DSO-2090 DSO-2150 DSO-2250 DSO-5200 /5200A
Channels 2 Channels
Impedence 1M 25pF
Coupling AC/DC/GND
Vertical resolution 8 Bit 9 Bit
Gain Range 10mV-5V, 9 Steps 10mV-10V, 10Steps
DC Accuracy +/- 3%
Timebase Range 4ns - 1h 38 Steps 2ns-1h, 39 Steps
Vertical adjustable Yes
Input protection Diode clamping
X-Y Yes
Autoset 30Hz~40MHz 30Hz~60MHz 30Hz~100MHz 30Hz~200MHz
EXT. input Yes
Trigger Mode Auto / Normal / Single
Trigger Slope +/-
Trigger Level Adj. Yes
Trigger Type Rising edge / Falling Edge
Trigger Source Ch1 / Ch2 / EXT
Pre/Post trigger 0-100%
Buffer size 10K-32K per ch 10K-512KB per ch
Shot Bandwidth DC to 40MHz DC to 60MHz DC to 100MHz 100MHz
Max Sanple Rate 100MS/s 150MS/s 250MS/s 200MS/s / 250MS/s
Sampling Selection Yes
Waveform Display port/line, waveform average, persistence, intensity
Network open / close
Vertical Mode Ch1, Ch2, Dual, Add
CursorMeasurement Yes
Spectrum Analyzer
Channels 2 Channels
Math FFT, addition, subtraction, multiplication, division.
Bandwidth 40 MHz 60 MHz 100MHz 200 MHz
Cursor Frequency, Voltage
Data Samples 10K-32K/Ch 10K-1M/Ch
T Triple Output riple Output
Bench Power Supplies Bench Power Supplies
The new CSI3303S & CSI5505S regulated DC
power supplies are high reliability, variable DC
Power Supplies with built in short circuit and ther-
mal protection. These power supplies are suitable
for the laboratory, electronics, communications
equipment maintenance, production line, scientific
research and educational institutions. Both units
are equipped with protection circuits that protect the
units from short circuits and over temperature by
shutting the unit down for safety. Both units allow
independent, serial and parallel mode operation.
Technical Specifications:
Independent mode: 2 independent 0-30V outputs
Series mode: CSI3303S Output from 0-60V & 0-3A
CSI5505S Output from 0-60V & 0-5A
Parallel mode: CSI3303S Output from 0-6A & 0-30V
CSI5505S Output from 0-10A& 0-30V
Both units also provide a 5V fixed output @ 3A
Load regulation: <0.1%+3mV (rating current <3A)
<0.2% +3mA
Ripple and noise: <1mVrms 5Hz-1MHz
<3mArms
Voltage accuracy: +/-0.5%rdg+2byte
Current accuracy: +/-.5%rdg+2byte
Display resolution: +/-0.5%rdg+2byte
Rated output: 5.0V +/-0.1V 3A
Tracking characteristics
Series specifications:
Load regulation: less than 50mV
Ripple and noise: (5Hz~1MHz) <=3mVRMS
Parallel characteristics:
Load regulation: less than 50mV
Ripple and noise: (5Hz-1MHz) CV less than
1mV<=6A), CV less than
1.5mV (I>6A)
Once again Circuit Specialists brings you a
quality product at a great price!
Item#
0 to 3A CSI3303S CSI3303S
www.circuitspecialists.com/CSI3303S 4+ $155.00 ea.
Item#
I0 to 5A CSI5505S CSI5505S
www.circuitspecialists.com/CSI5505S 4+ $179.00 ea.
$169.00 $169.00
$194.00 $194.00
New
New
Y
Y
ear
ear
, New Price
, New Price
CSI-S
CSI-S
t
t
ation1A
ation1A
0.8mm Chisel Tip
(KD-M-0.8D)
1mm Single Flat 40
o
Tip
KD-M-1C
1.2mm Chisel Tip
KD-M-1.2D
1.6mm Chisel Tip
KD-M-1.6D
2mm Single Flat 40
o
Tip
KD-M-2C
2.4mm Chisel Tip
KD-M-2.4D
3mm Single Flat 40
o
Tip
KD-M-3C
3.2mm Chisel Tip
KD-M-3.2D
4mm Single Flat 40
o
Tip
KD-M-4C
Conicle Fine Point Tip
KD-M-1
Conicle Fine Point Tip
KD-M-B
Long Conilce Fine Pt Tip
KD-M-LB
Easily our best value in our selection of soldering stations. O.E.M. manufactured just for
Circuit Specialists Inc., so we can offer the best price possible! The CSI-Station1Afeatures a
grounded tip & barrel for soldering static-sensitive devices and uses a ceramic heating ele-
ment for fast heat up & stable temperature control.
The control knob is calibrated in Fahrenheit & Celsius (392° to 896°F and 200°
to 480°C). One of the nicest features is the high quality comfort grip soldering
iron. The iron connects to the station via an easy screw-on connector making
iron replacement a snap. The 1 meter length iron cord provides plenty of length
for users to set up the station in a convenient location. Another nice feature is
the soldering iron holder. Made of rugged aluminum,it is a seperate piece from
the main station & allows the user maximum convenience.....you don't have to
reach all the way back to the station to store the iron. Yet another feature is the
stackable design of the CSI-Station1. The main station is designed for an addi-
tional unit to be placed on top of it allowing for space saving placement of the
CSI-Station1A. Also included at no additional charge is one user replaceable
ceramic heating element so that you will be prepared!
o
Made for us so we can offer the best possible price
o
Temperature Stable Ceramic element
o
Easy to Replace Soldering Iron (not hard wired)
o
Grounded Tip & Barrel to prevent ESD damage
o
24V Iron Operation
o
Soft Comfort Grip Pencil Iron
o
Iron Holder is Detached, Rugged aluminum construction
o
Includes one FREE replacement ceramic heating element
$29.95 $29.95
CSI-ST CSI-STA ATION1A TION1A
New Year,
New Price
Full Page.qxd 12/7/2010 10:01 AM Page 82
www.downmagaz.com
N
e
w

N
e
w

Y Y
e
a
r
s
e
a
r
s
S S
p
e
c
i
a
l
!
p
e
c
i
a
l
!
Check out our new programmable hi preformance
3 channel power supplies. Featuring both USB &
RS232 interfaces, Overload Protection, Auto Fan Control,
and Series or Parallel Operation. Both units feature a Large
LCD display panel with simultaneous output and parameter
view and a keypad for control. They are ideal for applications
requiring high resolution, multiple output, and automated oper-
ation such as in production testing. There are both fine and
coarse controls via the shuttle knob and 90 memory settings.
Software included.
Reliable, Highly Stable, Fan Cooled.
3 Channel Programmable 3 Channel Programmable
Regulated DC Power Supplies Regulated DC Power Supplies
Includes
1 Year USA
Warranty
You get both a 200 MHz
Oscilloscope and a multi func-
tion digital multimeter, all in
one convenient lightweight
rechargeable battery powered
package. This power packed
package comes complete with
scopemeter, test leeds, two
scope probes, charger, PC soft-
ware, USB cable and a conven-
ient nylon carrying case.
• 200MHz Handheld Digital Scopemeter with integrated Digital
Multimeter Support
• 200MHz Bandwidth with 2 Channels
• 500MSa/s Real-Time Sampling Rate
• 50Gsa/s Equivalent-Time Sampling Rate
• 6,000-Count DMM resolution with AC/DC at 600V/800V, 10A
• Large 5.7 inch TFT Color LCD Display
• USB Host/Device 2.0 full-speed interface connectivity
• Multi Language Support
• Battery Power Operation (Installed)
www.circuitspecialists.com/DSO1200
60MHz Hand Held Scopemeter 60MHz Hand Held Scopemeter
with Oscilloscope & DMM Functions with Oscilloscope & DMM Functions
• 60MHz Handheld Digital Scopemeter with
integrated Digital Multimeter Support
• 60MHz Bandwidth with 2 Channels
• 150MSa/s Real-Time Sampling Rate
• 50Gsa/s Equivalent-Time Sampling Rate
• 6,000-Count DMM resolution with AC/DC
at 600V/800V, 10A
• Large 5.7 inch TFT Color LCD Display
• USB Host/Device 2.0 full-speed interface
connectivity
• Multi Language Support
• Battery Power Operation (Installed)
www.circuitspecialists.com/DSO1200
60MHz Hand Held Scopemeter 60MHz Hand Held Scopemeter
w/Oscilloscope, DMM Functions & w/Oscilloscope, DMM Functions &
25 MHz Arbitrary Waveform Generator 25 MHz Arbitrary Waveform Generator
• All the features of the DSO1060 plus a 25 MHz Arbitrary
Waveform.Generator.
• Waveforms can be saved in the following formats:
jpg/bmp graphic file, .MS excel/word file
• Can record and save 1000 waveforms
• DC to 25 MHz Arbitrary Waveform Generator
www.circuitspecialists.com/DSO-8060
C Ci i r rc cu ui i t tS Sp pe ec ci i a al l i i s st ts s. . c co om m
1 10 00 00 0’ ’ s s o of f I I t te em ms s O On nl l i i n ne e! ! 1 1- - 8 80 00 0- - 5 52 28 8- - 1 14 41 17 7 F Fa ax x: : 4 48 80 0- - 4 46 64 4- - 5 58 82 24 4 S Si i n nc ce e 1 19 97 71 1
C Ci i r rc cu ui i t t S Sp pe ec ci i a al l i i s st ts s, , I I n nc c. . 2 22 20 0 S S. . C Co ou un nt tr r y y C Cl l u ub b D Dr r. . , , M Me es sa a, , A AZ Z 8 85 52 21 10 0
P Ph ho on ne e: : 8 80 00 0- - 5 52 28 8- - 1 14 41 17 7 / / 4 48 80 0- - 4 46 64 4- - 2 24 48 85 5 / / F Fa ax x: : 4 48 80 0- - 4 46 64 4- - 5 58 82 24 4
We carry a LARGE selection of Power Supplies, Soldering Equipment, Test Equipment,
Oscilloscopes, Digital Multimeters, Electronic Components, Metal and Plastic Project Boxes,
Electronic Chemicals, PC Based Digital I/O Cards, Panel Meters, Breadboards, Device
Programmers, and many other interesting items. Check out our website at:
www.CircuitSpecialists.com
0-30V / 0-5A 0-30V / 0-5A . DC Power Supply . DC Power Supply
The CSI530S is a regulated DC power supply which you can
adjust the current and the voltage continuously. An LED display
is used to show the current and voltage values. The output ter-
minals are safe 4mm banana jacks. This power supply can be
used in electronic circuits such as operational amplifiers, digital
logic circuits and so on. Users include researchers, techni-
cians, teachers and electronics enthusiasts. A3 ½ digit LED is
used to display the voltage and current values.
ww.circuitspecialists.com/csi530s
Programmable DC Electronic Loads Programmable DC Electronic Loads
Thease devices can be used with supplies up
to 360VDC and 30A. It features a rotary
selection switch and a numeric keypad used
to input the maximum voltage, current and
power settings. These electronic DC loads
are perfect for use in laboratory environments
and schools, or for testing DC power supplies
or high-capacity batteries. It also features
memory, and can also be connected to a PC,
to implement remote control and supervision.
360V/150W (CSI3710A) $349.00
www.circuitspecialists.com/csi3710a
360V/300W (CSI3711A) $499.00
www.circuitspecialists.com/csi3711a
$84. 95 $84. 95
Item #
CSI530S CSI530S
•Up to 10 settings stored in memory
•Optional RS-232, USB, RS-485 adapters
•May be used in series or parallel modes
wi t h addi t i onal supplies.
•Low output ripple .& noise
•LCD display with .backlight
•High resolution at .1mV
Programmable DC Power Programmable DC Power
Supplies Supplies
Model CSI3644A CSI3645A CSI3646A
DC Voltage 0-18V 0-36V 0-72V
DC Current 5A 3A 1.5A
Power (max) 90W 108W 108W
Price $199.00 $199.00 $199.00 $199.00 $199.00 $199.00
Item #
DSO1200 DSO1200
$739.00 $739.00
Item #
DSO1060 DSO1060
$529.00 $529.00
Blac BlackJ kJac ack SolderW k SolderWer erks ks
Hot Air System with Soldering Iron & Mechanical Arm
The BK5000
from BlackJack
Sol der Wer ks
provides a very
c o n v e n i e n t
combination of
hot air and sol-
dering in one
compact pack-
age. The hot air
gun is equipped
with a hot air
protection sys-
tem which pro-
vides system
cool-down and
overheat protection. The system cool-down fea-
ture removes the residual heat from the nozzle
after the hot air function is switched off. This will
cool the nozzle more rapidly & extend the life of
the heating element. The overheat protect fea-
ture effectively shuts off power to the heater
when an overheat in the middle of the handle has
been detected. The hot air gun is designed to use
different SMD nozzles for various SMD applica-
tions. The soldering iron incorporates a replace-
able tip design & uses the same series of tips that
are compatible with BlackJack models BK2000 &
BK2000+
SPECIFICATIONS:
Power Input : 110V
Dimensions: 188mm (w) x 126mm (h) x250mm (d)
Weight: 4.8Kg
SOLDERING IRON
Power Consumption: 35W
Temperature Range: 200 - 480 degrees Celsius
Heating Element with Tip: Ceramic Heater
Output Voltage: 24V
Tip to Ground Resistance: Below 2 ohms
Tip to Ground Potential: Below 2mV
HOT AIR
Power Consumption: 500W peak
Temperature Range: 100 - 500 degrees Celsius
Heating Element Metal Heating Core
Nozzle to Ground Resistance: Below 2 ohms
Pump/Motor Type: Diaphragm Pump
Air Capacity: 23 L /min (max)
A wide selection of accessories, soldering tips & hot air nozzels are also
available
Item #
BK5000
www.circuitspecialists.com/bk5000
Item #
DSO-8060 DSO-8060
$659.00 $659.00
200MHz Hand Held Scopemeter 200MHz Hand Held Scopemeter
with Oscilloscope & DMM Functions with Oscilloscope & DMM Functions
$97.00 $97.00
Model CSIPPS33T CSIPPS55ST
DC Voltage 0-32V x2
0-6V x1
0-32V x2
0-6V x1
DC Current 0-3A x3 0-5A x2
0-3A x1
Item #
CSIPPS33T CSIPPS33T
Item #
CSIPPS55T CSIPPS55T
www.circuitspecialists.com/CSIPPS33T
www.circuitspecialists.com/CSIPPS55T
$479.00 $479.00
$619.00 $619.00
Mechanical Mechanical Arm with Arm with
Air Gun att Air Gun att ached ached
Full Page 2.qxd 12/7/2010 10:07 AM Page 83
backcvr.qxd 12/7/2010 8:57 AM Page 84
www.downmagaz.com

Low-cost Industrial

Serial to Ethernet Solutions

SBL2e Chip

SBL2e 200

SBL2e 100

SBL2e

Hardware Features

Serial-to-Ethernet server with RS-232 support

Software Features

Low Prices

Need a custom solution?

SBL2e XA
Information and Sales Web Telephone

www.downmagaz.com

Microcontrollers

Power Your Connected Graphics Solution With the PIC32 Microcontroller
The Microchip name and logo, the Microchip logo, PIC and MPLAB are registered trademarks and PICtail is a trademark of Microchip Technology Incorporated in the USA and in other countries. All other trademarks mentioned herein are the property of their respective owners. © 2010, Microchip Technology Incorporated. All rights reserved. 9/10

Digital Signal Controllers Analog Memory

Connectivity and graphical user interfaces are essential in today’s applications. You’re challenged to deliver intuitive, high impact, connected solutions while maintaining flexibility to support several different product options. Microchip’s PIC32 series of 32-bit microcontrollers offer the right performance, memory size and peripherals to help achieve your goals. With 1.56 DMIPS/MHz performance topping any device in its category, up to 512 Kbytes of Flash, 128 Kbytes of RAM and integrated connectivity peripherals like Ethernet, CAN and USB the PIC32 can deliver the mix of performance and flexibility needed to help you meet your design challenges.

GET STARTED IN 3 EASY STEPS
1. Purchase PIC32 Ethernet Starter Kit and Multimedia Expansion Board 2. Download MPLAB® IDE 3. Start designing! www.microchip.com/graphics

Microchip gets you there with:

• PIC32 Starter Kits – Standalone easy to use development boards with
integrated debugger/programmer

PIC32 Ethernet Starter Kit – DM320004

• Multimedia Expansion Board – The most complete user interface development
solution in it’s class – enabling development of highly interactive, graphics and audio-based interfaces with WiFi connectivity – a modular add-on to any PIC32 Starter Kit.

• Microchip’s FREE Graphics and Connectivity libraries and code examples
– Eases your development effort and speeds your time to market

Multimedia Expansion Board - DM320005

www.microchip.com/graphics

www.downmagaz.com

.

PERIODICALS POSTAGE PAID AT CORONA. we’ve got a simple. This month. and an LED replacement for incandescent lamps. P. Box 15277.95 per year by T & L Publications. ■ By Bob Colwell Departments 08 28 49 66 6 DEVELOPING PERSPECTIVES NEW PRODUCTS SHOWCASE ELECTRO-NET January 2011 72 76 80 81 NV WEBSTORE TECH FORUM CLASSIFIEDS AD INDEX Nuts & Volts (ISSN 1528-9885/CDN Pub Agree #40702530) is published monthly for $26. CA 92879. POSTMASTER: Send address changes to Nuts & Volts.O. 58 Smiley’s Workshop Page 50 Programming • Hardware • Projects AVR_Toolbox — Documentation and Libraries. Corona. Box 54. a solar-powered wireless keyboard. P. Inc. a model railroad sequencer. cpcreturns@nutsvolts. electronically-driven pendulum that can produce all the randomness you like.nutsvolts.O. Page 30 40 A Simple DC UPS This article describes a simple uninterruptible power supply circuit that you can incorporate into your low power DC projects to ensure continued operation during power failures.com. ■ By Norm Looper 67 Near Space Approaching the Final Frontier The NearSpace UltraLight — The Everyman’s Flight Computer. and News Read about a new approach to electronics.com . plus more cool stuff you’ll find fascinating. Projects & Features 30 Explore Electronic Chaos Need more chaos in your life? Well.com Nuts & Volts Columns 10 TechKnowledgey 2011 Events. www.downmagaz. 50 The Design Cycle Advanced Techniques for Design Engineers Time for Some RTCC Translating. Windsor ON N9A 6J5. ■ By Philip Kane 44 Build a Wi-Fi Sprinkler System Be master of your lawn-watering system with this Wi-Fi project. CA AND AT ADDITIONAL MAILING OFFICES. 14 The Spin Zone Adventures in Propeller Programming From Spin to PASM and Back Again! 22 Q & A Reader Questions Answered Here This month’ questions cover a CAT 5 cable tester. CA 91615 or Station A. do-it-yourself thermocouples. Advances. 430 Princeland Court. North Hollywood.January2011 www. a low battery circuit.. you’ll learn the building blocks of the Rabbit RCM5450W module that runs it.

.

Modding as a source of supplemental income is something to consider in an economic downturn. one way around the cost issue is to go with a kit. Modding is simply taking an existing circuit and making it better. Add your own spice. or changing the audio characteristics of a guitar effects pedal. you get a small bag of capacitors. increasing the clock speed of a microprocessor. Modding can be a good business. resistors. For example. it’s generally a bad idea to make all the changes you have planned and then plug in the equipment. mod shops claim they can enable your pedal to produce better sound effects. most guitar effects pedal modders on eBay charge $50 to $100 for labor. By the way. proper orientation of ICs in their sockets. you could make a mistake that will take you hours to undo if you rush through the project. tubes. If your circuit stops working because of a mod error. and passive components in their amplifiers and other music equipment. They’re constantly changing the pickups in their guitars and experimenting with different chip sets. affordability. controls. It’s amazing what you can forget when you’re interrupted in the middle of a modding project. It takes a bit of discipline to be a good modder. Kits tend to be cheaper than buying parts piecemeal because of reduced shipping costs. In addition to the standard mod component changes. I rewired the pushbutton switch and made a few other changes that really improved the quality of the distortion produced by the pedal. Editor DEVELOPING PERSPECTIVES Every electric guitarist that I know is a modder at heart. you should try your hand at modding. It’s a good idea to take good notes when you mod. and a chip or two. but that’s about it. these two goals tend to be at odds with each other. The best thing about modding is that you start with just about everything you need. While you can get a bag of parts and instructions for $15. Why would someone spend $20 on parts and shipping.downmagaz. improving the regulation or efficiency of a power supply. Kits also reduce the risk of failure. The accompanying figure shows a typical mod sold on eBay for guitar effects pedals. and the rest. display. Examples of modding include increasing the output power of an amplifier.by Bryan Bergeron. This highlights another point of modding — start with what’s safe and proven. and fun. Because you may not be working with a schematic. but don’t end there. However. as well. improving the selectivity and sensitivity of a shortwave receiver. You’ll have to pay attention to capacitor and LED polarity. While kits are fun — I spent most of my money as a youth on HeathKit projects — they often lack the challenge of building a circuit from scratch. the mod shown in the figure turned out great. especially if you have to order from multiple suppliers. As many readers point out. By replacing the stock components with those from the kit.com . you want to know which mod is responsible. it’s not an all or nothing proposition. and another $20 on a custom printed circuit board when a superior circuit with a nice case and battery compartment can be had for $15 at a local retailer? As I’ve noted in past editorials. It’s better to make a small change such as changing the capacitors in the signal path and then checking the results rather than to update the power supply. you don’t have to worry about a chassis (have you priced one lately?). For a great mix of challenge. A 8 January 2011 www. It’ll stretch you as an experimenter and you’ll learn a lot more in the process. if you’re increasing the low frequency response of a stereo amp. in case you’re curious. You plug in and solder the parts and — assuming you’ve followed the directions faithfully — the circuit should be good to go. and the like. You can focus your efforts on the power supply and power amplifier circuitry. In contrast with kit building. NV Modding common thread in most of the emails we received in response to my question about the future direction of Nuts & Volts was the desire for more and more affordable hands-on projects. For about $15 (including shipping).

may be trademarks of their respective owners. Corona. North Hollywood. Other products. Inc.com ADMINISTRATIVE ASSISTANT Debbie Stauffacher PRODUCTION/GRAPHICS Shannon Christensen Copyright © 2011 by T & L Publications. Advertisers and their agencies agree to indemnify and protect the publisher from any and all claims. action. We are not responsible for mistakes. CA 91615 FOUNDER/ASSOCIATE PUBLISHER Jack Lemieux PUBLISHER Larry Lemieux publisher@nutsvolts.com EDITOR Bryan Bergeron techedit-nutsvolts@yahoo. Corona. logos. UPS. Scan mouser. and company names mentioned herein. Please send all editorial correspondence. and artwork to: 430 Princeland Court. overnight mail.com The Newest Products For Your Newest Designs ducts ™ Mouser and Mouser Electronics are registered trademarks of Mouser Electronics. Inc.com Subscriptions Toll Free 1-877-525-2539 Outside US 1-818-487-4545 P Box 15277 . CA 92879-1300 (951) 371-8497 FAX (951) 371-3052 Webstore orders only 1-800-783-4624 www.nutsvolts.O. misprints.EVERYTHING FOR ELECTRONICS Published Monthly By T & L Publications. CA 92879. 430 Princeland Ct.com ASSOCIATE PUBLISHER/ VP OF SALES/MARKETING Robin Lemieux display@nutsvolts. All Rights Reserved All advertising is subject to publisher’s approval.com WEB CONTENT Michael Kaudze website@nutsvolts.com SHOW COORDINATOR Audrey Lemieux MARKETING COORDINATOR WEBSTORE Brian Kirkpatrick sales@nutsvolts. Nuts & Volts Magazine assumes no responsibility for the availability or condition of advertised items or for the honesty of the advertiser.com Get Your Hands On What’s Next. Printed in the USA on SFI & FSC stock. January 2011 9 . CONTRIBUTING EDITORS Jeff Eckert Joe Pardue Norm Looper Bob Colwell Paul Verhage Russ Kincaid Fred Eady Philip Kane Jon Williams CIRCULATION DIRECTOR Tracy Kerley subscribe@nutsvolts. The publisher makes no claims for the legality of any item advertised in Nuts & Volts. Inc. or typographical errors. or expense arising from advertising placed in Nuts & Volts. This is the sole responsibility of the advertiser.

a professor in the Department of Engineering and Computer Science." Islam noted. leading to the possibility of an entirely new approach to electronics.com 2011 . and roll of helicopters. The good news is that a new laser technology developed at the University of Michigan (www. The discovery involves the creation ■ Asymmetric MIM diode developed at of a high performance "metal-insulator-metal" (MIM) diode. a chemistry prof at OSU. As a result.omnisciinc. A MIM diode." The key is the fact that supercontinuum lasers give off a beam of light with a broad range of wavelengths rather than just a single one. According to Oregon State University. ADVANCED TECHNOLOGY NEW LASER-BASED MISSILE DEFENSE n rough terrain places like Afghanistan. at high speed on a huge scale." ▲ A 10 January 2011 www. ADVANCES. they are highly vulnerable to shoulder-launched heat-seeking missiles." A patent application has been filed for the new technology which may offer a way to "simply print electronics on a huge size scale even less expensively than we can now." The system — developed with funding from the US Army and DARPA — is likely to have many other military applications. Douglas Keszler.edu) and spin-off Omni Sciences (www. Mohammed Islam. rattle. researchers at Oregon State University (http://oregonstate.8 miles." Today's silicon-based electronics work with transistors that control electron flow which is limited by the speed with which electrons can move through the materials. An additional advantage I ■ A Stinger infrared-seeking missile is launched in a Marine live-fire exercise. According to the prof. old-fashioned stuff from your telephone network to build a laser that has no moving parts.umich. They couldn't withstand the shake.downmagaz. even less than with conventional methods. at very low cost. has created an assembly of cheap. Manuel Valdez. In this device. AND NEWS Photo courtesy of Lance Cpl. is the device's simplicity. Because choppers tend to operate at low altitudes and at relatively slow cruise speeds. but it is particularly well suited for helicopters. the military has to rely on helicopters for many operations. "We've used good.edu) have solved a mystery that has eluded scientists since the 1960s. in which an insulator is sandwiched between two layers of metal performs the same function in a different and much faster manner. portable "mid-infrared supercontinuum laser" that can blind heat-seeking missiles from a distance of 1. the device can mimic an engine's electromagnetic signature and confuse incoming weapons. "Our lasers give off a signal that's like throwing sand in the eyes of the missile.TECH ■ BY JEFF ECKERT KNOWLEDGEY EVENTS. And when the products begin to emerge. They operate in longer infrared wavelengths that are invisible but can be felt as heat. "The laser-based infrared countermeasures in use now for some aircraft have 84 pieces of moving optics. the increase in speed of operation could be enormous.com) looks like a promising solution. off-the-shelf fiber optic components to build a sturdy. It's a basic way to eliminate the current speed limitations of electrons that have to move through materials. ▲ A NEW APPROACH TO ELECTRONICS? ccording to a recent report in the online journal Advanced Materials. "This is a fundamental change in the way you could produce electronic products. "the electron doesn't so much move through the materials as it ‘tunnels’ through the insulator almost instantaneously appearing on the other side.

▲ SOLAR-POWERED WIRELESS KEYBOARD emonstrating that there's more to keyboards than a bunch of keys." he noted. and it features the company's concave Incurve keys™ which are designed to support the shape of your fingertips and help guide fingers to the right keys. ▲ D January 2011 11 . the K750 is only 1/3 of an inch thick.nutsvolts.7 PFlops/s.com/ products/multimedia/. but before the upgrade. Tianhe-1 has begun trial use with clients that include the Tianjin Meteorological Bureau and the National Offshore Oil Corporation. The device operates with 2. but energy consumption is so low that it can work in total darkness for up to three months.507 PFlops/s — is now the world’s fastest supercomputer. Logitech (www.www. visit www.507 PFlops/s. and the installation of some domestically produced FeiTeng-1000 CPUs. It has a theoretical top speed of 4.php?/magazine/article/january2011_TechKnow T E C H K N O W L E D G E Y 2 0 11 COMPUTERS AND NETWORKING CHINA BECOMES SUPERCOMPUTER TOP DOG ntil recently. According to the company. the 155 ton machine reportedly used 14. GPGPU support is noted to be increasingly important for enhanced Augmented Reality applications and gesture recognition. The new Mali processor also reduces memory bandwidth consumption by up to 30 percent which improves energy efficiency. tablets. The tri-pipe innovative graphics architecture within the Mali-T604 GPU addresses the computationally intensive demand inherent in next-generation interactive user interfaces and gaming. "The debut of the scalable. DTVs. ■The Tianhe-1 supercomputer — clocking in at 2. including mobiles.com) has introduced what is probably its slickest keyboard yet. For details. According to Liu Guangming. The K750 eliminates the need to change batteries by powering itself from ambient light. U Specifics weren't offered. even indoors.logitech. According to ARM. ▲ NEXT-GENERATION GRAPHICS PROCESSOR FOR CONSUMER DEVICES C oming to a range of consumer products soon is ARM's fourth-generation Mali™ GPU. It appears now that China's Tianhe-1 (Chinese for "Milky Way") has smashed the record with a sustained computing speed of 2.arm. "It can also serve the animation industry and bio-medical research. (So.76 PFlops/s. and Samsung will be the first to embed it in its products.168 NVIDIA Tesla GPUs (each with 448 cores)." The unit is designed to meet the needs of General Purpose computing on GPU (GPGPU) and extends API support to include Khronos™ OpenCL™ and Microsoft® DirectX®.4 GHz wireless connectivity and includes 128-bit AES encryption for added security. said to deliver five times the performance of the current Mali processors.com/index. multicore Mali-T604 GPU raises the performance bar for visual computing in the consumer electronics space.) In addition.99. the world's fastest supercomputer was the Cray XT5 Jaguar system at Tennessee's Oak Ridge National Laboratory. with a speed of 1. lot of time typing in the dark. The GPU is available for license by ARM partners.336 Intel Xeon CPUs and 7. and automotive infotainment. if you spend a ■ The solar-powered Logitech K750 wireless keyboard. According to the developer — the National University of Defense Technology — the achievement comes from upgrading the Intel and NVIDIA processors. Suggested retail is $79. director of the National Center for Supercomputing in Tianjin. not only is it powered by light. you're in luck.

"Boy. designed for machine vision on the factory floor.25 x 15. and the HC1400 (75 fps." DCC Corporation (www.downmagaz.25 inches or 8. and they offer Gigabit Ethernet technology.99. ▲ I PC-TO-TV CONNECTION he latest from Imation (www. The Link works as a digital entertainment server. but you can pick one up for about 10 percent less from various online stores.com . more reliable contact mechanical twisting or clamping.com) is the Link™ Wireless Audio/Video Extender which allows you to send both audio and high-def video content (including Internet TV.dalsa. video-conferencing. transmitting data over standard CAT-5e and CAT-6 cables up to 100 m. and a dual core is recommended. For only $689. the compact size (3. Power is provided from the AC power line via a step-down transformer. resulting from the company's proprietary CMOS technology.9 cm) and light weight (6.dcccorporation. The PC. Other features include a ruggedized RJ45 connector highly suitable for robotic applications. The only snag is that you need at least a 1. DCC says it's faster than gas welding and produces a thermocouple fabrication.imation. you can join the list of 200+ current users. the HC1024 (117 fps. and so forth) to a television or projector using wireless USB technology. and 1000x anti-blooming. check out DCC's website anyway. The HotSpot generates an electric arc that fuses standard couple elements into freestanding beads and welds them to a base metal of any thickness.CIRCUITS AND DEVICES NEW CAMERAS FOR MACHINE VISION f you happen to be involved in manufacturing inspection. designed to provide fast and simple setup (said to take only a matter of minutes).com/mv. along with two-channel audio. 1400 x 1025). You can pick one up as a kit or in ready-to-fly form. ▲ T 12 January 2011 www. The receiver connects to the TV set via an HDMI or VGA input. Oddly enough. movies. between a PC and TV. The unit lists for $149. business conferences. Information on these and the DALSA's full line of machine vision products can be found at www. and you can weld wire pairs up to #24 gauge at a rate of 5 to 10 welds per minute. Plus. depending on the energy setting. or any field that makes use of high-speed color cameras. food inspection. 1024 x 768). I sure wish I could fabricate my own thermocouples. intelligent traffic systems. games. or from a gel-type battery that allows a few hundred welds without the ■ DCC’s HotSpot capacitive discharge welder for AC connection. I ■ A Genie high-speed color camera.0 port on a laptop or desktop. The Genies come with the company's Sapera ™ Essential and Genie Framework software packages.com) can make that wish come true. All comply with the Automated Imaging Association's GigE Vision standard for direct link to a PC. 640 x 480 resolution).25 x 15. photos. What? You say you've never wished for such a thing? Well.8 kg) make it highly portable. The HotSpot capacitive discharge welder is designed for just that purpose. The new Genie HC series consists of the HC640 (up to 300 fps.25 lb or 2. Stored weld energy ranges from 5 to 50 watt-seconds.6 GHz processor. you may be interested in the new lineup from Ontariobased DALSA Corp. providing up to 720p video quality ■The Imation Link provides wireless connectivity and 1080p for still images. ▲ DO IT YOURSELF THERMOCOUPLES f you have ever said to yourself. ranging from Abbott Labs to Zilog. and the transmitter connects to any standard USB 2.and Mac-compatible device uses a directional antenna to provide a line-of-sight range of up to 30 ft (9 m). they also manufacture and sell some cool ultralight and experimental aircraft based on designs by Earthstar.25 x 6 x 6.

NV GIZMOS THAT BRING YOUR DREAMS TO LIFE! 3 watt LED strip $10.95 12v LED Bars Dynamo Lamp $21.T E C H K N O W L E D G E Y 2 0 11 INDUSTRY AND THE PROFESSION COGSIMA 2011 CONFERENCE SCHEDULED n Feb. The projects are expected to support 6. but Intel is bucking the trend and has announced $6-8 billion in funding for future generations of manufacturing technology in American facilities. 5mm." said Brian Krzanich. Come to think of it. "Our factories produce the most advanced computer technology in the world. You're not alone." Although Intel generates approximately three-fourths of its revenues overseas.00 each Works with all micros and arduino Atmega 8/168/328 Development board $35 Atmel STK500 USB ISP programmer $38 Lego Flashlights Keychain $7. You could be here.95 1 watt Stars $3. But. Surface Mount Robot Kits Are Here: Completely configurable. don't worry.60 RGB $1. and create up to 1. the 2011 IEEE International Multi-Disciplinary Conference on Cognitive Methods in Situation Awareness and Decision Support will be held at the Miami Beach Resort and Spa. plus a new fab plant in Oregon. we can retain a vibrant manufacturing economy here in the United States by focusing on the industries of the future.SurplusGizmos. ▲ O ■ Forget the cold. "Intel makes approximately 10 billion transistors per second. maybe you need to know more about cognitive methods. and these investments will create capacity for innovation we haven't yet imagined. The gigabucks will underwrite next-generation 22 nm manufacturing technology among several existing factories. Visual programming. it maintains three-fourths of its microprocessor manufacturing in the US. The conference is expected to draw only 140 attendees. Great for kids age 10 and up With student workbook.95 Head Lamp $11. expandable.95 LCD Displays Let that light shine in the Graphic and Character next generation! Basic robot animal kits start at $25 5797 NW Cornelius Pass Road Hillsboro Oregon 97124 To see the best deals join our online mailing list or stop by our retail store! www. IR.000 permanent high-tech positions. INTEL INVESTING M oney is tight all over. access to the Miami Beach Golf Club.000 construction jobs. 22-24. If you don't even know what that means.00 Not just bright… Stupid Bright!! 1000’s of LED’s in stock 1. Contrary to conventional wisdom. senior VP and general manager. 3mm.000 to 8.50 UV. and 10mm from $. and modifiable. deepsea fishing. Starting at $95 Ask about school discounts Noritake Vacuum Fluorescent Display Regular $50 now $25. Heated pool.40 1/2 watt $. Intel and the world of technology lie at the heart of this future. scuba.com 503-439-1249 January 2011 13 . and rooms starting at $79. so what? We're talking February and Miami Beach.95 RGB LED Strips 7 Inch Lamp $19.8mm. This new investment commitment will allow the company to maintain its manufacturing employment base at these sites.

too — once you dig in. Spin has features that protect the casual programmer. and other times when it would just be nice in terms of performance improvement. you can find floating point math objects in the Object Exchange (ObEx) that are written in Spin and PASM — the latter being much faster. a whole new world of programming fun opens up for you. it took a few programs before the "Aha!" moment revealed itself. Again. Thankfully. there are a lot of great PASM objects available for us to use. I don’t want to learn Assembly!” With the speed improvement of the Propeller over the BASIC Stamp. So. That said. though.downmagaz. %0000. Like anyone.start(RX1. In working with friends. and this article is not about PASM programming but how to share variables in a complex project. In applications like real-time process control that require floating point math. while giving the advanced programmer the tools for creating code as he or she desires. I like programming in Spin and I think my exposure to other programming languages allowed me to pick it up and adopt it pretty quickly. Personally. Let’s start with a very simple program. There is no person in their right mind that would accuse me of being the brightest bulb in the box and yet I have been able to write PASM code for many applications.SPIN ■ BY JON WILLIAMS ZONE ADVENTURES IN PROPELLER PROGRAMMING FROM SPIN TO PASM AND BACK AGAIN! For those of us that started with the BASIC Stamp and then (perhaps) migrated to the SX via SX/B. I’m getting ahead of myself. As with many programming languages. In the “nice to have” category. such as how to connect Spin code to PASM code when that need arises. TX1. Once you have your own "Aha!" moment. let's start the new year with a tutorial of sorts so that we can get a really firm grip on these processes. as with the floating point libraries. 115_200) pause(1) term.tx(CLS) 14 January 2011 www.com . this will print a random number of stars (asterisk character) on a terminal every 500 mS: obj term : “fullduplexserial” var long stars pub main | lottery. but there will be times when using PASM over Spin is required. I find PASM far friendlier than other flavors of Assembly and am getting better all the time. know what you’re thinking: “He mentioned PASM – man. I got the idea that sharing variables and the cog-to-cog connection is a real challenge. SCOPING THINGS OUT Before we get to the Spin-to-PASM connection. Spin. you don’t have to for everything. this seems to be a stumbling point for many Propeller I newcomers and it is my hope to put a “regular guy” spin (pun intended) on the process to help you create cooler Propeller programs. it’s probably a good idea to talk about variable scope as this will answer the “Why do we have to do it that way?” question before we get there. there can be a bit of a learning curve moving to the Propeller and its native language. You will. it is my opinion that it must be done in PASM. idx term. speed is important and PASM is a big help. so they have to be) and the ~5 microseconds time per Spin instruction is just too coarse. For example: If you want to create a 1-Wire driver. The timing requirements of that protocol are very strict (it’s asynchronous.

It may seem a bit of a hassle to have to write a method to expose the value of a variable in the child object. The only code that has direct access to these variables is in main(). This technique allows objects to update variables in other objects. It should be clear that the key to allowing one method or object to access variables in another — even from another hub — is to share the address of the variable(s) you want to allow access to. if we know that variable’s address. that we should be able to get to any variable from any piece of code. Finally. For example. On the storage side. do we have access to them from our top object in the main() and printstars() methods? No. without the @ symbol. It’s likely that we’d have all sorts of naming conflicts in the project. rendering the use of The @ symbol tells the compiler to move the address of myVariable into pntr. that is to say that any of the methods in the object have access to them. we can also read a value this way: someValue := long[pntr][2] Knowing the base address. The benefit of this strategy is that a child object controls what it reveals to its parent. then. we should declare the method as private. there are generic names I use for local variables that have meaning to me. The ADC object I’m working on (in PASM. It stands to reason. lottery for random numbers and idx for an array index or generic counter.www. some are local. the second word after the location indicated by pntr will be moved into someValue. child objects do not have access to methods in their parent.com/index. we could do this: long[pntr] := someValue This bit of code tells the compiler to write a long (four bytes) to the address stored in pntr. even when normal scope rules would prevent it. we declared an object called term that will handle serial communications to a terminal program. we can see that this object — our top object — has a child object called term that is of a FullDuplexSerial type. Lou. If I wrote a line of code in printstars() that attempted to use lottery or idx. We can . CLK. Let’s skip past this for a moment and come back to it. we will create child object methods that should only be called from within that object. A couple final notes vis-a-vis scope for child objects: A parent has access to those child methods that are declared as public only.init(CS. Variables declared in the VAR section are global to the object. we can get to it from anywhere — even from anther cog. To write a value to a known address.nutsvolts. global variables are only global to the object in which they are defined. From time to time. useless. If we open that object. Let me give you a real-world example: I’m working on a pan/tilt controller for my buddy. In the VAR declaration section. the compiler would complain. we’ll see that it also has a global VAR section. The circuit includes an MCP3208 ADC chip. @joysticks) The first three parameters are the pins used by the January 2011 15 . In the main() method. I want the joysticks to be read every millisecond and automatically update an array that is part of the main program.php?/magazine/article/january2011_SpinZone repeat ?lottery idx := ||lottery // 32 + 1 printstars(idx) pause(500) pub printstars(count) if (count > 0) and (count =< 32) repeat count term.tx(“*”) term. WHAT’S YOUR ADDRESS.. it is the compiler that prevents local variables in one method from being [directly] accessed by another method. Some variables have global scope. Imagine if variables in a child object VAR section became global to a project in which the object is used. What we cannot do is give a local variable the same name as a global variable in the object as this would create a conflict for the compiler. as well as from the printstars() method.tx(CR) SPIN ZONE separate object files. In this particular example. In Lou’s project. all variables for Spin code are stored within the 32K hub RAM. While we’re not doing it now. we can treat the hub RAM as an array. This is what we mean by scope: it refers to the access of a variable. MAN? I have deliberately used the term “direct access” a couple of times — let me explain why. A child object usually provides access to its variables through custom methods. As I indicated earlier. hence runs in another cog) uses the following call to initialize: analog. With these variables defined in a VAR section. You may see code that looks like this: pntr := @myVariable Starting from the top. Of course.. we have two local variables: lottery and idx. we could access stars from the main() method. we have a long called stars. If we know the address of a hub variable. but this is really for the best. I try to give most variables unique names but as in this case. local variables can have the same name as local variables in other methods. as shown above. the local scope prevents conflicts. all Spin variables are stored in the hub RAM. In these cases. We can also write words and bytes. This is tricky at first but really useful. DIO. As I stated earlier. well. In Spin. At the top of the our listing. we would copy the value in myVariable to pntr.

As learning by specific example is best. let’s learn how to connect from Spin to PASM by creating a little LED control mechanism. The first. The next group is what we’re going to be working with. Some objects use a method called start(). the sky is the limit! Okay. Cmd will hold the command passed to the PASM code. is create a PASM program and launch it into its own cog. 16 January 2011 The first variable. Pin is the pin number we want to use. even a PASM cog. In general. A cog running the Spin interpreter can only run pre-compiled Spin byte codes (which are stored in the hub). there is no way to interleave straight PASM code into these programs. 2) We’ll have another command that lets us blink an LED a specific number of times — we can also specify the blink timing (ms). cog. however. and also serves as a flag to indicate when an external process is finished. If it does. the outside code passes a request to the cog through a known hub variable. It is also used to hold the state for direct on/off control. Pulses will hold the pulse count for that feature. Of course. knowing the hub address of joysticks[0] lets me update the array.com . we can’t get there without knowing where we’re going. it requires a little bit of effort to take it from template to working program. You can find that code in __pasm_subs. The PASM code will use the wrword instruction to write a word variable to a hub location. To access this code. What we cannot do. Keep in mind that our Spin code is running in a Spin interpreter (virtual machine is probably a better description) that has been loaded into a cog. we can’t — at least not directly. Propeller newcomers — especially those with Assembly experience in another processor — often ask how to integrate PASM methods into their Spin programs. which could be to write a value to some location in the hub that is known to the outside code. mstix. clear the command (so that the PASM cog will wait for a valid command). we create a Spin interface that allows values to move from Spin to PASM and back again. holds the number of counter ticks per millisecond. but to start to get comfortable connecting Spin to PASM. we’re not blinking LEDs for the sake of blinking LEDs. The way in which this variable is used is very standard in PASM objects created by Parallax and others. Initialization is pretty simple: We set the number of counter ticks per millisecond in mstix.spin.downmagaz. and blinking LEDs is something we can do with virtually any Propeller development setup. Let’s dissect it — though not in order as we find in the listing — to get a handle on how it works. I like creating templates for programs that will adopt a similar structure and I have one for creating subroutines in PASM. Note that in the cognew instruction we pass the address (@) of the code that will be loaded. is directly manipulate a PASM variable from another cog. What we do. timing will hold the pulse timing in milliseconds for that feature. is used to indicate that the PASM cog is loaded. Once we’re comfortable with the connection. access to the variable from outside the cog requires some code. @mstix) + 1 return ok The first thing we need to do is make sure that our object doesn’t already have a cog loaded and running. and this really should be set at run-time to account for the speed at which the Propeller is running. For this program. There was a recent post in the Propeller forum that www. as well as the address of mstix which is the first in our list of working variables.spin (I use the double underscore to force it to the top of the file’s pane in the Propeller Tool). we don’t have to pass any parameters to the init() method: pub init | ok finalize mstix := clkfreq / 1_000 cmd := 0 ok := cog := cognew(@entry. What I hope you grasp by now is that if a variable lives in the hub RAM. We need this for delays. then. Finally. so let’s make some decisions: 1) We’ll have a command that allows us to turn an LED on or off.ADC chip. As with variable access in a PASM cog. we can indirectly manipulate a PASM variable — this requires a gateway to the cog and will be the focus of the rest of this article. Of course. we can get to it from anywhere. and then we start the cog. The cog must read this request and respond as desired. we need to launch the code into its own cog. Remember. The fully commented blinker object is led_ctrl. and to get a result from PASM to Spin. At the top are the variables that are global to the object: var long long long long long long cog mstix cmd pin pulses timing FROM SPIN TO PASM AND BACK When dealing with a variable that’s part of a PASM program. but it handles a lot of the grunt work required to pass commands from Spin to PASM. Note that the forth is prefixed with @ which indicates I want to pass the address of the array called joysticks. As with other PASM objects. though I prefer to use init() as this prevents confusion with I2C commands that are often used with the Propeller. the finalize() method will shut it down.

This same process is used to save the hub addresses for the pin. As mstix is the first in our list of object variables. #4 pinpntr. This allows another command. the code eventually makes it to cmddone where the hub variable is overwritten with zero. tmp1 tmp1. With the variable pointers set up. This causes the program to wait for a non-zero command value. #1 #cmdset tmp1. the next part of our PASM code will wait on and process a command from the hub: getcmd if_z checkcmd if_e if_e cmddone rdlong jmp cmp jmp cmp jmp mov wrlong jmp tmp1. This part is really important. When the command is equal to the value we’re checking for. #1 or outa. 1 for on) from BIT0 of the value stored at pulsepntr. We read the pin number from the hub (stored at the address in pinpntr) into tmp1 and then use that to create a pin mask. tmp1 tmp1. we use the test instruction with a mask value of 1 (BIT0 only). This will be important in many applications. we have to load any variables required by the background process first. We use the same process (clear to zero) at the end of valid commands. the Z flag will be set and the next line will cause the program to jump right back to the top to read the command again. cmdpntr #getcmd wz wz Notice that the first line of code in this method actually checks to see if the PASM cog is busy by looking at the present hub value of cmd. Note that the Z flag is affected by this instruction. The first line reads the long at cmdpntr into tmp1. this is the equivalent of a stacked IF-THEN structure to process the command. This is a good thing as it allows our hard work (the PASM code) to be used by more programmers. when we launch the Assembly code into its own cog we pass the address of mstix in the par register. This gets saved into a PASM variable called cmdpntr. we’re doing it in reverse order. it’s easier to do the ticks-per-millisecond math in Spin. the next variable in our list. pinpntr mov pinmask. ms001. we need to know what the pin number is and the state we want to set it to. par ms001. and blink timing variables. I prefer this style because it is. pinmask jmp #cmddone wc if_c if_nc If you’re new to PASM. I have violated this idea by allowing Spin to “poke” values into the Assembly code before it is launched into its own cog. blink count. To check the state. Back to the Spin code. pinmask andn outa. the cog does have access to the clkfreq register but without built-in division. tmp1 tmp1. The if_e (if equal) condition — when true — causes the program to jump to the appropriate command handler code. Yes. If we add four to what’s in tmp1. If the command passed is not known by the program. tmp1 rdlong tmp1. cmdpntr wz #getcmd tmp1. This provides the connection to the variables we’ve established above: dat org entry mov rdlong add mov add mov add mov add mov 0 tmp1. When the set() method is called. #0 tmp1. Let’s skip down to the top part of the Assembly code for our object. pinmask or dira. we start looking at the value passed by the user and dealing with it. the Z flag will be set (wz must be specified with cmp to set/clear the Z flag). transmitting an IR code or other signal generation). #1 shl pinmask. Let’s look at the Spin interface for controlling an LED (turning it on or off): pub set(p. pulsepntr test tmp1. There is a good reason for the par only access: this allows creators of other languages to adapt our PASM objects. The next step is to load up the variables used and as you can see. There are many ways to do this and I tend to resort to simple. #4 cmdpntr. state) repeat pulses pin := cmd := while (cmd <> 0) := state p 1 As a reminder. Since the top of the PASM code is just waiting for cmd to change to a nonzero value.SPIN ZONE the interface to a PASM-coded object should be through a single variable (usually a variable address) which is passed in the par register (the second parameter in the cognew call). At the label checkcmd. If the command is To activate a pin. #4 pulsepntr. in fact. tmp1 tmp1. simple and allows the use of non-contiguous command values.. the following (super duper easy) PASM code is executed: cmdset rdlong tmp1. #2 #cmdblink tmp1.g. #4 timepntr. we can use it as an anchor point. especially when the background process is somewhat involved (e. In the past. we’ll have the hub address of the object variable called cmd. Tmp1 now holds the address of mstix so we use this with rdlong to move the number of ticks per milliseconds into the cog variable. The PASM code starts by copying par into tmp1 so we can modify it to point to the other variables. The cmp instruction compares what is now in tmp1 with a legal command value. tmp1 zero (no command). The test instruction works like January 2011 17 . We’re going to read the desired state (0 for off.

If you’re brand new to PASM.com GADGET GANGSTER Propeller Platform kits and accessories www. too. That instruction simply acts like a nop and does nothing (except consume one instruction cycle).gadgetgangster.com . I ask you to be kind to yourself and play with this program until the interface makes sense and you can make it bend to your will. www. is affect flags at our direction. you may be wondering what happens when a condition is false. the C flag will receive the desired LED state. if a program was doing a calculation or waiting to get a value back from an external device.) But so is going to the gym and lifting weights to get trim and healthy. by using andn.parallax. blinking LEDs is boring. we can write a “1” to the outa bit for the pin when it’s supposed to be on (high) or zero when it’s off (low). Now. keep spinning and winning with the Propeller! NV JON “JONNYMAC” WILLIAMS jwilliams@efx-tek. INC. we can write a “1” to the desired bit without affecting the others. Go have fun! Until next time. IT’S TIME TO PLAY! I know. What it will do. By using or with the pin mask. As in the Spin interface. you need this foundation. (For me. Note that in either case we always write a “1” to the pin’s bit in the dira register to make it an output.downmagaz. Okay? Okay. we can write a “0” to the desired bit without affecting the others.and but doesn’t affect the value in the destination field (tmp1 in this case). we would write the result back to the hub at a location known by the Spin interface. though.com PARALLAX. though. It includes a demo code that puts the object through its paces and will allow you to experiment. For that to happen. we can clear the command value and allow another to be passed. Using conditional instructions with the C flag. Once the result — if there is one — has been written to the hub. Remember to download the commented listing from Nuts & Volts website. We’re going to do some really fun projects this year and I want you to be able to modify them as your needs differ from mine. IT’S A NEW YEAR.com 18 January 2011 www. the command variable in the hub is the last thing to be modified. yet most of us do it. believe me. I know. You should be able to analyze and understand the command for blinking an LED (cmd = 2) with no trouble now. As we’ve specified modifying the C flag in the test instruction.

January 2011 19 .

the heart muscle causes small electrical changes across your skin. LTS1 Laser Trip Sensor Alarm Kit $29. $44. the ECG1C detects the heartbeat and allows you to accurately display it. MK173 Mini LED Light Chaser Kit $15. Great to help you identify cables or left/right reversals! Stereo RCA line level outputs.95 Bio-Energy Fuel Cell Kit $129.downmagaz. If you experience any cardiac symptoms. Runs on one 3V Li-Ion button cell.95 PL200 Includes 200 very creative fun projects and includes a neat interactive front panel with 2 controls. 200. young and old! A wooden hobby kit that teaches motor and gear driven operation that requires no soldering. Runs on 112-240VAC. Runs on a standard 9V battery.. it changes your voice with a multitude of effects! You can sound just like a robot. Provides 50Hz.95 300-In-One Lab Kit $89. MK171 Voice Changer Kit $14. 100Hz. plus 32 bit digital pink noise. not included. 5A relay makes it simple to interface! Breakaway board to separate sections. & 500 in one electronic labs! ✔ Practical through hole and SMT soldering labs! ✔ Integrated circuit AM/FM radio lab! ✔ Fuel Cell. 1kHz.95 500-In-One Lab Kit $219. Uses 2xCR2025.ramseykits. Use the Tag app in your smart phone to automatically get more information for that specific product. Factory Assembled & Tested ECGP10 Electrocardiogram Re-Usable Probe Patches. model trains. speaker. or shows. PL130A PL200 PL300 PL500 SP1A SM200K AMFM108K KNS10 KNS11 KNS13 KNS1 130-In-One Lab Kit $39. Includes enclosure shown. checking his heart! KNS13 KNS1 KNS11 The documentation with the ECG1C covers everything from the circuit description of the kit to the circuit description of the heart! Multiple “beat” indicators include a bright front panel LED that flashes with the actions of the heart along with an adjustable level audio speaker output that supports both mono and stereo hook-ups. It’s Fun! ✔ Learn and build! ✔ 130.95 Liquid Level Controller Not just an alarm. If you ever wanted an easy way to measure audio levels. but you'll get handson knowledge of the relationship between electrical activity and the human body. and there no better time for that ultimate resolution… taking better care of yourself. and hear it. seek proper medical help immediately! ECG1C Electrocardiogram Heart Monitor Kit With Case & Patches ECG1WT Electrocardiogram Heart Monitor. The three probe wire pick-ups allow for easy application and experimentation without the cumbersome harness normally associated with ECG monitors.95 Through Hole Soldering Lab $9. Solar Hydrogen. Each time the human heart beats.95 Running Light Controller Controls and powers 4 incandescent lights so they appear to “travel” back and forth (Like the hood on KITT!). or high levels! You can also set it to sound an alarm at the high or low condition. Additional patches are available in 10-packs. at the same time..95 Tyrannomech Motorized Kit $17. it will take you right to www.95 Pocket Vu Meter Hand held audio level meter that fits in your pocket! Built-in mic picks up music and audio and displays it on an LED bargraph. and learn exactly how to solder those tiny little components to a board! AMFM108K We not only take you through AM and FM radio theory but we guide you through IC’s. Great for the dance floor or promotional material attention getters.. Operates on a standard 9VDC battery (not included) for safe and simple operation. By monitoring and amplifying these changes.95 Steam Engine & Whistle Simulates the sound of a vintage steam engine locomotive and whistle! Also provides variable “engine speed” as well as volume. but gives you a LED display of low.com . exclusively for our followers! www.com! ✔ ✔ ✔ ✔ Build It! Learn It! Achieve It! Enjoy It! Follow Us and SAVE $$ Follow us on your favorite network site and look for a lot of super deals posted frequently.95 Look for the QR tag like this throughout our catalog and print ads. Runs on a standard 9V battery.95 $7. we have continued that goal! PL130A Gives you 130 different electronic projects together with a comprehensive learning manual describing the theory behind all the projects.95 SM200K Move up to Surface Mount Technology (SMT) soldering. Just like the K8032 to the right does with incandescent lights. Runs on 12-14VAC or 16-18VDC.5W speaker output plus a line level output! Runs on a standard 9V battery. MK134 Steam Engine & Whistle Kit $11. Enjoy learning about the inner workings of the heart while. PL500 The ultimate electronics lab that includes 500 separate projects that cover it all. K8065 Pocket Audio Generator Kit $29. As technology has changed over these years.95 Digital Voice Changer This voice changer kit is a riot! Just like the expensive units you hear the DJ’s use. Either learn from scratch or consider it a refresher. hooked up to the ECG1C after an engineering meeting! (We were all surprised it wasn’t flat lined!) The fully adjustable gain control on the front panel allows the user to custom tune the differential signal picked up by the probes giving you a perfect reading and display every time! 10 hospital grade re-usable probe patches are included together with the matching custom case set shown. giving you a window into the inner workings of the human heart and body! Use the ECG1C to astound your physician with your knowledge of ECG/EKG systems.95 Laser Trip Senser Alarm True laser protects over 500 yards! At last within the reach of the hobbyist. covering the stage-by-stage electronic circuit theory used in the kit to monitor it. K8032 4-Channel Running Light Kit $38. LED display and a meter. while at the same time making it a great learning experience. there’s always a need to hone your soldering skills.95 200-In-One Lab Kit $69. exhibits. and Bio-Energy labs! ✔ Beginner’s non-soldering kits! For over 3 decades we’ve become famous for making electronics fun.95 Fuel Cell Car Science Kit $82. not included. from the basics all the way to digital programming. it is intended for hobbyist usage only. it's another New Year. SP3B Whether young or old. middle. 10kHz. 10-Pack Beginners To Advanced. Makes a great mini attention getter for signs. And there's no better way to do that then to be "heart smart" with our ECG1C Electrocardiogram Heart Monitor! Not only will building an actual ECG be a thrill.95 H-Racer & Refueling Station Kit $144.95 SMT Practical Soldering Lab $22. you can even ad vibrato to your voice! 1. PL300 Jump up to 300 separate projects that start walking you through the learning phase of digital electronics.95 AM/FM IC Lab Kit & Course $34. Provides a 2A 240VAC rated relay output. 300. and even RC cars.. while the ECG1C professionally monitors and displays your heart rhythms and functions. K2639 Liquid Level Controller Kit $21.The Learning Center! Electrocardiogram ECG Heart Monitor ✔ Visible and audible display of your heart rhythm! ✔ Bright LED “Beat” indicator for easy viewing! ✔ Re-usable hospital grade sensors included! ✔ Monitor output for professional scope display ✔ Simple and safe 9V battery operation Well.95 $89.95 Mini LED Light Chaser This little kit flashes six high intensity LEDs sequentially in order. and end up with a neat little project when you’re done! Pocket Audio Generator A perfect test source for stereo line inputs on any amplifier or mixer. this is it! MK146 Pocket Vu Meter Kit $8. PL130A PL200 PL300 SM200K AMFM108K SP3B KSN10 One of our engineers/guinea pigs. Note. When you’re done you’ve built yourself an IC based AM/FM radio that works great! KNS10 With a reversible PEM fuel cell that combines electrolysis and power conversion into a single device you end up building your own fuel cell car! Learn tomorrows technology today! KNS11 Learn alternative fuel technology while you build your own H-Racer car and refueling station! KNS13 Convert ethanol alcohol to run a PEM fuel cell and watch it all work in front of your eyes! KNS1 A great beginner’s kit for the dinosaur enthusiast in the family. and at the touch of a button the steam whistle blows! Includes speaker. or in this case. In addition a monitor output is provided to connect to any standard oscilloscope to view the traditional style ECG/EKG waveforms just like you see in a reall ER or on one of the medical TV shows! See the display above? That’s one of our engineers. & 20kHz tones. this neat kit uses a standard laser pointer (included) to provide both audible and visual alert of a broken path.

In addition. PR2 Broadband RF Preamp $69.95 Air Blasting Ion Generator Generates negative ions along with a hefty blast of fresh air.ramseykits. Assmb. scan and more.ramseykits. and a crystal time base at 20ppm! Tube kits also available. ABM1 Passive Aircraft Receiver Kit $89. Featured on CBS’s Ghost Whisperer to detect the presence of ghosts! Req’s 4 AAA batteries. you can impress your friends with your own laser light show! Audio input modulates the laser display to your favorite music! Adjustable pattern & speed. 2 analog I/O’s! Includes diagnostic software and DLL for use with Windows based systems. or a perfect answer to add a mic to your project. drive UT5AS relays.95 Voice Activated Switch Voice activated (VOX) provides a switched output when it hears a sound.95 Electret Condenser Mic This extremely sensitive 3/8” mic has a built-in FET preamplifier! It’s a great replacement mic. UT5A Through Hole 555 Timer/Osc Kit $24. Runs on USB or 9V power. soft fade-out. seriously cramping my holiday shopping! Visit www. Actually includes TWO totally separate touch circuits on the board! Drives any low voltage load up to 100mA.5 degree bearing indicator with adjustable damping. and a regulated lab power supply! All in one small unit for your bench! It can’t be beat! LAB1U 3-In1 Multifunction Solder Lab $134. Standard RCA unbalanced line level output is provided for easy connection to any amplifier. and we even include coupling cap and a current limiting resistor! Extremely popular! MC1 Mini Electret Condenser Mic Kit $3.ramseykits. SA7 RF Preamp Kit $19. find RF sources.com for all options! DVMS8 Digital Voice Message 8Ch Kit $99.so there! .com RAMSEY ELECTRONICS. MK108 Water Sensor Alarm Kit $6. Drives any speaker. acceleration.95 Touch Switch Touch on. “Hey. Copyright 2011 Ramsey Electronics. messages are available for playback on-demand or automatic continuous looping.95 UT5AS SMT 555 Timer/Osc Kit $26. or FPS. TS1 Touch Switch Kit $9. And who can resist a blinking light and an unlabeled switch! Great fun for your desk.95 Passive Aircraft Monitor The hit of the decade! Our patented receiver hears the entire aircraft band without any tuning! Passive design has no LO. ABCE1 Vintage Radio Battery Elim Kit $199. but takes it to a whole new level! You can configure UT5A it on the fly with easyto-use jumper settings. Runs on 12VDC vehicle or battery power. Includes 5 piece antenna kit.com for version details.95 Tri-Field Meter Kit “See” electrical.95 Doppler Direction Finder Track down jammers and hidden transmitters with ease! 22. (Total message time and frequency response is dependant on selected internal sampling rate.95 USB DMX Interface Control DMX fixtures with your PC via USB! Controls up to 512 DMX channels each with 256 different levels! Uses standard XLR cables. all without any noise! The steady state DC voltage generates 7. availability.5kV DC negative at 400uA. Great for a hands free PTT switch or to turn on a recorder or light! Directly switches relays or low voltage loads up to 100mA. KPH. or sound system. VS1 Voice Switch Kit $9.95 Ultimate 555 Timers This new series builds on the classic UT5 kit. from speed..ramseykits.. Runs on 9-12VDC.95 Broadband RF Preamp Need to “perk-up” your counter or other equipment to read weak signals? This preamp has low noise and yet provides 25dB gain from 1MHz to well over 1GHz. Plus. Check www. auto-dim. even though she made me get this ad copy done in December. producing a LOUD ear shattering raucous racket! Super for car and home alarms as well. NY 14564 (800) 446-2295 (585) 924-4560 We are not responsible for typos.95 OBDII CarChip Pro The incredible OBDII plug-in monitor that has everyone talking! Once plugged into your vehicle it monitors up to 300 hours of trip data. All connections are easily made though terminal blocks. IG7 Ion Generator Kit $64. braking. 8 digital outputs.com/catalog! Prices. printer’s bleed. amplified speaker. Or download the PDF at ww. MB1 Mad Blaster Warble Alarm Kit $9. and “C” control grid supplies. or New Year’s morning headaches! Best 2011 wishes to Robin. Complete with aluminum case. the “Mad Blaster” is the answer. LLS1 Laser Light Show Kit $49. “B” plate. hears the active traffic as it happens! Available kit or factory assembled.95 Speedy Speed Radar Gun Our famous Speedy radar gun teaches you doppler effect the fun way! Digital readout displays in MPH. Output can reach 100mW! Runs on 12 volts AC or DC or the included 110VAC PS. phase inversion. 12/24 hour format. IN14TM Teak Maple Nixie Clock Kit $329. Can be remote controlled via 3-wire BCD with our interface options. magnetic. Runs on 110-240VAC. touch off. and directly interface all timer functions with onboard controls or external signals. LLC.95 Tickle-Stick Shocker The kit has a pulsing 80 volt tickle output and a mischievous blinking LED. PG13 HV Plasma Generator Kit $64.5 KHz.95 Get the brand new 2011 Ramsey Hobby Catalog today! Filled with some of the neatest goodies around! Order yours today. You supply two coffee cans! Runs on 12VDC or our AC125 supply.95 RF Preamplifier The famous RF preamp that’s been written up in the radio & electronics magazines! This super broadband preamp covers 100 KHz to 1000 MHz! Unconditionally stable gain is greater than 16dB while noise is less than 4dB! 50-75 ohm input. and more! 8226 CarChip Pro OBDII Monitor-Asmb $99. specials. The mystery is solved with this kit! K8055 USB Experimenter’s Kit $49. and RF fields as a graphical LED display on the front panel! Use it to detect these fields in your house. Runs on 6-12VDC.95 Sniff-It RF Detector Probe Measure RF with your standard DMM or VOM! This extremely sensitive RF detector probe connects to any voltmeter and allows you to measure RF from 100kHz to over 1GHz! So sensitive it can be used as a RF field strength meter! RF1 Sniff-It RF Detector Probe Kit $27. TS4 Tickle Stick Kit $12.. RPM and a whole lot more. you name it. stupids. terms and conditions.com for the latest pricing. and in many cases a series of three batteries for each radio were required! The new ABCE1 Battery Eliminator gives you an easy way to replace all these batteries with a simple household AC power connection and resurrect your vintage antique radios! Provides “A” filiment. Runs on 12-15 VDC. Reads and resets your check engine light.95 Laser Light Show Just like the big concerts. a standard 4-8 ohm speaker output is provided to directly drive a monitor speaker. Runs on 6-12 VDC. It provides up to 8 minutes of digital storage at a frequency response up to 3. Many classic radios operated on batteries only. therefore can be used on board aircraft! Perfect for airshows. it’s your choice with this little kit! Uses CMOS technology. mixer.Vintage Battery Eliminator Collectors come across some great deals on antique battery-powered radios.95 Water Sensor Alarm This little $7 kit can really “bail you out”! Simply mount the alarm where you want to detect water level problems (sump pump)! When the water touches the contacts the alarm goes off! Sensor can even be remotely located. or momentary touch hold.95 3-In-1 Multifunction Lab The handiest item for your bench! Includes a RoHS compliant temp controlled soldering station. Includes Light Player software for easy control. which are all isolated from each other.. Runs on 6-12 VDC. I told you not to touch!” Runs on 3-6 VDC. we've replaced the ceramic capacitor of other timer kits with a Mylar capacitor which keeps your timings stable over a much wider range of voltages! Available in through hole or surface mount versions! Visit www. and specifications are subject to change. LLC 590 Fishers Station Drive Victor. and that’s LOTS of ions! Includes 7 wind tubes for max air! Runs on 12-15VDC. SG7 Speed Radar Gun Kit $69. TFM3C Tri-Field Meter Kit $74. K8062 USB DMX Interface Controller Kit $67.95 Digital Message System The third generation of Ramsey digital voice storage kits! We started with the latest digital voice storage technology. Runs on a standard 9V battery. DDF1 Doppler Direction Finder Kit $169.ramseykits. but how to power them is a real problem. digital multimeter.95 DVMS8WT Assembled DVMS8 $149. Powered by 3-15VDC.95 Mad Blaster Warble Alarm If you need to simply get attention.95 Retro Nixie Tube Clock Genuine Nixie tubes popular in the 50’s brought back in one of the neatest digital clocks around today! Hand made teak maple base. 800-446-2295 www. Multiple fixtures can be simply daisy chained.95 HV Plasma Generator Generate 2” sparks to a handheld screwdriver! Light fluorescent tubes without wires! This plasma generator creates up to 25kV at 20kHz from a solid state circuit! Build plasma bulbs from regular bulbs and more! Runs on 16VAC or 5-24VDC.95 USB Experimenter’s Kit Get hands-on experience developing USB interfaces! 5 digital inputs.) Once recorded.

Send all questions and comments to: Q&A@nutsvolts. software. like: ✓ ● Cat 5 Cable Tester ✓ ● Low Battery Circuit ✓ ● Model Railroad Sequencer problem and time waster is knowing which “end” needs to be fixed. Sometimes it’s so difficult to ID the conductor colors in a plug that we end up cutting off and CAT 5 CABLE TESTER I do quite a bit of CAT-5/6 cable installations for telephone and data networks. troubleshooting. or shorted circuits. circuits. Feel free to participate with your questions. or open. I answer questions about all aspects of electronics. There are quite a number of LAN/telephone circuit testers on the market which are able to identify which pair or wire is shorted.QA & ■ WITH RUSSELL KINCAID In this column.com . including computer hardware. comments. Although I teach my crew to be very careful when attaching a RJ-45 plug or jack.com WHAT’S UP: Join us as we delve into the basics of electronics as applied to every day problems.downmagaz. or suggestions. crossed. open. Q invariably we end up with a few cables with crossed. but the biggest ■ FIGURE 1 22 January 2011 www. and anything else of interest to the hobbyist. electronic theory. One of Murphy’s Laws states that we will spend 20 minutes going to and inspecting the wrong end.

There are two tests: a short test where the microcontroller makes RB0 (pin 6) high and the other three (RB1. say.6 HIGH PORTA. When pair 5 and 4 is load tested.7=0 THEN GOTO PAIR3 IF CMCON.7=1 THEN GOSUB CHECK PAIR2: PORTB = 13 'SETS RB1 LOW.85 (short circuit).15 volts.6=0 AND CMCON.6 = 0 THEN LOW PORTA. Q3. The nominal impedance of 100 ohms will be off for pair 2 and pair 3. so that has to be checked. Even if tests show that pin 1 of end A connects to pin 1 of end B.7=1 THEN GOSUB CHECK PORTB = 0 HIGH PORTA. It seems to me that a circuit tester with a little more processing power and smarts could also determine if.15. RB1-3 LOW PORTB = 1 IF PORTB.7 REM CABLE PAIR 4 WAS TESTED AGAINST ALL OTHERS PREVIOUSLY GOSUB WAITF LOAD_TEST: A 'SETS RB0 LOW.6=1 OR CMCON.7=1 THEN GOSUB CHECK PAIR3: 'SETS RB2 LOW. Sometimes the mistake even gets repeated.6 'OPEN CIRCUIT IF CMCON.7 'RESET THE FAULT LEDs FOR THE NEXT TEST HIGH PORTA.php?/magazine/article/january2011_QA reconnecting both ends. wire 1 is on pin 1 at end “A” but on pin 2 at end “B. RB3) low.5 = 0 'DON'T PROCEED UNTIL THE FINGER IS OFF GOTO WAITF 'THE BUTTON WEND RETURN ■ FIGURE END 2 In the CAT specs. Short circuits are most likely to occur between adjacent pins but if a microprocessor is used.15 (open circuit). The second test is a load test where RB0 is made low and RB1. 1&3 LOW HIGH PORTA.6 = 1 THEN LOW PORTA.5 = 0 THEN LOW PORTA.7 IF PORTB.6=0 AND CMCON. The test stops when a failure occurs so you can see if it was a load test (D5 lighted) or a short test (D6 lighted). A CAT-5/6 cable tester to ID the miswired end would sure be welcomed and a very worthwhile project to build. the collector of Q1 will be low even though it is not turned on and the connection to RB4 will register a failed test.7=1 THEN GOSUB CHECK PAIR4: PORTB = 7 'SETS RB3 LOW. Q5 and Q1 are turned on and the transistors in the other cable pairs are turned off.4 = 1 THEN GOTO SHORT2 IF PORTB. 7 and 8 are pairs. Any help would be greatly appreciated. 5 and 4.5 = 1 THEN GOTO SHORT3 IF PORTB. both comparator outputs are low and the test is good.2&3 LOW HIGH PORTA.6=1 OR CMCON. Q2. RB0.0 * '* Notes : TWO TESTS ARE DONE: A SHORT TEST AND A LOAD TEST * '* : * '**************************************************************** REM DEVICE = 16F627A '1 = INPUT.www. RB0.85 and 1. 0 = OUTPUT FOR PORT B TRISB = %11110000 CMCON = %0100 'COMPARATORS SET AS TWO INDEPENDENT REM THE INTERNAL VOLTAGE REFERENCE IS NOT USED SHORT_TEST: 'SETS RB0 HIGH.” Yes. QU E ST I O N S & A N S W E R S '**************************************************************** '* Name : CAT 5/6 CABLE TESTER * '* Author : RUSS KINCAID * '* Notice : KINCAID ENGINEERING * '* Date : 10/20/2010 * '* Version : 1.6=0 AND CMCON.5 = 1 GOTO WAITF WEND WHILE PORTA. D7 is turned on. The Q5 circuit is a constant current of 10 mA driving pin 2 of J2. pins 1 and 2.6=1 OR CMCON. This will develop one volt across R1 in the receiving termination which is fed through RLY1 to a window comparator at pins 2 and 10 of IC1. If the signal is between 0.7=0 THEN GOTO PAIR2 IF CMCON. OTHERS HIGH PAUSE 10 IF CMCON. RB2. No one seems to make a tester that can ID which end of the cable needs fixing.7 'SHORT INDICATION GOSUB WAITF SHORT2: PORTB = 2 'SETS RB1 HIGH. and RB3 are high. 3 and 6. RB2.nutsvolts.7 'TURN OFF FAULT LEDS. OTHERS HIGH PAUSE 10 IF CMCON. D8 is turned on. and Q4 are turned on making those three cable pairs low. but most good technicians know how to keep that in perspective for the type of circuit being connected and tested.com/index. respectively. OTHERS HIGH PORTB = 11 PAUSE 10 IF CMCON. END OF TEST STOP CHECK: IF CMCON. SET AS OUTPUT. I was intrigued by the problem of a comprehensive cable test. so I came up with the schematic in Figure 1. If the signal is above 1.6 RETURN WAITF: WHILE PORTA. if the signal is below 0. I don’t know why it is that way. 0 = OUTPUT FOR PORT A TRISA = %00101111 REM RA4 IS UNUSED.7 'RESET THE FAULT LED IF PORTB. if there is no time delay.6=1 OR CMCON.. RB2 is low and the circuit returns to pin 4 of J2.7 'SHORT CIRCUIT GOSUB WAITF HIGH PORTA. Pins 1 and 17 of IC1 are the other comparator inputs which are biased at 0.6=0 AND CMCON.4 = 0 THEN LOW PORTA.6 = 1 THEN GOTO LOAD_TEST 'SHORT INDICATION IF PORTB. RA5 IS INPUT ONLY BY DESIGN '1 = INPUT. RB1 is set low and the circuit returns to pin 6 of J2. If either pin 1 or pin 2 of J2 or J1 is shorted to one of the low pairs. it is just as easy to check every pin. — Vonn Hockenberger You would need a time delay reflectometer to determine which end has the error.7 'SHORT INDICATION GOSUB WAITF SHORT3: PORTB = 4 'SETS RB2 HIGH.85 and 1. The program is in Figure 2 and is mostly selfJanuary 2011 23 .7=0 THEN GOTO PAIR4 IF CMCON. OTHERS HIGH PORTB = 14 HIGH PORTA. but you have to be aware that when pair 3 and 6 is load tested.7 'TIME FOR COMPARATORS TO SETTLE PAUSE 10 IF CMCON.7=0 THEN END IF CMCON. etc. it could be that wire 1 of pair 2 has been swapped with wire 1 of pair 3 on both ends. If I can make it work. the problem is at the transmitter end. there are considerations for “cross-over” and data “A”/“B” circuit connections.7 = 1 THEN LOW PORTA. This test will not detect a short between pins 1 and 2. but that will be checked in the next test. I plan to have a continue button so the operator can check for more faults.

Computation of the ■ FIGURE 5 resistor values is a little complicated but straightforward: R1 supplies 5 mA to the green LED which is used as a voltage reference. You might be better advised to change the sensor to one that is compatible with the IR LED. The source voltage is 12V and the LED has a voltage drop of 1. Cost and simplicity is a factor for this. it needs to reach about two inches. Now we have to solve two simultaneous equations in R4. represents the battery at Vd. when the battery is 12 volts. I have had success with RadioShack components for a distance of six inches.2V. LOW BATTERY CIRCUIT I am trying to design a low battery cutoff for a project that uses 12V SLA (sealed lead-acid) batteries. R6. R3. Also. then Rb = 17. R6.86 You can solve this with a BASIC program. I tried using LEDs from 20 mA to 100 mA. then kick back on when the battery reaches 12V.■ FIGURE 4 ■ FIGURE 3 explanatory. Vd = 2V.94K. Since the LED voltage is 2. and by inspection. I realize that I did not answer your question but I will think about a time delay reflectometer and perhaps have something in a later issue. R6 = 111. but the cut in/cut out voltage was too low.46K. and it still doesn’t work that great. when the battery A 24 Q January 2011 www.3K and Vbias = 1.com . The LED can produce much higher peak power when pulsed. My understanding is that you get more power by pulsing the LED than by using a constant source. What it needs to do is send light in the 880 nm wavelength to a A This circuit (Figure 3) has hysteresis such that it switches at 12V and 11V of the battery.2*R6/(R4 + R6) = 1. so how it would respond to pulses is unknown. is needed to get 1.downmagaz.83V. Rb is the parallel combination of R4. I don’t get the distance that I need. Choose Rf to be one meg. The voltage divider. One of the items it is powering will drain the battery lower than the charger can recover.3K and 2. so I don’t want to have any external switches or buttons if possible. as well.86V. and R5. or Eureka gives the solution: R4 = 20.86V. I’d also like this to be in a module form that I can bury inside the item.2V. LED REPLACEMENT FOR AN INCANDESCENT LAMP I want to replace an incandescent lamp with an LED. but R5 is large enough to be neglected which simplifies the calculation of R4 and R6. but the average power cannot exceed the DC rating of the device. assumed to be 2. Vd = 1. I tried a lot of different IR LEDs but I’m still having trouble getting the LED light source to equal the incandescent lamp. the voltage divider. what about the viewing angle? Do I want more or less for longer distance? I’m guessing less because it would be more concentrated. R6: R4*R6/(R4 + R6) = 17. Garage door systems work over a distance of 10 feet so two inches should not be a problem. The lamp is obsolete. I need the unit to cut off output current when the battery reaches around 11 volts. R4. Would that give me a greater distance? Any help will be appreciated. photo diode. I tried using simple SPDT relays. Narrowing the beam angle does increase the power and you can do that optically. Standard 1% values that will work are 20K and 113K. — Scott Bradford Q is 11 volts.8V at 100 mA DC. Now it is useful to simplify the circuit as in Figure 4. R2. — Jeff Miller Your system was designed to work with a constant incandescent source.

not so. My layout has 10 amusement park rides. all. The metal standoff of the RadioShack receiver may have some heatsink function. 10 . Any suggestions? — Dominick Senna A January 2011 25 . Perhaps a loop that turns on different numbers of rides in a pseudo random fashion will work. but that only turns on one at a time. '**************************************************************** one or the other or both REM DEVICE = 16F627A 'DISABLE ANALOG INPUTS CMCON = 7 are always on. each powered with their own wall wart power supply.. RA1 OUTPUT. and output). I recommend using the 276-640 IC receiver which has a logic level output. NV seconds per period. you will have a relay and because they are not programmable.1 = 0 THEN WAITE = 15000 IF PORTA. you will need to find a source of 5 VDC to power the receiver. '* :SECONDS. I don’t know how to The schematic in Figure 6 is randomly change the output ports partial. 5. or none could be on at a time.0 * '* Notes :THERE ARE 10 OUTPUTS. If that doesn’t work.0 = 0 THEN WAITE = 10000 '10 SECONDS relay is rated at 350 volts. I had 'RA0. The rides should run for a fixed period. CAN'T BE A WAITE VAR WORD process does not include VARIABLE 'MAXIMUM VALUE IS 255 SEQ VAR BYTE zero. two inches will be a piece of cake. The varistor PORTB = SEQ PORTA = A protects the relay from PAUSE WAITE the inductive kick when GOTO START ■ FIGURE 7 END it shuts off. OR 20 * only the low two bits. like 10-15 Q and use a one of 10 decoder. see Figure 5. If your sensor is two leaded. so I would not cut it off but bend it out of the way and use a dab of silicone to mount the receiver. The IF PORTA. I '* Date : 10/26/2010 * was surprised to see that '* Version : 1. I would like to build a sequencer that would turn the rides on randomly . there is definitely a problem elsewhere in the receiving circuit. The phototransistor (RadioShack 276-145) will plug right in the place of the photodiode.QU E ST I O N S & A N S W E R S What do you know about the sensor? Do you know the part number? How many leads does it have? Is it in a TO-92 package or T-1 3/4 or other? If you install a 38 kHz IR receiver and pulse the LED at 38 kHz. and S3 allow you to change the cycle time. those two bits A VAR BYTE would be zero a lot of START: '5 SECONDS WAITE = 5000 the time. varistor on all 10 outputs. Every circuit I think of does not produce random results. S2. RANDOMLY SEQUENCED. ■ FIGURE 6 MODEL RAILROAD SEQUENCER Love your previous model railroad circuits.15. One. The I could produce a random BCD code switches S1. like an actual amusement park.RA6. microcontroller. THE TIME * even though port A uses '* :BETWEEN SEQUENCES IS PROGRAMABLE.. all it does is '* Author : Russ Kincaid * restart the sequence. '15 SECONDS IF PORTA. The reset button is not '**************************************************************** '* Name : MODEL TRAIN SEQUENCER * needed.2 = 0 THEN WAITE = 20000 '20 SECONDS 100 mA which should be adequate in the primary RANDOM SEQ RANDOM A circuit. RadioShack part number 276-640 is a three lead receiver (power. In that case. ground. see Figure The BASIC language 6 and the program in Figure 7 (I RANDOM command went through a number of more comes to mind which complicated programs before this implies the use of a one). RA7 OUTPUT OTHERS TRISA = %00111100 thought that even INPUT 'ALL OUTPUTS TRISB = 0 though the random 'WAIT IS A RESERVED WORD. You will need a 38 kHz transmitter.

com/y-series.com/yseries.aspx • Available in LCD footprints • Serial and parallel interfaces • Selectable font sizes • Custom font table: 224 char.noritake-elec.com today for your free.com . 2635 Clearbrook Drive Arlington Heights.htm Shop online: noritake-vfd.Y Series VFD Module • Bright VFD technology • Brightness boost • Highlight function • More characters www. no obligation quote! 26 January 2011 www.iitmetalfab.downmagaz. IL 60005 (847) 439 .9020 Star Bright Various VFD modules available * Quality Quick Turn Sheet Metal Products & Precision Machined Parts * No Minimum Quantity Restrictions * Quote in 24 Hours or Less! * Several Metallic & Non-Metallic Materials in Stock Visit www.

How did Archer solve this very different assignment? Go to www.com/adventure1 1-800-831-4242 | www. The puzzle was created by Forrest M. www.What is the missing component? FREE! A fictional engineer we'll call John Archer spent a decade designing hardware and writing code for microprocessor-controlled games manufactured by a toy company. Citing a market for "back to basics" toys. Mims III Sign up for our e-newsletter and get a FREE comic book.com/search9 to see if you are correct. or other reasonablysafe projectile. rubber ball.com January 2011 27 .The catch: The game should not use a battery or external source of power.Jameco. the company president said he wanted to introduce a new line of simple games that would flash a red LED when a target was struck by a rubber band.Jameco.Jameco.

as well as calibration of test equipment. CHIPINO is programmed directly with an open sourced PICkit 2 or clone programmer. B 28 January 2011 www.cc RESISTANCE/ CAPACITANCE ranges. from 1 Ω to over 11 MΩ in one Ω steps. the RDB-10 is a compact. Pascal. from 100 pF to over 11 µF in 100 pF steps. For more information. along with a proto-shield that has a breadboard for building custom circuitry to interface to the CHIPINO. The result was a community soup (Chipino soup) everyone could share. offers five decades of capacitance ranges. or as a fully assembled module.com T NEW ADDITIONS TO GEARBOXES aneBots announces new additions to their highly successful P60 family of gearboxes. This programming method allows a user to plug any blank PIC16F or PIC18F 28-pin 0. where fisherman were asked to “chip in” at the end of the day from their daily catch. C. connector spacing.95 for a fully assembled module.globalspecialties.300” pitch into it. Designed with accuracy to meet the needs of industry and education alike. a kit of parts. Easy-to-use slide switches allow for straightforward addition and subtraction of resistance values. Pricing is $24. and most of the microcontroller I/O functions found on the popular Arduino. Also designed with accuracy for aiding in engineering design and testing. The CHIPINO name comes from an Italian fishing town in San Francisco. contact: CHIPAXE Web: www.com or http://chipino. The CHIPINO — developed by the Chipaxe Team — chipaxe. The CDB-10 has easy-to-use slide switches and the same rugged enclosure. BASIC. contact: Global Specialties Web: www. In addition to the stock gearboxes. CHIPINO.chipaxe.com matches the board outline. The unit is housed in a rugged enclosure with an impactresistant rubber boot. mounting holes. Flowcode.NEW P R O D U CHIPINO ■ HARDWARE ■ SOFTWARE ■ GADGETS ■ TOOLS C T S MODULE he CHIPINO is a Microchip PICbased module with the Arduino connection scheme. The CHIPINO is offered as a bare board. RDB-10 is a passive device that requires no power source. he model CDB-10 is a handheld capacitance decade box that creates a specific capacitance value using a combination of switches.downmagaz. CA. does this same thing by offering an open source platform to build upon and then share application ideas.com . The CHIPINO comes with a PIC16F886 along with the Microchip MPLAB IDE and the HI-TECH C compiler. convenient tool for aiding in engineering design and testing. You also get the Simple C library from Chuck Hellebuyck’s future book Beginner’s Guide to Embedded C Programming Volume 3 that makes writing C programs as easy as BASIC or Arduino. T DECADE BOX he model RDB-10 from Global Specialties is a handheld resistance decade box that creates a specific resistance value using a combination of switches. The CHIPINO offers PIC users the opportunity to use existing compiler and programming tools with all the shields available to the open source world of Arduino. and program in Assembly. It offers seven decades of resistance For more information. Starter kits that include a PICkit 2 clone programmer are also available. or any other compiler that T supports the PIC.

5” x 1.99 (qty. The rKEY can be mounted behind various materials — R plastics. 100).35” x1. hobby. RS-540. RS-390. and assembled in the US at their Colorado facility. additional colors will be available for a customized look. and RS-775 sized motors.5” footprint.5” x 1. The P60 has always been designed. Short.com continued on page 49 BaneBots Web: www. Another aspect of the P60 gearboxes is that they can be reconfigured to meet a customer’s changing needs as a project evolves. and long shafts give users more flexibility in design.99 each (qty. 1) and $8. The rKEY switch (1. RS-550. and the P60 gearboxes can be ordered greased or ungreased. manufactured.roguerobotics. wood. New.75 has a 1. With a new total of 34 ratios — ranging from 3:1 to 672:1 — the gearboxes can be customized in a number of ways. The rKEY-1. Many of the new options are a result of customer feedback and requests.4. For more information. For more information.com Web: www. The capacitive switches are selfcalibrating and extremely robust for harsh environments. multiple mounting patterns add to the diversity of applications and ease of use. commercial. Steel ring gear options give extra strength for those with more demanding operations.5 has a 1. as well. BaneBots has all the gearbox parts available separately so that the ratios can be changed without purchasing a whole new gearbox. If you own one P60. RS-395. and a hex shaft has also been added to the line-up. and industrial markets. and glass — to a suggested maximum thickness of 0. The P60 shafts will now be available in 3/8” in addition to the original 1/2” diameter. it is like owning several. P60 gearboxes have been applied in an array of settings.com January 2011 29 . Motors can be purchased either mounted or unmounted.” and have an operating temperature range of –40C to +85C. The rKEY capacitive switches allow OEM designers and hobbyists to quickly and easily add capacitive touch switches to their projects and products. standard.■ H A R D W A R E ■ T O O L S ■ G A D G E T S literally thousands of custom configurations will be available starting in January. contact: rKEY™ ROBUST CAPACITIVE SWITCH FOR INTERACTIVE DESIGNS ogue Robotics introduces the new rKEY™ capacitive switch product series. BaneBots also has increased the range of motor support to include industry standard RS-380.banebots.25” footprint.25”) footprint boards.35”) module retails for $11. Despite their compact size. these gearboxes pack a lot into a small package.5” x 1.0 has a 1” x 1” key area and a 1. In the near future.25 x 1. and the rKEY. The rKEY capacitive switch series are compact (starting at 2” by 2” down to 1. providing an easy-to-use nonmechanical touch switch for environmentally sealed environments and interactive displays such as music playback stations. Components are CNC machined for tight tolerances and contain cold rolled steel gears and hardened 4140 steel carrier plates. as well as popular hobby motors such as Speed 400 and rock crawler motors. contact: Rogue Robotics 416-707-3745 Email: sales@roguerobotics. the rKEY-1.35” key area and a 2” x 2” footprint. including the educational.

2. How The Pendulum Works Our chaotic pendulum consists of three subsystems: the mechanical pendulum itself. 3. CLK is generated by the U3 relaxation oscillator comprised of U3 (8. C7. this device (shown in Figure 1) has some residual order – but we can’t see it readily when plotted against time. and 5. and fundamentally unpredictable. R14).1. C7. is applied to CLK input U1-3 only if the switch closes when capacitors (C6. and discharges the capacitors through this electromagnet to repel the plumb bob and sustain its motion. rapid drips from a faucet. C3. and 10).The completed chaotic oscillator. If /RESET is high at U1-1 when U1 is clocked at pin 3. A Simple Chaotic Oscillator You Can Build You can build a simple. Together. electronically-driven pendulum that can produce automatic. 4. stable patches of commuter gridlock. 30 January 2011 www. Magnetic switch SW1 detects passage of the plumb bob magnet C over the center of coil L1.com . perpetual chaotic motions showing no discernable regularities. then /Q goes low — this turns off the CLK and also charges C2 through R3. a power supply that charges capacitors and powers the electronics. CLK. mounted on a wooden arm. Refer to Figures 3. we will explore how this kind of hidden order can be found and displayed. C2 and R3 create a delay with a time constant of about 50 milliseconds. The driver electronics detect when the plumb bob is transiting a central electromagnet. the unseen vortices of air tumbling off the back of your sedan. Transformer T1 supplies a nominal secondary voltage of 28 VAC RMS to bridge rectifier BR1 which charges capacitor bank (C6. A 1 kHz clocking square wave. and R5. Nonetheless. and C8) are fully charged. The Pendulum Driver Electronics. with a doughnut-shaped permanent magnet serving as the plumb bob. In a future article. the colliding. “Planetary” or satellite button magnets can be placed by the experimenter at a variety of different radii and angles relative to the central electromagnet to configure the general size and character of the plumb bob’s chaotic motion. C8) through power resistors (R13. 9. Many times the governing relationships of these fluids will show domains where they can be chaotic.By Norm Looper EXPLORE ELECTRONIC CHAOS Chaos is best viewed as a form of “constrained randomness” and is all around us: bubbling cells of hot oatmeal. Resistor R15 and shunt regulator VR1 provide a (+) five volt regulated rail for the digital electronics. Electronic Operation The Pendulum Power Supply Refer to the schematic in Figure 2. after which U2 (3. ■ FIGURE 1.downmagaz. and the pendulum driver electronics. and the movement of monetary “fluids” in distressed financial markets.

R9) — attenuate VCAP down to the required trigger level (1.com/index. Schematic of the pendulum power supply. this prevents retriggering of the flip-flop from occurring until storage capacitors (C6.nutsvolts.67 volts on U4-2) and threshold level (3. As we see in Figures 4 and 5.2) displays the versatility of the TLC555 CMOS timer when U3 is used in the astable mode — we use the timer to control the charge and discharge of voltages much greater than its own operating voltage of (+) five volts. the VCAP waveform lags the timer output. U4 (Figure 3. C7. Two voltage divider sets — (R6. This delay gives the plumb bob C time to travel off-center so that L1 can give it an optimal sideways magnetic “push. C8) are fully charged. Note that output U4-3.” ■ FIGURE 3. 6) transitions high.1. controls the resetting of the flip-flop at U1-1. acting through U2-8. ■ FIGURE 3. R7) and (R8. at U4-3 by the January 2011 31 .www. Vo.php?/magazine/article/january2011_Looper ■ FIGURE 2.33 volts on U4-6) for astable operation.2. Timer section of the pendulum driver electronics. Logic section of the pendulum driver electronics. turning on MOSFET Q1 and discharging VCAP through solenoid L1.

Timing ■ FIGURE 4.50 millisecond delay introduced by R3 and C2. use the same dowel stock. 13) provides a short 50 microsecond “housekeeping” delay to prevent SETD from setting the flip-flop’s D input (U1-2) high while /RESET at U1-1 is bringing the flip-flop out of reset. Cantilever F will form a snug fit through the hole in slide G. 32 January 2011 www. Note also that U2 (11. 12. Do not use an “S” hook to connect the pendulum arm to the pendulum cantileve. but it will still be moveable as needed. How To Make It: Assemble The Pendulum Arm See Figures 6. The thumbscrew H will self-thread through the soft plastic of the slide. Alternatively.com . Note: The chain is necessary. pendulum driver electronics. ■ FIGURE 5.2. Pendulum post I and the three stanchions.downmagaz. Lightly sand around the bottom circumference of A and then cement a doughnut magnet C with a 3/8” diameter hole snugly on to the bottom with generalpurpose cement. ■ FIGURE 6.2 to fabricate the relevant parts. ■ FIGURE 6.1 and 6.1. S. These involve only simple cuts and a few drilled holes. a hole for a wood screw has been provided. A hand vice works well for the drill. since this forces the pendulum into a largely fixed plane of oscillation. Pendulum arm parts.Timing diagram of the photograph of the pendulum driver electronics.The cantilever slide (G).

To orient the correct surface of the button magnets pointing upward. then carefully lift up each remaining corner of U and apply ample wood glue to the bottom of each stanchion S.Assemble The Pendulum Platform And Base The following order of assembly is critical to obtain a good fit of the parts because the “egg shell” plastic platform U is cut from a fluorescent light ceiling diffuser and is injection molded to exact dimensions. insert three wood back through the three stanchion holes in the bottom of stanchions. Visually insure that the perimeter of platform U is parallel to the sides of base T. 7. Drilling the base (T). on to the three stanchions.2. As shown in Figure 8. flange down. Glue post I into the drilled hole. Then slide reducer R down snuggly on to base T and cement it to T with a small amount of cement under the flange of R. stanchions firmly onto base T by January 2011 33 .) Cut platform U from The platform (U).) As shown in Figure 9. Fabricate the button magnets as shown in Figure 7. Bring the top of each stanchion flush with the top of U. R. using the bottom of doughnut magnet C. Slide three reducers.2. to base T by drilling Continuing with Figure 9. into the corner closed cells of platform U. the diffuser stock as 16 x 16 complete squares using sharp flush-cut pliers. When dry. slide reducer R on to the bottom of post I. ■ FIGURE 7. drill the base T from pre-cut hardwood stock. and allow the assembly to dry. Set it aside to dry in a protected place. lightly sand the stanchions around the top 1/2 inch of their circumferences to produce a tight but sliding fit. (See Figure ■ FIGURE 7. Button magnet fabrication using cap plugs. (See the Parts List. Set a few books on the small adjustments to post I to insure that it is vertical in platform to apply pressure. 1. Keep the stanchions inserted in U. V1.U up against post I so that I is flush with the sides of the open corner square in platform U. If necessary. use a vertical spirit level to make pushing down on platform U. Slide the entire assembly of S. flush with the bottom of base T.1. Before the glue dries. make sure the button magnets are installed in the cap plugs so that the top side of each button REPELS the BOTTOM of magnet C in its mounted orientation. two directions. reseating the ■ FIGURE 8. S. attach three feet.

Products. 3/4"x 1/2" Reducer bushings.D. polyethelene.com .D. x inch O.2. Size 6-X cap plug RS: Catalog No. AH. Reducer bushings. 10A/250V Fuse. E (None) (None) D C (None) G FS1 F1 (None) (None) SW1 T1 SW1 (or L1) QTY 1 1 1 3 1 1 4 2 4 4 1 2 8 6 1 1 1 1 2 1 1 4 1 4 MFG/PART # Revell SKU 307232 Often stocked. Dress the leads down and out to the left side of J and secure with PVC cement. 40. Cut wires M1 and M2 to 250 mm length using 30 AWG solid wire and strip/sand back the insulation from one end of each wire about 1/2 inch. 64-1888 RS: Calalog No. pan head Phillips. With an emergent lead length of 250 mm (10 inches) shown. jewelry. AH HD. Ask for 10 pcs Magnets. Sched. LO HD. 8 mm (5/16 inch) diameter Wood screw. panel mt. FY DK. magnetic. PVC. 12 mm x 12" x 12".platform T. Chain. Alternate winding forms are possible. AH. ceramic. H/D: U546021 SOURCE Dura USA D2466 Dura USA D2466 (any) Crown Bolt 24961 or equiv. For line and signal wiring Line cord. 5/8 inch diameter wood dowel Stanchion S. LO HD. R. with PCB pins Bumpers. hex body. LO. irrigation. aluminum. 30 AWG. cartridge. 3/8 inch diameter wood dowel Pendulum cantilever F 5/16 inch wood dowel . Type T. with two 4/40 screws each. LO FY HD. RS JA RS RS DK ON RS T1 V1 1 4 34 January 2011 www. LO HD. LO RS MI or phone 908-810-1111 RS RS DK. six feet Closed end spade lug for safety (green) wire to enclosure Standoffs." 3/8 inch I. 1" long x approx. Note 32 AWG is preferred Transformer. AH.. 30) Tamura 3FS-524 or Microtran Shepherd Hdwr. but you must achieve the specified turns to create an adequate magnetic field. five pack Magnet. EI. and EJ connections on Base T Wire.5" Screw eyes. EH. RS. and seat them firmly on to base T. RS HD. inc. Wipe away any excess wood cement immediately with a damp rag. 8 " x 6 " x 3. MI or phone 1-800-MICHAELS HD HD. or equiv. ceramic.1 and 10. #8 x 1-1/4 inches long Enclosure. it is important to determine which end will activate the switch closure when PARTS LIST DESCRIPTION Mechanical Plywood Base T. bending the soldered ribbons as shown in Figures 10. screw.2. Attach a foot V1 to the bottom of post I also. 120 VAC to 24 VAC. 64-1883 DK: F1484-ND. bayonet (size) Grommet. of wood cement neatly to the bottom flanges of each reducer. round.. irrigation. Sched. fine scale. magnet. AH Post I mat'l. HD. LMB-HEEGER LMB # TF-783 Crown Bolt #214. Wiring The Switch And Winding The Solenoid The coil form can be constructed from two PVC irrigation reducers back-to-back as shown in Figure 10. and attaching each foot with hardware V2 and V3. LO.D. 40. (scrap piece) Fuse holder. two pieces. Assembly of the base and platform. #3AG.D. 1/2 inch O. 1/2" x 1/4" Washer. RS: 270-364 or FY: NTE 74-FH6-8 Various Various JA: 38009 RS: 64-043 (10 pieces) RS: 176-195 SRC Devices Dyad® DK: 420-1047-ND EL175Pk/10 (10 pieces) RS: 28-1345 (3 gauges. "doughnut. Cap plugs. 64-1883 Hirschberg & Schutz Item No. metal. Platform U.D. AH. Since switch L (SW1) will be mounted vertically. LO. ceramic. white eggcrate louver Post I. AH. 3/8" dia. 244 cm (96 inches) Magnet. PVC. AH HD. four pack DESIGNATOR T U I S A F R J V2 V3 (None) B. 1/2 inch dia. gray rubber insulation. 3/8 " I. 1/2 inch O.. flat. white 22 mm (7/8" diameter).. 11/16 long each. but can be ordered Lithonia Lighting L2GTPLTS 643335. Attach an ohmmeter to the switch leads. Apply a small amount ■ FIGURE 9. MM32329-01 RS: Catalog No. round.downmagaz. to a total depth of 25 mm (one inch). LO. five pack Pipe. 5/8 inch diameter wood dowel Pendulum arm A. 1/8 A. wrap 500 turns of 32 AWG (or 700 turns of 30 AWG) insulated magnet wire around J and secure the windings tightly with square-cut masking tape. Keep the windings approximately uniform.1 and 10. four pack Switch. plastic molded (only) Fahnestock clips for EG. PVC. 18 AWG x 3. birch. black rubber. Wrap and solder these ends to the flat ribbon leads of magnetic switch L (circuit designator SW1). irrigation.

R10. .49K. TO-220 pkg Diode. HD: Home Depot.9565. RI: richco-inc. DK P4910-ND BC Mono-Kap™. Jameco Valuepro No.3K-2CT-ND EPCOS.001 µF Capacitor. DK: 568-1395-5-ND LM555. Dress the leads down and out to the bottom left. . the center cannot hold. LO DK DK DK JA DK DK DK Bumpers. MI: Michaels craft stores at michaels. two watts Capacitors. 1/4 watt Resistor.1. maintain this up/down orientation of L while threading leads through the hole in coil form J. R3. leaded only CMOS dual type D flip-flop. JA: 209234 General Semi. leaded only Capacitor. R14 R15 C1 C2 C3. C7. Mount w/ silicone grease Flat tie holder. R1. DK BC1151CT-ND EPCOS.49KXBK-ND Yageo. 9131.com. ■ FIGURE 10. Use with #6 mtg. 6. U3 U4 Q1 CR1 VR1 BR1 4 1 2 1 1 2 1 1 1 1 1 Resistor. . DK: 6. R8. x %. 100 ohms. five volts. No.com. DK P4898-ND United Chemi-con. DK: 568-1491-5-ND 74HC132N. carbon film. January 2011 35 . bridge. five watts Resistor. DK: 49. R11. 12 pack Heatsink for TO-220 pkg. in close proximity to magnet C. 800 volts PRV Voltage reference. R12 R7 R9 R13. Shepherd Hdwr. clear. 49. ON: Onlinesciencemall.3K ohms. electrolytic . No.1 µF Capacitor. #10-32 thread x 3/4" long Semiconductors. or equiv. or equiv. 14 DIP CMOS timer 8 DIP Transistor.32KXBK-ND Digi-Key.2. R5. C4 C5 C6. hardware and 4 1/2" cable ties Thumb screw. DK: 7. DK: TWM5K100E-ND Phoenix. 1%. TO-92 Rectifier. DK: P4904-ND EPCOS. carbon film. Products. R2. 1%. C8 10 1 1 2 1 1 1 2 1 3 Yageo. DF-M Series. Mere anarchy is loosed upon the world. 1/4 watt Resistor.32K.com.01 µF Capacitor. 14 DIP CMOS quad Schmitt nand. Apply a small amount of wood cement to the sides of switch mount K and position the switch in the coil form. Once established.“Things fall apart. 1N4006. JA: Jameco at jameco. Power MOSFET.com. R6. DK: DF01MDI-ND HD HD JA RI HD. Slowly pass the bottom face of C over each end of L while watching the ohmmeter for contact closure. AH. DK: LM555CNNS-ND Int'l Rec. DK: 493-1347-ND DK DK DK DK DK DK DK DK Source abbreviations: AH: Ace Hardware stores. Nylon. 1%. E-mode. LO: Lowes Hardware. one amp Passive Components. IRF 510. Secure the leads neatly with PVC cement. 7. 326596 Richco FTH-13 Series Ask for samples (various) 74HC74N. vinyl. rectifying. Switch and coil fabrication diagram. carbon film. 19 mm (3/4 diameter). DK: 565-1118-ND or Nichicon. DK: 54GICT-ND LM385Z-ND Diodes Inc. 1/4 watt HS1 (None) H U1 U2. 100 PRV. Switch and coil fabrication. alum.9K. DK: PPC1. 1. FY: Frye's Electronics. DK: Digi-Key at digikey. leaded only Resistor.9KXBK-ND Yageo. R4.” — Yeats ■ FIGURE 10.com. 1 µF Capacitor. 3300 microF 50 WVDC.

com . Mount four stand-offs as shown using No. Proceeding. Preparing the enclosure. Then. but it can penetrate human flesh and can even be lethal if you are superbly careless. and any other exposed wiring with heat-shrink tubing and/or electrical tape. Wiring And Installing The Transformer WARNING: 120 VAC is easily handled safely. The black HOT wiring to EA should connect to the narrow blade of the wall plug and the white NEUTRAL wire to EB should connect to the wide blade. Mount T1 tightly upside-down — with the bobbin seated on electrical tape — with nylon cable ties and cable feet (Figure 12). Continue the black wire from the opposite end of FS1 to T1-1. remember that the hole locations shown are now reversed. cover T1 pins 1 and 2. The NEUTRAL (white) line solders directly to T1-2. Replace the fuse and see the primary resistance return. Also check continuity between the wide and narrow blades. You should see the transformer’s primary winding resistance of about 75 ohms. Solder T1 secondary pins 6 and 7 together with bare wire. ■ FIGURE 11. install fuse F1 and without plugging in the power.Wiring and mounting the circuit board. Use #6-32 hardware to secure the feet — adhesive feet will break loose! Alternatively. Thread the power cord through the power grommet. Now. the green safety wire of the line cord to the chassis using a closed-end spade lug that has internal star burrs. Tighten them hard. making sure that FS-1 is placed only in the HOT (black) line. Never modify wiring or insulation with power applied. 36 January 2011 www.Preparing The Enclosure Drill and prepare the enclosure as shown in Figure 11. run a continuity check of the primary with an ohmmeter. 4-40 screws with star washers under the heads. If you drill through from the bottom. remove the fuse while doing this and observe the primary circuit come open. Failure to follow these wiring instructions constitutes an improper usage of this project and equipment. bolted cable clamps can be used. Connect ■ FIGURE 12.downmagaz. Solder the black wire to the fuse holder FS1.

L) to the marked center of the grid with silicone rubber. Self-thread thumb screw H in the bottom hole of the cantilever slide G and insert pendulum cantilever F through the hole in G. wire pairs. EI. K. Using your oscilloscope. IMPORTANT! Solenoid J should push away (i. place four wood screws through four Fahnestock clips and mount them loosely in the four holes EG through EJ (Figure 14). respective Fahnestock clip — about 1/4 inch below the The screwdriver is on clip EG. and about 1/4” to 1/2” above it. As shown in Figure 14. and with the thumb screw H. working over wax paper.Wiring the base (EG.e. Do not wrap the wires around the screws. hold pendulum magnet C over switch SW1 and observe the ramp waveform at trigger U4-2 run freely up and down. mounting screw. Alternatively. three feet) length. Apply power and check the power rail for stable. U3.8 volts to (+) 5. Place this assembly on top of post I. L). mount the switch leads M1 and M2 flat under clips EG and EH.) Final Assembly Mount the circuit board on the remaining four standoffs (Figure 12) and route the wire pairs EG. and observing electrostatic handling precautions. EJ out of the front grommeted hole in the enclosure. upper to lower). Hook the pendulum arm A with chain D on to hook E on the cantilever. The cantilever may now be adjusted in three dimensions by sliding through G. and mount the coil leads under clips EI and EJ. such that a 90-degree bend of bare wire will fit flat under its ■ FIGURE 14. quiet (+) five volt operation. K. EH and EI. First. U2. Bring out circuit points EG. (See Figure 12. Testing Strip and connect the two wire pairs EG. reverse the wires at clips EI and EJ. S. omitting U1. or (b) beside base T. Monitor the gate of Q1 for oscillation. turn off the power. install the remaining CMOS components. EH and EI. Cut and sand the insulation off of each lead coming from the coil and switch for about 1/2 inch. since they will “scroll” and break when the screws are tightened. Use stranded hook-up wire.1 volts.) I prefer to solder up this kind of board by soldering with 30 AWG Kynar™ solid wire wrap wire. EJ as two twisted ■ FIGURE 13. EJ from the enclosure into the eyes of their respective Fahnestock clips. Component layout on printed circuit boards. (See Figure 13..2 volts between the IC power and ground pins. Temporarily connect the T1 secondary (pins 5 and 8) to the circuit board at points C and F. When dry. and U4. One simple alternative is to wire the circuitry on two small prefabricated boards — such as RadioShack part number 276-150 — joining them together using Gorilla® glue. EJ. cut to about a one meter (approx. EH. January 2011 37 . When on target. Adjust it so that magnet C rests centered on coil J below. repel) magnet C when it is pulsed. ribbon cable can be used. wire only the power supply from BR1 through VR1. If not. EH and EI. Snap the mounting platform U down on to the stanchions. and use a voltmeter to check for (+) 4. Hold magnet C well away from SW1 and observe U4-2 become static at about (+) 5. tighten H. Polarity is not yet important. Remove U and cement the coil assembly (J. and locate and closely mark the position in U for the coil assembly (J.Wiring The Circuit Board A printed circuit board for the pendulum drive circuit is offered by the author. or (c) removed from the base and otherwise out of sight. Select a length for this wiring which will facilitate placement of the enclosure (a) under base T. Then. Refer to the circuit waveforms in Figures 4 and 5. Use tweezers.

downmagaz. Periodic Behavior. come up with some of your own to test out the theories.com. relative to post I: (5. Using any number of repelling magnets and with power applied to the electronics. (5.com . Can you nudge the planet into an elliptical or circular orbit that is stable over several minutes? Question: Do you think that the orbits of the planets in a binary star system over very long times are guaranteed to be stable? Research Problem 2. Static Equilibrium. contact nglooper@gmail. can you find a button magnet configuration which will result in the pendulum eventually becoming trapped and permanently at rest outside of the center of the platform? Research Problem 3. (9. can you find a button configuration that will result in the pendulum adopting a constant period of oscillation? After you try these research problems.7). NV 38 January 2011 www. Using at least one button magnet. y locations as shown in Figure 7. Also. Planetary Orbit Stability In A Binary Star System. Note that even symmetrical placements of the button magnets still produces chaotic behavior due to the inherent nonlinearities of the magnetic fields involved. and therefore attracting the planet. and (12. Research Problem 1. try the following placement of five magnets using the x. you don’t need many magnets to produce complex results.5). (9. To start. It’s a good thing to bring a little chaos to your life. Experimental Chaotic Brain Teasers The assembled button magnets can now be placed experimentally in the matrix of platform U to produce chaotic operation.10).6).For further information.11). Consider pendulum magnet C as representing a planet in a binary star system and two button magnets inserted upside down into the bottom of platform U as representing two parent stars in slow orbital motion around each other.

1-800-728-6999 • www. and the included illustrated manual guides you through each of the projects step-by-step. Now you can build this model straight fromDa Vinci's musings and marvel at how ahead of his time he truly was. The constant. family. . always swinging.95 Da Vinci Aerial Screw Kit Reinvent a Fanciful Flight A precursor of the modern day helicopter. Laxman "Inner-tainment" System Unparalled Experience in Focus and Relaxation Truly in a class all its own. and foyers.95 Superhero Approved2 IRON MAN AS SEEN IN . #30850-66 . The unique six button infrared remote allows you to control three different motors simultaneously. . . #31521-38 . $69. The revolutionary technology combines the most effective light and sound technology with the features of a state-of-the-art multimedia device. Support Disk. this moving stick model appears to defy gravity and turn logic on its head. . Microfiber Cleaning Cloth. . fluid motion of the revolving sticks creates an almost hypnotic effect that your friends. Laxman Unit includes Ganzfeld – All Color Open Eye Goggles. . . . . $49. . . . No soldering required. as well as a prototyping breadboard for you to get started on projects right away. Recommended for ages 12 and up. . waiting rooms. After you build all of the projects you can use the parts for your own designs too. plus hundreds more visit scientificsonline. . and clients will want to watch for hours. The result is a sensory phenomenon that simultaneously atunes your brain waves to auditory and visual stimulation. . . work with IC chips. $19. Headphones.designed to compress air in order to obtain flight. . and two AA Batteries. . . built-in MP3 Player with 1 gig storage with SD mini slot for additional card (not included). create an interactive noise maker and more.com. Requires 4 AA batteries (not included).00 Remote Control Machines Kit Assemble 10 Different Models Demonstrating Motors This incredibly fun construction kit walks you through building your own motorized vehicles and machines and then control them with a wireless remote control unit. . Handbook/Instructions Manual. .95 The Swinging Sticks Mysterious. . creating a ground-breaking display of colorful shapes and a sensation unlike any other. this display provides sophisticated style and unmatched entertainment. Continuous Moving Desk Display Never ceasing. . . . The three motors can be combined to make complex vehicles and machines in numerous configurations limited only by your imagination. the Laxman 'Innertainment' System is the next generation of mind machines. with easy-to-activate touch sensors. moving each of them forward or in reverse. . $649. . . Make a light detector. . . Ideal for conference rooms. . medical offices. Recommended for Ages 8 and up. . Reccomended ages 8 and up. . USB Cable. display windows.00 DIY Discover Electronics Kit Everything You Need to Learn Basic Circuit Design What are the basic electronic parts? How do they function? How are they related to one another? These questions and more can be answered by spending some time with our electronics kit. . For full descriptions of the products featured here. the Aerial Screw designed by Leonardo da Vinci was. exhibition areas. #31520-85 . $289. . #31521-51 . . . .scientificsonline. #31522-28 . The perpetual motion illusion was created by an electrical engineer and designer to baffle and amaze all onlookers. It contains over 130 standard parts – all of the most common electronics components.com Wonder and Inspiration Delivered–Gifts for rocket scientists of today and tomorrow.

com . It consists of an unregulated DC source. The voltage regulator supplies the application with regulated DC power.A SIMPLE DC UPS By Philip Kane Photos by Sarah Kane An uninterruptible power supply (UPS) ensures the continuous operation of critical electronic equipment. the unregulated DC source is switched back into the circuit. There are a number of applications that have relatively low power requirements and run on DC rather than AC voltage but must also remain operational in the event of a main power failure.downmagaz. This article describes a simple UPS circuit that you can incorporate into the design of your own low power DC project to ensure continued operation during short term power failures. a backup power source.These include small security sensor modules. 40 January 2011 ■ FIGURE 1 www. and status monitoring devices among others.They are manufactured to meet a wide range of power requirements. T he block diagram in Figure 1 shows the organization of a simple DC UPS. If the main power is interrupted. The input to the voltage regulator normally comes from the unregulated DC source. When main power is restored.They are especially necessary if you live in an area where there are frequent power failures. and a voltage regulator. data acquisition. Most UPS systems are designed to transparently maintain AC power to your equipment. switching logic.They provide for a smooth transition from main power to backup power and back again. then the switching logic switches the backup power source to the input of the regulator. from backing up your personal computer to keeping your entire home office (or workshop) going during a power failure.

Two factors to consider when choosing D1 and D2 are the required load current and the leakage current. It is essentially a linear regulator with battery backup. If Vs is 9V. Vbb is provided by either alkaline or non-rechargeable lithium batteries. the input to the 7805 will be at least equal to the specified minimum. A good choice for Vbb will be a compromise between the specified maximum and minimum values. Therefore. It receives input from either the main power source Vs or the backup source Vbb.com/index. LED1 and LED2 are used to determine the status of the UPS. as well as LED1 and LED2 — while useful for testing the UPS prototype — are optional and need not be included in your application. Note that S1 and S2. Vbb can’t be greater than 9V if D2 is to remain reversebiased.php?/magazine/article/january2011_Kane About the Circuit ■ FIGURE 2 The circuit shown in Figure 2 is a UPS intended for low power applications. as well as the specified minimum input voltage for the 7805. Mount the 7805 on a heatsink. while diode D2 comprises the switching logic that will be described later.nutsvolts. LED1 is the main power indicator. Diode D1 isolates the main power source from the backup circuit. However. To determine the maximum and minimum values for Vbb. Circuit Operation The 7805 is a standard linear 5V regulator. PARTS LIST ITEM C1 C2. then the backup battery configuration will be a significant factor in your choice of an enclosure. If — as in this case — you’re using non-rechargeable lithium or alkaline batteries. This diode has a specified maximum reverse (leakage) current of 5 µA at 50V DC (reverse voltage). It provides a regulated 5V DC from an unregulated DC input of at least 9V. C3 D1. C2. Vbb can’t be less than 8V. The battery backup feature can be eliminated from the circuit via switch S1. R2 330 ohm resistor S1. you must consider the forward voltage drop across D1 and D2. January 2011 41 . then the voltage at the cathode of D2 (and also the input to the regulator) is 8V. then this will shorten its usable life. the entire prototype circuit can be assembled on a piece of perf board using point-to-point wiring.www. you should choose a diode with low leakage current. Choosing a value for Vbb that is close to the minimum input voltage can help to extend battery life in situations where Vs may frequently fall between its normal level and the 7805’s minimum input voltage. S2 SPST switch (optional) Construction If you intend to use this as a standalone power supply.000 µF electrolytic capacitor 0. Vbb will fall below its nominal value. D2 DESCRIPTION 1. It remains on as long as the regulator is being supplied by the main power source.5A maximum output current of the 7805.5A and low reverse leakage current IC1 LM7805 (or equivalent) 5V regulator LED1. which is 7V. We used a 1N5400 diode in our prototype.1 µF capacitor (polyester or mylar) 1N5400 diode or any diode with a maximum forward current rating of at least 1. LED2 Light emitting diode (2 mA) R1. C3. The 7805 will provide a regulated 5V output for any input voltage from its specified maximum and minimum input voltages. If you choose Vbb at or close to its minimum possible value. and IC1 form the linear regulator section of the circuit. Its forward current rating is 3A which is more than adequate to deal with the 1. Capacitors C1. In order to ensure that if Vs fails. Taken together. Let’s assume that the forward voltage drop for D1 and D2 is 1V. over time. LED2 is the output power indicator. If you intend to incorporate the UPS circuit into your own application. If Vs were higher — say 12V — then there would be a wider range for Vbb (8V to 12V).

place the backup battery in the circuit.Close S1. NV www. . or bad indicator LED2. UPS has apparently failed. Make sure that you have a DC adapter that can deliver the required maximum current at the required input voltage. Be careful not to exceed the 7805 maximum current limit. LED2 should remain on. then suspect the adapter and check the voltage across the input to the UPS.Prototype Checkout and Troubleshooting Before powering up the circuit. . It should not exceed the specified leakage current for the diode you have chosen. The output voltage should remain relatively constant.If LED1 is off and LED2 is on. Main power failure. 42 January 2011 The configuration of LED1 and LED2 indicates the status of the UPS and the condition of the main power line. Another possible improvement would be to replace the linear regulator with the more efficient switching regulator. the status of the UPS is shown in Table 1. .2 volts. you could use the same part to build a nine volt UPS to power a DC appliance or to design a five volt UPS into your next project. • Connect the DC adapter to the UPS and plug it into the wall outlet. check all connections. If neither LED is on. Assuming both S1 and S2 are closed. Main power on. then check LED2 and its limiting resistor. Conclusion There are obviously a number of improvements that you can make to the basic circuit presented here. then check the wiring for LED1 and its limiting resistor. check out the circuit as follows: • Set S1 and S2 to their open (off) positions. • Measure the current between the anode of D2 and ground. low dropout (LDO) regulator. However. Possible causes include bad battery. No backup battery or low backup battery.If LED1 is on and LED2 is off. Both LED indicators should be on. first check the UPS output voltage. Main power on. then measure the voltage on the input side of the 7805 regulator. bad regulator. it can be configured for a range of output voltages.downmagaz. The lower minimum input voltage of the LDO would extend the range of Vbb. Otherwise. LED1 should go off. If the UPS output voltage is okay. UPS operating properly. If there is no UPS output voltage. UPS in backup mode. On Off On On Table 1: UPS status conditions assuming switches S1 and S2 are closed. . For example. • Verify that the regulator portion of your circuit is operating correctly by varying the UPS output load and measure the output voltage. For example. • With S1 still closed. open diode. LED1 Off Off LED2 Off On Condition Main power off. If there is no regulator input voltage. With the backup battery out of the circuit. the output of the nine volt adapter that I used was 11. • Close switch S2 and place S1 in the open (off) position (or remove the adapter from the wall) to simulate a power failure. suspect the 7805. You can replace the standard 7805 with a variable voltage.com . Use a fresh battery. Note: The voltage measured at the adapter output when it is not under load will most likely be higher than the rated voltage at the specified load current. It should still be at the regulated level.Measure the output voltage. then suspect D1. Additionally.

$499. measure or monitor just about any audio signal. Kit supplied with PCB.50 plus postage & packing This quick and easy kit plugs into your motherboard to provide IR support for external devices such as notebook computers. Kit includes PCB. Everything is included in the kit except for a housing for the transducer and sealant.Solar Powered Happy New Year From the JAYCAR Team HOW TO ORDER POST & PACKING CHARGES Order Value $25 .Friday 09.75 plus postage & packing Turn your computer into an oscilloscope. It can also be used with solvents such as kerosene or just water and detergent.NEW YEAR . ornate bric-a-brac and a host of other hard-to-clean items. PCB.25 plus postage & packing Host your own website on a common SD/MMC card with this compact Web server In a Box (WIB).O. such as an old cistern or laundry tub.jaycar.$99. and all electronic components • Optional CRO probe to suit . some SMD soldering and a 6-9VDC adaptor. • 9-12VDC @300mA • PCB and components FRONT END PRE-AMP FOR PC SOUND CARDS KA-1811 $21.00 plus postage & packing Program both the microcontroller and EEPROM in the popular gold. potting and gluing transducer is and housings.NEW KITS! Remote Control Digital Timer Kit KC-5496 $25. Instructions outline software requirements that are freely available on the internet. four digital outputs and four analogue inputs. • PCB Dimensions: 123 x 74mm FULL FUNCTION SMART CARD READER / PROGRAMMER KIT KC-5361 $40. Power requirements:12V. and for a housing. RS232 serial port. The kit includes the transducer.com 1-800-784-0263* +61 2 8832 3118* techstore@jaycar. Car size: 60(L) x 30(W)mm KJ-8838 . or its potential to be used for unlawful purposes. so local customs duty & taxes may apply. The kits are very simple to build and come with a manual that provides construction details and explains how alternative energy can generate electricity. Research reveals only one all parts needed for boats under 32ft. By building yours e! Standard includes some potting) you save a fortun and case. silver and emerald wafer cards.00 plus postage & packing Remote-controlled digital timer with a bright 20mm-high 7-segment red LED display. with Silicon Chip have developed and a similar system based on this technology project uses information in the public domain. For sealant you can use any neutral cure silicone suitable for wet areas. An internal relay and buzzer activate when the unit times out. case and electronic components. like those from op-amps. Jaycar. Powered by 9-12 VDC wall adaptor or a 9V battery.99 $100 . Connecting to the Internet via your modem/router.99 $200 . and all electronic components. unit consists of control electronic kit components ultrasonic transducer.5A 12VDC plugpack.you'll need to add your own universal remote.and the list goes on! • Kit includes PCB and all specified electronic components KIT OF THE MONTH Ultrasonic Antifouling Kit KC-5498 $155. Most PC sound card inputs have a limited dynamic range. The relay contacts can be used to switch devices rated up to 30VDC or 24VAC and the project can be powered from a plugpack or a battery. dynamic DNS client.Wind Powered KJ-8839 . Minimum order $25. SMTP email client. It uses an external power supply to tap into the existing line. it features inbuilt HTTP server. You'll also need epoxy resin such as Araldite or JB Weld. case with silk screened and punched panels.99 $50 .50 $20 $40 $60 $75 Max weight 12lb (5kg). Heavier parcels POA.70 plus postage & packing Many of you know that you can buy $3-8.5A Transducer voltage: 250VAC square wave Frequency range: Main mode 19kHz to 42kHz Timeout adjustment: 30s to 10m Includes: • PCB and components • Powered by 12VDC BEST SELLER USB POWER INJECTOR KC-5399 $24. High Power Ultrasonic Cleaner Kit KC-5499 $124.$49. 2. Requires a SD memory card. This project will allow full current draw no matter how many peripheral devices you are running.com . PDAs. Basically . • PCB measures: 141 x 101mm Jaycar Electronics will not accept responsibility for the operation of this device. effectively boosting the available current. PC INFRARED TRANSCEIVER KIT KC-5323 $17. Rydalmere NSW 2116 Australia • ALL PRICING IN US DOLLARS • MINIMUM ORDER ONLY $25 *Australian Eastern Standard Time (Monday . Its timing period can either be set and controlled using the remote control or it can be automatically controlled via external trigger/reset inputs. Box 107. • Kit includes case. It can count up or down from one second to 100 hours in 1-second increments.99 $500+ Cost $7. Card used needs to conform to ISO-7816 standards.jaycar. Prices valid until 31/1/2011 www. digital cameras. to be measured without degradation. they may be trying to draw more current than your USB port can provide. fabrics which can't be machine washed.00 • Or use it for amplifying a high quality microphone for sampling SD/MMC CARD WEBSERVER IN A BOX KC-5489 $65.30 GMT + 10 hours) Note: 10-14 days for air parcel delivery Order online: www.use our QC-1902 $25. its related software.50 plus postage & packing A power boost for your USB port! If you have a lot of peripheral devices running from your computer. WEB: PHONE: FAX: EMAIL: POST: Note: Products are dispatched from Australia.00 to 17. power supply and enclosure.000 imported marine growth electronic antifouling systems.25 each plus postage & packing These mini remote controlled cars will surely entertain and educate curious minds about the concept of wind and solarpower. waste and vent end cap available from any plumbing supplier will do the job.com P. Short form kit only . Power is derived from the soundcard's D15 Joystick output socket. wafer card socket and all electronic components. data samplers . so why not a much larger version? It would be ideal for cleaning automotive and other mechanical parts. case. relatively low input impedance and poor overload protection .50 plus postage & packing Most people would know that you can get small ultrasonic cleaners for jewellery and similar small items.this kit will eliminate these limitations and allow tiny signals. audio monitor or spectrum analyser! Plug the kit into your computer's soundcard and by using software available over the Internet. Kit supplied with PCB. This lly identical the same ultrasonic waveforms and virtua ultrasonic transducers mounted in sturdy elf (which polyurethane housings. a short piece of 65mm PVC plumbing pipe and a drain. FTP server. supplied in the project kit including wiring • 12VDC • Suitable for power or sail generator • Could be powered by a solar panel/wind • Price includes epoxies WIND AND SOLAR POWERED RC CARS KJ-8838 & KJ-8839 $31. You can use a variety of receptacles for a tank. silk-screened front panel.$199. cable and electronics and can be powered from a 2.

an Internet connection. If you read the documentation very carefully.4V high). Next month. We will use these specifications in designing an appropriate relay driver circuit.4V low. or actuate solenoids like the ones inside the 24 www. so this first article will show how to use the Rabbit module to do the basic functions for this project (or others). and don’t cost much. Rabbit Semiconductor RCM5450W Wi-Fi m odule. you will find that all bits of Port A are available for your use. The Wi-Fi sprinkler uses a module from Rabbit Semiconductor to control a set of 16 relays. are low power with lots of I/O port bits.●●●● SPRINKLER SYSTEM BUILD A WI-FI By Bob Colwell Part 1 I have a lot of projects I want to work on.0V (0. There’s also an interface to a standard 2x16 LCD display module. Software is covered in a comprehensive file included in the downloads. we’ll talk more about the sprinkler-specific aspects of the design. day of the month. plus an internal real-time clock so the module knows the day of the week. I’ve included a labeled “pin field” that brings the Rabbit module pinouts to a set of 50 stakes. 44 January 2011 ■ FIGURE 1. Certain bits of Ports B and C have other duties that you can work around if necessary. Rabbit’s documentation states that RCM5450W ports can source or sink 24 mA and are guaranteed to swing an output voltage of 2. One particular project is my Wi-Fi sprinkler system that exemplifies these aspects. The same is true of Port D.com . and time of day.11a/b/g fluently. to make it easy to connect scopes and logic analyzers to aid in software debugging. they are physically small. The module uses some of the bits of some of the ports for Wi-Fi and other functions. come with a large sample code library. energize circuits. We have a lot to cover. Wi-Fi to connect it to my home network (so I can use my iPod in my yard to turn water zones on and off). such as they need a control module that speaks 802. They all have certain things in common. The Wi-Fi Module Rabbit’s Wi-Fi module has five general-purpose eight-bit I/O ports. The module needs to be able to turn on motors.downmagaz. 2. Control by Relay Almost every project needs to control something.

If you turn off the coil current. the code ended up being more of a challenge than I had expected. So.7 – 0. half? That’s why they’re paralleled in this design. or gain. and the transistor is driven directly by the Wi-Fi module’s processor. I set the wireless WEP key and network name to what I have at home. the current requirements are a trivial 75 mA. but after a couple of years of experience I’m pretty happy with the Rabbit.5 volts) / 0. it came with a large library of sample C code for doing all of the things I expected to do in this project. This project would work fine with only a single-throw single-pole relay. the CD4515’s internal four-bit latch holds a random number. thus connecting pin 3 to pin 4. whose inhibit bit was controlled by another port output bit. and the relay’s switch defaults to the upper connections (3 to 2. What’s that diode for? When the coil is energized. R = E/I = (5 – 0. and the corresponding Y output will want to go active.28 mA. or approximately 28 mA. January 2011 45 . uncontrolled water would briefly flow. and because we won’t turn on multiple zones at once. Isn’t that true of most code. and fully saturate the transistor otherwise. Triacs would work. The coil current will be (5 – 0.5 mA of base current. When transistor Q1 is on. but these DPDT subminiature relays were cheap and small. The value of R1 must satisfy two constraints: keep the transistor off if the port output is high or not yet configured. energizing it so that a magnetic field is formed around the coil. Let’s round up to 0. The base resistor R1 will have 0. Typical transistor beta. and Rabbit supplies a C compiler and development board for it. would be around 100. I now had the flexibility to also handle the LCD interface. current is permitted to pass from Q1’s emitter through the transistor to its collector and then down through the coil. no coil current flows. we just need a way to control this electrical current to each zone’s sprinkler valve. we could just assign one bit to each relay (16 in all) and then ensure that the C code never drives more than one bit low at any given time. (That “all I had to do” was partly tongue-in-cheek. inhibiting the 4515 from selecting any of its 16 outputs during initialization. Until a Rabbit bit is set as an output.3.5V on one end and +5V minus the 0. I would look into the Arduino.7V emitter/base drop on the other end.2 and Relay 1. The RCM5450W modules aren’t exactly cheap but they have 1 MB of Flash memory for the C code we will compile and download (of which my current download image uses 300K) and a relatively fast processor at 74 MHz (compared to Arduino’s 16 MHz).600 ohms.0005 amps = 7. or 0. plus the HTML that would run the Wi-Fi module’s website. flipping those switches from their normally open state to a closed state. The manufacturer says their 5V relay coils are 178 ohms. so we need at least 1/100th of 28 mA in the transistor’s base to get that collector current. Coil actuation current is controlled by a simple transistor driver circuit. the magnetic field collapses and a spring pulls the relay switch open again. and 8 to 9). A relay is a magnetically controlled switch. We can get 24 VAC from a transformer. Figure 3 shows the basic transistor relay driver circuit. and I figured as long as there were two contacts. When Q1 is off. If I were starting this project over today. but after some misadventures using port bits that were already allocated to the Wi-Fi functions. I put a latched 4:16 CD4515 decoder chip in the circuit. Relay coil current causes a magnetic field that pulls on the switch and closes it.1)V / 178 ohms. why not gang them and cut the load current through each by Why Rabbit and not Arduino? I chose a Rabbit Semiconductor RCM5450W module for this project because I liked its features: it had a lot of I/O ports. This prospect of wet mayhem is averted by the active-high 4515 Inhibit input. its Relays and Their Drivers With enough Rabbit port bits. When the chip is first powered up. For our WiFi Sprinkler system. though?) The 802. and pin 8 to pin 7. ■ FIGURE 2. A fully-on transistor exhibits an emitter-to-collector drop of approximately 0. an internal pullup resistor holds the wire at logic-high. I rounded that up to a convenient value of 10K. I tried that first.VAC water valves used in yard sprinkling systems. All I had to do was write the C code that would control the relay transistor drivers. but relays are cheap and easy to understand. I simplified the code by taking advantage of the one-zone-ata-time rule. This magnetic field pulls on the switches shown as Relay 1. This makes PD 7 (see Figure 3) appear to be high. Block diagram of the Rabbit RCM5450W module. and added my code to Rabbit’s sample code.11a/b/g wireless functionality was supplied by Rabbit — I changed the IP address to something suitable for my network. Now.1V.

plus a four-bit latch on its inputs. Two corner pins — 2 and 50 — 46 January 2011 are grounds. When the coil current is cut off. I’ll show that as 0010. Rabbit controller board schematic. C. U51 is a standard decoupling capacitor. If you are not familiar with “bus-style” schematics. magnetic field is holding the relay’s switch contacts closed.3V to the module. Rabbit labels all the pins on one side of the module connector as even. The diode provides a low impedance path into which the magnetic field’s induced current can discharge. The CD4515 chip is a 4:16 decoder with an output inhibit. As it does.■ FIGURE 3. meaning the Y2 output would be asserted. and the other side carries all the odd pins. you’ll be expecting the numbers to start with pin 1 at one corner. In the schematic in Figure 3. If you’re used to normal IC package numberings. and can be quite large.” because D is the most significant bit. Per Rabbit’s documentation. Interfacing to the Relay Drivers Earlier I said we would take advantage of the fact that we will never want more than one zone on at a time. and sequentially number the rest around the package in a counterclockwise direction (looking down at the part). One thing to beware: For some reason. and pin 1 supplies +3. I’m going to call this four-bit input “DCBA. The magnitude of that voltage is proportional to how quickly the field collapses. that thick blue line that all of the pins seem to “connect to” does not imply that all of the signals are somehow connected together into one big fat (useless) blue wire. and A is the least significant. All non-selected outputs will remain high. and D — pick one of the 16 Y output pins to assert. B.com . and R34 pulls the reset pin to an inactive high level when S1 is not active. that magnetic field collapses.downmagaz.2K resistor. The Wi-Fi Module Interface There are 50 pins in the Rabbit module’s connector. there is a 3V battery backup connected through a 2. That thick blue line is just a convenient way of grouping all of the signals at the interface of the RCM5450W module so that we can pick out subsets of them for various uses in other schematic pages. Note that the Y www. If only the B bit is high and the other three are low. it induces current in the coil which causes a reverse voltage to appear across the relay’s coil. Here’s where we do that — in the circuit that translates the module’s port outputs into the 16 transistor relay driver signals. S1 is a momentary contact reset switch. I chose to bundle all 50 into one bus — the “RCM5450_bus” — for the sake of easy and clear documentation. and it corresponds to a binary 2. The 4515’s four select inputs — A.

equals 6), thus Y6 will be low and all other Y outputs will be high. Also note that it is literally impossible to activate more than one zone at a time because the 4515 will only ever precisely do one of two possible things: it will assert no zones if the inhibit input is asserted, or it will assert whichever Y output corresponds to the four-bit pattern in its internal latch. What’s the purpose of the four-bit latch? Notice that I have used four of the PA bits from the RCM5450W module’s Port A. I will also use those same bits to convey data to and from the LCD module. The 4515 lets me write the four bits into its internal latch; once the PA bits have been written into that latch, I can reuse PA bits for other things, such as changing the display on the LCD module so that the clock remains accurate. I’m using PD5 as the latch enable. The protocol here is simple: To enable relay X, write the RCM5450W Port A bits 3:0 with the value of X. Then, write Port D bit 5 (which is normally a 0) to a 1, and then back to a 0. That causes the latch to open which passes X through to the 4:16 decoder, and then causes the latch to close which causes the latch to remember that value of X until next time. Meanwhile, PD7 has been held inactive all this time, so no Y outputs of the 4515 are asserted, and no relays are yet activated. Once the four-bit value is sent on Port A bits 3:0 and latched by pulsing PD5, we can de-assert the 4515’s “INHIBIT” input by writing PD7 to zero, and keep it low for the duration of the sprinkling desired.

■ FIGURE 4. Rabbit RCM5450W module mounted on 1/4” spacers. control the LCD module: Port D bits 0, 1, and 2. PD0 is the module's RS bit, PD1 is R/W, and PD2 is the Enable bit. The particular module I used has a switchable backlight, so I provided a transistor “relay driver” circuit to turn the backlight on and off. The only new element here is an additional resistor in the emitter leg of U8 which is there to limit the LED current for the LED backlight. LEDs drop approximately 2V while illuminated, and should be limited to less than 20 mA to avoid burnout; 5V – 2V – 0.1V (emitter-collector drop when transistor is on and saturated) = 2.9V. E=IR, so R = 2.9 volts/0.020 amps = 145 ohms. I upped this to 180 ohms for a safety margin. The base resistor limits the base current and was determined along similar lines. When the transistor is on, we want 20 mA in the collector, so we need at least 1/100th that much in the base, or 0.0002 amps. The transistor’s emitter lead is at 5 – 2.9 = 2.1V. The emitter/base junction is 0.7V, so there are 2.1 – 0.7 volts at the base and 0.5V at the other end of the resistor which leaves 0.9V across the base resistor. Therefore, R = 0.9 volts/0.0002 amps = 4,500 ohms which I rounded up to 4.7K.

Interfacing to the LCD Module
The only semi-tricky part of interfacing to the LCD module is to find a way to accomplish that interface without interfering with the relay interface. Previously, I showed how the relay interface was done, using Port A bits 3:0 and Port D bits 5 and 7. If Port D bit 7 is high, then you can do anything you want to the Port A bits. The relays won’t see it because the 4515 chip’s outputs will not be enabled. So, to interface to the LCD module, I used all eight Port A bits, plus some Port D bits for the three LCD control signals RS, E, and R/W. Note that the Port D control bits I chose were not the same ones I used for relay interfacing. The LCD module listens to Port D bits 2:0, plus bit 6 to control the LCD module backlight; the relay interface uses Port D bits 5 and 7. There are 16 pins on the LCD module. Pins 1 and 16 are grounded, and pin 2 supplies +5V. Pin 3 is a voltage between 0 and +5V - this voltage sets the display's contrast. I assigned three Port D signals to

January 2011

47

www.nutsvolts.com/index.php?/magazine/article/january2011_Colwell

Power
There are three separate power supplies in this project: +3.3 VDC, +5 VDC, and 24 VAC. The +3.3V is for the Rabbit module; +5V is for the subminiature relays; and 24 VAC for the sprinkler valves. I found a cheap switching power supply for the +3.3 VDC and +5 VDC, and a 24 VAC transformer. Because four-pin power connectors are ubiquitous from their use in personal computers, I used one in this project. The two capacitors smooth DC ripple from the supplies and minimize problems from inductance in the wires of the four-wire cable coming from the power supplies. Notice that although two wires of the four-wire power cable are ground wires, I take care here to keep

them electrically separated from one another. To accomplish this, they have different names. The noisy, relatively high current relay coil ground returns are labelled “Relay GND,” while the Wi-Fi module and other logic use the “GNDDIGITAL” ground return. Only at the other end of the four-wire power cable do these ground wires get connected together. The basic problem of sharing current paths is that these paths are not perfect. Even fat ground traces have small but not inconsequential resistance (R) and inductance (L), and the longer the shared path, the higher the induced noise from changes in current. By minimizing the sharing of any current paths between the coils and the logic, there is much less shared R and L and therefore much less induced noise seen by the logic. NV

microEngineering Labs, Inc.
www.melabs.com
PICBASIC PRO™ Compiler
Bridges the gap between ease of

888-316-1753
LAB-X Experimenter Boards
Pre-Assembled Board Available for 8, 14, 18, 28, and 40-pin PIC® MCUs 2-line, 20-char LCD Module 9-pin Serial Port Sample Programs Full Schematic Diagram

Professional Development Tools for PIC ® Microcontrollers

USB Programmer for PIC® MCUs

use and professional level results. The simplicity of the language allows both hobbyist and engineer to master it quickly, but the engineer appreciates what’s happening under the hood. This is a true compiler that produces fast, optimized machine code that's stable and dependable.
Supports: More than 300 PICmicro® Microcontrollers Direct Access to Internal Registers In-Line Assembly Language Interrupts in PICBASIC and Assembly Built-In USB, I2C, RS-232 and More Source Level Debugging in MPLAB

$89.95 (as shown)
RoHS Compliant
Programs PIC MCUs including low-voltage (3.3V) devices
Includes Software for Windows 98, Me, NT, XP, and Vista. With Accessories for $119.95: Includes Programmer, Software, USB Cable, and Programming Adapter for 8 to 40-pin DIP.

Pricing from $79.95 to $199.95

PICPROTO™ Prototyping Boards
Double-Sided with Plate-Thru Holes Circuitry for Power Supply and Clock Large Prototype Area Boards Available for Most PIC® MCUs Documentation and Schematic

PICBASIC PRO™ Compiler $249.95

See our full range of products, including books, accessories, and components at:

Pricing from $8.95 to $19.95

www.melabs.com

48

January 2011

www.downmagaz.com

continued from page 29

QUICKTURN PROTOTYPES IN AS LITTLE AS

SHOWCASE
Dealers Wanted

24 HOURS
unstone Circuits has enhanced their services by offering prototype delivery within 24 hours on all four-layer boards ordered within their PCBexpress® quickturn product line. Sunstone’s PCBexpress® quickturn with predefined capabilities offers the best value for up to 100 pieces per order. By using this PCB design service, customers can now shave two days from the standard three-day lead time. Customers are increasingly using multilayer board designs during the initial prototyping phase to dramatically shorten design-time and save project dollars. This technique works particularly well when highspeed design work may be a factor in the actual schematic. This improved lead-time also comes with enhanced DFM rules which reduces the risk of design mistakes. When a prototype is meant to prove a concept or demonstrate a solution, adding layers to the design isn’t that risky; risk it mostly a factor when engineers design on the border of the fabricator’s limitations. This service now allows designers the ability to optimize their time by saving the ‘tight-routing’ elements for when prototypes become production ready. This equates to fewer prototype spins which consequently means reduced costs on PCB components, assembly, and labor.

S

MIAC is an industrial grade PICmicro controller which retails at $180. Features include direct USB download, 8 analog/digital inputs, 4 relays, 4 motor outputs, integrated CAN bus and a free copy of Flowcode V3. We are looking for commercial partners for MIAC – if you are interested then please call us in the UK on +44 1422 252380.

Zeroplus LAP-C 16032 2 Logic Analyzer
16-channel - 100MHz - USB 2.0 SPI - i2c - UART - 7-segment t 2 free additional protocols

Rigol DS1052E DSO
50MHz - up to 1GSa/s 1 Meg mem - TFT LCD - USB Advanced triggering: Edge, Pulse, Video, Slope, Alt

Open Source Hardware d
Arduino Duemilanove Arduino MEGA Freeduino - Seeeduino Arduino Shields - Ethernet XBee

For more information, contact:

http://www.NKCelectronics.com l

Sunstone Circuits
Web: www.Sunstone.com

SHOW US WHAT YOU’VE GOT!
If you have a new product, please email a short description and a photo of your product to:

newproducts@nutsvolts.com

THE
■ BY FRED EADY

DESIGN

CYCLE

ADVANCED TECHNIQUES FOR DESIGN ENGINEERS

TIME FOR SOME RTCC TRANSLATING
Sprechen sie Deutsch? I don’t, but I had to perform some cross-language code translation to gain the information necessary to write the code for this month’s project. My cross-language translating does not involve BASIC to C. I’m talking about German to English source code translation.

Achtung is about all of the understandable German I can utter. However, I did manage to wade through some German source code and force my EA DOGM162L-A to speak English. Once we are able to get the dog to bark, we can start teaching it new tricks.

PROBLEME MIT DER ANZEIGE DER ZEIT

that, the search for answers begins. After some exhaustive research, I ended up back in the DOWNLOAD area of the EA DOGM162L-A website. There’s a download item there that I have been purposely My problems with displaying time started all of this avoiding. The downloadable serial source code driver is confusion. Our goals this month are to write drivers for written in German and targets AVR microcontrollers. The the EA DOGM162L-A LCD and the PIC18F47J53’s AVR part of the code doesn’t bother me as I know that I hardware RTCC (Real Time Clock Calendar). The EA can easily port AVR mnemonics to PIC speak. Another DOGM162L-A is based on the Sitronix ST7036 Dot Matrix problem with the German SPI driver source code can be LCD controller/driver. New seen in Listing 2. Notice that INITIAL_START: number, same commands there are no carriage return CALL HARDWARE_RESET and mechanics as the and line feed characters in CALL DELAY40mS ST7036 is HD44780 the listing. As Scooby would MOV A,#38H ;FUNCTION SET CALL WRINS_NOCHK ;8 bit, N=1,5*7dot compatible. say, “WRUT WRO!” CALL DELAY30uS The ST7036 datasheet Fortunately, keys in the MOV A,#39H ;FUNCTION SET offers an example German language listing CALL WRINS_NOCHK ;8 bit, N=1,5*7dot,IS=1 initialization code snippet such as mS(50), us(50), void, CALL DELAY30uS that is based on the saintly parenthesis pairs, and some MOV A,#14H ;bias CALL WRINS_NOCHK 8051 microcontroller. As you English wording caught my CALL DELAY30uS can see in Listing 1, the EA eye. So, I dumped the MOV A,#78H ;Contrast set DOGM162L-A 8051 SPI contents of Listing 2 into a CALL WRINS_NOCHK CALL DELAY30uS initialization source code is NoteTab editor session and MOV A,#5EH ;Power/ICON/Contrast control written in assembler. went to work. I began to try CALL WRINS_NOCHK However, we can easily pick to add carriage returns and CALL DELAY30uS MOV A,#6AH ;Follower control out the timing calls and line feeds that would make CALL WRINS_NOCHK ST7036 register values which the jungle of characters in CALL DELAY200mS ;for power stable MOV A,#0CH ;DISPLAY ON are all we’re interested in Listing 2 look like classic C CALL WRINS_NOCHK anyway. The problem is that source code. I also used CALL DELAY30uS these timings don’t work MOV A,#01H ;CLEAR DISPLAY ■ LISTING 1. I figured CALL WRINS_NOCHK with an EA DOGM162L-A since this code was part CALL DELAY2mS of the ST7036 datasheet, it being driven by our MOV A,#06H ;ENTRY MODE SET was gospel. After all, the CALL WRINS_NOCHK ;CURSOR MOVES TO RIGHT (Universal Storage Control timings match the datasheet CALL DELAY30uS Module) USCM-47J53. With declarations.
January 2011

50

www.downmagaz.com

Once the Master SPI portal I/O pins are established.3µs warten ST7036_write_command_byte( 0x6c ). we must first assign the SPI clock and data lines to appropriate pins on the PIC18F47J53. //RP13 (RC2) as SCK2 (output pin) RPINR21 = 23.3µs warten ST7036_write_command_byte( 0x7c ). the ST7036 initialization sequence begins.php?/magazine/article/january2011_DesignCycle ■ LISTING 2. PPSCONbits. 3 zeiliges Display /1d warte_us(50). EECON2 = 0xAA. // mehr als 26. 4) #define ST7036_CSB As_(PORTD. // Spannungsfolger und Verstärkung setzen /6c warte_ms( 500 ).RD5 //EA DOGM162L-A RESET pin #define OUTPUT_PIN #define INPUT_PIN 0 1 //CSB 51 CODING THE EA DOGM162L-A DRIVER Before we can deliver bytes to the EA DOGM162L-A’s TRISCbits. // mehr als 26. I knew that I could make some sense of this jumble of German-English source code. So. Cursor Home warte_ms(400). 3) #define ST7036_RESET As_(PORTB. C4 setzen /50 warte_us(50). warten_ms(50). Set_Bit(ST7036_CSB).3µs ST7036_write_command_byte( 0x39 ). // Display löschen. 8 bit Datenlänge. EA DOGM163. the ST7036_init function follows along just like the example code in Listing 1. we must adjust their directions. Unlock ends Pin Remapping RPOR6 = 10.IOLOCK = 1. The coded pin assignments are echoed in Schematic 1: #define EACSB PORTCbits. Consider this line of C source that I gleaned from the mass listing: warten_ms(50). If you compare the timing marks of Listing 1 with Listing 2. To bring a Master SPI portal to life. 1) /* ein Byte in das ???-Register des ST7036 senden */ void ST7036_write_byte( char data ) { signed char u8_zahl According to the Listing 1 initialization source code. Basically. you won’t get very far. C1 setzen /7c warte_us(50). If you’re just joining us. we must establish a Master SPI portal at the USCM47J53 end of the proposition. 8 bit Datenlänge. // Function set. AVRGCC) *** NO FREE SUPPORT ON THIS PIECE OF CODE *** if you need an offer: mailto: programmer@demmel-m.IOLOCK = 0. ST7036_reset(). After the mandatory greater than 40 mS delay. 2 Zeilen warten _us(50). // Kontrast C3. The mnemonics shown in Listing 1 instruct us to delay for 40 mS. As you can see.Sample code for driving ST7036 on ELECTRONIC ASSEMBLY’s DOG-Series (tested on ATmega8. C source lines that began with warten or warte and ended with a semi-colon followed by a comment became prime targets as each source line contained a timing value. Cursor BLINKEN /0f warte_us(50). we revealed the magic behind the SPI remapping process in the previous Design Cycle.RC7 //EA DOGM162L-A CSB pin #define EARS PORTDbits. the peripheral pin select feature of the PIC18F47J53 must be unlocked which enables us to associate PIC18F47J53 Master SPI functions with multi-purpose PIC18F47J53 I/O pins: //Initialize the SPI // UnLock Registers EECON2 = 0x55.nutsvolts. So. // mehr als 26. the comment tells us to wait in excess of 40 mS and that advice is heeded by 10 mS in the actual code. Lock Registers ends // // // // // The EA DOGM162L-A’s CLK and CSB pins are driven to their inactive states and an ST7036 hardware reset is initiated. // Cursor Auto-Increment warte_us(50).3µs warten } SI pin. // Booster aus. // mehr als 40ms ST7036_write_command_byte( 0x38 ). I’ve included this code snippet. // mehr als 40ms /* ——————————————————————————————————. // Display EIN.3µs warten ST7036_write_command_byte( 0x1d ). BS 1/5.TRISC7 = OUTPUT_PIN. // mehr als 26. 5) #define ST7036_CLK As_(PORTC. 2) #define ST7036_RS As_(PORTD. remappable peripherals are selected via values placed in the peripheral pin select register set. Cursor EIN. C2. DESIGN CYCLE semi-colons and C comment slashes (//) to delineate lines of Germanic source code. Mehr als is German for more than and warten means wait. CSB is an EA DOGM162L-A input pin and a corresponding output pin must be configured at the USCM-47J53 end. To begin the Master SPI portal initialization process. // mehr als 200ms warten !!! ST7036_write_command_byte( 0x0f ). //RP23 (RD6) as SDI2 (input pin) Pin Remapping ends Lock Registers EECON2 = 0x55.3µs warten ST7036_write_command_byte( 0x01 ).RD4 //EA DOGM162L-A RS pin #define EARESET PORTDbits. // mehr als 26. // Bias Set.de —————————————————————————— ————————. // Instruction table 1 warte_us(50). Let’s apply these German timings and register settings to our USCM-47J53 SPI driver code. // ST7036_write_command_byte( 0x06 ). Kontrast C5. January 2011 . When I picked out the words Cursor BLINKEN.com/index. 2 Zeilen. which reads just a bit better than Listing 2: void ST7036_init(void) { Set_Bit(ST7036_CLK). // Function set.*/ //Serieller Betrieb von EA DOGModulen mit dem ST7036 #define ST7036_SI As_(PORTD. a 40 mS delay must be observed following a hardware reset. // mehr als 26.www. // mehr als 26. EECON2 = 0xAA. PPSCONbits. For instance.3µs warten ST7036_write_command_byte( 0x50 ). //RP6 (RB3) as SDO2 (output pin) RPOR13 = 11.

TRISD6 = = = = = OUTPUT_PIN.h.7uF 5 D7 D6 D5 D4 D3 D2 D1 D0 3V3 EN IN 36 37 39 R1 10K SDI 1 4 2 U1 MC74VHC1GT125DT CS SDO 3V3 SCK R2 100 ICSP 1 2 3 4 5 6 7 8 microSD CONNECTOR SDO CLK RS CSB 3V3 2 EDTP microSD INTERFACE CARD 1 2 3 4 5 6 3V3 NOTE: 1. to activate the LCD. However. As Wernher von Braun would have said.” At this point. The same holds true for the Microchip compiler. The EA DOGM162L-A’s RESET pin does exactly what you think it does. Yes it is.com 38 CSB VBUS VR1 TC1262-3. we would stuff the bits directly into the SPI SFR (Special Function Register) to initialize and configure the PIC18F47J53’s Master SPI portal.TRISD5 TRISBbits. //RS //RESET //SDO2 //SCK2 //SDI2 3 As you can see. that’s a no-brainer as the CCS C compiler has built-in delay functions. the EA DOGM162L-A’s CSB pin must be The first argument of the OpenSPI2 library function sets the SPI clock speed. I found that a SPI SCLK line clocked at Fosc/64 works best with the USCM47J53’s clocking system. However. OUTPUT_PIN.TRISB3 TRISCbits. by simply including spi. The SPI clock could be set up to run faster but through experimentation. The Microchip C18 C compiler comes equipped with library routines that take some of the bit twiddling tedium out of configuring PIC peripherals. For instance. to take advantage of the C18 C compiler delay routines. we can call upon their functionality like this: Delay10us(5) DelayMs(5) = delay for 50uS = delay for 5mS At this point.0uF 24 .h.7uF IN OUT 3 C10 4.3V3 1 2 3 4 5 6 1 2 3 4 5 6 VBUS C4 100nF ■ SCHEMATIC 1.TRISC2 TRISDbits. INPUT_PIN. Again. it’s pretty obvious that we’ll need to code some delay routines.3 3V3 C2 100nF C1 100nF R2 10K R1 10K SDO = MISO SDI = MOSI 1. CODING THE EA DOGM162L-A SPI DRIVER Basically. “Time is on our side. we need to send commands and data to the EA DOGM162L-A’s SI pin via the PIC18F47J53’s Master SPI portal SDO2 pin.TRISD4 TRISDbits. we must include TimeDelay. we can assemble our EA DOGM162L-A SPI driver routines. Schematic 1 reflects the EA DOGM162L-A RESET pin circuitry. there are procedures that must be followed in order within our EA DOGM162L-A SPI driver routines. OUTPUT_PIN. Once we have the delay routines in place. Normally. Much of our coding work has been done for us within the C18 SPI library. As far as the RS pin is concerned. The EA DOGM162L-A CSB pin resets the EA DOGM162L-A’s internal SPI bit counter on its falling edge. MODE_11. The MODE selection indicates 52 January 2011 www.0uF 3V3 3V3 CAP1N EA DOGM162E-A 22 CAP1P VIN VOUT E R/W RS 25 C15 A1+ A2+ C1C2- 1 20 2 19 12 13 14 15 16 17 18 19 20 21 22 EXT-5V0 COM 28 29 30 31 32 33 34 35 1 2 1 C11 4. “Kein Hexenwerk hier. Judging by the listings we’ve studied. If we were writing our EA DOGM162L-A driver code using CCS C. we also matched up the EA DOGM162L-A’s control lines (CSB. SMPEND). we have control of the PIC18F47J53’s Master SPI portal and as Mick Jagger would say. it performs the same command/data identification function as it does in parallel mode. if we want the USCM-47J53 to issue a hardware reset to the ST7036 — and we do — we must tie the its RESET line to VDD by way of a pull-up resistor and assign a PIC18F47J53 I/O pin to the RESET function. It can be tied directly to VDD. SMPEND (sample input at the end of data output time) is just a place holder here as the EA DOGM162L-A doesn’t send any data in the SPI clock stream back to the Master SPI device.downmagaz. However. we can open and configure the SPI2 Master portal with this selfcommenting line of code: OpenSPI2(SPI_FOSC_64. THE SLAVE SPI DEVICES ARE LABELED IN THE PERSPECTIVE OF THE PIC18F47J53. No matter if the SPI bit stream is carrying a command or byte of data. TRISDbits. that the SCLK rest (inactive) polarity is logically high and that data is transferred on the active to inactive edge of SCLK. OUTPUT_PIN.768 KHz C12 1uF R4 MINI-B USB RECPT 100K U1 GATE SCK CS 44 43 42 41 40 39 38 37 36 35 34 R5 470 Q1 DMP2123L SWITCHED_3V3 R3 1. RS. and RESET) with the appropriate PIC18F47J53 I/O pins and defined their data directions. ” (No rocket science here.5K CSB RS RESET SDI RC6/RP17 RC5/D+ RC4/DRD3/RP20 RD2/RP19 RD1 RD0 VUSB RC2/RP13 RC1/RP12 NC C8 12pF NC RC0/RP11 OSC2 OSC1 VSS2 VDD2 RE2 RE1 RE0 RA5/RP2 VDDCORE/VCAP 33 32 31 30 29 28 27 26 25 24 23 3V3 C5 100nF SDO 1 2 3 4 5 6 7 8 9 10 11 NC NC RB4/RP7 RB5/RP8 RB6/RP9 RB7/RP10 MCLR RA0/RP0 RA1/RP1 RA2 RA3 RC7/RP18 RD4/RP21 RD5/RP22 RD6/RP23 RD7/RP24 VSS1 VDD1 RB0/RP3 RB1/RP4 RB2/RP5 RB3/RP6 LED1 C7 20pF Y1 12 MHz 3V3 BLUE LED 3V3 LCD1 PIC18F47J53 26 C3 100nF C6 20pF C13 100nF 27 21 VDD VSS PSB 23 3V3 R6 10K RESET 40 RESET C1 10uF C2 100nF C14 1.) C9 12pF Y2 32.

we will use an LCD text holding area (LCDText[]) that is emptied only when its turn comes around in the queue.3. i < 32u. } } spi_data(LCDText[i]). //line break. Once the EA DOGM162L-A’s bit counter is reset by the falling edge of the CSB signal. } } spi_data(LCDText[i]).4) and // y = column (1 thru 20) char address. } January 2011 53 Note that the CSB pin’s fall to logically low and rise to logically high encapsulate the bit transmission in both the command and data transmission routines. spi_cmd(0x80|address). The WriteSPI2 function is provided by the C18 SPI library. Data is clocked out of the SDO2 pin when the EA DOGM162LA’s RS pin is driven logically high. i < 16u. EARS = 0. i++) { // Erase the rest of the line if a null // char is encountered (good for printing // strings directly) if(LCDText[i] == 0u) { for(j=i. case 4: address = 0x54. WriteSPI2(data). WriteSPI2(cmd). j < 32u. // Output first line for(i = 0. For instance. “Where there’s a function. DelayMs(2). j++) { LCDText[j] = ‘ ‘. our little spi_cmd function is the pivot point for our spi_gotoxy driver function: void spi_gotoxy( char x. we can code the following core driver routines: //*********************************************** //* SEND LCD COMMAND VIA SPI //*********************************************** void spi_cmd(char cmd) { EACSB = 0. case 2: address = 0x40. } //set DDRAM address It’s like the old axiom that states “Where there’s smoke. //line break.h”). we have to build our EA DOGM162L-A driver to step into and step out of the round-robin queue as quickly as possible. } 1 2 3 4 . The spi_data and spi_cmd functions form the basis for our EA DOGM162L-A SPI driver set. So. //line break. i++) { // Erase the rest of the line if a null // char is encountered (good for printing // strings directly) if(LCDText[i] == 0u) { for(j=i. j < 16u. j. the RS pin must be conditioned to inform the EA DOGM162L-A about the type of data it is about to receive. } address += (y-1). char y) { // where x = lcd row (1. The text holding area is a simple ASCII array that is loaded by the user and dumps its text to the EA DOGM162L-A with a cue from the update flag: void spi_update(void) { char i. plus other various tasks. } // Set the address to the second line line2. there’s fire. there’s a macro. // Go home line1. EACSB = 1.update = 0.1) //goto line 1 LCD macro #define line2 spi_gotoxy(2.” In our case. j++) { LCDText[j] = ‘ ‘.DESIGN CYCLE driven low before any bits are clocked out of the Master SPI portal’s SDO2 pin. } //*********************************************** //* SEND LCD DATA VIA SPI //*********************************************** void spi_data(char data) { EACSB = 0.1) //goto line 2 LCD macro The USCM-47J53 operates in a round-robin environment. EARS = 1. case 3: address = 0x14. } flags. switch (x) { case 1: address = 0. The inclusion of the C18 delay library routines (#include “TimeDelay. which we included into our application (#include “spi. EACSB = 1. //line break.” We can spin the spi_gotoxy driver and spi_cmd functions into a trio of EA DOGM162L-A driver macros: #define lcdcls spi_cmd(0x01) //clear the LCD macro #define line1 spi_gotoxy(1. With that. That means that the PIC18F47J53 is servicing a USB port as well as the EA DOGM162L-A LCD. A command is transmitted when the EA DOGM162L-A’s RS pin is driven logically low. To accomplish this. // Output second line for(i = 16. DelayMs(2). default: address = 0.2.h”) takes care of the 2 mS delays at the end of each of our bit transfer routines.

The PIC18F47J53 datasheet is rather detailed when it comes to the description of the operation of the real-time clock calendar.TMR1CS0 = 0. One other important fact you need to know is that the time/date data is stored within the RTCC as BCD digits. The trick is loading the date/time registers and picking out the date/time data that your application requires.768 KHz crystal. TIME IS ON MY SIDE The PIC18F47J53 is equipped with a full-monty RTCC.TMR1CS1 = 1. and half seconds. the PIC18F47J53’s RTCC contains alarm capability. In addition to keeping time and date. months. However. The ticks generated by the TIMER1 oscillator produce time keeping in years. Here’s all we need to do to put a message on the EA DOGM162L-A glass: //Display Character position 12345678123456781234567812345678 char lcdmsg_dc[] = “ DESIGN CYCLE SPI LCD Driver “. you would have to reload the RTCPTR bits to point at the byte set you desire to manipulate. the PIC18F47J53’s internal RC clock can also be used as a timing source.x<sizeof(lcdmsg_dc). minutes. All we need to make the PIC18F47J53’s real-time clock calendar tick is a clock source and a little bit of code. you must write to it if you want the RTCC innards to automatically move to the SECONDS byte. EECON2 = 0xAA.T1OSCEN = 1. they will stay there until the user resets them.++x) LCDText[x] = lcdmsg_dc[x]. The PIC18F47J53 datasheet provides a recommended method that involves writing a 0x55/0xAA sequence before setting the RTCWREN write lock bit: EECON2 = 0x55. The RCTPTR bit set will decrement after every access to the RTCVALH register.TMR1ON = 1.downmagaz. for(x=0. The USB connection is a bit more than a power source as the USCM-47J53 has enumerated and clocked in as a HID class device with the host laptop. set the RCTPTR bits to 01 and load the data to RTCVALL. seconds. // T1CONbits. Table 1 is representative of how the date/time data is arranged. The dog is barking and standing on its hind legs in Photo 1. The USCM-47J53 has pad area to support a Fox FX135 SMT 32. Whether you use the WEEKDAY byte or not. it all boils down to a few “must do” operations and an understanding of where the time/date data resides.768 kHz crystal controlled clock. Note that the spi_update driver routine automatically divides the LCDText array contents into a pair of 16 character lines.com .The spi_update function is a modified version of the generic parallel LCD driver that comes with the Microchip application libraries. Otherwise.update = 1. In that we’re using the Timer1 oscillator option. RTCCFGbits. we can now enable the RTCC and write to the date/time array: 54 January 2011 www. //power up the T1OSC //crystal driver T1CONbits. flags. Writes to the date/time array are controlled by the RTCWREN bit which must be set to allow writes to the date/time array. //start TIMER1 The next step in getting the RTCC up and running involves unlocking the date/time array for write operations. Once the RCTPTR bits reach 00. Thus. hours.RTCWREN = 1. Two bits form a pointer to the date/time data within the RTCC. Configuring the PIC18F47J53’s RTCC begins with the configuration fuse settings: #pragma config RTCOSC = T1OSCREF //RTCC uses T1OSC/T1CKI as clock Our application employs the preferred external 32. ■ PHOTO 1. The FX135 is the missing link in the PIC18F47J53’s TIMER1 oscillator chain. The USCM-47J53 is running in USB HID mode and has enumerated with the Lenovo laptop host. we could spin up some laptop-side and USCM-47J53-side code to display characters under the control of incoming HID report packets. we must also make sure that Timer1 is activated: // Initialize the RTCC T1CONbits. //clock source is //T1OSC T1CONbits. The results of the modified version are the same as the original routine with the exception of the bits being driven over a SPI portal via our spi_data routine. day of the week. However. With the write lock removed. To write to the HOURS byte. days.

//get MINUTES LCDText[3] = hibyte. //clear the rest of the LCD On the next pass through the ProcessIO function. we perform the display test on the 1’s value of the SECONDS ASCII bytes. } Since we obtain the SECONDS value before we acquire the MINUTES value. LCDText[5] = ‘:’. //get WEEKDAY and ignore Reading the WEEKDAY automatically decrements the RTCPTR bit pair and places us in the position to January 2011 55 . It is recommended that we write lock the date/time array after finishing the required write operations: EECON2 = 0x55.RTCPTR1 = 0. //HOURS //WEEKDAY //SECONDS //MINUTES Note that I have set the RTCPRT bit pair to point at the WEEKDAY/HOURS registers. RTCVALL = 0x59. RTCCFGbits. we’ll read the WEEKDAY value and simply ignore it: get_bcd(RTCVALH). the state of the update flag will determine if a new time value will be displayed on the EA DOGM162L-A’s glass: if(flags. RTCVALH = 0x59. LCDText[7] = lobyte. The trick is to set the RT CPTR value and load or read the least significant byte first.RTCPTR1 = 0.RTCWREN = 0. All we need to do is add 0x30 to each RTCVAL to convert the RTCC’s BCD data to display-able ASCII. To display the time every second. RTCCFGbits. Let’s walk through the process beginning with setting the RTCPTR pointer bits: RTCCFGbits.update = 1. read the SECONDS value.update) { spi_update(). the time will be updated on the LCD in the next round-robin task pass.y<33. //get HOURS YET IT IS Photo 2 is proof that we followed the rules of the ■ TABLE 1. The HOURS bytes are read and stuffed into the LCDText array. Following the SECONDS value acquisition. lobyte = (data & 0x0F) + 0x30. The clock is running. RTCCFGbits. LCDText[0] = hibyte. I’ve added the prev_secs variable. This is easily done with the LCDText array pointer values: get_bcd(RTCVALH). prev_secs = 0x30. EECON2 = 0xAA. Meanwhile. we must adjust the position of the MINUTES and SECONDS values in the LCDText array. //get SECONDS if(prev_secs != lobyte) { prev_secs = lobyte. The prev_secs value is compared to the latest retrieved SECONDS value with every pass through the round-robin task queue.RTCEN = 1.RTCPTR0 = 1. We can pipe the time to our EA DOGM162L-A LCD using our spi_update function coupled with a new function that retrieves and converts the raw date/time for use by the LCD: void get_bcd(unsigned char data) { hibyte = ((data & 0xF0) >> 4) + 0x30.DESIGN CYCLE RTCCFGbits. //point to HOURS We can use the second line of the LCD to display anything we wish. } LCDText[6] = hibyte. The WEEKDAY value is set for Sunday (0). Rather than reload the RTCPTR bits. If the values don’t match. the date/time array holds time data only with a value of 23:59:59. we are in the position to access and read the HOURS value: get_bcd(RTCVALL).RTCPTR0 = 1. RTCVALL = 0x23. } Using our new get_bcd driver function. the spi_udate function is triggered and all of the date/time information that has been stuffed into the LCDText array is displayed. LCDText[4] = lobyte. LCDText[1] = lobyte. When we pass by the MINUTES set instruction. LCDText[2] = ‘:’. I’ve elected to clear the rest of the LCD by writing NULL characters to the remaining DDRAM locations: for(y=8. In this instance. Note that we “ignored” the WEEKDAY value by not saving the value into the LCDText array. RTCVALH = 0x00. we stuff the current SECONDS value into the LCDText array for display: get_bcd(RTCVALL). When the values don’t match. flags.++y) LCDText[y] = 0. RTCCFGbits.

“You’ll Come Running Back“ for more next month. The high intensity light emitted by my Flash boxes wiped out the display pixels and so did the standard camera flash.. Taking it one step further. SOURCES Mouser Electronics EA DOGM162L-A www. the camera is fast enough to catch the pixels before they disappear..com Microchip Microchip C18 C Compiler Microchip Application Libraries PIC18F47J53 www. We can just as easily run the EA DOGM162L-A and USCM-47J53 as a CDC device which forces the USCM-47J53’s USB portal to emulate a standard RS-232 portal. What you see here is the display rolling over between 32 and 33 seconds just as the flash popped. The application frameset we’ve used today is based on the HID model. Inc.mouser. the microSD card can be activated for instant mass data storage capability.microchip.com Fred Eady can be reached at fred@edtp. NV ■ PHOTO 2.com EDTP Electronics.com. I’ll end this edition of Design Cycle with the bridge of Mick’s song .edtp.com . hopefully. 56 January 2011 www. USCM-47J53 www.downmagaz.RTCC to the letter. Fortunately.

January 2011 57 .

AVR_Toolbox What we really need is a well organized toolbox for www.. In the last two articles. and to make matters worse. I often can’t even find where I left the working code. if you didn’t see it when you were looking just now . then reality smacked me up side the head and I realized that we were getting into fairly complex stuff without having discussed some of the background concepts we will need to understand to keep from getting too confused.com .com www. The point is that without some higher level of organization. the ADC for light.downmagaz. so you go looking for it and hours later you find it under a pile of other widgets gathering dust in a corner. A data logger uses just about everything that a microcontroller can do. In a real workshop. and then realize AGAIN that for the next step you need another widget just like one you built several months ago.nutsv by Joe Pardue ■ FIGURE 1. I wrote the stuff and can’t rewrite it from memory. temperature. I Left It Around Here Somewhere . we built a new light chaser LED project that had nothing to do with memory). the hardware SPI to talk to the DataFlash. So now. yes the laws of nature work here — it really is the last place you’d think to look. attach it to your project. Smiley’s Workshop is like a typical real workshop: It is very messy. So.] So you dust it off. when we examined AVR memory we divided it up into five articles where we learned about each type of memory and wrote some code that let us use each type. build a copy of it. you can easily recall all that you learned and immediately write the code — right? Well.. [And. if you can. We will be using the DataFlash to log the data.. you’ll be puttering along with a project and remember that you need to use a widget similar to one you built a few month’s ago. but where? And off you go again. you’ve got a better memory than I do.. AVR_Toolbox. we learned more about SPI (Serial Peripheral Interface) and how to use it with the AVR Butterfly’s 4 Mbit DataFlash. we’ve been pretty much dealing with only a few things at a time. we learned to access external memory in the Butterfly’s Atmel DataFlash using the SPI bus (with hardware and software versions — and as a side benefit. g with this Follow alon book & kits e’s series! Jo ailable at are av olts. and other things that escape me at the moment. with all these great simple projects under your 58 January 2011 belt. I ended that article with the promise that this month we would use the Butterfly DataFlash in a data logger application. the USART to talk with a PC. And darned. one of the timers for a real time clock. Up to now. this month we will begin to build resources that we will use later to make that promised data logger. this project will get out of hand. However. and voltage sensors.#30 AVR_Toolbox — Documentation and Libraries Recap Last month. For instance.

nl/~dimitri/doxygen/] is a software documentation system that helps you write comments in your source code that can be scanned to produce documents in a variety of formats. After selecting and SPI number. Most of the doxygen commands use a backslash (‘\’) character such as \mainpage. This code was tested for SPI0 in both software and hardware modes on the ATmega169. Test it for the ATmega644. \todo 2. If you keep your documents in a separate manual and you make a change in the code. Anyone can download the code and since this is a “we” project.gif <center>Visit us at: http://www. \todo 3. likewise. [The source code file is in the Workshop30. we will convert those functions into a library that we will document with doxygen to illustrate the principles involved.\n Which are alia’s for the software or hardware version.html and . then the user selects either software or hardware for that number: //#define SPI0_SOFT #define SPI0_HARD The user accesses the following functions:\n void spi0_init_master(void).exe January 2011 59 . We expect to get better with time. we will be able to use the same toolbox. The user first selects a SPI number from a list that can be expanded as needed: #define SPI0 //#define SPI1 //#define SPIx // place holder ■ FIGURE 2. Retest with the Arduino board.chm). Documenting With Doxygen Doxygen [http://www. you and me! Because of the miracle of the Internet. you can even keep a to-do list directly linked to the code (shown in Figure 8).com </center> \mainpage SPI (Serial Peripheral Interface) This code was designed to allow the user to create multiple SPI links using either bitbanged software or regular AVR hardware SPI. making it easy to change it also. I especially need feedback on typos and bugs. AVR_Toolbox is a work in progress and always will be. There are many doxygen commands. you will find doxywizard. If we change the code. Since we discussed the SPI last month. be sure and post something in the ‘issues’ page. I’d be happy (even grateful) for your help.] Using Doxygen After you install doxygen.\n uint8_t spi0_master_rw8(uint8_t to_slave). most relevant here are HTML (shown in Figure 2) and Windows Help files (. but we will only use a small subset of them to keep things simple. we expect our tools to get better. we create the documentation for our main page using the doxygen \mainpage directive: /*! \image html AVR_Toolbox. if you want to participate (and aren’t crazy). The AVR_Toolbox (metaphorically shown in Figure 1) is an open source project hosted on Google Code [http://code. With doxygen. First.stack. com/p/avrtoolbox/] where you will be able to access all sorts of AVR tools discussed in Smiley’s Workshops. we’ve got the documentation right there in the code.smileymicros. Doxygen can do a lot of stuff and the AVR_Toolbox documentation is only one way to do things — one way that might evolve over time as we learn more about it. ATmega328.zip available from Nuts & Volts. One good reason to use doxygen is that it allows us to keep the documentation in one place tied directly to the source code. Please note that I said ‘we’ — yes. 2010 */ Doxygen will find this section and turn it into an html file that looks like Figure 2.google. you’ll write a note to yourself to remember to change the manual and then (if you’re like me) you’ll lose the note. The first thing to notice about the code is that the section we want doxygen to look at is delimited with /*! and */.SMILEY’S WORKSHOP ☺ all our stuff. so if you see any problems.\n uint16_t spi0_master_rw16(uint16_t to_slave). and ATmega644 (TODO) \todo 1. Doxygen generated HTML main page. Improve the comments before letting this puppy loose! \author Joe Pardue \date October 29.

save it along with the rest of your project and ■ FIGURE 5. In the frame on the left. then if you want to change anything. click on the SPI file and you’ll see the functions listed as ■ FIGURE 6.nutsvolts. I was shocked the first time I ran through this because the doxygen generated output document looks surprisingly good.www. in the bin file.com . and set the output as shown in Figure 5. After you have finished playing with doxygen and are ready to close it. It makes you want to go back to the code and spiff it up a bit just so it won’t be embarrassed to be seen with such classy documentation. Doxywizard mode. Doxywizard output.zip]. it will ask if you want to save the configuration file ‘Doxyfile’ – which you do. You’ve seen the main page in Figure 2. Click Next. so play with it a bit to see what you’ve really got.php?/magazine/article/january2011_SmileysWorkshop ■ FIGURE 3. and save time filling in the wizard boxes. Click Next and set the mode as shown in Figure 4. Doxywizard project. 60 January 2011 www. the next time you run doxygen you can use the File menu to open the existing Doxyfile. In our case. Click Next again. we will be creating html documentation for the SPI functions in doxygen_test [in Workshop30. but skip the Diagrams and you get what you see in Figure 6 where you will click on the ‘Run doxygen’ and doxygen will generate your html files.downmagaz. This application provides a GUI front-end for doxygen that helps simplify using it. Open it and fill out the project information as shown in Figure 3. So.com/index. ■ FIGURE 4. Looking At The Doxygen Generated Output Quite frankly. Doxywizard run. Clicking on ‘Show HTML output’ will open your default browser with the files as shown in Figure 2.

chm. ■ FIGURE 8. As we progress with developing our AVR Tools library. HTML Help Workshop. and that you need to click on index. keeping in mind that our goal is to make the code documenting process as simple and easy as possible so we will use it. Set Doxygen to prepare the HTML output for compressed HTML (.hhp generated by Doxygen which will fill out the IDE as shown in Figure 10.SMILEY’S WORKSHOP ☺ ■ FIGURE 7. we will add a few more doxygen features to the process. You will probably want to ■ FIGURE 10. shown in Figure 7. January 2011 61 . doxygen_test. Doxywizard output compressed HTML. Download Microsoft HTML Help Workshop from http://msdn. Click on the ‘Compile HTML file’ button as shown in Figure 11.microsoft. Click on the Todo List and you’ll get what’s shown in Figure 8. Doxygen generated SPI function. Compile HTML file. You can convert these files into a single compressed HTML (. but with just enough features to make the output really useful. Change the name to ■ FIGURE 11. Converting To The HTML Help .html to open the browser to access them.aspx. Open HTML Help Workshop and click ‘File\Open.chm) by selecting what’s shown in Figure 9.chm and click on it to reveal the help file shown in Figure 12. then run it to create the file.chm) file (such as the typical Microsoft Help file shown in Figure 12). The results will be index. Doxygen generated Todo list.com/en-us/library/ms669985.’ then browse to select the index.chm File You will notice that the HTML output is about 40 files ■ FIGURE 9.

We want to ■ FIGURE 16.c that we used for our doxygen test. Libraries It might seem logical to keep a bunch of related functions in a single text file like we do with SPI.■ FIGURE 12. there is a problem with this in that when we write a program that only uses a few of the SPI functions. You now have one simple way to generate documents for your source code and you have an introduction to a tool (doxygen) that has many other features you may want to explore. the compiler will create a single object module for it and all the functions whether used or not will get linked into our program. ■ FIGURE 15.c file.c files. We don’t want that. Doxygen_test compressed HTML Help file. Find the Command Prompt. This has the same information in it as the HTML files generated earlier. Individual functions as . Add the . However. expand this to full screen. ■ FIGURE 14.c files. Verify that you’ve created the objects. ■ FIGURE 13. if we include the entire SPI. increasing our code size unnecessarily.com . but it is now all in one file (half the size of the original html) and the Help format provides some search options not available viewing the HTML version in a browser. 62 January 2011 www.downmagaz.

we will use a Butterfly specific subset of the SPI functions discussed last month. Next. we extract the SPI functions that we want to use with the Butterfly into four separate . spi0_master_rew16.exe — in the WinAVR bin directory (in my case.c file that.exe). Since we are going to be using the AVR Butterfly for our data logger. The library creation program requires a long and difficult to type January 2011 63 . keep the code as small as possible and only link to the functions we will use. we add the main. and spi0_SS.c files: spi0_init_master. we add them to an AVRStudio project SPI_Library as shown in Figures 13 and 14. does nothing: int main() { // Do nothing since this program // is just to create the objects } ■ FIGURE 18. The linker will scan the library to find only the functions that are used in the code. Let’s do this cookbook style.c. C:\WinAVR20090313\bin\avr-ar. then copy and paste it to the cmd window. Use Notepad to input the command string shown below. Don’t try to type your commands into the Command Prompt since (if you are like me) you will never get it right.c. you must first find the ‘Command Prompt’ by browsing to the Windows Accessories directory as shown in Figure 16.’ the following string will create our library: Run the compiler and you will generate the object modules for each of the . In order to do this.c.c files that will be located in the \default directory as shown in Figure 15. command line. spi0_master_rw8. Then. First.c. Assuming that our object files are in ‘C:\SPI_library\. in this case. To use this. and put them into a special Butterfly SPI library. Project Options. then open it as shown in Figure 17. Run avr-ar in the Command Prompt.SMILEY’S WORKSHOP  ■ FIGURE 17. You will find the library builder — avr-ar. we will put each function into a separate file and compile each function into an object module that we will then put in a library.

Next. Using libButterflySPI. Click okay and compile the project.downmagaz. Next month — if all goes well — we will continue with AVR_Toolbox by making it an open source project. Click on the libraries icon to open the window shown in Figure 18.avr-ar rcs C:\SPI_library\libButterflySPI.o NOTE that this must all be on one line and is shown here on several lines since it would be too wide otherwise.c file. as mentioned above. It should compile okay and function exactly like it did when you used the SPI.a to replace it. > Simple for non-technical end users. In the upper part of this window. for all Microchip C compilers. to “wire it all together. From the makers of HIDmaker FS: om m www.o C:\SPI_library\default\spi0_master_rw16. we open the AVRStudio Project menu and select the Project Options. It will show SPI\ in the upper text box and it will also locate the libButterflySPI. Copy and paste it as shown in Figure 17. simply. If you just can’t wait and want to get a good leg up on C and the AVR (while helping support your favorite magazine and technical writer). Lay Out Your Content (with gorgeous web-ready screen controls that you can grab on to) using TCPmaker’s drag & drop Visual Page Designer. you don’t get any messages. with variable names that YOU create. so you’ll want to look in the SPI_library directory and make sure that libButterflySPI. > Grows with your product line: for a new product w/ different processor or connectivity type.a file and show it in the ‘Available link Objects:’ list. > Encrypted system protects your firmware from theft or from being programmed into the wrong device.a C:\SPI_library\default\spi0_init_master. Define Your Data. NV 64 January 2011 www. we delete the SPI. just add another SUMS bootloader. Wrap-Up TCPmaker for control over the Web Easy as 1-2-3: 1. 2.zip].com . 3. then click the ‘Add Object’ button to add it to the ‘Link with these objects’ list. We can document and create libraries for all those Butterfly goodies that we’ll want to use in our data logger. Highlight the library. Generate Your Code. click on the little folder icon (left of the red X) and navigate to the SPI folder. and securely. buy my C Programming book and Butterfly projects kit through the Nuts & Volts website. > Automatically delivers upgrade by email.a is really there.c file and copy/paste libButterflySPI.a Let’s test this by copying the DataFlashTest project from last month’s workshop to a new SPI_Library_Test directory so that we can test known good code with the new library [source is in Workshop30. So it works the same.com 888-474-1041 Now we know a good way to document our software and a way to create libraries.” NO PC PROGRAMMING AT ALL – just point your web browser at your device! Simple Upgrade Management System Low cost integrated system manages upgrades across different processors & connectivity types: > Lets your end users upgrade your PIC firmware safely. Make sure there is a single space between each item.o C:\SPI_library\default\spi0_SS. Push the ENTER button on your keyboard and if it runs okay. what did we gain with all this rigmarole? The main thing. is that now the project will only use (compile in) the functions that you actually need and not clutter things up with unnecessary functions.tracesystemsinc. This works pretty much like last month’s DataFlash program except that in the SPI subdirectory.o C:\SPI_library\default\spi0_master_rw8.

35mm diameter gearhead. Yellow-green LED backlight. Call. Built-in charge control board with 10K NTC.5" red lens. 21MM PIEZO ELEMENT 50mm wire leads. STN Transflective LCD.D • Shipping and Handling $7.. Hot-swappable and plugand-play connections. CAT# DCM-518 $ 1500 each VIBRATING MINI-MOTOR Designed to vibrate in cell phones or pagers.A LL E L EC T RO NIC S C O R P O R A T I O N SATELLITE SPEAKERS W/ BRACKETS Compact. sealed cabinet. attention-getting display with more than 100 LEDs operates on 120 Vac. Each speaker is 2. CAT# VTL5C1 $ 200 each CAT# SK-331 20 pairs for $8. 12" dia.5 x 10 x 10mm high.5mm overall.6mm. Mid to high-range 4Ω shielded drivers with 2" diameter. Removed from service in good.0 ports to your PC or Mac. VAN NUYS. this tiny 1. send $3.com 1-800-826-5432 FAX (818) 781-2653 • INFO (818) 904-0524 E-MAIL allcorp@allcorp. Module size: 182 x 33..00 for the 48 Continental United States . Removed from working equipment in very-clean condition. American Express or Discover • Checks and Money Orders Accepted by Mail • Orders Delivered in the State of California must include California State Sales Tax • NO C. fast response time. Three mounting holes on face of motor. Not suitable for automatic insertion. Write. Character size: 3. 120 VAC. SINGLE-OUTPUT VIDEO AMPLIFIER 50-900MHz. surface-mount solder tabs. 80 RPM @ 19vdc. 56 RPM @ 12Vdc (no-load). 96:1 gear ratio. very high dark resistance.S.00 postage.10 each • 100 for 95¢ each Shop ON-LINE ORDER TOLL FREE MAIL ORDERS TO: ALL ELECTRONICS CORP. January 2011 65 . Outside the U. including terminals and shaft. Hawaii.5mm x 11mm long. Matte-black. Body is 4.5-4. and printers. 30mm diameter motor.5Vdc motor has an offset weighted shaft. 6" overall depth. 0.A. 6.7V 550 mAh Li-Polymer rechargeable iPod Mini battery. and Canada Must Pay Full Shipping • Quantities Limited • Prices Subject to change without notice.00 each $ 1600 each 12DB.50 each $ 850 each each MICROMINIATURE 12 VDC SPDT RELAY Fujitsu #FBR21D12. 8 x 10 x 12mm long.00 per pair $ 900 per pair CAT# RTL-1 10 for $14.9" square x 4. CAT# AMP-612 CAT# XLR-3FX 25 for $2. external hard drives. RED ARROW LED TRAFFIC LIGHT.com NO MINIMUM ORDER • All Orders Can Be Charged to Visa. 4. FAX or E-MAIL for a FREE 96 page catalog. flash drives. 100mA (no-load).ALL OTHERS including Alaska.R. 75mm. P.5 x 13.55mm iPOD MINI BATTERY 3.1VA. Adjustable wall-mount swivel bracket with each speaker. 7. XLR CABLE CONNECTOR. Viewing area: 154. 18mm.2 x 5. wall-mount satellite speakers.4" long.5mm x 5. Bright. VTL5C1 OPTOISOLATOR / OPTOCOUPLER Perkin Elmer VTL5C1. CA 91411-2610 www.65 each $ 300 per pk $ CAT# PE-56 850 each each $ 1.4" (35mm) uninsulated clips. 3-POLE FEMALE Neutrik # NC3FX. Wire leads. x 1. CAT# RLY-616 7-PORT USB HUB Provides seven additional USB 2. 2A. 80¢ each 10 for 65¢ each 100 for 50¢ each CAT# USB-71 $ 1095 each CAT# DCM-382 $ 125 each 10 for $1.5A @120VAC. MANUFACTURERS . Rated 19. Operates on 120Vac. working condition. Flat.We Purchase EXCESS INVENTORIES. 100dB dynamic range. Mastercard. QUALITY Parts FAST Shipping DISCOUNT Pricing CALL. 36" leads.40 each 40 CHARACTER X 2 LINE LCD W/ LED BACKLIGHT #UMSH3077JDYG. 12VDC 534 Ohm coil. CAT# ALG-27 $ 300 5 packs for $2. 100 each 10 for 85¢ each PRECISION GEARHEAD MOTOR. May be scuffed.5mm. collar and mounting plate. One upstream and seven downstream ports. Overall length of motor and gearhead. to connect digital cameras. USED 12" diameter LED Arrow traffic signal. 14928 OXNARD ST. WRITE.allelectronics. Maximum carry current.5mm diameter x 20mm long shaft.4" ALLIGATOR CLIPS 1. Prepped with 17mm diameter metal gear.. Overall length. SPDT contacts rated 1A @ 24Vdc. Includes rubber mounting gasket. 20 per package. Note: PC leads are not stiff. 33 x 40 x 4.1Vdc. soft-edge cones. E-MAIL or Fax YOUR LIST.4 x 16. Three 38mm leads with female connector CAT# LCD-3077 CAT# LBAT-54 $ 500 10 for $7.O. USED Pittman # GM8712F191 / PM3662. VHF/FM/UHF amplifier.

Communications. Test Fixtures. Power. COM AM/FM Broadcasters • Hobby Kits Learnng Kits • Test Equipment .nutsvolts.ELECTRONET WWW . Display.com .com Electronic Parts & Supplies Since 1967 For the ElectroNet online. BASIC ON BOARD Eliminates development tools ATRIA Technologies Inc www. Experiments.downmagaz. POLOLU .AND LOTS OF NEAT STUFF! Microcontroller Boards GREAT for Breadboards. Prototypes. go to www.com Looking for solar stuff and kits? www.. Home Projects. Labs and more.nutsvolts..com click Electro-Net 66 January 2011 www.AtriaTechnologies. Microcontrollers.

These flight computers combined an APRS tracker with a programmable microcontroller and allowed me to follow the near spacecraft. HSERIN is a background command that permits the PICAXE to read serial data into its scratch pad while it operates the rest of the mission. In addition to the power switches and indicators. GPS data is constantly read into memory for processing at a later time. I’ve made about one dozen flight computers for near spacecraft. and the near spacecraft to autonomously operate experiments. now with a microcontroller selected. The power switches and indicators are routed (by cables) to the exterior of the airframe. y goal was to create an affordable near space flight computer that was still worth flying into near space. However. PAUL VERHAGE THE NEARSPACE ULTRALIGHT — THE EVERYMAN’S FLIGHT COMPUTER Since 1996. launch crews switch the near spacecraft on and off without opening up the near spacecraft. there are power supplies. M power indicators for both the logic and servos. the Commit Pin and programming port are also routed to the airframe. The programming port is a female DB-9 connector and permits sensors to be tested and the flight program updated without ■ The NearSpace UltraLight is a plug and play flight computer. With the advent of the Tiny Track 3 by Byonics and the PICAXE-28X by Revolution. Of its inputs. By placing them on the airframe. This PICAXE has 2 Kb of memory and up to 12 inputs and 17 outputs (depending on its configuration settings). and . it wasn’t the PICAXE’s large number of inputs and outputs that sold me.NEAR APPROACHING THE FINAL FRONTIER SPACE ■ BY L. It’s a match made in near space. and two camera channels. The Commit Pin prevents (if written into the flight program) the UltraLight from recording data while still on the ground. three digital channels. January 2011 67 THEORY OF OPERATION First. The UltraLight has four analog channels. it’s time to design a flight computer around it. two servo channels. Separating servo power from the rest of the flight computer ensures the servos can’t brown-out the flight computer should they seize up in near space or the battery goes weak. The most affordable PICAXE capable of meeting this need was the PICAXE-28X1. power switches. So. four of them can digitize analog sensor voltages in the name of science. a very capable flight computer has become affordable to those wishing to start a near space program. it was its hardware serial input. Just plug in the GPS receiver and you’re ready for a near space mission.

+5 volts. Once bypassed.nutsvolts. and ground. 68 January 2011 channels. The final port (and different from the others) is the Camera Port which operates the shutters of two cameras.com/index. The UltraLight uses the three-pin servo standard for all its I/O ■ The back of this DB-9 has solder cups that allow wires to be soldered directly to the connector. if a camera’s power switch has also been bypassed. opening the airframe. The third port is the Servo Port. These are cameras in which a cable has bypassed the camera’s shutter button. The Camera Port can control two different styles of cameras.com . There are two additional LEDs on the airframe. These indicate when the GPS has a lock and when the flight computer is transmitting a position report. Therefore. The second port is the Digital Port with its three channels. A good example is the Geiger counter. This is where sensors that produce ON/OFF signals connect to the flight computer. The Analog Port digitizes sensor voltages with a precision of either eight or 10 bits. It controls the positions of two servos. First. and to release dropsondes. it produces a pulse (0 to 5 volts) upon the detection of a cosmic ray.downmagaz. First are the traditional cameras with modified shutters. The second type of camera that the UltraLight can operate is a Canon camera running the USB remote. the two channels of the Camera Port can power on and off a camera and trigger its shutter.www. It’s more convenient if the flight computer’s I/O provides not only access to the PICAXE. Servos are useful in near space to position experiments. the cameras depend on the flight computer’s relays to trigger their shutters. like cameras. there’s the Analog Port of four channels. each channel in the I/O has a connection directly to the PICAXE. The I/O channels on the UltraLight are grouped into four ports based on their function. Alternatively. but also provides power to all experiments plugged into them. www.php?/magazine/article/january2011_NearSpace ■ The schematic of the NearSpace UltraLight.

Note there’s one jumper wire beneath the male DB-9 connector (the diagram illustrates it as the wire peeking out from under. The transmitter socket consists of ■ This is what the mounted male DB-9 will look like on your UltraLight flight computer. at the bottom-left of the connector). January 2011 69 .N E A R S PA C E These cameras use a CHDK script to sense a +5V signal in their mini USB. The near spacecraft’s antenna attaches to the SMA connector next it. All seven capacitors are polarized. Usually. ■ The parts placement for the NearSpace UltraLight by NearSys. Without this inversion. So. reformats it for APRS. you’ll get your near spacecraft back to fly another day. This ensures your mission data is clean — you don’t have to edit out 90% of the position reports in an APRS log just to get your science results. It makes installing the DB-9 into the PCB easier if the cut resistor leads are not all the same length. note that the Camera Port is not just for cameras. resistors. don’t worry if you made an error in your flight code. Byon Garrabrant has obviously put a lot of care into the design of the Tiny Trak 3. Finally. and then keys the radio and sends the appropriate tones. make a single-sided PCB from the pattern available in ■ Two down and seven more to go. The 2N3904 transistor is next. So. You should be getting the impression the NearSpace UltraLight is a basic near space flight computer. The last IC is the MAX232. It’s a bullet-proof. Any device requiring a switch closure or a five volt signal to operate can replace a camera. check the diagram for their correct orientation. Once you acquire the parts for your UltraLight. This IC inverts the GPS data for the PICAXE-28X1. including one for the transmitter. only a failure of the GPS or main power is going to bring the mission to an early end. There are two other ICs onboard the UltraLight. The 2N3904 transistor between the Tiny Trak and the transmitter inverts the press-to-talk signal from the Tiny Trak. This is necessary to properly key up the BM1HT transmitter. Since the PICAXE and Tiny Trak 3 run parallel to each other. transmit only terminal node controller (TNC) that takes GPS data. Those groups new to the near space field will find that the UltraLight makes a perfect first flight computer. Begin with the jumper wires. don’t trim them until after you’ve soldered the DB-9 to the UltraLight PCB. The first is a 24LC256 (or other similar IC) with a 32 Kb memory (operating over an I2C network) for storing flight data. but other features can be coded into the camera’s script. Since the Tiny Trak 3 is not used to telemeter science data. CONSTRUCTING THE ULTRALIGHT Start by acquiring the components listed in the Parts List. Use tantalum capacitors as they are sealed and can’t leak under a vacuum. The tracker half of the UltraLight is a Tiny Trak 3 by Byonics. and diodes. but still very capable. that data is stored onboard the flight computer and downloaded after recovery. Next. the script causes the camera to take a picture. the download on the Nuts & Volts website. Use IC sockets. There’s nothing tricky about assembling the UltraLight. the flight computer is not able to take advantage of the HSERIN command. add the capacitors. The radio is transmit-only wide band FM and produces a 400 mW signal.

and just solder the end pins to • • • • • • • • • • • • • • • • • • • • • DB-9 (male) DB-9 (female) One row receptacle (20 pins) Right angle header (two pins) Shorting block 2 x 3 pin header (3) AAA battery holder 9V battery snap SMA connector (145374 from Jameco) SMA cable (three feet long) Piezo beeper or alarm (2) 1N4001 diode (3) Sub-miniature toggle switches (SPST or SPDT) (2) Reed relay (RadioShack 5V reed relay) 3 x 3 pin receptacle 3 x 4 pin receptacle 3/16” plastic tube 2” long (4) #4-40 bolts 1/2” long (4) #4-40 nylock Hook-up wire (at least 17 feet of #24 AWG stranded) 12 gauge solid wire 40” long Parts List • Radiometrix BI1HT FM transmitter * • PICAXE-28X1 microcontroller • Tiny Trak 3 microcontroller ** • 24LC256 32 Kb memory • MAX232 RS-232 signal inverter • 28-pin DIP socket (300 mils wide) • 8-pin DIP socket (300 mils wide) • 16-pin DIP socket (300 mils wide) • 18-pin DIP socket (300 mils wide) • (4) LEDs (different colors are nice. nine pins long. sand the cut ends of the receptacles to make the radio socket look nice. but not required) • LM2940 voltage regulator (TO-220) • 2N3904 NPN transistor • 100 µF tantalum capacitor (6. plug the receptacles into the PCB. You can order the radio through Lemos International.com. Remove the 10th pin from one end of the 20-pin receptacle and slice it into two pieces through the empty socket. Although not electrically necessary.two single-row receptacles.3V) • 22 µF tantalum capacitor (6.com . Repeat this a second time and you’ll have two single-row receptacles.2K resistor (1/4W) • 10K resistor (1/4W) • (2) 330 resistor (1/4W) • (2) 22K resistor (1/4W) * Depending on your location and the frequency of the radio you purchase. 70 January 2011 www. Now. www. you may need to be a licensed amateur radio operator to use this flight computer. plug these receptacles into the transmitter. ** Available as a chip from Byonics.downmagaz.com.byonics. www.3V) • Ceramic resonator (10 MHz) • (4) 680 ohm resistors (1/4W) • 1K resistor (1/4W) • 2K resistor (1/4W) • 3K9 resistor (1/4W) • (3) 4K7 resistor (1/4W) • 8.lemosint.3V) • (5) 1 µF tantalum capacitor (6.

press the cut resistor lead into the pool of molten solder and hold it steady as the solder cools. Now that the receptacles are properly aligned with the transmitter. as they will eventually come loose. It’s really bad news if a metal nut comes loose and shorts out a trace underneath the UltraLight flight computer while it is in near space. You may have to wiggle things around a little and use a pair of tweezers on particularly stubborn leads. hold (with tweezers or needle-nose pliers) a cut resistor lead to the cup and heat the lead and cup with a well tinned soldering iron. Don’t use regular machine nuts. Onwards and Upwards. and must be prepped before it can be soldered to the PCB. Once all the leads are in place. On the left side of the flight computer PCB are the I/O ports. I use three-pin wide receptacles when possible and cut them to length. but you won’t be able to switch out the transmitter if you want to change the frequency of your UltraLight flight computer at some later time. press the DB-9 firmly into the PCB and then solder the leads. Slip the pieces between the DB-9 wings and the PCB. As soon as the solder melts. The first step is to tin each solder cup. Then. Insert the DB-9 into the PCB by working each lead into its respective hole. solder the male DB-9 connector for the GPS. I use a longer two-pin wide header and snap it between the third and fourth pairs of pins. The second type has solder cups on the back like the one shown here. heat each cup and apply a thin coating of solder to the inside of the cup. You can solder the transmitter directly to the PCB. That way. So. but needs wires soldered to it first. It’s a good idea to insert a three-pin header into the receptacles before soldering them. Use cut resistor leads for the wires. When I can’t find threepin wide receptacles. Cut two pieces of plastic tubing long enough to fit between the wings of the DB-9 and the PCB. The servo port is a 2 x 3 pin header. The first type has nine wire pins sticking out of the back and will solder directly to the UltraLight PCB. This type of DB-9 connector is still simple to solder to the PCB. carefully remove it and finish soldering the other receptacle pins to the PCB. Then. I use a combination of one-pin wide and two-pin wide receptacles and solder them next to each other. solder the voltage regulator and the SMA antenna connector. and then bolt the DB-9 to the PCB with #2-56 bolts and nylocks (nylon lock nuts). Next. That completes the assembly on the PCB. their openings will properly align for sensors. The next step is all the cabling and we’ll handle that next time. There are two variations of DB-9 connectors. Repeat this for the remaining eight solder cups in the back of the DB-9. Your near space guide NV January 2011 71 . The analog and digital ports both use receptacles.N E A R S PA C E the PCB.

This practical guide provides you with a working knowledge of the latest topologies. Discover how resistors. this do-it-yourself book explains how to attach an Arduino board to your computer. and upload your site to the web. it shows you how to build many pieces of equipment yourself and save money. $14. and transistors function in real circuitry.95 TEARDOWNS by Bryan Bergeron Learn How Electronics Work by Taking Them Apart Amp up your knowledge of electronics by deconstructing common devices and analyzing the revealed components and circuitry. build. and debug a variety of PICAXE microcontroller projects.95 Master and Command C for PIC MCUs by Fred Eady Master and Command C for PIC MCU. transducers.You'll also go beyond the basics and learn how to save your own web graphics.95* Build Your Own Electronics Workshop by Thomas Petruzzellis BUILD YOUR OWN DREAM ELECTRONICS LAB! This value-packed resource provides everything needed to put together a fully functioning home electronics workshop! From finding space to stocking it with components to putting the shop into action -. use Cascading Style Sheets (CSS). Fully updated and revised.95 Sale Price $24. the author takes a systems-level view. $29. work with multimedia.95 Electronics Explained by Louis Frenzel The New Systems Approach to Learning Electronics Don't spend time reading about theory. $29.that's history! Industry veteran. Now the home hobbyist can create projects with these little microcontrollers using a low-cost development tool called the CHIPAXE system and the BASIC software language. create dynamic web content with basic JavaScript. Fourth Edition explains how to structure a page. By the end of the book. components.95 Switchmode Power Supply Handbook 3/E by Keith Billings. you will not learn how to make a circuit but how a signal flows from one integrated circuit (IC) to the next. impressive websites in no time.95 PICAXE Microcontroller Projects for the Evil Genius by Ron Hackett This wickedly inventive guide shows you how to program. For example. format text.downmagaz.For a comple t e pr oduct de t ail visi t our webs tor e!! The Nuts & Volts WEBSTORE ELECTRONICS HTML: A Beginner's Guide by Wendy Willard Essential HTML Skills Made Easy! Create highly functional. $14. HTML:A Beginner's Guide.95 Sale Price $21. workbench measuring instruments. place images. The author describes some basic compiler operations that will help programmers.95 72 January 2011 www. Louis Frenzel. theory.com . and old ham radios . Reg $24. Rather than tearing electronics apart and looking at every little piece.building. and practice. Engineering requirements of switchmode systems and recommendations for active power factor correction are included.95 30 Arduino Projects for the Evil Genius by Simon Monk 30 Ways to Have Some Computer-Controlled Evil Fun! Using easy-to-find components and equipment. Microchip PIC microcontrollers are being designed into electronics throughout the world and none is more popular than the eight-pin version.This great book has it all! And the best part is. PICAXE Microcontroller Projects for the Evil Genius gets you started with programming and I/O interfacing right away. gives you the real scoop on electronic product fundamentals as they are today. and so on to the ultimate goal. along with step-by-step approaches to component decisions to achieve reliable and cost-effective power supply designs. and musical equipment. $125. This comprehensive volume explains common requirements for direct operation from the AC line supply and discusses design. As Eady notes in his preface. and use forms.The only limit is your imagination! $24. a single built-in CCS compiler call output_bit can serve as a basic aid to let programmers know about the "health" of their PIC code. and troubleshooting systems.Volume 1 aims to help readers get the most out of the Custom Computer Services (CCS) C compiler for PIC microcontrollers. big time! Reg Price $29. Teardowns: Learn How Electronics Work by Taking Them Apart contains 14 projects that expose the inner workings of household appliances. particularly those new to the craft create solid code that lends itself to easy debugging and testing. testing. capacitors. create links. sensors. Taylor Morey The definitive guide to switchmode power supply design — fully updated. then you've found the right book. you'll be able to build custom websites using the latest HTML techniques. and connect electronics to it to create fiendishly fun projects.Chuck Hellebuyck introduces how to use this development setup to build useful projects with an eight-pin PIC12F683 microcontroller. and then shows you how to develop a master processor circuit. add color.95 Programming PICs in Basic by Chuck Hellebuyck If you wanted to learn how to program microcontrollers. program it. $24.

95 Do you want a low cost way to learn C programming for microcontrollers? This 300 page book and software CD show you how to use ATMEL’s AVR Butterfly board and the FREE WinAVR C compiler to make a very inexpensive system for using C to develop microcontroller projects. constants. and temperature. sense edges and gray levels. AND it still fits in your shirt pocket! January 2011 73 . please visit our webstore.9 5 tables.95 Plus S/H This lab — from the good people at GSS Tech Ed — will show you 40 of the most simple and interesting experiments and lessons you have ever seen on a solderless circuit board.95 Subscriber’s Price $119. fade an LED with PWM. and more! An Arduino Workshop Combo Reg Price $ 124. As you do each experiment. you will learn to: blink eight LEDs (Cylon Eyes). Along with the purchase of the lab.95 This great little book is a concise all-purpose reference featuring Only hundreds of $ 1 2 . light.Order online @ www. maps. you will receive a special password to access the fantastic online interactive software to help you fully understand all the electronic principles. For a complete product description and sample software. sense voltage. read a pushbutton and 8-bit DIP switch. ! formulas. and conversions. Reg Price $79.With this.95 Subscriber’s Price $75.com Or CALL 1-800-783-4624 today! BOOK & KIT COMBOS CD ROM SPECIALS From the Smiley Workshop C Programming for Microcontrollers by Joe Pardue Kit $66. make music on a piezo element. Combo Price $99.95 Plus S/H From the Smiley Workshop An Arduino Workshop by Joe Pardue The book An Arduino Workshop and the associated hardware projects kit bring all the pieces of the puzzle together in one place.95 Book $44. optically isolate voltages. control motor speed. you learn how basic components work in a circuit.nutsvolts.

The PCB is 10”x11” and harbors more than 1. Prices do not include shipping and may be subject to change.250 components! For more info.95 Non-Subscriber’s Price $45. and green.95 As seen on the April 2007 cover This unique DIY construction project blends electronics technology with carefully planned handcraftsmanship. see the December 2010 issue Assembled units also available. For more information. Subscriber’s Price $36. Subscriber’s Price $76.com PROJECTS Mini-Bench Supply Complete Kit A small power supply with +5V. It doesn’t matter if you’re a complete novice looking to do their first science fair project or a super tech-head gadget freak. and -12V outputs is a handy thing to have around when you’re breadboarding circuits with both op-amps and digital ICs.95 Sale Price $199. please visit our website. Includes an article reprint. please see the “feature article section” on the top right side of the Nuts & Volts website. then this kit is for you! There are no integrated circuits. New applications have been added since inception. as well as an assortment of ready-made applications.CALL 1-800-783-4624 today! Or Order online @ www. Subscriber’s Price $39.000 projects on this CD. Kit includes: Enclosure box. switching regulator kit. see the November 2009 issue. Includes an article reprint.95 Non-Subscriber’s Price $55. red. Subscriber’s Price $29. here is a great project to amaze your friends and to demonstrate a unique way of producing sound. components. DC-to-DC converter kit. Kit contains one piece of piezoelectric film.All you’ll need to add is a battery and a sound source.95 Garage Door Alarm PCB & Chips 16-Bit Micro Experimenter Board N owb l e ! la d vai mble ! a e s Ass oard b Magic Box Kit As seen in the November 2010 issue.” The kit comes with a CD-ROM that contains details on assembly. not to mention the additional technical info and bonus features. there are enough projects on the single CD-ROM to keep you and 50 of your friends busy for a lifetime! Reg Price $26. and article reprint.The Mini Kit is a user interface with a rotary encoder using the PIC24F timer peripheral set and its interrupt capability. and construction manual.0 The Complete Collection by Bright Science. black.95 Sale Price $23.95 The Mini Kit The best experiment yet for the 16-Bit Experimenter Board. LLC There are 1. all functionality is achieved using discrete transistor-diode logic. accessories.The other components can be fould at your favorite parts house. PCB.95 Non-Subscriber’s Price $39.00 74 January 2011 If you like electronic puzzles.We provide the difficult parts: the transmitter and receiver PCBs with their matching programmed MCUs.downmagaz. and is a fun and easy project to build.95 Non-Subscriber’s Price $31.95 e! Sal Available in blue. For more info. Subscriber’s Price $59. All components are pre-cut and pre-bent for easier assembly and the microcontrollers are pre-programmed with the software. MC.com . Is Your Garage Door Open? This project uses the latest in wireless technology.95 WE ACCEPT VISA. Kits also include PCB. Subscriber’s Price $49.95 Non-Subscriber’s Price $83. Piezoelectric Film Speaker Kit NE W! As seen in the November issue.95 rCube Talking Alarm Clock Kit As seen on the May 2009 cover Transistor Clock Kit The Amateur Scientist 3. you’re in luck! In the December 2009 Nuts & Volts issue.95 Adding this Mini Kit to your Experimenter Board will enhance the Experimenter. Subscriber’s Price $69. Reg $225.95 Non-Subscriber’s Price $54. audio input cable.95 Non-Subscriber’s Price $74.AC adapter. AMEX. operation. For more information. and instructions on CD-ROM.nutsvolts. www.95 Ready to move on from 8-bit to 16-bit microcontrollers? Well. speaker film stand. and DISCOVER. you’re introduced to “the 16-Bit Micro Experimenter. This clever trick has the observer remove one of six pawns while you are out of the room and upon re-entering you indicate the missing pawn without ever opening the box. +12V.

95 50 Green Projects for the Evil Genius by Jamil Shariff Using easy-to-find parts and tools. Subscriber’s Price $79. easy-to-follow plans. William Brinsky Flip the switch to energy-efficient lighting! This do-it-yourself guide makes it easy to upgrade residential and commercial lighting to reduce costs and environmental impact while maintaining or even improving the quality of the lighting. $19. alternative fuels. explore whether solar power makes sense for them.This book helps readers understand the basics of solar power and other renewable energy sources. This is a must-watch for anyone planning on installing a wind turbine who wants to learn the process and the proper techniques for a safe and successful installation.At t en t ion Subsc r ibe r s ask abou t your discoun t on pr ic es mar ke d wi t h an * The Nuts & Volts WEBSTORE ALTERNATIVE ENERGY SECTION The Complete Idiot’s Guide to Solar Power for Your Home by Dan Ramsey / David Hughes The perfect source for solar power — fully illustrated. high-tech guru Gavin Harper gives you everything you need to build more than 30 thrilling solar energy projects. from choosing a site. So.Topics covered include transportation. solar.The projects in this unique guide range from easy to more complex and are designed to optimize your time and simplify your life! $24. oxygen and hydrogen gas containers.95* Solar Energy Projects for the Evil Genius by Gavin D J Harper Let the sun shine on your evil side — and have a wicked amount of fun on your way to becoming a solar energy master! In Solar Energy Projects for the Evil Genius. he teaches you how to produce the most power by evaluating the pitch (setting angle) of the profiled blades.95 The Solar Hydrogen Education Kit includes a solar cell.95 Non-Subscriber’s Price $89.You'll find complete. Subscriber’s Price $56. classroom use.and off-grid systems. and what’s involved with installing various on. assembling the tower. home insulation. so you know exactly what's involved before you begin. plus recommended sources for energy-efficient products. and more! The set only needs pure water to create hydrogen and produce electricity. Filled with step-by-step instructions and methods for calculating return on investment.95 The WindPitch Wind Turbine Kit is a miniature real-working wind turbine and is one of the great projects from the series of articles by John Gavlik. Perfect for science labs. $24. "Experimenting with Alternative Energy. what their options are.95 Non-Subscriber’s Price $84. construction. with clear diagrams and schematics. a PEM reversible fuel cell. or demonstration purposes. please visit our webstore. $24. $19.95 Hydrocar Kit Solar Hydrogen Education Kit Windpitch Kit The Hydrocar is used in a couple of great projects from the series of articles by John Gavlik." In Parts 10 and 11. Seth Leitman. wind. For kit details. especially for people who learn by seeing how things work. and hydro power.95 ! Wind Turbine Installation NEW DVD Manuals can sometimes be confusing.95 Non-Subscriber’s Price $59. this DVD takes the viewer step-by-step through the entire installation process. to running wire.95 NE W! Green Lighting by Brian Clark Howard. this do-it-yourself guide offers a wide variety of environmentally focused projects you can accomplish on your own.95 January 2011 75 . and more." In Parts 8 and 9. and finally using a winch for the final lift. For kit details and a demo video. "Experimenting with Alternative Energy. he teaches you the operation of the Polymer Electrolyte Membrane "reversible" fuel cell. Subscriber’s Price $84. please visit our webstore.

Questions are subject to editing and will be published on a space available basis if deemed suitable by the publisher.68 µf to 4. If a one-off circuit is built.01 µF) on the output. 130V and minimum load current is 5 mA.74 µF. and the little solder balls make the connection. At 60 Hz. two times 0.902 µF. The equivalent reactance Xc = Vcapacitor/Irms. the nearest standard value would be 0. there are still lethal voltages present. It would be good to be able to use multiple such devices at regular intervals along the fence. I am looking for lowest cost/complexity. An electrolytic with few to a few hundred µF (depending on the current) should be sufficient. be careful even with the isolation transformer. you can use diodes in series to give you your voltage drop. I usually use 105 or 106V.downmagaz. plus a small capacitor (0. add a capacitor to ground after the last diode for filtering. but need to lower the output to 9 VDC for the other. assume . Answers are submitted >>> ANSWERS [#9108 . Add 3 to 5 mA for the zener. Bryan Suits Houghton. I’m thinking about applying solder paste to the end. I’m certain the problem is the center conductor. I have roughed it up with serrated pliers. Ideally. A very good approach is to start from the output and work back to the source.4V (that is. Raposa Vallejo. MI [#10101 .111/(377 x Vcapacitor). etc. The average current is about 90% of the RMS current. so all values would work. Subtract the zener voltage plus two diode drops from the minimum line voltage. No mention was made of the current requirements. to keep it at the zener voltage even at full load. Next. the zener wattage has to be determined. so C = 1/377Xc. we know that Xc = 1/377C. Use an isolation transformer when testing the circuit. #1 Before starting. Using Iav and Vcapacitor in the formula. This is the average current needed out of the fullwave bridge rectifier feeding the zener.82 µF. and load current is at minimum. Use the 7809 for up to 76 January 2011 output current desired. some advice: These supplies have no isolation from the line and should only be used to power loads that are completely isolated from the user. so multiply average current by 1. For lower currents (up to 100 mA).T ECHFORUM READER-TO-READER >>> QUESTIONS 75 ohm Coax Connections Seems like I always have reliability issues with 75 ohm coax connections. C = ~0. but if they aren't too demanding you can get 9 VDC quite easily from the 12 VDC using a three-terminal regulator such as the 7809. one can select a capacitor or parallel combination very close to the desired value and the worst case current at high line voltage will be a bit less. Note that this makes no allowances for capacitor tolerance. bent the end a little. C = Iav x 1.553 mA. Using our 12V example and a 20 mA maximum load current.7V) from 105V leaves 91. Alternatively. Or. we get Iav = 20+3 = 23 mA and Irms = 25. For the example.. the circuit would simply attach between high V and ground strands of the fence. line voltage is ~10% high. Always use common sense and good judgment! www. Also. four to six in series should be sufficient. Determine the maximum All questions AND answers are submitted by Nuts & Volts readers and are intended to promote the exchange of ideas and provide assistance for solving technical problems. by readers and NO GUARANTEES WHATSOEVER are made by the publisher.September 2010] Voltage Dropping I have two circuits in the same enclosure: one works on 12 VDC and the other on 9 VDC. but still have a problem. Depending on the type of diode used. In this case. Have the bridge rectifier end of the supply connected to the neutral side of the line. A perfect solution would be able to cope with an inadvertent reverse connection. you might get by with the 78L09. If your circuit does not already include one.82+10%. A "turnkey" solution would add 10% for capacitors with a 10% tolerance.6V across the capacitor. but it has always been trial and error. #1112 Kevin Dickinson Australia 1A with a heatsink. #1111 Frederick M. All the quality parts/crimps are just not reliable. This one assumes all tolerances and line voltage go to the worst case: capacitor is 0. to maybe seal out oxygen.October 2010] Reactive Transformerless Power Supply How does one calculate the value for the reactance capacitor in an AC to DC reactive power supply so as not to over-work the zener diode? I‘ve used from . It is strongly advised to include a fuse in series with the limiting capacitor or use "across the line" capacitors — also called "X" capacitors. CA Electric Fence I need to show when an electric fence (6 KVa to 16 KVa) is active by flashing a simple LED with every pulse. the zener losses at minimum load will be less. a 12V zener plus 1. I have a 12 VDC transformer for one. For example. The implementation of any answer printed in this column may require varying degrees of technical experience and should only be attempted by qualified individuals. I tried with resistors to lower the voltage to 9 VDC with no success.7 µf for various voltages out.111 to get the RMS current in the capacitor.com .

we get C = 1. all the current will pass through the zener diode instead of the load plus zener. By short circuit. Not shown in the that the zener diode is replaced by a figure. This limits peak currents in the capacitor and diodes during turn-on and when line transients occur. The easier way is to model the circuit on a circuit simulator such as LT Spice IV.nutsvolts. J Wexler via email #2 There are two relatively easy ways to approach this issue. mA. (It's good practice to derate capacitors.1= 0. and capacitor type in the range of 220 µF to 1.1V accuracy of the calculation by about half watt zener may safely pass a 12/120 = 10% for a 12V supply. This is the worst possible case that needs to be designed for. a good place to start for this example might be 150 or 220 µF at 20 or 25V. The first one involves determining the capacitive reactance from frequency (60 Hz) and capacitance (the ARRL Handbook has a handy nomograph). so the zener is drawing 28 mA . too — run them at no more than 2/3 of their rating.15 mA RMS. (To be conservative. reference [1] recommends a short circuit. add a surge limiter in series with the capacitor. current of I= 0. and solving for C.com for tips and info on submitting to the forum. etc. the (V-Vz) only improves the voltage.276W. shown in the figure. Reference [2] Guidance on calculating the value gives a similar equation for the fullwith respect to ripple voltage is given wave circuit.5 mA =23 mA and dissipates 12V x 23 mA = 0.) capacitors.1V V = RMS input voltage zener voltage subtracting C = Capacitance in Farads from the line voltage. found by seaching for the title on the For the full-wave circuit. The difference between max DC and min DC load added to the knee current needs to be smaller than the current handling capability of the zener.6 x 377 x 0. Then. for the RMS short circuit current The filter capacitor in parallel with drawn by capacitor C in terms of RMS the zener diode can be an electrolytic line voltage.902 µF =~31. frequency. f = frequency A more exact solution IHW = halfwave short circuit current involves replacing V in the IFW = fullwave short circuit current Figure 2 equations by (V-Vz) to January 2011 77 . you might Considering the poor tolerance on want to cut that in half.1V IHW = 2•√2•V• C• f IFW = 2•√2•V• C• f zener diode will draw less Where: current due to the 5. and is less complicated than the case where some current passes through the load. For the moment. substituting 50 mA (about half of the Practical considerations: Type X2 98 mA). we will 100 ohm resistor in series between the simplify the problem by assuming that output filter capacitor and zener a zener draws the same current as the diode. A 5. A capacitor will go across the zener to reduce ripple voltage to an acceptable level. The power correct for the voltage dropped across rating of the zener diode must not be the zener. zener current. 1/2W is a good starting point.7 mA for short circuit current. For example. Internet.> > > YO U R E L E C T R O N I C S Q U E S T I O N S A N S W E R E D H E R E BY N & V R E A D E R S Send all questions and answers by email to forum@nutsvolts. You can also subtract off exceeded by zener voltage times the forward rectifier voltage drop.com Check at www. NH #3 If a zener diode regulator is unloaded as in Figure 2. Selecting a 1 µF standard C C value.000 C for a half-wave configuration as µF according to reference [1]. we mean in the references.. re-solving the fullV wave equation for current.23 µF. V we get I = 40. That would suggest a 1/2W zener for this example.5/5. A conservative choice is to keep the actual power in the zener at half of the zener's rating. the effort is not warranted Reference [1] gives an equation for 12V or lower supplies. Figure 1 shows the principle. maximum currents. Figure 1 some through the zener. Both of the references can be short circuit.) Lastly. This is an average current of ~28 mA. a 5. Icapacitor is 91. voltage differentials. I = P/V. and 60 Hz. 120V. For a given zener diode However.098A = 98 5/120 = 4% for a 5V supply. This will produce start-up curves. use Ohm’s Law to calculate the current flowing in the AC and DC loop. Walter Heissenberge Hancock. 47 ohms. The AC loop current needs to match max DC load plus knee current of the zener diode. and currents at any moment in time by clicking on it. and you can look at all the voltages.

T ECHFORUM READER-TO-READER Figure 3 Entering the target IP address may be cumbersome so I propose the following software structure: After booting. Test the gauge readings before reinstalling. Dan Danknick Santa Ana. Bruce Bubello Wayne. al. set R = 0." pp 169. It would be a neat project to build a ping tester using one of the widely available development boards and microcontrollers. Possibly adjust the float arm as well for Full and Empty. They will have an AC voltage rating. where Xc = 1/(2*pi*f*C). [2] Nathan O Sokal.. Continually update an internal list of responses (and age out the non-responders) so that a real-time display of the subnet can be shown. select a 330 VDC capacitor for use with 120 VAC.com . Be sure to observe correct power-line polarity. 1998. and some pushbuttons. use DHCP to obtain an IP address and then repeatedly scan the subnet looking for responders to your ping command. "WARNING: As with all circuits powered directly from the AC power line. Follow all local electrical codes. 02. Dennis Crunkilton Abilene.04.02.10*Xc. you might need to open the case of the potentiometer and swap the resistance element if the assembly does not mount the same way. I typically use a laptop. There are cable testers with ping functionality but they are costly. At the worst case. The Winnebago sending unit gives a 10 ohms full and 180 ohms empty resistance reading. a potentially lethal shock hazard exists. Safety: Let me quote reference [1]. "Simple Off-Line Power Supply Minimizes Costs". invert. Do not connect any line operated test equipment to this circuit unless using an isolation transformer. Reference [2] recommends a resistor in series with C to limit poweron surge current to 10x normal current.October 2010] Ping Tester I work in large building complexes and need to "ping" devices several floors away or in the next building.TX [#10102 . Reference [2] recommends ceramic or film capacitors.downmagaz." References: [1] Brian King and Robert Kollman. There are so many choices I don't know where to start. scale. pp 69. which is what you'll need to play in the ICMP game to implement ping. et. If using a capacitor with only a DC rating. Do not use this circuit with high brightness LEDs. That is. with the one from the Buick sending unit. An isolation transformer is recommended when working on or testing the circuit. EDN. It would be easy then to use the pushbuttons to slide your display-sized window through the list. Op-Amp Handbooks — the Burr-Brown Handbook reissued by Texas Instruments — and early National www. I found the Keil IDE to be top-notch. I recommend you start with a Luminary LM3S6965 development board. but it's difficult to hold or set down while in riser or mechanical rooms. April 9. They have a ridiculously powerful 32-bit CortexM3 CPU onboard along with 10/100 Ethernet. OLED display. They cannot withstand the surge current even with the limiting resistor. Could someone point me in the right direction? Construction of a battery powered "ping tool" would be a great project to undertake. Then. This is mandatory when powering LEDs from an unfiltered supply. and amplify. The gas gauge in the new dash requires 242 ohms for a full and 42 for an empty reading.October 2010] capacitors are recommended for C by reference [1]. reconvert to a current. Either a new one or from a salvage yard. CA [#10104 . I need help in designing a circuit to do this conversion. There are many good serial-to-Ethernet converter solutions out in the world but none appear to offer raw IP-level packet generation. "Stepdown rectifier makes a simple DC 78 January 2011 power supply. You may need to slightly alter the connections at the potentiometer to get Full and Empty in the correct direction. NJ #2 Convert the variable resistance to current. shift. #1 I think the easiest way to solve your gas gauge problem will be to get a sender from the proper model Buick. The board runs $70 from Digi-Key and comes in many flavors. Resistance Inverter/Converter I installed a dash from a Buick into a Winnebago. You then need to remove the sender from the Winnebago and replace the potentiometer on it. That should work and should be doable. Safety regulations require a 470K ohm or other appropriate resistor in parallel with C for a one second or less discharge time. Electronic Design.

all outside taps have to have an integral non-return valve built into them. 7-in-1 toolbox essentials.com NEED A SCOPE? Sample price $57. in the UK. The current through R5 serves as an offset adjustment (current) and is constant.> > > YO U R E L E C T R O N I C S Q U E S T I O N S A N S W E R E D H E R E BY N & V R E A D E R S Semiconductor Appnotes are all available on the web and can serve as good references).com (206) 768-0602 www. make the most of it — they're that rare. and R7. Also see our website for a great selection of spectrum analyzers. PC memory-stick-sized scope adapters and “scope-in-a-probe” models. This will yield a current of 1. 3 and 5-day lead times available Best Selection . R8. Perhaps I could just turn that circuit off and deal with it when I had more time and enthusiasm? (If you have a good day in the UK summer. remarkably economical LCD scopes. Front Panel Designer Cost effective prototypes and production runs Powder-coated finish and panel thickness up to 10mm now available Choose from aluminum. unique selection of scopes to suit any budget and application: low-end PC scope adapters for less than $180 up to high-end 16-bit 12GHz units. OP2 sums up three currents through R5. We don't have cellars/basements in the UK — unlike many US homes — and sometimes people do the weirdest things to make upgrades fit. It wasn't audible at the tap but the effective water hammer only became noticeable at this hollow wall which must have acted as a resonator into the ceiling/floor cavities. but had a more down to earth solution. I would NOT have been pleased to discover the real cause AFTER tearing into a perfectly well decorated wall! Ms.2 to 6. Anyway.lowest prices! We have the widest. Standalone.) But with no result!!??? The problem was not electrical in nature. and Waveform Generators not available anywhere else. A zener stabilizes the supply voltage and provides two reference voltages: one for the constant current source of about 262 mV and a higher one of 1.32 + S&H Designed by you using our FREE software. The 50 Hz was a red-herring. A buffer is required on OP2's output if higher currents are necessary. up to bargain-priced 4-channel benchtop workhorses with FFT and auto-test capabilities. Figure 3 shows a possible approach. acrylic or customer provided material 1. I was about to reluctantly tear into this plasterboarded wall when I decided to just turn off all building power to try to isolate exactly which circuit was causing the noise. The difference in currents needs to be provided through R8. and the collector of T1 so that they are zero. R8.05V. The moral is that a bit of lateral thinking can save the day. You may need to adjust the values of R5. RF signal sources. even when you already 'know' what the problem is. The result is an inverted voltage output against 12V.com/scopesnv January 2011 79 .saelig. My outside tap (over a room away) was weeping very slowly. I located it to an area of interior hollow plasterboarded wall which could conceivably contain a central heating pump. In short. A resistor in series with AM1 reconverts into a current. FrontPanelExpress. NH >>> COMMENTS In regards to John Hobday's query about hum detection in the September ‘10 issue. and this small plastic valve was chattering at 50 Hz. I have recently suffered from the same problem — a low-level pervasive 50 Hz-ish hum (our mains frequency as I'm in the UK too) which was only audible inside the house. By law. Sally Jelfs UK subscriber Custom Front Panels & Enclosures FREE Software 888-772-3544 info@saelig. Walter Heissenberger Hancock.2 mA injected into the inverting input of OP2. It was all down to plumbing.

SOIC-18 uM-FPU V3. Hobby Vers.KELVIN.nutsvolts.95" x 0.com tix com COMPONENTS Nixie Power SURPLUS Floating Point Coprocessor 32-bit IEEE 754 SPI or I2C DIP-18. Buy . 1 MaxSonar-WRC (IP67) ( (IP67) • Compact packaging • Weather resistant • Quality narrow beam • $99. 12-bit A/D. FFT.35" $9.1 2-16V In. 1 MaxSonar-WR (IP67) XL-MaxSonar-EZ • Beam pattern choice • Real-time calibration • High acoustic power • $39.95 USD qty. 1 www.5V • $29.S.com 80 January 2011 Looking for solar stuff and kits? www. 4-8W / 150-200VDC Out 0. user-defined functions. Version..CLASSIFIEDS KITS/PLANS PCB SOFTWARE EXCLUSIVE U. 1 YOUR COMPLETE SOLUTION! • PCB Design • PCB Simulation • CAD/CAM Menu 121747. $275 • Industrial packaging • Weather resistant • Standard ¾” fitting • $99.com .95" x 0. Pro.Trade CALL KEYWAYS 937-847-2300 or email buyer@keyways.com www.com/nixie New full featured Compiler ENERGY SOLUTIONS MISC SERVICES Extensive floating point support.com www.micromegacorp.Sell .maxbotix.com HARDWARE WANTED DEC EQUIPMENT WANTED!!! Digital Equipment Corp. DISTRIBUTOR ROBOTICS MaxSonar Ultrasonic Ranging is EZ LV-MaxSonar-EZ • Power-up calibration • Smallest MaxSonar • Low power. 2.downmagaz. and compatibles. www. matrix operations.95 (Shipping included) www.95 USD qty. $175 121743. GPS input.95 USD qty.5V-5.tayloredge.95 USD qty.

...........................71 RF TRANSMITTERS/ RECEIVERS Abacom Technologies ...................................................... ........49 microEngineering Labs ............ Inc....................................................49 BUYING ELECTRONIC SURPLUS Jaycar Electronics .....................43 LeCroy .49 Trace Systems..........56 Robot Power .. ..................................18 ExpressPCB .................49 PROGRAMMERS microEngineering Labs .49 Jameco ........................49 Saelig Company.4 Mouser Electronics ...........................Back Cover PCB Pool . Inc......7 Command Productions .................64 MOTORS BaneBots ...........................38 Technological Arts ..........................4 Mouser Electronics .49 Noritake ..............19 Matrix Multimedia ...57 Mouser Electronics ...............7 Cana Kit Corp.............................................64 ROBOTICS EDUCATION BaneBots .............. ...........................................9 ENCLOSURES Front Panel Express LLC ................. Inc............26 I/O Bridge .......................................4 Circuit Specialists.......79 Trace Systems...........................................................57 BaneBots .......79 Fun Gizmos ......2 NKC Electronics ........................................................................ .......................79 V-Module ............49 Lynxmotion....... Inc............26 TEST EQUIPMENT Bitscope ............47 Jaycar Electronics ...................................................49 Dimension Engineering .............................. .............................71 Front Panel Express LLC .................................................. Inc............57 CCD CAMERAS/ VIDEO Circuit Specialists..................... CABLE AND CONNECTORS Jameco .............. Inc..................................57 Technological Arts ................ Inc........................ ..............19 Solarbotics/HVW .........7 Fun Gizmos ........5 Lemos International Co...............................................................................29 Cunard Associates ...........19 Ramsey Electronics.........18 Global Specialties ...................2 Lemos International Co................................ ........................26 PAiA ...........57 Parallax..Back Cover Pololu Robotics & Electronics .............................................................................................................................................64 SATELLITE EMBEDDED TOOLS Mouser Electronics ..........9 MISC........................ Inc...........................................................27 Jaycar Electronics ............56 QKITS ...49 Ramsey Electronics...........38 Surplus Gizmos ................................................................65 Front Panel Express LLC .. ...............49 COMPUTER Hardware Matrix Multimedia ..........79 PCB Pool .........57 QKITS .....47 BATTERIES/ CHARGERS Cunard Associates ...70 Pololu Robotics & Electronics ..................................48 ExpressPCB .... Inc................................ ..............................................................................82-83 Dimension Engineering ......................... .....................64 PROTOTYPING & TRAINERS Global Specialties ...........................18 Bitscope ....................................48 MikroElektronika ....................................49 I/O Bridge ........48 MikroElektronika ... Inc............57 Cunard Associates .......................................... ...........26 Abacom Technologies .......43 LeCroy............49 Jameco .................7 Circuit Specialists..............................................38 All Electronics Corp.............................64 SECURITY PolarisUSA Video........................................43 NetBurner ..........■ LOOK FOR ■ SEARCH FOR ■ FIND Find your favorite advertisers here! ADvertiser INDEX OPTICS Noritake .....................49 PAiA ................. Inc..... ....2 NKC Electronics ........ Inc..../SURPLUS All Electronics Corp..........26 V-Module .....3 microEngineering Labs ..........19 Ramsey Electronics.............................70 Matrix Multimedia .................................................................. .....18 Electronix Express ................19 Trace Systems. .......................................63 Electronix Express .................... ........ ................ Inc......................19 NKC Electronics .............20-21 V-Module .........63 AMATEUR RADIO AND TV PolarisUSA Video...........5 NKC Electronics .................27 January 2011 81 .............................................49 Dimension Engineering ........................ .......................................9 NetBurner ...................18 Jameco ..........79 PCB Pool ................................... Inc.............43 DESIGN/ ENGINEERING/ REPAIR SERVICES Cana Kit Corp...................... ..............................49 Solarbotics/HVW .................19 PolarisUSA Video.......................71 Front Panel Express LLC .............20-21 Front Panel Express LLC ...................................39 KITS & PLANS Cana Kit Corp...13 Technological Arts ........................38 Microcontrollers / I/O Boards Abacom Technologies .26 PAiA ................................79 Integrated Ideas & Tech...........49 Linx Technologies ............................38 Linx Technologies ....63 Jaycar Electronics ...64 Parallax....38 Bitscope ...... ...............49 Lynxmotion..........48 MikroElektronika ................... Inc.............................................................. Inc........... Inc........................2 WEB SERVICES I/O Bridge ............9 Noritake ........ ....................................20-21 Solarbotics/HVW ................................3 COMPONENTS Cana Kit Corp..........82-83 PolarisUSA Video..38 Global Specialties .....................79 Scientifics ...........49 BaneBots ...............................................................49 Trace Systems.......................49 Ramsey Electronics........................29 Global Specialties .............................. .......................................................................... .............................................................. Inc................27 WIRE.................49 Microchip .........19 Technological Arts ................................................. Inc........19 Saelig Company..................82-83 Command Productions ................................................................39 Surplus Gizmos ...........................................................64 V-Module ........... ...........19 Jameco ............... ..... Inc............................................... ..................49 Noritake .......... ...........................................63 ExpressPCB .......57 CIRCUIT BOARDS AP Circuits .................................................... Inc..........47 Integrated Ideas & Tech.......................... .......27 Linx Technologies ...........65 AP Circuits ............................................13 TOOLS MikroElektronika ..........................................79 Scientifics .............. Inc...................56 Solarbotics/HVW .................... Inc...............49 Saelig Company. ....48 Fun Gizmos ..............................47 I/O Bridge ........................ Inc........ ...............................................................................4 NetBurner ..............................................18 Bitscope ...19 Pololu Robotics & Electronics ...... .............................................................................. Inc......................................64 NetBurner .................20-21 Robot Power ......................................... ....... ...........49 Software Matrix Multimedia ..................27 Lemos International Co.............. .................................................49 Microchip ...........................................18 Fun Gizmos ........

addition.M. waveform average. Rising edge / Falling Edge Trigger Type Ch1 / Ch2 / EXT Trigger Source 0-100% Pre/Post trigger 10K-32K per ch 10K-512KB per ch Buffer size DC to 40MHz DC to 60MHz DC to 100MHz 100MHz Shot Bandwidth 100MS/s 150MS/s 250MS/s 200MS/s / 250MS/s Max Sanple Rate Yes Sampling Selection port/line.8mm Chisel Tip (KD-M-0.6D 2mm Single Flat 40o Tip KD-M-2C 2.it is a seperate piece from the main station & allows the user maximum convenience.5 2 8 .5%rdg+2byte +/-. CV less than 1.00 $355..00 4+ $155. production line. Also included at no additional charge is one user replaceable ceramic heating element so that you will be prepared! <0. 10Steps Gain Range +/. Ch2.5%rdg+2byte o o o o o CSI-STATION1A Voltage accuracy: Current accuracy: Grounded Tip & Barrel to prevent ESD damage 24V Iron Operation Soft Comfort Grip Pencil Iron Iron Holder is Detached.2D 1. Add Vertical Mode Yes CursorMeasurement Spectrum Analyzer 2 Channels Channels FFT.1000’s of Items Online! 1-800-528-1417 Fax: 480-464-5824 Since 1971 CircuitSpecialists.4mm Chisel Tip KD-M-2. One of the nicest features is the high quality comfort grip soldering iron. * Easy to use: Intuitive and easy to understand. New Price Display resolution: +/-0.4 6 4 . electronics.circuitspecialists. 39 Steps Timebase Range Yes Vertical adjustable Diode clamping Input protection Yes X-Y 30Hz~40MHz 30Hz~60MHz 30Hz~100MHz 30Hz~200MHz Autoset Yes EXT. multiplication. variable DC Power Supplies with built in short circuit and thermal protection. The iron connects to the station via an easy screw-on connector making iron replacement a snap. * Best performance for your dollar: Thease units have many features that are comparable to the high speedah stand-alone DSOs. with 12Mbp communication speed.00 ea.com/CSI3303S 100HMz www.circuitspecialists. serial and parallel mode operation. Another nice feature is the soldering iron holder. * Various data formats: Can save wavrfrom in the following formats: . so we can offer the best price possible! The CSI-Station1A features a grounded tip & barrel for soldering static-sensitive devices and uses a ceramic heating element for fast heat up & stable temperature control.bmp & MS excel/word 40MHz www.txt .com/DSO-2150 DSO-2150 www.8D) 1mm Single Flat 40o Tip KD-M-1C 1. Technical Specifications: Independent mode: 2 independent 0-30V outputs Series mode: CSI3303S Output from 0-60V & 0-3A CSI5505S Output from 0-60V & 0-5A Parallel mode: CSI3303S Output from 0-6A & 0-30V CSI5505S Output from 0-10A & 0-30V Both units also provide a 5V fixed output @ 3A Load regulation: Ripple and noise: Easily our best value in our selection of soldering stations. The control knob is calibrated in Fahrenheit & Celsius (392° to 896°F and 200° to 480°C)..com/DSO-2250 DSO-2250 I 0 to 5A CSI5505S $194..downmagaz. These power supplies are suitable for the laboratory.00 $259.00 ea. 9 Steps 10mV-10V. * Probes & USB cable included.5 8 2 4 www. Both units allow independent. Math 40 MHz 60 MHz 100MHz 200 MHz Bandwidth Frequency. Dual. division. P h o n e : 8 0 0 .E.circuitspecialists.95 New Year.0V +/-0.2mm Chisel Tip KD-M-1.2 4 8 5 / Fa x : 4 8 0 .2D 4mm Single Flat 40o Tip KD-M-4C Conicle Fine Point Tip KD-M-1 Conicle Fine Point Tip KD-M-B Long Conilce Fine Pt Tip KD-M-LB The new CSI3303S & CSI5505S regulated DC power supplies are high reliability. But costs a fraction of the price. Made of rugged aluminum.circuitspecialists.com/DSO-2090 DSO-2090 $169.5mV (I>6A) es ob d Pr lude Inc USB Digital S torage Oscilloscopes Specifications DSO-2090 DSO-2150 DSO-2250 DSO-5200 /5200A 2 Channels Channels 1M 25pF Impedence AC/DC/GND Coupling 8 Bit 9 Bit Vertical resolution 10mV-5V.circuitspecialists. Both units are equipped with protection circuits that protect the units from short circuits and over temperature by shutting the unit down for safety. intensity Waveform Display open / close Network Ch1.com/DSO-5200 DSO-5200 www. I n c.5%rdg+2byte Rated output: 5.com/CSI5505S www. New Price CSI-St ation1A The following soldering tips are also available 0.4D 3mm Single Flat 40o Tip KD-M-3C 3.00 $209. * No external power required: Bus-powered from the host computers USB port.1 4 1 7 / 4 8 0 .1%+3mV (rating current <3A) <0.com Triple Output Bench Power Supplies New Year.com .2mm Chisel Tip KD-M-3.1V 3A Tracking characteristics Series specifications: Load regulation: less than 50mV Ripple and noise: (5Hz~1MHz) <=3mVRMS Parallel characteristics: Load regulation: less than 50mV Ripple and noise: (5Hz-1MHz) CV less than 1mV<=6A). manufactured just for Circuit Specialists Inc.6mm Chisel Tip KD-M-1.circuitspecialists..com/DSO-5200A DSO-5200A C i rcuit Specialists. The 1 meter length iron cord provides plenty of length for users to set up the station in a convenient location.00 $299. subtraction. O.00 4+ $179. input Auto / Normal / Single Trigger Mode +/Trigger Slope Yes Trigger Level Adj. Yet another feature is the stackable design of the CSI-Station1..00 Item# 0 to 3A CSI3303S Item# $169.jpg .1h 38 Steps 2ns-1h. scientific research and educational institutions. 60MHz www. Voltage Cursor 10K-32K/Ch 10K-1M/Ch Data Samples Once again Circuit Specialists brings you a quality product at a great price! * High performance: * USB connected: Uses USB and supports plug'n play.4 6 4 .you don't have to reach all the way back to the station to store the iron.3% DC Accuracy 4ns . persistence.circuitspecialists. Rugged aluminum construction Includes one FREE replacement ceramic heating element $29.2% +3mA o Made for us so we can offer the best possible price <1mVrms 5Hz-1MHz o Temperature Stable Ceramic element <3mArms o Easy to Replace Soldering Iron (not hard wired) +/-0. 200MHz 200MHz www. communications equipment maintenance. The main station is designed for an additional unit to be placed on top of it allowing for space saving placement of the CSI-Station1A.

This power supply can be used in electronic circuits such as operational amplifiers.com/DSO-8060 Programmable DC Power Supplies •Up to 10 settings stored in memory •Optional RS-232. The output terminals are safe 4mm banana jacks. Users include researchers. Overload Protection. ww. I n c .circuitspecialists.circuitspecialists.com/bk5000 BK5000 Item # $97. and automated operation such as in production testing. A 3 ½ digit LED is used to display the voltage and current values. The soldering iron incorporates a replaceable tip design & uses the same series of tips that are compatible with BlackJack models BK2000 & BK2000+ SPECIFICATIONS: Reliable.00 www.000-Count DMM resolution with AC/DC at 600V/800V. It also features memory.com/csi530s Item # CSI530S $84. technicians. Model DC Voltage CSIPPS33T 0-32V x2 0-6V x1 DC Current 0-3A x3 CSIPPS55ST 0-32V x2 0-6V x1 0-5A x2 0-3A x1 DSO1200 Item # $739. 360V/150W (CSI3710A) $349. Digital Multimeters.0 full-speed interface connectivity • Multi Language Support • Battery Power Operation (Installed) 60MHz Hand Held Scopemeter with Oscilloscope & DMM Functions www. Check out our website at: www. teachers and electronics enthusiasts. charger. These electronic DC loads are perfect for use in laboratory environments and schools. 10A • Large 5.com/csi3711a Item # $659.com/DSO1200 Power Input : 110V Dimensions: 188mm (w) x 126mm (h) x250mm (d) Weight: 4.0 full-speed interface connectivity • Multi Language Support • Battery Power Operation (Installed) Hot Air System with Soldering Iron & Mechanical Arm BlackJack SolderWerks Check out our new programmable hi preformance 3 channel power supplies. 2 2 0 S . and many other interesting items.7 inch TFT Color LCD Display • USB Host/Device 2. PC soft. Test Equipment. soldering tips & hot air nozzels are also available Programmable DC Electronic Loads • All the features of the DSO1060 plus a 25 MHz Arbitrary Waveform.& noise •LCD display with . This power packed package comes complete with scopemeter. •Low output ripple . to implement remote control and supervision.circuitspecialists.1 4 1 7 / 4 8 0 .com/csi3710a 360V/300W (CSI3711A) $499. It features a rotary selection switch and a numeric keypad used to input the maximum voltage.5 2 8 .ture removes the residual heat from the nozzle after the hot air function is switched off.circuitspecialists. Metal and Plastic Project Boxes.circuitspecialists.com/CSIPPS55T DSO1060 Item # $529. USB.circuitspecialists. . Fan Cooled.CircuitSpecialists. Device Programmers. Featuring both USB & RS232 interfaces.00 0-30V / 0-5A .00 CSI3645A 0-36V 3A 108W $199. An LED display is used to show the current and voltage values. PC Based Digital I/O Cards.00 www.overheat protection.1000’s of Items Online! 1-800-528-1417 Fax: 480-464-5824 Since 1971 CircuitSpecialists. • Waveforms can be saved in the following formats: jpg/bmp graphic file. and can also be connected to a PC.5A 108W $199. Software included. The hot air gun is equipped with a hot air protection system which provides system cool-down and cool the nozzle more rapidly & extend the life of the heating element.circuitspecialists. and Series or Parallel Operation. Both units feature a Large LCD display panel with simultaneous output and parameter view and a keypad for control.000-Count DMM resolution with AC/DC at 600V/800V.circuitspecialists.00 A wide selection of accessories.backlight •High resolution at .circuitspecialists. . Breadboards. RS-485 adapters •May be used in series or parallel modes w i t h a d d i t i o n a l supplies.500 degrees Celsius Heating Element Metal Heating Core Nozzle to Ground Resistance: Below 2 ohms Pump/Motor Type: Diaphragm Pump Air Capacity: 23 L /min (max) rs Ye a l ! w Ne ecia Sp www. The BK5000 from BlackJack SolderWerks provides a very convenient combination of hot air and soldering in one compact package.com/CSIPPS33T CSIPPS55T • 60MHz Handheld Digital Scopemeter with integrated Digital Multimeter Support • 60MHz Bandwidth with 2 Channels • 150MSa/s Real-Time Sampling Rate • 50Gsa/s Equivalent-Time Sampling Rate • 6. Electronic Components.4 6 4 .com We carry a LARGE selection of Power Supplies. DMM Functions & 25 MHz Arbitrary Waveform Generator www. test leeds.Generator.00 www. all in one convenient lightweight rechargeable battery powered package.00 The CSI530S is a regulated DC power supply which you can adjust the current and the voltage continuously.00 Mechanical Arm with Air Gun attached attached CSIPPS33T Item # Item # $479. A Z 8 5 2 1 0 P h o n e : 8 0 0 . The hot air gun is designed to use different SMD nozzles for various SMD applications. C o u n t r y C l u b D r. USB cable and a conven. current and power settings.00 www. The system cool-down feaware.com/DSO1200 www.00 CSI3646A 0-72V 1. DC Power Supply DSO-8060 Thease devices can be used with supplies up to 360VDC and 30A. 10A • Large 5.8Kg SOLDERING IRON Power Consumption: 35W Temperature Range: 200 . digital logic circuits and so on.2 4 8 5 / Fa x : 4 8 0 .4 6 4 .00 $619. Soldering Equipment. • 200MHz Handheld Digital Scopemeter with integrated Digital Multimeter Support • 200MHz Bandwidth with 2 Channels • 500MSa/s Real-Time Sampling Rate • 50Gsa/s Equivalent-Time Sampling Rate • 6.7 inch TFT Color LCD Display • USB Host/Device 2. Highly Stable. There are both fine and coarse controls via the shuttle knob and 90 memory settings. Oscilloscopes. The overheat protect feature effectively shuts off power to the heater when an overheat in the middle of the handle has been detected.95 C i r c u i t S p e c i a l i s t s . two scope probes.1mV Model DC Voltage DC Current Power (max) Price CSI3644A 0-18V 5A 90W $199. They are ideal for applications requiring high resolution.480 degrees Celsius Heating Element with Tip: Ceramic Heater Output Voltage: 24V Tip to Ground Resistance: Below 2 ohms Tip to Ground Potential: Below 2mV HOT AIR Power Consumption: 500W peak Temperature Range: 100 . Electronic Chemicals. multiple output. Auto Fan Control.MS excel/word file • Can record and save 1000 waveforms • DC to 25 MHz Arbitrary Waveform Generator 60MHz Hand Held Scopemeter w/Oscilloscope. Panel Meters. or for testing DC power supplies or high-capacity batteries.5 8 2 4 . This will ient nylon carrying case. M e s a .com 3 Channel Programmable Regulated DC Power Supplies 200MHz Hand Held Scopemeter with Oscilloscope & DMM Functions Includes 1 Year USA Warranty You get both a 200 MHz Oscilloscope and a multi function digital multimeter.

downmagaz.com .www.

Sign up to vote on this title
UsefulNot useful