0% found this document useful (0 votes)
29 views84 pages

Nutsvolts201503 DL

The document features various articles and columns from the March 2015 issue of Nuts & Volts magazine, including topics such as building frequency counters, cost-effective traffic light controllers, and the importance of avoiding Equipment Acquisition Disorder (EAD) in electronics. It also includes reader feedback, Q&A sections addressing common electronics issues, and product reviews. Additionally, it highlights upcoming events like the Chicago CoCoFEST and offers insights into new technologies and techniques in electronics.

Uploaded by

Bob B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views84 pages

Nutsvolts201503 DL

The document features various articles and columns from the March 2015 issue of Nuts & Volts magazine, including topics such as building frequency counters, cost-effective traffic light controllers, and the importance of avoiding Equipment Acquisition Disorder (EAD) in electronics. It also includes reader feedback, Q&A sections addressing common electronics issues, and product reviews. Additionally, it highlights upcoming events like the Chicago CoCoFEST and offers insights into new technologies and techniques in electronics.

Uploaded by

Bob B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

Page 22

March 2015
Page 46 46 Give Your Sound a Boost — Amplifier
Modules to Power Your Project’s Audio
22 Build a Frequency Counter Want to hear about a way to add sound to your
project? Then, check out this review on a selection
Frequency counters have been around for years
as a standard piece of test equipment in both of low to mid power amplifier modules from
commercial and hobby labs. If you need one Parts Express.
for your workshop, take a gander at the one ■ By J.W. Koebel
presented here.
■ By Jim Teixeira 54 A Look at the 23rd Annual
“Last” Chicago CoCoFEST!
30 A Cost-Effective Traffic Light Controller So, what’s the big deal about a vintage computer
This project spotlights how sometimes the good expo in this modern world of Windows, Androids,
old fashioned way is the most efficient when and iPads? Not only does this event highlight the
constructing circuits. TRS-80 Color Computer, but it also showcases a
■ By Alan Grambo unique fusion of old and new technology.
■ By Salvador Garcia
36 Beyond the Arduino
Ready to cut the apron strings and discover what it’s
like to work directly with a microcontroller? This
series will help you down that road less travelled.
■ By Andrew Retallack
06 DEVELOPING 67 ELECTRO-NET
PERSPECTIVES 68 NV WEBSTORE Page 54
Starting Out:
Avoiding EAD 71 CLASSIFIEDS
07 READER FEEDBACK 78 TECH FORUM
18
20
NEW PRODUCTS
SHOWCASE
81 AD INDEX
Departments Columns
08 Q&A 64 Open Communication
Reader Questions The Latest in Networking and
Answered Here Wireless Technologies
Find out how to fix burn marks on LCD screens and New Short-Range Wireless Standards
whether or not to go with CFLs or LEDs. Target IoT Applications.
Now, it is easier than
10 PICAXE Primer ever to connect devices
over the Internet with the
Sharpening Your Tools of Creativity
features available in
USB-to-Serial Adapters Revisited.
upgraded versions of
Explore a hardware solution that allows you to use a
Bluetooth and ZigBee.
wide variety of relatively inexpensive USB-to-serial
adapter cables in PICAXE breadboard projects. Page 64
72 The Design Cycle
59 The Ham’s Wireless Workbench Advanced Techniques for
Practical Technology from Design Engineers
the Ham World A Blueprint for Embedded Wi-Fi.
Last month, we discovered that the Numbat Wi-Fi
Oscillators. module on the Moray development board can take
Every signal begins with an oscillator — which is a
care of itself in the wild. However, you can’t Wi-Fi in
key element in ham radio to generate, mix, and
the woods if you have to be attached to the USB port
extract the info from these signals. This time, see
of a laptop. This month, we will replace the USB
how to make an audio oscillator, plus learn about
cable, laptop, and terminal emulator with a simple
common RF types.
PIC microcontroller and some tricky CCS C code.
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; [email protected].

4 March 2015
Learn more

JOIN THE Today

EVOLUTION.
2005

1945

1905

Evolve to app-based control


with AIR for Wiced Smart!
If you’re ready to evolve from fixed control panels
Get “mobile smart” populated with dials, buttons, keypads, and LCD
in 3 easy steps: displays to mobile-app based control of your
f Wiced
Get your AIR for d embedded product – check out Anaren’s AIR for Wiced Smart module,
Smart dev kit at your featuring Broadcom’s Wiced Smart Bluetooth® chip (BCM20737).
distributor of choice.
ebsite for a
(See our website
Not only does our small-footprint, SMT, and pre-certified all-in-one
t.)
current list.) module save you the time, effort, and trouble of designing your
own radio... It’s supported by our industry-exclusive Atmosphere
Develop your
ur wirelesss
link and basic
sic app using
usin
ng
development ecosystem that lets you develop your basic embedded
ve Atmosphere
our exclusive Atmoosphereere code and app code in one, easy-to-use development tool – for a far
developmentnt tool.. speedier product development cycle and time-to-market. Follow the
With our AIR for Wiced
steps at left to join the evolution, right now!
Smart module on board, www.anaren.com/AIRforWiced
proceed in record time to 800-411-6596
a prototype and final,
nal, In Europe: 44-2392-232392
mobile-app development!
opment!
by Bryan Bergeron, Editor
DEVELOPING
PERSPECTIVES
Starting Out: Avoiding the Equipment Acquisition
Disorder (EAD)

S tarting out in electronics — as with any hobby —


requires an investment of time, energy, and finances.
This is especially true in the early stages, when unbridled
either new or used — as your budget allows.
Furthermore, you’ll be tempted to lean towards the
feature-laden versions of each piece of equipment in the
enthusiasm blurs what expenditures on equipment and off chance that you might need those extra features one
supplies are necessary and which are detours. It’s amazing day — even though you’re unclear exactly what benefit
how easy it is to succumb to the equipment acquisition you’ll derive from those features.
disorder or EAD — even on a relatively tight budget. For example, let’s say you’re facing the choice of a $9
EAD manifests itself in two ways. The first is in the wall wart and a $300+ bench power supply. Even though
number of pieces of equipment acquired — everything the wall wart will probably be all you need for the first six
from a digital o’scope to a bench multimeter. The second months or so of your experimentation, you’ll be tempted
is in the specifications of each piece of equipment, with a to go for the bench supply. Then, there’s the issue of
leaning towards an abundance of often unnecessary digital readout — number of digits, single readout for
features. voltage and current, or dual digital readouts, current-
For example, let’s say you start your adventure by limiting features, and the like. You could easily end up
setting up a workbench for microcontroller work. At the with a power supply that not only requires more space on
outset, you’ll be faced with determining what equipment your bench, but that is so complex you’ll have to spend
is necessary, what’s nice to have, and what would simply hours just learning to use every feature. Unless one of
add clutter to your workspace. If you’re like most novices, your goals is to master commercial power supplies, these
you’ll refer to advertisements, reviews, and perhaps join an are hours that you should have spent working directly with
online forum or two in hopes of determining exactly what microcontrollers.
you’ll need. Left to your own devices, you might How do you avoid EAD? If you’re extremely lucky —
accumulate a dozen different pieces of equipment — or persistent — you’ll identify a mentor at a local
electronics club who will take time
to understand you, your plans, and
real needs. The second best option
is to identify a virtual mentor on one
of the many online forums.
The challenge is finding a
mentor that doesn’t have a hidden
agenda linked to sales of equipment
or supplies. Otherwise, you could
end up with an even more severe
case of EAD than if left on your
own. I’ve found that the most
credible online mentors emphasize
ingenuity over equipment.
Another thing I’ve learned is
that when exploring an unknown
field, it’s better to learn one thing —
be it a device or technique —
thoroughly before moving on to
something else. Taking this approach
will naturally limit any EAD
tendencies you might have.
Good luck experimenting. NV
6 March 2015
EVERYTHING FOR ELECTRONICS
Published Monthly By
READER FEEDBACK
T & L Publications, Inc.
430 Princeland Ct. Electronics Left Out board would be similarly rated by
Corona, CA 92879-1300 in the Cold their manufacturers.
(951) 371-8497 My limited electronics
FAX (951) 371-3052 I enjoyed reading Paul Verhage’s knowledge is self-taught. I always
Webstore orders only 1-800-783-4624 Near Space column in the May 2014 looked upon the ratings in a
www.nutsvolts.com issue about building an electronic datasheet as being definite, but it
Subscription Orders thermometer for a thermal vacuum appears from your project that the
Toll Free 1-877-525-2539 chamber. The article mentioned that ratings are not absolute. Could you
Outside US 1-818-487-4545 the thermometer could read down to please say a few words on the
P.O. Box 15277 -99 degrees Fahrenheit. My thoughts subject, and about your own
North Hollywood, CA 91615 immediately went to the effects of experience with component
FOUNDER such cold temperatures on the reliability in the face of such cold
Jack Lemieux electronics. (Actually, I guess you temperatures? Thank you!
PUBLISHER have to deal with that factor every Judy May W1ORO
Larry Lemieux time you launch.) Union, KY
[email protected]
The LM335 temperature sensor,
ASSOCIATE PUBLISHER/
ADVERTISING SALES
for instance, is rated at -40 degrees Thanks for asking, Judy. It's great
Robin Lemieux Fahrenheit for its absolute maximum to get letters from readers.
[email protected] rating when operating, and -76 Actually, my thermometer for the
EDITOR degrees for non-energized storage (I TVC works to -99 degrees because
Bryan Bergeron am referencing the Texas Instrument's that's the lowest temperature the
[email protected]
datasheet). I would think that many
VP OF OPERATIONS
Vern Graner of the other components on your Continued on page 45
[email protected]
CONTRIBUTING EDITORS
Lou Frenzel Tim Brown
Fred Eady Ron Hackett
Ward Silver J.W. Koebel
Andrew Retallack Salvador Garcia
Jim Teixeira Alan Grambo

CIRCULATION DEPARTMENT
[email protected]
SHOW COORDINATOR
Audrey Lemieux
WEB CONTENT
Michael Kaudze
[email protected]
WEBSTORE MARKETING
Brian Kirkpatrick
[email protected]
WEBSTORE MANAGER
Sean Lemieux

ADMINISTRATIVE STAFF
Debbie Stauffacher
Re Gandara

Copyright © 2015 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. March 2015 7


■ WITH TIM BROWN
Q&A
In this column, Tim answers questions about
all aspects of electronics, including computer
• Burn Marks on LCD Screen
hardware, software, circuits, electronic theory, • CFLs vs. LEDs for
troubleshooting, and anything else of interest to Residential Lighting
the hobbyist. Feel free to participate with your
questions, comments, or suggestions. Send all
• Mailbag
Post comments on this article at www.nutsvolts.
questions and comments to: Q&[email protected]. com/index.php?/magazine/article/march2015_QA.

Burn Marks on LCD TV Screen Residential Lighting: CFL Versus LED

Q Q
Is there anything I can do about burn marks on I am looking for ways to save energy and protect
an LCD television? Thanks. the environment, so I was wondering which
— Mark Erickson, El Paso, TX lamps are better for home lighting: CFLs or LEDs?
— Charles Davis, Portsmouth, VA

A A
I’m assuming that your problem is image Saving energy and protecting the earth's
persistence which exhibits a "ghost" type environment should be goals that everyone is
reflection which remains on the screen when seeking to achieve. Until the past decade, most
the on-screen scene is changed. Image residential lighting was provided by the
persistence is usually caused by viewing a static screen for incandescent or tubular fluorescent lamps. Historically,
long periods of time. What happens is the LCD pixel anything that would burn — such as tar, plant materials,
element crystals become "locked" in a certain state due to olive oil, whale oil, kerosene, etc. — was used until a
staying in this position for prolonged periods of time. reliable incandescent bulb was commercialized in the late
First, check the manufacturer's information to see if 1800s by Thomas Edison et al. Fluorescent lighting was
the set has a built-in fix for image persistence. I am commercialized in the late 1920s.
assuming that you have already tried turning the TV off for Tungsten filaments in the incandescent lamps are
24 to 48 hours to see if the problem will clear itself. heated via electrical current flowing through the resistance
A simple fix that I would try first is to reduce the of the filament. This generates heat, thus causing the
brightness and contrast settings for the TV screen. If this filament to emit visible light and heat. The heat of the
doesn't work, try running the set with a "snow" pattern by incandescent bulb is wasted in most cases since it does
tuning to a channel that does not have a signal (some not provide any visible light, yet constitutes about 85 to
devices produce a blue screen when no signal is present, so 95% of the energy input to the bulb. (On the plus side, I
this step will not work). If the image retention persists (pun have used incandescent bulbs to heat an outdoor animal
intended), you may want to buy a screen maintenance tool hutch in the winter for which they were very effective.)
such as Pixel Protector (www.pixelprotector.com). Some of The fluorescent tube lamps waste around 70% of the
our readers may have other solutions they can submit. electrical energy they receive, so they reduce energy
Let me know how these ideas work out. consumption tremendously as compared to incandescent

MAILBAG available (at least as I type this answer as surface mount


Re: Dec 2014; page 14; Need Battery Monitor Circuit: instead of thru hole) from the manufacturer, ON
The IC you mentioned (MN13811-M) is not available Semiconductors in sample sizes or tape and reel
online, or at least I can't find it. This is a nice little project (www.onsemi.com/PowerSolutions/product.do?id=NCP
but if the parts are not available to the public, then what is 301). Mouser Electronics also has this part available
the point of publishing it in the first place? www.mouser.com/ProductDetail/ON-Semiconductor/
Pete Emmel via email NCP301LSN31T1G/?qs=%2FugrpAKHX8qlQVgDtV2w2g
Thank you, Pete for catching my major blunder. Upon %3D%3D). If you need a 3.2V reset voltage, use the
further research, I found that the MN13811-M used in the NCP301LSN32T1G. It has five terminals (versus three for the
www.circuitstoday.com battery monitor circuit is no MN13811-M's TO-92 package) but only three are used, with
longer stocked (I looked up the tech specs but failed to see the other two helping secure the chip to the circuit board.
the word "discontinued"). Further research found the You can see the datasheet for the NCP301LSN31T1G at
NCP301LSN31T1G has a 3.1V reset voltage/open drain N- www.onsemi.com/pub/Collateral/NCP300-D.PDF.
channel active high device like the MN13811-M (both I'll repeat myself again: I don't know everything and I
devices generate a high output when the input voltage rely on our sharp-eyed readers to keep me straight. I'll try
drops to the reset value), except the NCP301LSN31T1G is to do better in the future. Tim Brown
8 March 2015
QUESTIONS and ANSWERS

lamps. Compact Fluorescent Lamps (CFLs) waste about 25% intended) review: longer bulb life; not susceptible to
of the energy input, and Light Emitting Diodes (LEDs) waste destruction when you drop the flashlight (I have destroyed
only about 10 of the input energy, so the reduction of many incandescent bulbs this way); the small size of the
electrical power usage is even greater using CFLs or LEDs LED flashlight gives much more light than some of my
rather than incandescent bulbs or fluorescent tubes. Since larger sized incandescent lights; and the batteries seem to
the electrical power used to light a home is approximately last forever (months vs. a couple of weeks in the
25%, the reduction in wasted energy pays environmental incandescent lights). All in all, looking at bulb cost,
dividends by creating a smaller "carbon footprint" (close to longevity, power consumption, and environmental
70% of electricity in the US is produced by petroleum, considerations, I feel that the LEDs are the way to go. NV
coal, or natural gas which generate
carbon dioxide — a major
greenhouse gas). CFLs and LEDs are
manufactured so they can be

     
installed in the same ubiquitous
fixtures as incandescent bulbs,
which explains their popularity.
However, there are caveats: (1) + ++*) ( ( ' ( ' & %$#"! & * & #
Incandescent lighting fixtures are
' & % $ & # "! #  & $ $ #              
relatively cheap and reliable; (2)
Fluorescent tube fixtures use ballasts # # ' #' " '#
(auto-transformers) that fail a lot # '"'# '"# " #
more often than the incandescent EDCBAB@C?>=<=;<;:=>9B 8AB8 E:!;(;:9B!B6+0506#3B
fixtures; (3) CFLs and fluorescent 8766543B210/53B40.4<56-21/B :<6*/B*6B-6"0*/B/-50%*B5/B
,-1+4*/++B@)B7656-9B #6#<+46-50#.B-65%-B+0549B /+0+<
tube lamps contain mercury which >9>('B&0%7/5/-B$B=9;'B*6#.9B 50/B*6%&B;9=B:B&BB(;1%B=B&9B77
is an extremely toxic material, so ;9>('B&0%7/5/-B$B:'B*6#.B &0%9B"*%55/&B+4%"59B 77B54-/%&/&B,1+40#.9
their disposal is an environmental +4%"59B(>!;B B054B )B0#+B B761#50#.B5%,+B"6-B%&&0506#%*B
+16-59BB 
 
hazard as is the non-biodegradable #6B*6%&9BE10*5B0#B+//&B+/#+6-9B
glass and the slightly toxic Tungsten !<:(&B6/-%50#.B6*5%./9B #$*')& 
in incandescents. 65/B40+B5/B6"B@)B7656-B-/210-/+B%B
CFLs are much more expensive 6#5-6**/-B56B"1#506#9B/B4%/B+67/B0#/$<  ## '"'
/#+0/B6#5-6**/-+B%#&B+/-6B5/+5/-+BB54%5 6<*6%&B-%50#.B;B B B
than incandescent bulbs, and LEDs %#B,/B1+/&B56B6/-%5/B540+B7656-9B8//B61- B&3::;79B6-+B/**B

 
are more expensive than CFLs. LEDs /,+05/B"6-B76-/B0#"6-7%506#9 &6#B56B:9(&B:> 9B:77BB$B>;77
contain arsenic, lead, and several    @9B77B&0%9B$B::77B"*%55/&B+4%"59B>;77
other hazardous metals. (Hey, */%&+B054B><0#B"/7%*/B6##/56-9
# # ' "'#
nobody is perfect. I feel that the
pollutants in LEDs are easier to deal
%*/BB"/7%*/B/#&+B
6##/5/&B054B

#$*')&  

with than the glass and mercury in :;'B0-/+9B*6#B
fluorescents or the glass and 461+0#.9B6*&<*%5/& #""'# #
6#5%5+9B :>B/B/%&B054B#17/-%*+B
Tungsten in incandescents.)   ;B< 3BB%#&BA9B#/B6776#B


My personal experience comes 5/-70#%*9B)6#5%5+B-%5/&B
from re-lamping most of our  #$*')&
>;B7B B>B&9B>9;:'B$B
 #$*')&
residential incandescent fixtures with >9>'9BE*%B054B405/B,1556#+9B
CFLs. The energy savings was enough  #'#"  #"  61#50#.B46*/+B6#B:9'B$B>9>'B/#5/-+9B
=<6+0506#9B8-/B5/-70#%*+B )%#B,/B-/%-<761#5/&B54-61.4B%B>9>('B$


that — after the first two years — the
power company owed me money at
054B0-/B*%7+9 :9:'B156159

%5/&B:;B B=;;9B  
the end of the year, plus reduced my (B$B>>B$B:>779BB
Equal Payment Plan fee the next year. 6-B>><:>B0-/9  '  "'# #
"  #" #

I have noticed than the cheaper 
#$ ')& 10<-/*/%+/B+-0#.<
CFLs do not last as long as I would 
*6%&/&B5/-70#%*+9B
like, but their life still exceeds that of  "# # " # /5B1B56B:>BB
incandescents and the savings goal ?%7*0#B4/-7/50%**< 0-/9B /&,*%B6*6-<6&/&B*//-+9B>9!('B$
is still achieved. My experience with +/%*/&B.*%++B-//&B+0549B:9;'B*6#.B$B ;9 !'B"665-0#59B61#50#.B46*/+B6#B>9='


;9='B&0%9B,6&9B/#.54B0#*1&0#.B*/%&+3B=9=!'9 /#5/-+9B86*&/-<*66B5/-70#%*+9
LEDs consists of several flashlights I
  

  
bought because they used LEDs. I  #$ ')& #$ ')&
give the LEDs a glowing (pun #$*')& 
March 2015 9
PICAXE PRIMER ■ BY RON HACKETT
www.jrhackett.net

USB-to-Serial Adapters Revisited


Back in the June 2010 However, this month, we’re used an NPN transistor as a switch
going to explore a hardware solution back in our first LED-multiplexing
installment of the Primer, to inverting the TxD and RxD signals project way back in the December
so that a wide variety of relatively 2009 Nuts & Volts. Since that’s quite
we discussed the FTDI inexpensive USB-to-serial adapter some time ago, let’s quickly review
cables can be used for our PICAXE the basics of transistor switches.
USB-to-TTL serial cable, breadboard projects. First, as you may remember, the
In the process of writing this three junctions of a bipolar transistor
and how a single cable month’s column, I experimented with are referred to as the base, the
can be used to both power a couple of different logic gates collector, and the emitter. (In Figure
(inverters and NAND gates). A logic 1, they are labeled “B,” “C,” and “E,”
and program a PICAXE gate can certainly be used to invert a respectively.) Second, the standard
data signal, but it turns out that the symbol for an NPN transistor
breadboard circuit. The most space-efficient solution (at least includes a small triangle pointing
for non-SMD parts) is to simply use away from the base at the emitter
FTDI cable is simple to an NPN bipolar transistor for this connection.
use, plus it consumes purpose. I chose the 2N3904 NPN, Third, when using an NPN (or
but any general-purpose NPN PNP) transistor as a switch, the
much less breadboard transistor should do. general rule is that the switch will
turn on (i.e., current will flow from
space than the standard Experiment 1: Using the collector to the emitter)
whenever the base is “taken toward”
AXE027 programming an NPN Transistor as a the collector, i.e., whenever the base
cable and a separate
Data Inverter is connected to the same voltage
level as the collector.
power supply. As a result, I Figure 1 shows the schematic of Finally, the transistor is not a
a simple NPN data inverter. The “perfect” switch. In other words,
almost always choose the schematic doesn’t show the standard there’s a small internal voltage drop
PICAXE programming circuit, but, of between the collector and the
FTDI cable whenever I'm course, you need to include one — emitter whenever the transistor
just use whatever programming switch is “on.” For my setup, I
setting up a new PICAXE connection you prefer. measured the drop to be about 0.3V.
breadboard project. The circuit in Figure 1 may look In order to understand how the
familiar. That’s because we’ve already transistor switch in Figure 1 functions

nfortunately, the FTDI cable has


U a downside. Even though it’s
cheaper than the AXE027, it’s still ■ FIGURE 1.
relatively expensive — especially if Inverter
schematic.
you want to work on more than one
project at the same time.
I originally chose to use the FTDI
cable because it was the only cable
that I could find that included the
capability of inverting the polarity of
the TxD and RxD signals in software,
which is necessary for the PICAXE
programming interface. As far as I
know, that’s still the case.
10 March 2015
SHARPENING YOUR TOOLS OF CREATIVITY

as an inverter, let’s examine the two ■ FIGURE 2. Breadboard setup for


possibilities. Experiment 1.
The collector is tied to +5V
through R2, which serves as a
current-limiting resistor. Therefore,
when the base of the transistor is
also connected to +5V (through R1,
which is a current-limiting resistor
too), the transistor “turns on” which
effectively connects the collector to
ground. However, don’t forget the
small internal voltage drop I
mentioned earlier.
As a result, it would be more
accurate to say that the collector is
connected to 0.3V, not 0.0V
(ground), but that voltage drop isn’t
significant, and it’s simpler to just
think of it as “the collector is
connected to ground.” On the other
hand, when the base of the transistor
is connected to ground, the transistor rather than pin C.3. really simple, as we will see when
“turns off,” which disconnects the If C.4 happened to be configured we’ve completed construction of the
collector from the emitter (i.e., no as an output, whenever the voltage test circuit.
current can flow into the collector). level at the collector differed from However, if you prefer, you can
So, in Figure 1, the collector is simply the voltage level on the C.4 output, a eliminate the 08M2 altogether, and
connected to +5V (through its direct short would occur, and the simply use a multimeter to measure
current-limiting resistor). transistor and/or the 08M2 would the voltage at the right end of R3 as
To summarize the above: When probably be damaged. Resistor R3 you change the voltage level that’s
the base of the NPN transistor is at prevents that from happening by input to the base of the transistor.
+5V, the collector is (almost) at limiting the current flow to a safe At this point, we’re finally ready
ground; when the base is at ground, level. to test our simple inverter circuit. A
the collector is at +5V. In other At first glance, it might appear formal parts list isn’t really necessary;
words, the transistor switch functions that resistors R2 and R3 form a all you need is a 2N3904 transistor
as an inverter: high in = low out, and voltage divider, but that’s not the (or any general-purpose NPN
low in = high out. case. As we discussed earlier, when transistor you have on hand), three
Now, let’s turn our attention to the voltage at the base of the current-limiting resistors (I used three
the level of the input signal at pin C.3 transistor is +5V, the transistor switch 10K resistors, but anything between
of the 08M2. The first point that turns on, so the collector is 1K and 10K will also work), a
needs clarification is resistor R3 — connected to ground and pin C.3 is resistorized LED (or a regular LED
which is connected between the pulled low through R3. and a current-limiting resistor), and an
collector of the 2N3904 and pin C.3 On the other hand, when the 08M2 processor with a programming
on the 08M2. As you know, pin C.3 voltage at the base of the transistor is circuit. If you’re missing anything, all
on the 08M2 is fixed as an input. As 0V, the transistor switch turns off, so the necessary parts (except the
a result, R3 is really not needed at all. no current flows through the 08M2) are available on my website.
If we were to replace it with a collector and pin C.3 is held high Figure 2 shows my completed
jumper wire, the circuit would still through the combined resistance of breadboard setup for this experiment.
function properly. Whenever the R2 and R3. As you can see, I deviated from the
2N3904 collector is at a high level, Before actually testing our schematic in two minor ways: I’m
the input to pin C.3 is at a high level; inverter circuit, there’s one last point using a resistorized LED (so I omitted
whenever the 2N3904 collector is at I want to mention. The only reason R4), and I replaced the SPDT switch
a low level, the input to pin C.3 is at the 08M2 is included in the circuit is with a long jumper wire (which you
a low level. However, consider what to provide visual feedback for the can see dangling in the lower right
would happen if we accidentally state of the pin C.3 input. The corner of the photo). (When we run
connected the collector to pin C.4 program to accomplish this goal is the experiment, we’ll just insert the
March 2015 11
Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/index.php?/magazine/article/march2015_PICAXEPrimer.

■ FIGURE 3. Pinout of the ■ FIGURE 4.


PL2303HX cable. Prolific adapter
schematic.

unconnected end of the jumper wire After you type this code into the because it’s known to work reliably
into either the +5V rail or the ground PICAXE Editor, download it to your with PICAXE processors (as long as
rail.) The jumper wire provides an breadboard setup. Whenever you the two data signals are inverted —
opportunity to observe an interesting insert the loose end of the long which we’re about to do); it’s readily
aspect of the circuit, as we’ll soon see. jumper wire into the +5V rail, the available; and it sells for less than half
When you’ve completed your LED should be off; whenever the the price of the FTDI cable.
breadboard setup for the experiment, loose end of the jumper wire is Figure 3 presents the pinout of
we can turn our attention to the inserted into the ground rail, the LED the cable that we’ll be using in this
program we’ll use to test the inverter. should be on. experiment. A cable with the same
It’s so short that I’m including it here; Also, note what happens color-coding is available on my
just type it into the PICAXE Editor. The whenever you disconnect the jumper website (www.JRHackett.net) and
program simply displays the real time wire from the +5V rail — the LED elsewhere. (If you use a different
state of the input to pin C.3 on the immediately lights. In other words, PL2303HX cable, the color coding of
LED. If the input is high, the LED is +5V is the only input level that results the four wires may differ.)
on; if the input is low, the LED is off. in a low input to pin C.3. If the input The schematic for Experiment 2
to the transistor switch is at ground (and 3) is presented in Figure 4.
‘ === InverterTest.bas ======== level or if it is entirely disconnected, Essentially, it consists of two NPN
‘ Program tests the 2N3904
‘ inverter. the input to pin C.3 is high. transistor inverter circuits: one for
When you’re finished testing each of the two data signals. Both
‘ === Directives ========
#com 6 your breadboard setup, we can move inverter circuits function identically to
#picaxe 08M2 on to applying what we’ve learned in the single inverter circuit of
#terminal off Experiment 1. We’re going to invert Experiment 1, and all six current-
#no_data
the Tx and Rx data signals on a USB- limiting resistors are again 10K.
‘ === Constants ========= to-serial cable, so that it can be used In this experiment, we can ignore
symbol LED = C.2 to power and program our PICAXE the two headers in the schematic and
‘ === Variables ========= projects. just focus on the required
symbol data_In = pinC.3 connections. (When we get to
‘ === Begin Main Program ====== Experiment 2: Inverting Experiment 3, we’ll discuss the two
headers.) As you can see in Figure 4,
do
if data_In = 1 then the Data Signals on a the output signal from the Prolific
high LED
else USB-to-Serial Cable TxD line is connected to the base of
low LED the lower inverter, and the inverted
endif
loop I chose to use the Prolific output of the lower transistor is fed
PL2303HX cable for Experiment 2 to the Serin input on a PICAXE
12 March 2015
processor; the output signal
from the PICAXE Serout line Experiment 3:
is connected to the base of Constructing a
the upper inverter, and the Stripboard
inverted output of that
transistor is fed to the RxD
Programming
input on the Prolific cable. Adapter
Figure 5 shows my
completed breadboard If you’re interested in
setup for this experiment. using a Prolific USB-to-serial
Before assembling your own adapter cable to power and
breadboard circuit, take program your PICAXE
some time to trace the breadboard circuits, you
wiring on my breadboard, would certainly want a
and make sure you ■ FIGURE 5. Breadboard setup for Experiments 2 and 3. more convenient solution
understand how it implements than the breadboard circuit
the circuit of Figure 4. Also, note the we just tested. Of course, the
resistorized LED that’s connected obvious solution is to construct a
between the 08M2 Serout line and stripboard version of the circuit, and
ground. We’re going to test the Prolific that’s just what we’re going to do
USB-to-serial programming interface now.
by downloading a simple “Hello Figure 6 shows the stripboard
World!” program that blinks the LED layout for our USB-to-serial inverter.
on the Serout line (i.e., pin C.0). (A large size version of the layout is
Also note that there’s no switch available for downloading at the
in the power connection from the article link.) The schematic for this
Prolific cable; in order to turn off the circuit is identical to the one
power to the breadboard, it’s presented earlier in Figure 4. In that
necessary to disconnect the cable. schematic, H1 is the four-pin right
(We’ll return to that point before angle male header on the left side of
we’re finished this month.) the stripboard layout, and H2 is the
When you’ve completed your four-pin female header on the right
breadboard setup for the experiment, side of the layout. If you’re interested
we’re ready to look at the software in constructing the stripboard version
we’ll use to test the programming of our USB-to-serial inverter project,
circuit. (Actually, the real test of the you may want to start by tracing the
circuit is to see whether it downloads wiring in Figure 6 to make sure you
the program to the 08M2.) As in understand how it also implements
Experiment 1, our test program is the schematic of Figure 4. The Parts
really simple, so just type it into the List for the stripboard circuit is shown
PICAXE Editor. ■ FIGURE 6. Prolific adapter layout. in Figure 7. Again, all the necessary
As I mentioned above, the parts (including the Prolific
program just blinks the LED on pin PL2303HX cable) are available on my
‘ === Begin Main ===========
C.0 to say “Hello world!” do website and elsewhere, but you may
high LED already have most of the parts on
‘ === ProlificTest.bas ===== pause abit
low LED hand.
‘ Program tests the Prolific
‘ programming connection. pause abit
loop
‘ === Directives ===
#com 6 Type the program into the
#picaxe 08M2 PICAXE Editor and download it
#no_data to your breadboard setup. You
#terminal off
should see the LED blinking
‘ === Constants ==== about once per second; if not,
symbol abit = 500 you will need to troubleshoot
symbol LED = C.0
your breadboard wiring. ■ FIGURE 7. Parts List for Prolific adapter.
March 2015 13
The construction of the visible) underneath the joining power switch on the USB-to-serial
stripboard circuit is very stripboard. However, you can just use inverter board; to disconnect power
straightforward, so a list of four jumper wires to make the from the breadboard, you have to
instructions isn’t necessary. As usual, necessary connections if you prefer. physically disconnect the cable. I’m
install the parts by starting with the Our USB-to-serial inverter circuit sure you’re wondering why, so let me
lowest ones (the jumper wires), and provides a simple and inexpensive explain.
work your way up to the tallest (the way to power and program our The inverter board is part of a
four-pin female header). However, PICAXE breadboard circuits with a larger project that I’ve been working
there is one point that I should single connection. If your primary on recently. Back in the June 2010
mention: The holes at B3 and B6 computer is a laptop, it also enables Primer, I introduced the FTDI-based
need to be slightly enlarged so that a the possibility of mobile project AxMate programming adapter, and
header pin and a resistor lead will fit development. (I’ve actually worked for some time now, I’ve wanted to
in the same hole. on the hardware portion of PICAXE extend the AxMate concept so that it
A 1/16 inch drill bit is large projects while commuting on the can work with a variety of USB-to-
enough — just be sure to drill the local railroad!) serial adapters.
board with the traces facing up so Before wrapping up Experiment Since all PICAXE processors
you don’t tear out the traces around 3, there’s one final point that needs require the serial programming data
the holes. to be mentioned. If you use the to be inverted, and (as far as I know)
If you prefer not to take this extra inverted Prolific cable to develop a the FTDI cable is the only adapter
step, just cut the stripboard so that PICAXE project that will ultimately be that supports software inversion of
the traces include nine holes rather powered by batteries (or any other the data lines, I decided to develop a
than eight, and move the four-pin power source), don’t forget that if two-board system which includes an
right angle male header one position you remove the USB cable and adapter board containing the
to the left. inverter board from your circuit, you circuitry required by a specific USB-
When you’ve completed will need to tie the processor’s Serin to-serial cable (e.g., FTDI, Prolific,
construction of the stripboard circuit, pin to ground (via a 100K resistor) in AXE027), and an interface board
you can test it with the same program order for the circuit to function containing the circuitry required by
that we used in Experiment 2. correctly. all USB-to-serial cables (i.e., a switch,
Figure 8 is a photo of my Of course, the same thing is true an LED power indicator, and a by-
completed stripboard circuit, and for the AXE027, the FTDI cable, or pass capacitor).
Figure 9 shows how I connected it to any other programming connection. So far, I’ve developed three
my breadboard circuit. As you can different adapter boards:
see, I used a second stripboard to Where's the
make the connection. This approach
makes it easier to make the +5V and Power Switch?
ground connections to the power As I mentioned
rails with two jumpers (that aren’t earlier, there’s no
■ FIGURE 9. Prolific
stripboard connected to
breadboard.

■ FIGURE 8. Completed Prolific adapter.


14 March 2015
• FTDI-IFB contains the
necessary current-limiting
resistors for a software-inverted
FTDI cable.
• Prolific-IFB includes the
inverting circuitry we just
developed.
• Stereo-IFB contains a female
stereo connector and the
standard PICAXE programming ■ FIGURE 10. AxMate-IFE and Prolific-IFB on large breadboard.
circuitry.
want to have the option of As I was writing this article, I
Each of the above adapter connecting an eight-wire ribbon realized that the AxMate-IFE board
boards includes a 4x2 female header cable to the AxMate board for can also be used with a large (630-
with the same pinout that we just possible future projects. hole) breadboard (see Figure 10).
implemented on the Prolific Similarly to the original AxMate Of course, the AxMate-IFS
stripboard circuit, except that there boards, there are two versions of the doesn’t have the same flexibility
are two rows of pins rather than one. new AxMate board: the AxMate-IFS, because the holes in the power rails
The female header mates with a which can be inserted along the side and the main portion of the
4x2 male header on the AxMate of a standard small (300 hole) breadboard are aligned differently the
interface board that includes the breadboard; and the AxMate-IFE, on small and large versions.
circuitry I mentioned earlier. I chose which can be inserted at one end of However, it would be easy to
to use two-row headers because I a standard small breadboard. design an AxMate-IFS board for use

YOUR
DESIGN Y SOLUTION
OUR SOL UTION TTODAY
ODAY
CALL
C ALL 480-837-5200

TTS-7670
S-7670 and TS-7680
TS-7680 Industrial
Industrial Computers
Computers TS-4900
TS-4900 H
High
igh Performance
Performance Computer
Computer M
Module
odule
Up tto
o 454 MH MHzz ARM w/ 256 MB RAM RAM Up tto GHzz Q
o 1 GH Quad
uad Core
Core ARM CPU
2 GB Flash
Flash Storage
Storage Up tto
o 2 GB DDR3 R
RAM
AM
Industrial
Industrial Temperature
Teemperature (-40 ºC ttoo 85 °C
°C)) P
Pricing
ricing
WiFi and Bluetooth
WiFi Bluetooth starts
starts at
at
DIO
DIO,, C
CAN,
AN, Modbus,
Modbus, RS
RS-485
-485 Pricing
Pricing
starts at
starts at 4 GB FFlash
lash and microSD
microSD $ 99
TTS-7670
S-7670 FFeatures:
eatures: Qty
Qty 100
GPS and C Cell
ell M
Modem
odem $129 Gigabit EEthernet
thernet
Qty
Qty 100 SATA
SA
ATA II and PC
PCI-Expr
PCI-Express
ess $134
1x EEthernet
thernet Q
Qty
ty 1
DIO,
DIO
O, CCAN, COM, I2C, I2S
AN, COM,
microSD
2x micr oSD CCard
ard SSockets
ockets $168 NG
W! TTS-7680
S-7680 FFeatures:
eatures: Qty
Q ty 1 LLVDS
VDS GB Display
V & RRGB Display Ports
Ports MI !
NE CO ON
SO
W
WiFi
iFi and Bluet
Bluetooth
ooth IIndustrial
ndustrial Temperature
Tem
eemperature (-40 ºC ttoo 85 °C
°C))
TTS-7970
S-7970
24 VAC
VAC Power
Power IInput
nput LLow
ow ccost
ost plastic Supports
Supports Linux, Android,
Android, & QNX SBC Version
Version
enclosur
enclosuree aavailable
vailable of the TTS-4900
S-4900
2x EEthernet
thernet Windows Support
Windows Support Coming
Coming Soon
Soon

We’ve never Embedded Support every step Unique embedded


FE

AL
ED

EN
LI

IN

discontinued a systems that are of the way with solutions add value
GG
NG

IG
OP
RU

product in 30 years built to endure open source vision for our customers
OR
LO

March 2015 15
■ FIGURE 11. AxMate-IFS
and Prolific stripboard.

■ FIGURE 14.
AxMate-IFE and
FTDI-IFB.

■ FIGURE 12.
AxMate-IFS and
Stereo-IFB.

■ FIGURE 13.
AxMate-IFE and
Prolific-IFB.

with large breadboards, so I think I’ll the AxMate-IFE board, which • Figure 11: AxMate-IFS and
add that to my to-do list. provides a good amount of flexibility Prolific stripboard adapter.
Each of the three adapter boards in PICAXE programming setups. • Figure 12: AxMate-IFS and
(FTDI, Prolific, and Stereo) can be The following figures present a Stereo-IFB.
mated with either the AxMate-IFS or few of the possibilities: • Figure 13: AxMate-IFE and
Prolific-IFB.
• Figure 14: AxMate-IFE and
FTDI-IFB.

As you can see in these figures,


dividing the PICAXE programming
interface circuitry between the two
sets of boards provides the flexibility
of a “mix and match” approach to
powering and programming PICAXE
breadboard circuits.
This is especially true in
situations where we need to connect
more than one USB-to-serial adapter
cable to the same PICAXE project —
which is exactly what we’re going to
do with our Prolific cable in the next
installment.
See you then ... NV

16 March 2015
IInertial
nertial Sensors
Sensors Orientation
Orientation & TTilt
ilt SSensors
ensors GPS-Aided Attitude
GPS-Aided Attitude & Heading Systems
Systems

Best-in-class performance
at
Unbeatable prices
Our new UM7 Orientation Sensor represents the state-of-the-art in low cost, light weight
attitude and heading sensors. We’ve combined the latest and greatest MEMS technology

without emptying your wallet.

Come and see how we are revolutionizing the inertial


sensing industry!

www.CHRobotics.com
ww
www.CHRobotics.com
w.CHRobotics.com
March 2015 17
■ HARDWARE

NEW PRODUCTS ■ SOFTWARE


■ GADGETS
■ TOOLS

LED VINTAGE
LIGHT BULBS
S uper Bright LEDs, Inc., announces their new
LED vintage light bulbs. These LED filament
bulbs replicate an elegant antique bulb look, while
offering modern day energy efficiency in one long-
lasting bulb.
These dimmable old-fashioned style LED
replacement bulbs with traditional exposed filament In addition to the new LED vintage light bulbs, Super
appearance for decorative illumination are the perfect Bright LEDs also offers a selection of LED globe bulbs,
vintage reproduction touch for antique fixtures, vintage LED bi-pin bulbs, LED tube lights, LED smart bulbs, LED
wall sconces, traditional lamps, and older wall lanterns. strip and tape lights, LED panel lights, and LED T8 tubes.
Lasting up to 30,000 hours, the bulbs range from 280 to
450 Lumen, and are available in both warm white and For more information, contact:
ultra warm white. Their warm color temperature replicates Super Bright LEDs, Inc.
the look and feel of antique bulbs. Web: www.superbrightleds.com

FAMILY OF PRODUCTS FOR SchmartBoard has released six types of SchmartPatch


boards. Each comes in packs of four for a retail price of
PCB REPAIR $15. Volume purchases can be arranged with

S chmartPatch — new from SchmartBoard — allows


users to add surface-mount components to a
substrate such as a printed circuit board (PCB), or to
SchmartBoard directly for larger rework needs.

For more information, contact:


replace existing components. SchmartBoard
Web: www.schmartboard.com

AIR FOR WICED BLUETOOTH


SMART MODULE
SchmartPatch boards each support multiple pre-
A naren, Inc.’s,
Wireless Group
has announced the
defined components and allow one to cut off a pad from release of its first AIR
the SchmartPatch (using scissors or a blade), stick the pad for WICED™ Smart
on to the surface of the substrate (utilizing adhesive Bluetooth module and
already on the back of the SchmartPatch), and then solder Atmosphere on-line
a component onto the SchmartPatch. developer platform as
The component pads are routed to other pads that part of a strategic
allow one to solder jumper wires from the SchmartPatch engagement with Broadcom Corporation. This new
to make the electrical connection to the substrate. relationship advances the goal of both companies to
SchmartBoard sees a few scenarios that the product support designers, innovators, and end-equipment
can be utilized for. One situation might be to replace manufacturers looking for intuitive, easy-to-use developer
ruined pads in a circuit board repair in the field. Another tools (like Atmosphere) that will simplify the challenge of
example might be to add a component to a run of PCBs ‘going wireless’ and speed up their time to market. In beta
to resolve an issue immediately rather than waiting for trials of its new module and Atmosphere tool, customers
new PCBs to arrive. They can also be used as part of one's were able to get their product “proof of concept” running
prototyping or project development. in 90 minutes or less.
18 March 2015
Among the specific features for the lower barrier to SOCKET & TEST QFN74 DEVICES
product developers are the module’s small size, low cost,
pre-certification to global standards, and comprehensive WITH EXTREME TEMP
technical support.
The goal of Atmosphere is to enable any OEM to SOCKET
quickly and painlessly turn a mobile Bluetooth smart
device — such as an iPad, iPhone, or Android-based device
— into a mobile control panel.
I ronwood Electronics
recently introduced a
new stamped spring pin
socket addressing burn-in
For more information, contact: test requirements for
Anaren, Inc. testing 74 lead QFN -
Web: www.anaren.com CBT-QFN-7038s. The
contactor used in the CBT-
ETHERNET-BASED QFN-7038 socket is a
stamped spring pin with
MULTIFUNCTION DAQ 15 gram actuation force

M easurement Computing Corporation has announced


the release of the E-1608: an Ethernet-based
multifunction Data Acquisition (DAQ) device. The E-1608
per ball with a cycle life of
10,000+ insertions. The
self inductance of the
provides both analog and digital I/O, and is priced at $499. contactor is 0.98 nH,
insertion loss < 1 dB at 10
GHz, and capacitance
0.03 pF. The current
capacity of each contactor
is 2.2 amps. Socket
temperature range is -55°C to +155°C.
The socket also features a clamshell lid for easy chip
insertion and removal. It has a wave spring with swivel
compression plate for vertical force without distorting
device position. The specific configuration of the package
to be tested in the CBT-QFN-7038 is a QFN, 4.5 mm x
12.5 mm, 0.4 mm pitch, with 74 peripheral positions with
an additional 6x3 array of pins for the center ground pad.
The socket is mounted using supplied hardware on the
target PCB (printed circuit board) with no soldering, and
uses the smallest footprint which allows inductors,
resistors, and decoupling capacitors to be placed very
The E-1608 features 250 kS/sec sampling and 16-bit close to the device for impedance tuning.
resolution. It offers eight analog inputs, eight digital I/O, To use, place the QFN device into the socket and
one counter input, and two analog outputs. The device is close the lid by snapping it to the latch. This socket can be
supported in Windows and Android operating systems; used for quick device screening and device
Linux support will be added in the near future. An OEM characterization at extreme temperatures, as well as for
board-only version is also available. production burn-in testing. Pricing for the CBT-QFN-7038
Microsoft Windows software options for the E-1608 is $603 (at qty 1) with reduced pricing available
include DAQami and TracerDAQ® to display and log depending on the quantity required.
data, along with comprehensive support for C, C++, C#,
Visual Basic, and Visual Basic .NET. Drivers for DASYLab For more information, contact:
and NI LabVIEW are also provided. Ironwood Electronics
Android support for the E-1608 allows users to Web: www.ironwoodelectronics.com
develop DAQ applications for tablets and smartphones.
Free sample applications are available for download on EXPANDED CAPABILITIES FOR
Google Play™.
WAVESURFER O’SCOPE
For more information, contact:
Measurement Computing
Web: www.mccdaq.com
T eledyne LeCroy has now introduced additional multi-
instrument capabilities enhancing the debug
effectiveness of its WaveSurfer 3000 oscilloscope. The
March 2015 19
addition of CAN and LIN trigger and
decode capabilities to the protocol
analyzer provides the tools needed
to analyze and debug automotive
systems using the CAN and/or LIN
serial data communication standards.
Arbitrary waveform generation
capabilities have been added to the
WaveSource function generator,
enabling the import of .csv files to
recreate analog waveforms.
Digital voltmeter (DVM)
capabilities activate an integrated
four-digit digital voltmeter and five-
digit frequency counter that operate
T H E O F F I C I AL through the same probes already

A RD U I N O S TARTE R K I T !
attached to the oscilloscope channels.
Measuring and monitoring voltage
levels is simple with the digital
voltmeter capability of the
WaveSurfer. This new feature provides
real time measurements that can be
viewed on the screen even when the
NKCelectronics.com/starterkit oscilloscope is not triggering. A
Includes the Arduino Project Book (1 70 pages)
dedicated DVM user interface is
Purchase Orders are accepted from Educational Institutions ,
US Government and Research Centers available for set up and more
measurement details. The DVM
option is offered as a free software
download for all WaveSurfer users.
Stock Drive Products
Setting Ideas Into Motion
Generating arbitrary waveforms
is critical for complete design debug
One-Stop Shop for and validation. With new capabilities
M in the built-in WaveSource function
EX
EXPLORE generator, arbitrary waveforms can
DESIGN
DE be generated by loading .csv files
saved from an oscilloscope or offline
BUY ONLINE
BU
waveform creation software. These
w arbitrary waveforms can then be
no minimum requirement controlled, manipulated, and output
directly from the WaveSurfer for use
in closed loop circuit analysis.
The package for the WaveSurfer
includes CAN and LIN trigger and
NATIONAL RF, INC. decode capabilities, and has a price

N
of $990. The arbitrary waveform
R F
TYPE HFDF capabilities of the WaveSource are
included with the function generator
NOISE LOCATION SYSTEM
option and are available to existing
customers with an option through a
free software update. The DVM
capability can be downloaded at no
charge from the website.

LOCATE NOISE IN THE HF SPECTRUM


For more information, contact:
Visit www.NationalRF.com for this Teledyne LeCroy
and other Radio Products! Web: www.teledynelecroy.com
Office: 858-565-1319
20 March 2015
BUILD IT YOURSELF

BUILD A FREQUENCY
COUNTER

By Jim Teixeira

Post comments on this article and


find any associated files and/or
downloads at www.nutsvolts.com
/index.php?/magazine/article/
march2015_Teixeira.

Frequency counters have been around for many years as a standard piece of test
equipment in both commercial and hobby labs. It has evolved to remarkable levels of
accuracy that are several orders of magnitude higher than most hobbyists could ever
use. For example, I borrowed an Agilent 53131 counter to test the design of this
project. The 53131 displays up to 10/11 digits of frequency that translates to reading
a 10 MHz signal to .001 Hz! Counters of this type use advanced circuits called
interpolators that correct the ±1 count tolerance normally stated in spec sheets. My
design target for this project was seven digits, so a 10 MHz input signal could be
accurate to 1 Hz, and a 10 Hz signal be accurate to .00001 Hz using a one second
measurement time (without an interpolator).
22 March 2015
Fundamentally, a frequency counter has three main counter divides the 10 MHz by 2^20 (1,048,576), giving
components: a gate signal generator that produces a very 9.536743 Hz — exactly what the display reads. In this
accurate gate time interval, usually in the .1 to 10 second case, a ‘P’ in line 2 indicates that a direct period type
range; a counter chain that counts input clock pulses measurement was used. Software in the PIC
under control of the gate; and a control unit. For example, microcontroller automatically chooses which type
if the gate time is set to one second and the input signal is measurement (frequency or period) is best.
5 MHz, then the counter chain will accumulate five Figure 1 shows the major components of my
million input pulses in the one second interval — the exact frequency counter design. It’s based on a 28-pin
input frequency. A binary counter driven by an accurate PIC16F886 and the 74F579 IC — a synchronous eight-bit
time reference oscillator (often a 10 MHz oscillator) is binary counter with three state outputs that can operate at
usually used to get a precise one second gate interval by up to 85 MHz. This version differs from popular designs
opening the gate for exactly 10,000,000 pulses from the that use the PIC internal components to do the gating and
reference oscillator. counting functions. In my design, all critical timing
This configuration works well if the input frequency is functions are moved from the PIC to the 74F579 counters.
equal to or greater than the 10 MHz reference. For The main building block of the counter is shown in
example, with a one second gate and an input frequency Figure 2. It has three 74F579 ICs in series to make a 24-
of 10 MHz, the counter will get 10,000,000 clock
pulses for a 7/8 digit accuracy. However, with a
1,000 Hz input, the counter would reach only
1,000. That’s just a three-digit accuracy.
To get high accuracy for lower input
frequencies, the counter itself or the user must
switch to a period measurement. The roles of the
gate counter and input counter are swapped. A
period measurement operation (with seven-digit
accuracy) is discussed under the software section
of this article.
The frequency counter described here has the ■ FIGURE 1.
performance shown in Photo 1. All measurements Frequency
use a one second gate time. At the top of Photo 1 counter block
is the frequency measured when the input signal is diagram.
the 10 MHz reference (line 1) and its period (line
2). The ‘F’ indicates that the reading was made by a
direct frequency measurement. For the center
display output, I multiplied the 10 MHz by six
and made a direct frequency measurement of
the 60 MHz signal. The bottom display output
is the most interesting.
Here, I set up an external 20-stage binary
counter using the 10 MHz as its input. This

■ PHOTO 1. ■ FIGURE 2. Basic counter module for both the gate and count banks.
March 2015 23
state of the flip-flop is five nanoseconds,
then since the flip-flop output is the clock
input to the next stage, the delay of the
second flip-flop is 5 + 5 nanoseconds. This
delay ‘ripples’ through the counter.
In a 24-stage counter, the delay at the
last stage is 5 x 24, or 120 nanoseconds.
■ FIGURE 3. Unfortunately, this delay may vary over a
Gate synchronizer two (or three) to one range just due to
schematic.
production variances. A synchronous
counter removes the ripple effect by having
each stage clocked by the same clock. The
synchronous counter operation is necessary
for accurate gate timing, but it’s not
sufficient. The gate timing must also start
and stop on a clock edge. This is the reason
for the gate synchronizer (Figure 3) which
bit binary counter bank, and an input switch (74AS00) to uses a 74F74 dual flip-flop.
allow the PIC to control the input clock source. This I’ll go through the process of making a simple one
building block is used as the gate signal generator and as second frequency measurement to illustrate the gate
the input counter. operation. Note (as mentioned) that the gate counter is
The 74F579 is designed for bus operation. Its data set to count up, so we set it to a value that is minus the
outputs are tri-state, and are also used as inputs to preset desired count. First, the PIC presets the gate and counter
the counter. Operation of the IC uses three control pins: banks. The counter bank is set to zero (effectively a reset
CS’ – Chip Select; PE’ – Parallel (input) Enable; and OE – operation) and the gate bank is set to minus 10,000,255
Output Enable’ (the ‘ indicates logic low active). The PIC (see below). Normally, the START line is logic low, with
can address each of the 74F579s by setting its CS’ pin to U6A in the reset state and U6B in the set state.
a logic low (0), and setting either PE’ low to preset the The PIC starts a frequency reading by first selecting
chip flip-flops or OE’ low to read the chip flip-flops. So, to the internal reference as the gate clock and the input
preload the counter banks, the PIC sequentially performs signal as the counter input. The PIC then sets START to a
a CS’/PE’ pair individually for each of the three 74F579s in one. At the next internal reference clock pulse, U6A sets
each bank. An additional U/D’ pin on the 74F579 controls since U6B is already set. The AND gate enables the CET’
the counting direction. I set both banks to count up. pin on both counter banks, thereby starting the counting.
The 74F579 is a synchronous counter. To understand The TC’ pin of the third stage of the gate counter goes
what this means, we have to look at how a traditional low 256 clock pulses before the gate bank reaches its
‘ripple’ counter works. In a ripple counter, each flip-flop terminal count. This TC’ is connected to the D input of
output is the clock input to the next stage so that the U6B. On the next gate clock pulse, U6B is reset thus
delay adds up as the stages add up. For example, if the turning off the gate.
delay between the clock input and the change in output I had to preset the gate bank to minus 10,000,255

QTY ITEM SOURCE


1 309 J-FET Transistor eBay
1 MC10116P Quad Driver eBay
3 2N4403 PNP Transistors Jameco.com 38447
2 1N4148 Diodes Jameco 179215
6 20 μF Tantalum Caps Jameco 545852
6 0.1 μF Ceramic Caps Jameco 151116
1 1 μH Choke Jameco 372357
1
6
PIC16F886
74F579 Counter IC
Jameco 2127531
eBay
PARTS
2 74AS00 Gate IC eBay LIST
1 74F74 Dual FF IC eBay
1 Piezo Oscillator Model 2920136 eBay
3 BPS BR1 PC Breadboard Jameco 2125034
5 16-pin Ribbon Cable Connector Jameco 42674
1 16-conductor Ribbon Cable Jameco 643831
Various 1/4 watt ±5% metal or carbon film resistors
24 March 2015
because the TC’ occurs 256 pulses
early and I add one clock pulse for
synchronizing, so I add minus 256 plus
1 to the desired gate time. Because the
gate bank starts and stops exactly on a
clock pulse (because of the gate
synchronizer) and the delay through the
counter is very low, the gate timing is
very accurate. At the end of the gate
time, the PIC reads the count bank
outputs to get the frequency.
Making a period measurement
follows a similar path, except the gate
bank and count bank inputs are
reversed by U2. The PIC preloads the
gate bank with a value equal to minus
the number of input signal pulses minus
255. For example, to count 1,000 signal
pulses, the gate bank is loaded with
minus 1,255 (minus 1,000 minus 255). ■ FIGURE 4. Input amplifier schematic.
Period measurements are a little more
complex since we have to pick the number of input signal The frequency range can be increased to the 300
pulses (the 1,000 in this example). MHz range, or even higher by using a prescaler. Again,
The accuracy of the measurement depends on how the Internet has many designs for this. The rotary switch
many internal reference clock counts are accumulated in input circuit is simply a four-resistor voltage divider, with
the count bank. If we use the 1,000 signal pulses the voltage taps connected to the switched terminals of a
discussed here and the input signal is 1,000 Hz, then the rotary switch. The switch wiper terminal connects to RA0
gate will be open for one second and the count bank will on the PIC, and the PIC A/D converter determines the
record 10,000,000. This gives us our 7/8 digit accuracy. switch position by simply reading the voltage on pin RA0.
However, if the input signal frequency is 100 kHz, the The software recognizes three switch positions:
gate will be open for .01 seconds and the count bank will
record 100,000 or 5/6 digit accuracy. On the other hand, 1. Make high accuracy (7/8 digit) readings (top tap of
if the input signal frequency is 10 Hz, the gate will stay the switch). These take about 1.3 seconds per reading.
open for 100 seconds. As we’ll see shortly, the software 2. Make medium accuracy (6/7 digit) readings (center
(available at the article link) solves this problem nicely and tap). These take about .6 seconds.
will force a gate time of close to one second (or whatever 3. Make continuous (5/6 digit) readings (bottom tap).
value we want). Five more components complete the These take about .1 seconds.
block diagram shown in Figure 1:
■ FIGURE 5. PIC schematic.
1. The input signal amplifier.
2. The rotary switch input circuit.
3. The PIC16F886.
4. The display.
5. The internal 10 MHz frequency reference.

The input signal amplifier (Figure 4) is


used to take a low amplitude input signal with
a frequency range of 10 Hz to over 70 MHz
and convert it to a TTL voltage level. Every
frequency counter has some sort of input
amplifier and the Internet is full of designs
ranging from simple two-transistor FET
amplifiers to multi-component designs often
using the popular MC10116 ECL triple line
receiver.
March 2015 25
■ FIGURE 6. PIC assembly.

I chose the PIC16F886 (see Figure 6) because it is a ‘Sec’ and a ‘P’ when the gate is on and making a period
cheap popular unit that does the job without overkill. measurement.
Since there are no critical timing requirements, the internal The final item in Figure 1 is the internal frequency
8 MHz oscillator works fine. This PIC also has just enough reference. The measurement accuracy is totally dependent
I/O pins (22 available). If you want to add RS-232 or USB, on the accuracy of the gate time, and thus on the
then try the PICF887. It has plenty of I/O and has USB accuracy of the internal frequency reference. The design
support. goal of seven digits is within an oven-controlled crystal
The display for this project is a 2x16 backlit oscillator range. I used a piezo model 2920136 10 MHz
alphanumeric version. This type of display usually oscillator that I bought on eBay for $25. It outputs a TTL
connects with four-bit data bits, but sometimes eight bits square wave and warms up to seven-digit accuracy in
are used (these bits are shared with the 74F579 bus) and about five to 10 minutes. Unlike cesium, rubidium, or GPS
two control signals (R/S’ and E’). Fortunately, most references, oven-controlled crystal oscillators have to be
compiler products include display drivers so you don’t calibrated initially. If you don’t have access to a calibration
have to understand the inner workings of the display. facility, then here is an alternate technique that works.
(Look ahead in Figure 8 for the front panel components The National Institute of Standards and Technology‘s
and connectivity.) (NIST) radio station WWV broadcasts high accuracy
The top line is used to display the input frequency in signals at several shortwave frequencies, including 10 and
7/8 digits, plus up to two commas or a decimal point. This 20 MHz. These transmissions contain exact one second
is followed by ‘Hz’ or ‘MHz’ and the letter ‘F’ when the time markers, but the carriers themselves are also exact
gate is on and making a frequency measurement. The frequencies set by their cesium standards. If you tune a
second line simultaneously displays the period of the input shortwave radio to one of the WWV frequencies at 10 or
signal in scientific notation (like 1.2534E-6), followed by 20 MHz, you will hear the one second time ticks and

■ FIGURE 7. Counter bank and synchronizer assembly.


26 March 2015
some voice messages.
Now, move the radio close to your
oscillator and vary the oscillator
frequency adjuster until you hear a beat
tone as the oscillator frequency
approaches and passes through the
WWV carrier frequency. As you get
very close to the WWV frequency, the
beat tone will become inaudible, but
you will hear the noise level change in
amplitude as the oscillator goes in and
out of phase with WWV. It will sound
like swoosh ... swoosh ... swoosh.
If you are tuned to the 10 MHz and
the swooshing sounds repeat once per
■ FIGURE 8.
second, then the oscillator is accurate Front panel
within one part in 10,000,000. It’s not schematic.
difficult to do five or ten times better.

Software 992.150 Hz and the .1 second reading is 99. We multiply


99 by 10 to get 990, then this value (actually minus 990
Off-loading the critical frequency counter functions to minus 255) is set into the gate counter. The gate open
hardware makes the software control very straightforward. time will be 990/992.150, or .9978329 seconds — close
Basically, to make a frequency measurement, the software enough to the desired one second. The counter bank will
preloads the count registers to zero; the gate counter to end up at 9,978,329. We now calculate the actual
the measurement period (.1 sec, 1 sec); the FREQ bit to frequency as 10,000,000/9,978329 X 990 = 992.150 Hz.
one (to set the gate bank input to the 10 MHz reference Note that the counter banks are only 24 bits long,
and the count bank input to the input signal); and finally, giving a total count of 2^24 or a maximum count of
the START bit is set to one. 16,777,216. This is fine for the gate counter since its
After waiting for the measuring period to end, the maximum count is about 10,000,000. However, for a high
software reads the count registers to get the frequency input frequency, the counter bank could exceed
directly for a one second gate or frequency/10 for a .1 60,000,000. I get around this by using a counter wrap-
second gate. Making a period measurement follows a around property. When the count equals the maximum, it
similar course, except the PERIOD bit is set to connect wraps around and starts again at zero. So, a 60,000,000
the gate bank input to the input signal and the count bank count will actually be 60,000,000 – 3 x 16,777,216 =
input to the 10 MHz reference. The key here is 9,668,352. This begs the question of how do we know
determining what value of input signal pulses to assign to that the counter over-flowed three times. It’s simple. When
the gate counter. I make the .1 second measurement, I divide by 1677721
A HighRes measurement starts with the software and the number of counter wrap-arounds is the integer
making a sample .1 second frequency measurement. The result – (integer)6,000,000/167721 = 3.
measured frequency is multiplied by 10 to get the actual
frequency. If the actual frequency is equal to or greater Construction
than 10 MHz, then the software goes on to make a higher
accuracy one second frequency measurement. Otherwise, The unit is built on three solderable prototype PCBs
the software makes a period measurement by setting the (printed circuit boards; Jameco part 2125034). One board
gate counter equal to the actual frequency from the .1 (Figure 6) houses the input amplifier (Figure 4) and the
second frequency measurement. PIC16F886 circuits (Figure 5). (An optional design is to
This means that the gate time will be close to one mount the input amplifier in a separate shielded
second and the count bank will reach close to enclosure.) I isolated the five volt bus for the preamplifier
10,000,000, giving 7/8 digit accuracy. Note: We want the by cutting the five volt etch between the input amplifier
gate time to be about one second only to get the desired and the PIC. I then bridged the cut with a 1 µHenry
7/8 digit accuracy. The frequency will be calculated using choke. A second board (Figure 7) contains a counter bank
the number of 10 MHz pulses accumulated, and the (Figure 2) and the gate synchronizer (Figure 3). The third
count value preset into the gate counter. board (Figure 5 without U6) contains just a counter bank
For example, suppose the input frequency is exactly (Figure 2).
March 2015 27
■ FIGURE 9. Frequency counter assembly.
connector for the front panel display and
controls. The boards each measure 7 inches
x 1-7/8 inches. When mounted with the long
sides adjacent, the total footprint of the
counter electronics is about 7 inches by 6
inches. The unit uses about one ampere of
five volts for the digital circuits and less than
.5 amperes at 24 volts for the piezo
oscillator. Most dual 5/24 volt power
supplies will work.
Figure 9 shows the main component
layout. The footprint is approximately 8
inches x 10-1/5 inches. I purchased all of the
parts through either Jameco or eBay. The
digital components cost less than $30, and
the oscillator and power supply cost a total
of $55.
For software development, I chose the
mikroC Pro compiler and a cheap PICkit 2 to
program the microcontroller. The software
The three boards are connected together via a short design does not use interrupts and can easily be
16-conductor ribbon cable that contains the 74F579 data programmed in assembly language or BASIC, as long as
bus and selection and control signals. The microprocessor floating point arithmetic is available. Now, go get your
board also contains a 16-conductor ribbon cable “freq” on! NV

YEARS

Create your own


Solder Reflow station

Reflow Controller: $ 315.00

NEW!
Large Beta Reflow Kit: $ 178.00
_________________________
Total Cost $ 493.00
Laser Stencil for assembly FREE
with every PCB-POOL® order: $ 0.00
www.pcb-pool.com
For information, please call the
USA office toll free at 888-977-7443
Order online at
www.beta-eSTORE.com
28 March 2015
March 2015 29
PROJECT SPOTLIGHT
By Alan Grambo
Post comments on this article and

A COST-EFFECTIVE find any associated files and/or


downloads at www.nutsvolts.com
/index.php?/magazine/article/
march2015_Grambo.

TRAFFIC LIGHT
CONTROLLER
Every Digital Electronics’ Lead The Way (see
sidebar) student has had to build a traffic light
controller for a lab assignment. Usually, they
are required to build a digital circuit using
discrete digital components. The student is
then required to use the digital circuit to
illuminate Light Emitting Diodes (LEDs) which
typically draw 20 milliamps. Some digital
circuits can provide this small current directly
without the use of drive transistors or relays.

More sophisticated students might make use


of an Arduino board to design an even better
circuit. The advantage of using an Arduino
board is that the design allows the use of
proximity sensors to detect the presence of a
vehicle in a turn lane, and have the Arduino
program change the timing of the lights
accordingly. The Arduino has input lines to
change the timing of all the light outputs.
Those who use an Arduino board for this
purpose can find many methods of
programming it on the Web.
30 March 2015
What is Project Lead The Way? Computer Science and Software Engineering
Computer Science Applications
Project Lead The Way (PLTW; www.pltw.org) classes Artificial Intelligence
are now held in more than 6,500 K-12 schools in the US. Biomedical Innovation
These classes help students develop skills for today’s Digital Electronics
world by aligning themselves with Science, Technology, Engineering Design and Development
Engineering, and Math (STEM) programs. PLTW classes Principles of Biomedical Science
are typically taught by instructors that have been trained Human Body Systems
in a professional development PLTW class. Medical Interventions
There are many different genres of PLTW classes Biomedical Innovation
available. Here is a brief list of some of the classes being
taught in schools:
Digital Electronics is just one of the choices of
Introduction to Engineering Design possible classes offered. Each school decides which
Principles of Engineering PLTW class to offer, based on instructor availability and
Aerospace Engineering what classes the students might desire to take. As an
Biological Engineering example, one of the assignments in the Digital
Civil Engineering and Architecture Electronics class at Fishers High School in Fishers, IN is
Computer Integrated Manufacturing to build a traffic light controller.

A Programmable Logic Controller (PLC) could also be versatile multi-function controller, but the cost was beyond
used to control the traffic light bulbs. The PLC has the my co-worker’s budget.
capability of receiving inputs to control the outputs to the I then designed and tested a circuit that used two 555
colored lamps. IC timers that worked well, until I added the relays and
The problem becomes a little more complex when driver transistors to the circuit. The inductive kickback of
you design the circuit to operate like a real traffic light the relays — even with protective diodes — caused the 555
rather than to control low current LEDs. Real traffic lights circuits to trigger at the wrong time, so the circuit would
have either eight inch lenses or 12 inch lenses, with 150 skip a lamp periodically. Also, the sequence would
watt incandescent lamps inside. This size bulb takes about sometimes be yellow-green-red rather than yellow-red-
1.3 amps with a surge of about nine amps when first green.
energized, so relays would normally be required to The second digital circuit I tried used a 555 timer, a
operate the lamps reliably. You could use a Silicon 4017 decade counter, 13 diodes, three drive transistors,
Controlled Rectifier (SCR) to control the higher current, and three relays. With these parts, I was able to arrive at a
but SCRs have a habit of being unreliable because of the suitable operational circuit. This design, however, had a
large surge current required to
illuminate incandescent lamps.
A former co-worker of mine
has 110 real full-size traffic lights
that have no control circuits. So,
they cannot work as regular traffic
lights do. He approached me
because he wants to sell them, and
he wants to be able to offer the
buyers control circuits for the lights
if they wanted them. Concerned
about the cost of such control
circuits, he asked if I could come
up with a circuit that would cost
less than $20 to build.
I first designed an Arduino
circuit to control the traffic light.
The main problem with building
the Arduino circuit was that it
would be too expensive. The
Arduino Uno board would cost
$25; the drive transistors, relays,
and power supply would cost
more than $20. It would be a ■ FIGURE 1. Digital circuit using a 4017 decade counter.
March 2015 31
switches located 60 degrees apart
■ FIGURE 2. Locations for switches and cam. — activated by a dual-pronged cam
that was 60 degrees wide — each
light would be on for about 10
seconds.
I needed a Computer Aided
Drafting (CAD) program to lay out
the switches with different cam
positions to see if the parts would
mesh correctly. When I taught
Project Lead the Way Engineering
and Drafting, I used Autodesk
Revit and was able to lay out parts
like this. However, I do not
parts cost over $20 and would have required a printed presently have access to that program. So, I purchased
circuit board (PCB) to be designed and stuffed with parts, TurboCad 18, which is a great program for a reasonable
plus a 12 volt power supply to operate the relays. Again, price ($39.99 at Amazon.com; Resource 1).
the parts cost was too high (Figure 1). I found that TurboCad was able to lay out the
For the least expensive circuit, I used limit switches. switches in a variety of ways, and I could visually verify
With limit switches and a mechanical design, I built an how the cam and switches would interact. Using the first
inexpensive control circuit for a real traffic light. In this layout, the prototype caused the gear motor to bog down
case, a simple mechanical design was less costly. since the cam was pushing on the switch directly instead
The limit switches can directly handle 120 VAC and of pushing on the lever arm to provide some mechanical
the nine amp surge current. These limit switches needed fulcrum leverage. Modifying the TurboCad drawings was
to be mechanically operated. If I used a gear motor easy, and it was fun to have a nice drawing program to
running at one revolution per minute, I could design a work with.
cam to activate the limit switches. If I used three limit If I asked the program to print out the drawing on my
Brother MFC-7360N printer in a drawing
scale of 1/1, the drawing was accurate to
within the width of a printed line. This
allowed me to cut out the printed
drawing and use it as a template to make
the parts. This may not be the case for
every computer/printer combination, but
it was sure nice to have a template for
making my parts. TurboCad did a nice job
in my situation and saved me from having
to measure the dimensions on the drilled

Author Bio
Alan Grambo was an electrical
engineer for 28 years who worked on
smart bombs for the Navy. He retired to
teach high school electronics students.
He has also worked as a forensic
engineer for lawyers and insurance
companies to investigate the causes of
accidents and fires.
He is a nationally recognized
tournament table tennis player and has
played table tennis in over 20 states,
Canada, and Finland. He now teaches
electronics to his grandkids by building
■ FIGURE 3. Mounting hole dimensions. gadgets with them.
32 March 2015
boards. As a project engineer, I used
to sign off drawings with a note, “Do
not scale drawing.” If a drawing had
a missing dimension, the machinist
had to call the mechanical engineer
to correct the drawing so that a bad
part would not be made. If you have
a good 1/1 scale print, then
dimensions may not be necessary.
The second optimum layout is
shown in Figure 2. The best design
used a 55 degree arc for the cam. If
you use 60 degrees, two lights will
be on at the same time. The idea is
to have one light turn on when the
other goes off. If your cam has two
lights on at the same time, it is easy
to sand the corner off the cam to
allow fine adjustment on the light
timing.
I added a toggle switch in series
with the motor power line; the user ■ FIGURE 4. Controller board installed in traffic light assembly.
can stop the motor movement so
one light might be on all the time.
The mechanical design was
the least expensive of all the
controllers because I was able to
find a surplus 50 RPH gearmotor
for $1.89 (Resource 2) and the
limit switches for $0.75 each
(Resource 3). I also found a 12 x
12 x 1/8 inch plywood board at
Tower Hobby for $2.98.
The cam can be made from
this plywood plank or you can
use a 1/8 inch piece of clear ■ FIGURE 5. Schematic of traffic light wiring.
plastic to fabricate the cam. Using
limit switches solves the current-
handling problem while providing a reasonable cost to The TurboCad 18 dimensions for the mounting holes
implement an effective circuit. are shown in Figure 3, Figure 4, and Figure 5.

ITEM QTY PRICE TOTAL SOURCE

Limit Switch 3 $0.75 $2.25 www.allelectronics.com/make-a-store/item/SMS-309/10A-SNAP-ACTION-


SWITCH/1.html
50 RPH Gearmotor 1 $1.89 $1.89 www.surpluscenter.com/Electric-Motors/AC-Gearmotors/AC-
Gearmotors/50-RPH-115-VAC-INLINE-GEARMOTOR-10-958-A.axd
1/4" Mount Hub 1 $4.00 $4.00 www.pololu.com/product/1993
Mounting Board 1 $0.50 $0.50 1/8 plywood board from local hobby store — use to also make cam
Lugs 9 $0.16 $1.44 www.newark.com/molex/05-06-0301/unknown/dp/54H5270
Power Cable 1 $2.49 $2.49 15 foot extension cord from local hardware store
Motor Switch 1 $1.25 $1.25 www.allelectronics.com/make-a-store/item/mts-4/spdt-on-on-mini-toggle-
switch/1.html
TOTAL $13.82 Prices subject to change without notice. PARTS LIST
March 2015 33
The cam was originally
mounted on a Pololu mounting
hub #1993 which added about $4
(Resource 4). Again, I used
TurboCad 18 to lay out a new hub
and had the local high school
Career Center machine shop class
fabricate hubs to the TurboCad 18
drawings shown in Figure 6 and
Figure 7. The schematic shows
that a switch is in series with the
gearmotor to allow it to be turned
off (Resource 5).
This allows the operator to
turn on just one light and leave it
on all the time (Figure 8). I have a
friend who stated that if he
displayed a continuous green light,
that meant that it was okay to visit
■ FIGURE 6. Dimensions to make the square hub.
his man-cave; a continuous red
light meant to stay away.
Lugs to connect to the switches
and to the terminals in the traffic light
housing can be obtained from Newark
(Resource 6).

Upgrade
Possibilities
and Other
Applications
■ FIGURE 7. A 3D model of the hub. Because of the symmetry of the
cam and the spacing of the limit

34 March 2015
ITEM SOURCE
Resource 1 www.amazon.com/TurboCAD-Windows%C2%AE-8-7-Vista- RESOURCES
XP/dp/B00DDV74FC/ref=aag_m_pw_dp?ie=UTF8&m=AWG7LPR0FBMV7
Resource 2 www.surpluscenter.com/Electric-Motors/AC-Gearmotors/AC-Gearmotors/50-RPH-115-VAC-INLINE-
GEARMOTOR-10-958-A.axd
Resource 3 www.allelectronics.com/make-a-store/item/SMS-309/10A-SNAP-ACTION-SWITCH/1.html
Resource 4 www.pololu.com/product/1993
Resource 5 www.allelectronics.com/make-a-store/item/mts-4/spdt-on-on-mini-toggle-switch/1.html
Resource 6 www.newark.com/molex/05-06-0301/unknown/dp/54H5270

switches, each light is on for approximately 12 seconds


and does not duplicate the normal short on time for the
yellow light in a regular traffic light. A future modification
might be to design a different cam and/or different switch
locations so the yellow light is on for a shorter duration.
This might be accomplished by having an upper and lower
cam with the limit switches at different heights.
The controller could also be used for sequencing
Christmas light decorations or attention-getting advertising
booth chaser lights. The unit cost for parts for the finished
controller was $13.82 when I purchased enough parts for
20 units.
This interesting mechanical design using limit switches
provided a cost-effective solution for an entertaining
project. NV

■ FIGURE 8. Controller with new square hub


and plastic cam.

March 2015 35
Beyond the
Arduino
Getting Started with
AVR Microcontrollers
I bet that you've built some amazing
projects with your Arduino — it is an
incredible platform. At some stage,
though, you're likely to want to cut
the apron strings and discover what
it's like to work directly with the
microcontroller. This series of
FIGURE 1. The Arduino ecosystem.
articles is designed to make your
The tipping point was an irrigation controller I was
journey a little less bumpy. working on. My garden was drying out in the summer
heat, so I turned my mind to building an irrigation
controller, then turned my hand to the (occasionally
Heading Towards the Light disastrous and very damp) task of plumbing in my
A number of years ago, I discovered the excitement of solenoid valves. I learned a great deal that summer, and
using software to physically interact with my environment. finally had a green garden that was being watered to
As a software developer, it was an eye opener when I schedule — thanks to a microcontroller-based project.
found that I could write code that would make a robot The journey away from the safety of the Uno was a
drive around a room avoiding obstacles. It was so much tough one. There was an almost endless supply of
more “real” than writing code to manage warehouse stock information I found on the Internet, but the snippets were
levels or generate invoices. fragmented and didn’t form a cohesive guide to take me
Like many others, an Arduino Uno was my from the Arduino ecosystem to a stand-alone “bare metal”
introduction to this crazy world of physical computing. I microcontroller project. I stubbed my toe, banged my
spent hours building robots, temperature sensors, the head, and slowly waded through a barrage of online
obligatory flash-lots-of-LEDs projects, and alarm clocks. tutorials, blogs, forums, Wiki articles, and Instructables to
You name a tutorial, I had read it. However, in my hunger arrive out the other side with a degree of competency.
to build more and more complex and interesting Through my journey, it became apparent that there
embedded projects, I found I was hitting up against the were many others in a similar situation to me. As the
limits of the simplified Arduino environment. The Arduino platform matures as a product and as hobbyists
processing language sitting on an all-in-one development become more serious enthusiasts, more people are
board got me up and running very quickly and taught me looking to take the next step and move beyond the
a great deal, but now I needed to spread my wings and Arduino. I do hope that I can help you head towards the
start working directly with the microcontroller. light in this series of articles.
36 March 2015
Post comments on this article and find any associated files and/or downloads By Andrew Retallack
at www.nutsvolts.com/index.php?/magazine/article/march2015_Retallack.

How do Microcontrollers
Differ from the Arduino?
The Arduino is often referred to as an ecosystem. It is
similar to a natural ecosystem in the way in which the
various elements inter-relate and depend on one another.
The core elements in the ecosystem are the physical
boards and the software integrated development
environment (the IDE and the Arduino libraries), which are
then surrounded by the documentation, the support
structures, and the larger Arduino community (Figure 1).
In moving away from the Arduino ecosystem, you are
leaving these behind, but that doesn’t mean you’re
moving into an environment without these inter-
relationships. These elements exist in some form or
another, but are not as neatly packaged or as accessible.
A microcontroller by comparison is just one of the
components that make up a physical Arduino board — it is
the most important element as it is effectively the “brains”
of the board. In order for a microcontroller to function, it
needs only a few simple components and regulated
power. The Arduino Uno that I used supported the
microcontroller by housing these parts and providing it
with a steady clean supply of power.
My Uno went a few steps further by giving me a way
to communicate with the onboard microcontroller. A
stand-alone microcontroller can’t communicate with a PC,
so Arduino cleverly incorporated USB connectors to make FIGURE 2. Square peg, round hole: Form factor is
this happen. The main reason to open a communication a reason to work with raw microcontrollers.
channel is to allow you to program the microcontroller —
there’s not much point working with one otherwise!
Secondly, by using a serial terminal, you can
communicate with your sketch while it’s running — I use
this extensively for debugging. Also on the Uno is a
second microcontroller that handles the translation from
serial to USB. On newer boards (like the Leonardo), the
main microcontroller has the ability to do this.
This might all sound rather complicated, but by the
end of this article you’ll have built your own mini Uno on
a breadboard — and be able to communicate with it.

Why Even Think About It?


So, you’ve got a good partnership going with your
Uno. Why would you even want to consider making the
leap into the unknown? Using my irrigation controller as
an example, I’ll give you a few good reasons:

Physical Form: The Uno measures 55 mm by 75 mm


and is a chunky rectangular shape. In contrast, the
microcontroller on the Uno only measures 10 mm by 35
mm, and can be built into a board of almost any shape
you want (Figure 2). FIGURE 3. Integrating a microcontroller into a
Figure 3 had a shift register, an EEPROM chip, a real PCB with other components.
March 2015 37
time clock, an LCD and buttons, and a host of other Best Tool for the Job: The Arduino range has only a
components. By using a microcontroller, I was able to handful of microcontrollers to choose from — and for
design and build the whole project on a single printed good reason. However, when I started on one of my
circuit board (PCB). If I’d gone with an Uno, I would have smaller sensor projects, having a 28-pin MCU was
needed to find a way to mount the Arduino onto my complete overkill. Instead I opted for a smaller Atmel
board — or worse, connect it with a whole lot of wires just MCU: an eight-pin ATtiny85.
waiting to come loose.
Additional Flexibility: I recently created a small
Cost: There are some low cost Arduino clones sensor that I wanted to run on a single battery for at least
available, but they’ll be hard-pressed to beat the cost of a a year. The design needed to incorporate a slower watch
microcontroller integrated into your own PCB. The crystal, running at 32.7 kHz. This crystal runs more than
Arduino is great as a prototyping and learning platform, 480 times slower than the standard 16 MHz Uno, which
but it just doesn’t make sense to have one of these built translates into a real power savings. I needed flexibility
into every one of your working projects. that the Arduino (with a built-in crystal) couldn’t offer me.

FIGURE 4.
Schematic of the
breadboard Arduino
we'll build.

38 March 2015
turned out to be less challenging than I thought.
Voltage Regulators In tackling our simplified Uno here, we’ll include only
the most important elements: the regulated power supply
There are a range of voltage regulators available which can
simplistically be divided into switching and linear regulators. We'll and the microcontroller itself.
work with linear regulators as they are easier to use and need
simpler supporting circuitry. When choosing a voltage regulator, the The Microcontroller
main parameters to normally look at are the dropout voltage, input The Uno has an ATmega328P-PU microcontroller
voltage range, output voltage, and the maximum current.
which is a popular 28-pin MCU from Atmel (see
Dropout Voltage: This shows how much of the input voltage is Resources.txt). It comes with 32 KB of program memory,
"lost" within the regulator. It is an important number to look at when 2 KB of RAM, and 1 KB of EEPROM. In the world of
considering the voltage that is fed into the regulator. A 5V regulator computers, this is unbelievably small. However, in the
with 2V dropout voltage needs an input of at least 7V in order to
achieve the 5V output. A class of regulators called low-dropout world of microcontrollers, it’s a very decent size. We’ll see
regulators have a lower dropout voltage, meaning firstly that they as we progress that some MCUs only have 1 or 2 KB of
don't need such a high input voltage, and secondly that they're more program memory!
efficient.
Input Voltage Range: I normally look at how I'll be powering my While we’re comparing, another big difference to PCs
project, and then what input range my regulator needs to be able to is the speed. The ATmega328P has a top speed of 20
handle. I'll try to use a voltage source as close to the output voltage MHz — 150 times slower than a common computer. For
as possible (taking dropout voltage into account, of course). microcontrollers, this is a reasonable speed and, in fact,
Output Voltage: This is a pretty obvious parameter to look at, but
one does need to make a choice whether to go with a fixed voltage you’ll often intentionally slow it down further.
or a variable voltage regulator. For our purposes, a fixed 5V regulator Most microcontrollers need a few simple supporting
does the trick and is simpler to use. components to work and the ATmega328P is no different,
Maximum Current: This is an important number to look at, as so we’ll include these in the build. The cost?
regulators can range from as low 20 mA (current that low is not
useful for our project). The ATmega328P can supply a maximum of 20 ATmega328P’s are readily available from most online
mA per pin (with certain overall limits), so a regulator with a electronics stores for less than $4.
maximum output over 800 mA is more than sufficient. If you want to
power other components off your regulator, then it may make sense Power to the MCU
to get a slightly higher current regulator.
Microcontrollers are fussy about how they’re
powered. They need to be fed a constant clean voltage —
Curiosity and the Challenge: The reasons I’ve listed any ripples, spikes, or variations in the voltages upset their
so far are all very practical — in fact, they sound a little too internal workings and could cause them to behave
practical. So, I think I need to come clean: The biggest unpredictably. The 5V that an off-the-shelf AC/DC
motivator for me to start working with microcontrollers converter (commonly called a wall wart) provides is
was a primeval desire to learn more. I wanted to know generally not clean enough for the MCU — and is often
how that Arduino board worked, and I wanted to build not as close to 5V as we’d like. We therefore need to
one myself. I was so impressed with the Arduino and what include a regulated power supply on our breadboard.
I was achieving, that when I saw I could build my very The ATmega328P can run on a wide range of voltage
own I just had to do it. And I haven’t looked back since! — from 1.8V up to 5.5V — but we’ll stick with the 5V that
the Uno runs on.
Let’s Set a Course
Less Talk, More Action
Over this series of articles, we’ll steer a course from
the Uno to working with the raw AVR microcontroller. Let’s get going on the build! Check out the schematic
We’ll tackle a number of topics that will enable you to in Figure 4.
gain greater control (and flexibility) in your projects. The We’re going to start with the power supply first so we
first step is to create a stand-alone microcontroller to work have power to test the rest of the board as we build it. I
with — essentially, we’ll be building our own simplified wedged the power supply out of the way on one end of
Uno. For this article, we’ll stick with the familiar Arduino the breadboard, so I had loads of space left to connect
IDE, and save the leap to a lower-level development other components at a later stage.
environment for next month. The mainstay of the power supply is a voltage
regulator. There are a wide range available with different
Build Your Own Arduino Uno characteristics, but for this project I chose a simple L7805
linear regulator. It’s not the most power efficient, but for
At first, I didn’t believe that I could really build my prototyping it works perfectly (refer to the sidebar).
own Uno. The Uno was a mystical blue square of genius — In addition to the voltage regulator, we need a couple
how could a newbie like me create my own? It actually of capacitors to help keep the voltage stable — think of a
March 2015 39
Step 3: Capacitors
Next, we need capacitors to help maintain a stable
voltage. The voltage regulator’s datasheet will usually
advise on what capacitance these should be in their
application circuits. Usually these are polarized, so make
sure the leads are connected to GND and V+ correctly.
Insert one capacitor on either side of the regulator as
shown in Figure 6.

Step 4: Regulated Output


FIGURE 5. Identifying the pins of a voltage
regulator from the datasheet. We have now created a regulated supply. Insert
jumper leads in the same row as the GND and output
pins of the regulator, and connect them to the power rails
capacitor as a reservoir that reduces the effect of any of the breadboard.
spikes or dips in voltage. Finally, we’ll add an LED to show
when the board is powered up. Step 5: Turn On the Light
Finally, add an LED and a resistor on the opposite side
A Power Supply in Five Steps of the breadboard divider, connecting the LED’s anode to
the positive power rail, and the cathode to the resistor
Step 1: Voltage Regulator (which, in turn, connects to the ground rail).
Place the voltage regulator on the breadboard in the It’s now time to test! Connect the input leads to the
third row, leaving room for capacitors and leads on either battery/wall wart and see if the LED lights up. If it doesn’t
side. You’ll need to refer to the datasheet for your light up, then disconnect immediately and check the
particular regulator in order to identify the ground, input, connections. I once connected my regulator back to front,
and output pins. Figure 5 shows a typical example. and ended up nearly melting my breadboard!

Step 2: Power In Improving the Power Supply


Place the leads that you’ll connect to your power
source in the first row of the breadboard. I soldered a There are two really useful items that you can add to
couple of jumpers onto a 9V battery clip, but you could the power supply to improve it. I haven’t added these here
also solder a jack connector that accepts the connector in order to maximize breadboard usage and to keep things
from a wall wart. Make sure that your voltage regulator’s simple. Firstly, a protection diode: This ensures that
input and ground pins are next to each other, and connect nothing gets damaged if you mix up the polarity on your
the source so that negative goes to ground and positive input. After my first mistake with switching the polarity, I
goes to input. learned the value of adding a protection diode between
the positive input and the first capacitor.
Secondly, a PTC fuse can be useful to ensure
that you don’t try to draw too much current
through the power supply. A PTC fuse (PolyFuse)
is a resettable fuse that trips once its current rating
is exceeded, then “resets” once it cools down and
allows the current to flow again. I usually place
this between my protection diode and the
capacitor.

Bringing the
Microcontroller Onboard
Let’s bring the microcontroller on board. To
ensure compatibility with the Uno, we’ll connect
an external 16 MHz crystal — in later projects,
you’ll see this isn’t really necessary as the
ATmega328P can operate on an internal (slightly
FIGURE 6. Building the regulated power supply less accurate) oscillator. Before continuing, make
on the breadboard. sure the power is disconnected from the board —
40 March 2015
Microcontroller Pin # Pin Function Connect to Breadboard Rail
Pin 7 VCC +ve rail
Pin 20 AVCC +ve rail
Pin 21 AREF +ve rail
Pin 8 GND GND rail
Pin 22 GND GND rail
Figure 7. Power connections for the ATmega328P.

never connect components when there is power!

Step 1: The Microcontroller


Gently insert the ATmega328P into the breadboard so
that it straddles the center separator. Place it so as to keep
the board nice and compact. You’ll probably need to
bend the pins slightly inward as they’re normally angled
just too wide to fit easily into the breadboard. I place the
chip on its side on my anti-static mat, and gently bend
them in with a short ruler to keep them aligned.
If you prefer, you can use a ZIFF socket to allow for FIGURE 8. Crystal connection specifications from
the ATmega328P datasheet.
easy removal and re-insertion. Personally, I don’t like this
option as the pins in the socket don’t always line up nicely
with the breadboard pins. Most ICs have a notch in the The line above the pin name means that it is “active low”
center of one end and/or a dot/triangular marking at one — in other words, the microcontroller will be in a reset
of the pins — this helps to orient the chip correctly. Pin 1 state when the pin is low.
is always the pin to the left of the notch, or the pin We really don’t want the microcontroller to spend its
indicated by a dot. If in doubt, check the pin diagrams on time in reset — it doesn’t do anything in this state.
the first few pages of the datasheet. Therefore, we need to tie this pin high (to +5V). We could
just use a jumper here to connect it to the +ve power rail,
Step 2: Connect the Power but that will interfere with our efforts to program it later.
With reference to the datasheet to help in identifying For now, we need to use a resistor to connect it to the
the pins on the microcontroller, connect the MCU pins to +ve rail; I used a 10K resistor successfully.
the power rails on the breadboard as in Figure 7.
Almost There
Step 3: Connect the Crystal We’re nearly done. Figure 9 shows the
The Uno has an external 16 MHz crystal to set the microcontroller we’ve built that is able to function on a
speed of the microcontroller. We’ll therefore
connect one to the microcontroller — we need to
connect it to pins 9 and 10.
If you’ve been brave enough, you may have
looked at the ATmega328P datasheet (a
whopping 567 pages long). I often opened it,
skimmed through it, and then closed it in terror.
Slowly, I became more comfortable with it, and
eventually even started to find it useful.
Once of the things the datasheet states is that
the crystal needs to have capacitors connected
between the crystal pins and ground. Figure 8
shows that the recommended range is 12-22 pF —
I had some 22 pF ceramic capacitors lying
around, so I used those.

Step 4: Stop the Reset


Pin 1 of the ATmega328P is labelled RESET. FIGURE 9. An Arduino on a breadboard.
March 2015 41
Bootloaders and Serial Resources
Communications Author's Website:
www.crash-bang.com
"What the heck is a bootloader?" That was my first question as I
started on my learning curve to programming stand-alone Atmel ATmega328P:
microcontrollers. In generic terms, a bootloader is a program that www.atmel.com/devices/ATMEGA328P.aspx
runs when a PC or microcontroller starts up. In the world of
microcontrollers, the function of the bootloader is to transfer a SparkFun's FTDI Breakout Board:
sketch (over the serial port) onto it. www.sparkfun.com/products/9716
If no sketch is available to be transferred over the serial port,
then the bootloader transfers execution to the sketch currently opinions on whether or not a capacitor is needed on the
loaded on the microcontroller. reset line. On my first attempt, I couldn’t get the
What this means to you and me is that we're able to upload microcontroller to enter a reset state and accept the
sketches to a microcontroller without needing a dedicated hardware
programmer — all we need is a way to allow the PC to communicate sketch being uploaded. When I added a 0.1 µF capacitor,
serially with the MCU. For that, we'll use a USB-to-serial converter the programming worked perfectly. The Atmel design
— the most common being an FTDI cable or board that works great notes state that they aren’t required, but can filter out
for programming microcontrollers. noise. In your build, test it out and see what works best.

stand-alone basis — this is all you need to deploy a project Pins 2 and 3: Tx and Rx
into the “wild.” When I built my first one, I couldn’t As any corporate coach (or marriage counselor, for
believe that this was all I needed to get a microcontroller that matter) will tell you, communication is a two-way
project up and running. Of course, we need to be able to process. The same applies to the microcontroller — it
program the MCU, so these final few steps will get that needs to receive (RXD) and to transmit (TXD). It makes
working. sense that the transmission of one party is received by the
other. Therefore, we connect the TXO pin of the FTDI
Open Channels of board to the RXD pin (pin 2) of the microcontroller, and
the RXI pin of the FTDI to the TXD pin (pin 3) of the
Communication microcontroller.
When I tackled my first breadboard Uno, I These are often connected incorrectly, which is why
underestimated the challenges involved in being able to SparkFun added an “O” to the Tx pin (to specify output)
talk to it. It took a fair amount of research, twiddling, and and an “I” to the Rx pin (to specify input).
hair pulling (which unfortunately, I can ill afford!) to get
the right components in place to program my project. I Pin 4: GND
was using an ATmega328P-PU loaded with the Optiboot This is straightforward — connect the GND pin from
bootloader — the same configuration as the Uno. The the FTDI to the GND rail on the breadboard. Regardless
bootloader (refer to the sidebar) allows us to program the of whether you choose to power the board from the FTDI
MCU over a serial connection . board, you still need to connect the GND.
The first USB-serial converter I bought was an FTDI
basic breakout board from SparkFun (see Resources.txt). It Pin 5: Power
was also the last one I bought — not because it was bad, If you want to power your MCU from the FTDI board
but because it’s given me all that I’ve needed over the (I often do), then connect the 5V pin (or the 3V3 pin,
past few years. depending on the model you have) to the +ve power rail.
The FTDI board has five pins that need to be
connected in order to get it working. We’re Finally There
Pin 1: Reset We’re done with the wiring now — we have a fully
Before we start uploading a sketch to the functioning (simplified) Arduino on a breadboard (Figure
microcontroller, we need to reset it in order to fire up the 10)!
bootloader. The FTDI board sends a “low” signal over the When I completed this for the first time, I couldn’t
“DTR” pin before it starts transmission. Therefore, we need wait to test it out. So, of course, I uploaded the “Hello
to connect this to the RESET pin on the ATmega328P. The World” of microcontrollers: a sketch that blinks an LED.
low pulse “overpowers” the 10K pull-up resistor on the The great thing about having created a project that is
RESET pin and causes the microcontroller to enter the effectively Arduino compatible was that I could use the
reset state. Arduino IDE to upload a sketch. I could take things step
One of the problems I encountered was the range of by step rather than jumping off a precipice!
42 March 2015
FIGURE 11. Mapping the Arduino pin numbers
with the ATmega328P pins.

FIGURE 10. Ready


to go: The FTDI “13” on the Uno. I connected my LED to pin 13 on the
board connected to microcontroller, fired up the sketch, and ... nothing. Not a
the ATmega328P. flicker. A whole lot of research later, I found that “13” isn’t
always “13” — unlucky!
The datasheet on the ATmega328P labels the function
of the pins pretty cryptically, so I created a quick cheat
sheet to work off of in my projects (Figure 11). This
“maps” the actual pin numbers on the ATmega328P
Make that LED Go “Blink” (which you’ll see run sequentially around the chip) to the
Uno pin numbers (in square brackets).
I’m sure you’ve made your Arduino blink an LED From this, we can see that the Uno’s pin 13 is actually
before, probably using the example sketch — the built-in the microcontroller’s pin 19. Carefully count your way
LED on pin 13. Of course, on this board we don’t have an around to pin 19, and then connect your LED as you
LED on pin 13 — so let’s add one.
At this point, I learned one of the most important
lessons of my transition away from the Arduino: Pin 13 on
the microcontroller is not the same as the pin labelled

Parts List
ITEM DESCRIPTION
BT1 7V+ Battery with Clip and Leads
C1 100 μF 16V+ Aluminium Electrolytic Capacitor
C2 10 μF 16V+ Aluminium Electrolytic Capacitor
C3 22 pF Ceramic Capacitor
C4 22 pF Ceramic Capacitor
C5 0.1 μF Ceramic Capacitor
U1 Linear Voltage Regulator 5V (e.g., L7805/LD1085V50)
D1 Red LED 20 mA
R1 330 ohm Resistor, 0.25W
R2 10K ohm Resistor, 0.25W
X1 16 MHz Crystal
IC1 ATmega328P-PU Microcontroller
FIGURE 12. The Arduino blink sketch to upload.
March 2015 43
Load the blink sketch
/*
* Beyond Arduino 1 - 1 Blink up (Figure 12) and select
* the Uno as your board. I
* Nuts & Volts - Beyond Arduino #1 usually check what serial
* --------------------------------
* Blinks an LED on pin 13 ports are available under
* the “Serial Port” menu and
* Author: Andrew Retallack
make a note of them. I
*
*/
*/
www.crash-bang.com
Listing 1 then plug my FTDI cable or
board in and give the PC
int LED_PIN = 13; enough time to recognize
it (by now, you’ll have
void setup() { realized that I’m working
pinMode(LED_PIN, OUTPUT);
} on a Windows machine). I
take another look at the
void loop() {
Serial Port menu and
digitalWrite(LED_PIN, HIGH); // Set the LED pin high (turn it on) choose the new port that
delay(1000); // wait one second has appeared.
digitalWrite(LED_PIN, LOW); // Set the LED pin low (turn it off) Before you do this, you
delay(1000); // wait one second will need to have installed
} the drivers that the FTDI
manufacturer provides. I
sometimes find that
normally would on an Arduino project: anode to pin 19; Windows doesn’t recognize the port, but usually it picks it
cathode to resistor; and resistor to the GND rail. up if I unplug, wait 20 seconds or so, and then connect
the USB cable again.
Once the serial port and board are correctly selected,
it’s as simple as uploading a sketch to your regular
Arduino. Click the upload button and watch the LED
come to life!

What’s Next?
Looking back on my first foray into microcontrollers, I
couldn’t wait to build my next design. I spent a whole lot
of time working in the Arduino IDE, and coming up with
all sorts of projects. I went down the path of etching my
own circuit boards and incorporating this basic
microcontroller setup into my builds.
After a while, I wanted to work on more complex
projects that demanded more from the microcontroller.
The trigger was trying to reduce the power consumption
on one of my projects — when I looked at some of the
online projects around, I realized that I had a lot more
exploring and learning to do!
My first step was to say goodbye to the Arduino IDE
and step up to the more fully-featured (and more
complex) Atmel Studio (Atmel’s own in-house IDE). In
moving onto Atmel Studio, I had to understand the
microcontroller from a very different perspective and learn
how to use it quite differently. In my next article, we’ll start
a journey in that same direction.

Make sure you keep your breadboard Uno handy, as


we’re going to be using it next time, and through the rest
of this series. NV
44 March 2015
READER FEEDBACK Continued from page 7

display will show. However, it should 3. A 5V (1A) USB wall wart. otherwise, all three sources produced
work lower, with some caveats. Your essentially the same result: There was
question does bring up a very To place a load on the supply, I a small high frequency ripple (about
important point that needs to be connected a 1K resistor between +V 18 mA @ 20 MHz).
addressed. and ground on the breadboard. As I have been using an FTDI USB-to-
The ratings listed in datasheets expected, the output voltage did vary serial cable for powering and
are those that the component was slightly among the three power
designed for and tested to. If a part sources (from 5.2V to 5.4V), but Continued on page 81
fails prior to reaching its maximum
rating, then it is defective and — The College of New Jersey Hosts
depending on return policies — TM TM
should be replaced. TCF @40 The 40th Anniversary of
THE ORIGINAL PERSONAL COMPUTER SHOW
TCF @40

Trenton Computer
Fortunately, many components
don't fail abruptly. They tend to
deviate from their normal function.
So, I expect my thermometer will
need an adjustment to its calculated
temperature as its gets colder. This
can be done with software, so it's
trivial to fix.
Festival Dharmeshvaja - graphicriver.net
TM

Admission: $10.00 (advance)


My flight computers and sensors
produce output that changes $12.00 at Gate
gradually during a flight. Since I don't Free Parking
see an abrupt change in sensor
output, I know there's no significant
www.tcf-nj.org
failure. There may still be calibration @ The College of New Jersey, Ewing, NJ
issues to deal with, but I expect
they're minor. KEYNOTE SPEAKER: Saturday, March 21, 2015
Dan Rosenbaum,
Paul Verhage Technology Journalist Focus on 9:00 am –– 5:00 pm
and Award-winning Registration/Flea Market open at 9 am,Talks start at 10:15 am.
Power to the USB Writer, Wearable
Wearable Tech Insider, • Internet-of-Things
Thanks for the January 2015 speaks on Technology • Android Wear talk by author Barry Burd
PICAXE Primer column, even though “Approaching and Celebration
Singularity” • Project Tango • Android/iPhone Apps
I don't use PICAXE. It was an of the 40th TCF!
interesting look at USB that I've not • Raspberry Pi Tutorial and Projects
looked into before. Out of curiosity, INDOOR FLEA MARKET & VENDOR FAIR MULTIMEDIA, SECURITY,
is there not a need to include any 50+ Talks, Workshops, Tutorials, WEARABLE TECHNOLOGY,
filtering caps on the supply? I'm sure Demos and Special Events! PHOTOGRAPHY, HOME CONTROL,
that the supply from a PC is relatively HISTORIC COMPUTERS and WIFI
Object-Oriented Programming University:
clean, but what about the wall wart? One Day of Short Courses by Mike Redlich Ham Cram Session & Exam:
Andrew Retallack Microsoft Presentations and Special Get an Amateur Radio License in
Workshop on “Safe Computing” one day at TCF! Cram begins at 9 am
I'm glad you found the January Quadcopter and 3D Printer Demos Robot Arduino Developer/User Tutorial/
Primer article interesting, Andrew! Demos
Tour the Sarnoff Museum of Tech. Workshop
Your email prompted me to pull
out my scope and run three separate IEEE/ACM IT PROFESSIONAL CONFERENCE
Friday March 20, 2015, 8:30 am — 5:00pm**
DOOR PRIZES
tests. I connected a USB cable to the Continuing as part of TCF’s Saturday Talks.
following three voltage sources, and For Conference Info and Fees See IEEE Integrated STEM Education Conference (ISEC)**
took a look at the +5V power line in 2
http://princetonacm.acm.org/tcfpro/ Saturday, March 7 – 8:00 am — 5:00 pm
0 at Friend Center, Princeton University, NJ
each case: 1
5 For additional TCF’15 info, Creating a Culture of Achievement
P
-
r
directions and advance tickets: Info: http://ewh.ieee.org/conf/stem/
1. A USB port on my PC.
e
v
-
www.tcf-nj.org **The IT Pro (Friday) and ISEC Conferences require separate registrations.
0
2. A powered USB hub. 5
a
TM
The 2015 Trenton Computer Festival is sponsored by The College of New Jersey and its School of Engineering.
March 2015 45
PRODUCT REVIEW

Give Your Sound a Boost —


Amplifier Modules to
Power Your Project’s Audio
Sound is important! If it's working well, it fades into the background, but
noisy (or quiet) audio can spoil nearly any project that's supposed to make
sounds. From custom boomboxes to special effects and robotics, what good
is your project if nobody can hear it? It's easy to throw in an LM386 while
working on the bench, but to take your project out of the lab you're going
to need more than the little chip's one watt or so of output power.

nless you're specifically building an audio

U amplifier, most of the time it's easier to just


go with a drop-in solution so you can focus
on the rest of project. There's quite a few
modules on the market, with all the components
assembled and ready to provide that much-
needed boost in power to your project's audio
output. Just supply an audio signal and go!
Parts Express provided a selection of low to
mid power amplifier modules to evaluate for this
article, which are perfect for including in a larger
design (Photo 1). These three modules are
available at Parts-Express.com, and all run from a
12V DC power supply. There’s a Diodes

PHOTO 1. The three modules and their


accessories. Top left, the PAM8610. Top right, the
model TA2024 board. Everything else: the DTA-2
digital audio amplifier module.
46 March 2015
By J.W. Koebel
Post comments on this article at www.nutsvolts.com/index.php?/magazine/article/march2015_Koebel.

PHOTO 2.
The
PAM8610
amplifier
module,
with its all
surface-
mount
construction.

PHOTO 3. The model TA2024 amplifier module.

PHOTO 5. My test
stack: Top, Rigol
DS1102E digital
oscilloscope; middle,
Keithley 2015 THD
multimeter; bottom,
Sencore PA81 stereo
power amplifier
analyzer.
PHOTO 4. The DTA-2 digital audio amplifier module.

Incorporated PAM8610-based class D amplifier


module offering up to 10W RMS in a package just a
little bigger than a quarter (Photo 2). Next, there’s a
pair of amplifiers based on the Tripath TA2024 "class
T" amplifier chip: the model TA2024 board shown in terminals which would work well in a system with an
Photo 3; and the Dayton Audio DTA-2 digital audio external volume control, or where the signal level is
amplifier module shown in Photo 4. Both these boards controlled by another active device like a microcontroller
deliver up to 15W RMS output power. or single-board computer.
The smallest option (the PAM8610) has a completely
integrated tiny package which makes it great for any place
space is a factor — like wearables or ultra-portable The Test Setup
accessories. The Dayton Audio DTA-2 has flexible
mounting options with a two-board design connected by a In addition to hooking them up for a listen, I
ribbon cable and with all the controls onboard, but does measured each of these amplifier modules with a Keithley
require four solder connections to assemble it. 2015 THD multimeter using its internal source as the
Lastly, the model TA2024 comes with no onboard signal generator, and a Sencore PA81 stereo power
controls at all — just a three-pin connector and screw amplifier analyzer for output meters and load resistors
(Photo 5). The pulse output from the generator served as
PAM8610 2x10 Class D Audio Amplifier Board the external trigger control for the Rigol DS1102E digital
$11.80 oscilloscope to keep an eye on the waveforms during
T-Amp Tripath TA2024 2x15W Audio Digital Amplifier Board testing. I powered the modules with a 12V 10A regulated
$13.80 switching power supply (Photo 6).
Dayton Audio DTA-2 Class T Digital Audio Amplifier Module All of these modules are primarily designed to power
$19.80 a four ohm load, but are generally happy with eight ohm
March 2015 47
PHOTO 6. A generic but high quality 12V 10A
regulated switching power supply used to power
the modules. PHOTO 7. Both PAM8610 modules performed very similarly.

loads, as well. So, I took THD+N measurements using reference circuit provided by the manufacturer (Photo 9).
both. All the tests were performed at an ambient Except for the onboard filter capacitor, control, and
temperature of 20°C (the temperature in my shop), which input/output connectors, the module is entirely surface-
is a bit lower than the 25°C ambient temperature for mount construction, with entirely 0805 components and
measurements in the chip datasheet. If anything, these the QFN amplifier chip. This particular module uses a DC
amplifiers might perform a little better at a slightly lower volume control, so it's only a single potentiometer instead
temperature (Photo 7). of the dual control used in the signal path of the Dayton
Audio DTA-2 module, which saves some space. It's small

Smallest First enough that it could feasibly be integrated with a project


like Craig Lindley's DIY electric guitar to make a self-
powered/self-amplified musical instrument. That'd be
As mentioned, the smallest of the amplifier modules is pretty interesting to see! (Refer to Photo 10.) It's very
the PAM8610. Since it’s just a little bigger than a quarter,
it could fit nearly anywhere. According to the datasheet,
with a 12V power supply the chip can deliver up to 10W
at very low distortion, and 15W at 10% THD+N when
fitted with a heatsink; refer to Photo 8.
The tiny module looks to be fairly close to the

PHOTO 9.
The reference
circuit for the
PAM8610 chip,
from the
PHOTO 8. THD+N vs. power for the PAM8610 chip, from manufacturer's
the manufacturer's datasheet. datasheet.
48 March 2015
inexpensive, too, at only
a little over $10.
On my first run
through testing this
module, I was so
surprised by the
performance I measured
that I reached out to Jill
(my contact at Parts
Express) to get some
more information. It
looked downright
broken!
My initial
measurements were
showing no less than
9.1% THD+N at low
power, rising very PHOTO 11. The PAM8610 next to the 50 uH low DC resistance
quickly to more than inductors to simulate the speaker load.
60% THD+N. That can't be PHOTO 10. Craig A.
Lindley's electric guitar
right! Jill put me in touch project (Nuts & Volts,
with Rory, the Product Line June 2013).
Manager for these modules
over at Parts Express, who sent me a note about the
test strategy for this type of device. He grabbed one
off the shelf and took some of his own
measurements to confirm my findings.
Rory wrote, "Most stand-alone class D amps
provide onboard reconstruction filtering, but amp
boards designed to be built into a device will
sometimes omit it because they intend for the driver
VC inductance to take care of the needed filtering.
The PAM8610 board we sell is one of this type."
That's true. There is no filter on the output of this
module. Rory and I had a short phone conversation
where he explained his own test setup, and
recommended I limit the bandwidth of my THD
analyzer to keep residual switching noise from
impacting the measurements. He also suggested
PHOTO 12. Tektronix TM504A mainframe housing the AA
adding a series inductor in each leg of the speaker leads 501A audio analysis system.
to simulate the inductance of a voice coil (which wasn't
provided) into a resistive dummy load. He checked a few
speaker datasheets, and we determined that 50 uH in A class D amplifier — or switching amplifier — differs
each leg should accurately simulate a speaker driver load. from most other types of amplifiers in that instead of directly
amplifying a signal, it uses high speed pulse width modulation
Armed with this information and several low DCR chokes,
(PWM) followed by a low pass filter to recover the analog
I went to try again; refer to Photo 11. waveform from the pulse train. These amplifiers are very
The second time measuring this module, I switched efficient, but can be challenging to design and implement.
to my other audio analysis system which has better filter Class D amplifiers commonly use a switching frequency
options (a Tektronix AA 501A Mod WQ distortion around 10x the highest frequency of the signal to be
analyzer with SG 505 ultra-low distortion oscillator) and amplified, such as the PAM8610 with a 250 kHz switching
re-ran the numbers with a 30 kHz low pass enabled, frequency to deliver full audio bandwidth. A "class T" amplifier
along with the inductors in each leg of the speaker leads is the name for Tripath's proprietary implementation of class
(Photo 12). This seemed to do the trick since D technology, which uses an advanced control scheme and
performance improved drastically! It no longer seemed to an extremely high switching frequency (50 MHz or greater) to
be completely broken, although it was still coming in a bit deliver even higher efficiency and performance.
March 2015 49
oo bad at low volume; and distortion growing quickly but
still delivering quite an intelligible signal.
Due to the noise and distortion on this module, I
couldn't recommend it for a hi-fi musical application, but
in a project where audio quality isn't a huge factor it could
certainly get the job done. Guitar amplifiers often have a
fairly high distortion figure anyway, so the self-powered
guitar project is still on the table. Other applications
where you need some volume but won't be playing much
recorded music would also be great — maybe a DIY
intercom or pager project, or built into a small kiosk or
pop-up display to play interface noises and sound effects.
Several forum posts on diyAudio and other Web
PHOTO 13. PAM8610 THD+N measured into four and communities also report similar performance with
eight ohm loads from 0.25W through maximum power modules based on this chip, and speculate that
output. performance might be improved by swapping out some of
the surface-mount components for other values and
higher than the theoretical specs say it should. However, adding better cooling.
at such a low price ($11.80), it's easy to imagine there If you're into experimenting, it might be a fun exercise
were some design trade-offs to keep the price down while to get this little module to perform better. The price is low
still delivering reasonable audio quality. enough it wouldn't break the bank to try. The underlying
In total, the distortion started just over 1% THD+N at chip has great specs, so if you've got a set of hot tweezers
0.25W into any load and rose to over 10% THD+N at and don't mind working under a magnifying glass,
about 9W, capping out at a total of 19.2% THD+N into a modifying the module would probably be an interesting
four ohm load at a maximum output of 10W. Oddly, project unto itself.
neither sample of this module I was sent would deliver
above 5W into an eight ohm load. I did experience some
odd cut-in/cut-out behavior at bass frequencies and when Headers Only
running it very hard; Rory mentioned he'd encountered
similar behavior on our call. Moving up a bit, the model TA2024 amplifier module
We determined it occurs when the amplifier exhausts (its stock number happens to be the same as the chip)
its current reserve in the onboard electrolytic capacitor. It takes up quite a bit more space, but really does offer a lot
would be pretty easy to change out the stock 470 µF of flexibility — all that extra space means bigger, better
capacitor for a much larger one to improve the low end components. There are a set of film input capacitors, plus
performance (Photo 13). an actual sharp-cutoff low pass filter on the output to
My live listening test confirmed what the meter remove any residual RF left over after the switching.
measured: a fair amount of background hiss, although not The module comes with a small three-conductor cable

PHOTO 14. The


back of the Wi-Fi
Internet radio project
showing an amplifier
module (Nuts & Volts,
March 2012).

PHOTO 15. THD+N vs. power for the Tripath TA2024 chip,
from the manufacturer's datasheet.
50 March 2015
PHOTO 17. Model TA2024 THD+N measured into four
PHOTO 16. The model TA2024 amplifier module under test. and eight ohm loads from 0.25W through maximum
power output.
for the inputs and attaches to a socket on the left side of good little board!
the board; on the other side is a barrier strip with screw One thing about this particular module ... it only
terminals for the left and right speaker outputs and power delivered the low distortion into a four ohm load. It's rated
supply connection. That's one of my favorite things about for much less power into an eight ohm load, but
this module since it will make it so easy to integrate it into comparing performance at 5W, the module delivered
other projects with a minimum of messing around with 0.55% THD+N which is much higher. Certainly listenable,
external controls and switches. It'd be
easy to attach a volume control pot to
the input if needed, but I'm envisioning
this one being great in applications where
the audio signal is being controlled by a
pre-amp or receiver — like the Wi-Fi
Internet radio project shown in Photo 14.
The Tripath TA2024 is a decent little
chip itself. It can deliver up to 15W into a
four ohm load at 10% THD+N, but is
rated for "audiophile" quality sound at up
to 9W at 0.04% THD+N (Photo 15).
Naturally, this is going to depend on the
implementation, which can really throw it
off if it's done poorly. Fortunately, though,
this module delivers pretty close to its
specified performance. It's close to the
reference design from the datasheet, as
well (Photo 16, Photo 17, and Photo 18).
I'd call this a very solid PHOTO 18.
implementation; performance is very Tripath TA2024
close to the datasheet figures. While chip amplifier
everyone's ears are a little different, most reference circuit,
people can't pick out distortion below from the
manufacturer's
about 1% unless they're specifically datasheet.
looking for it. This module delivered 11W
into a four ohm load at only 0.7%
THD+N. At 9W, it was well into the
audiophile quality range, with only
0.082% THD+N — a bit higher than the
theoretical figure of 0.04% THD+N, but
very respectable nonetheless. This is a
March 2015 51
but getting up into the range
where I might not consider it
audiophile quality.
The sound itself was
clean and neutral through
the middle of the range (if a
bit thin sounding), and not
unpleasant or fatiguing at all.
At the high end of the power
output, though, a noticeable
hiss came up from the
background and the
PHOTO 19. The Big Ear distortion became quite
distant listening device to apparent. The audio was still
pick up sounds from far
away (Nuts & Volts, very intelligible, however.
December 2008). One thing about this
module is that it would
definitely benefit from a PHOTO 20. The DTA-2 digital audio amplifier module
heatsink. After about five minutes playing at the full rated with all of its pieces.
volume, a whisp of smoke arose from the QA sticker
which was on the top of the chip. The thermal cut-off performance, or where picking out fine details of the
killed the output. I think in a real world application, it's sound over speakers might be important; for example, in
unlikely to be run deep into the red the entire time, so I something like the Big Ear project referred to in Photo 19.
don't see this as a huge problem.
Smoke coming from electronics is never a fun sight,
but there was no actual damage. It fired right back up A Flexible, Full Stack Solution
after cooling off, and its performance was unchanged.
The chip is large enough that it would be easy to fit The second of the TA2024-based amplifier modules is
with a heatsink for better thermal performance, and that the Dayton Audio DTA-2 digital audio version. This one
would almost certainly solve the problem. If you're goes the opposite direction of the bare board: It has a
mounting this in a small enclosure without much power connector (although there are solder pads for a
ventilation, it'd be a very good idea to include one. hard-wired power supply); a 1.8" stereo mini jack for the
I'd recommend this module for any application that input signal; and a volume knob with an integrated power
might actually play back music based on its good switch on a second small printed circuit board (PCB)
connected by a flexible ribbon cable (Photo 20).
There's also an LED power indicator which I didn't
assemble for these tests. The speaker leads need to be
soldered to the board which is a little annoying, but not

PHOTO 22. Dayton Audio DTA-2 measured into four


and eight ohm loads from 0.25W through maximum
PHOTO 21. The DTA-2 under test. power output.
52 March 2015
PHOTO 23. The Dungeon Keeper
— an animated Halloween prop
which would go well with some
powerful sound effects (Nuts & Volts,
September 2009).

the end of the world. There are


holes for power leads for a hard-
wired application in parallel with
the power jack, too.
At first glance, this one looks
like it should dissipate heat a bit
better than the other TA2024
module. There's a large thermal pad on the bottom of the PHOTO 24. The Prop Dropper — a spooky Halloween
board — even some traces on the top are designed for project which certainly could use a punch in the audio for
dissipating additional heat — but it only has one onboard ambient effects (Nuts & Volts, October 2009).
filter capacitor; the rest of the components (except for the
output filter inductors) are all surface-mount (Photo 21).
Since it's based on the same chip as the other TA2024 where you wouldn't be able to notice the distortion as
module, it will have the same maximum ratings. This one much.
didn't quite measure all the way up to spec, but I'd be
comfortable recommending it for more ambient
applications where volume and packaging are more Final Thoughts
important than sound quality.
Distortion rises steadily — although not too quickly — Designing your own amp can be a fun project, but in
up to 11.4% THD+N at full rated power into a four ohm most cases where you need some volume but don't much
load, but through much of the range there's little to no care about the specifics, a module like one of these is the
background hiss which makes the sound much cleaner way to go. Based on my results, any of these modules has
overall (Photo 22). That's right where the datasheet says it good potential for a variety of different applications. The
should be in the end, although it is supposed to be mostly PAM8610 would shine in lower powered, non-musical
clean and flat until the high end of its power bandwidth. projects where size is a factor. The model TA2024
Like its connector-less cousin, this one also went into amplifier module and the Dayton Audio DTA-2 digital
cutoff when running at high power for several minutes, but version (both based on the Tripath TA2024 class T amp
since that's not really likely to happen in most real world chip) do a great job and provide more power at lower
applications, it isn't a huge problem. Again, a heatsink distortion.
should clear that right up. It doesn't sound terrible, but at If you're building a project that's primarily musical, I'd
higher power there's a bit of hiss and the several percent recommend the model TA2024 on account of its
distortion is easy to notice. audiophile-grade performance. For hybrid applications like
Since the Dayton Audio DTA-2 doesn't quite manage sound effects or where you don't quite care about the
audiophile-quality sound but is still very listenable, I'd sound (like a DIY Bluetooth speaker project), I'd
recommend this one for projects where music isn't the recommend the Dayton Audio DTA-2 digital audio
main focus, but you might still want to play music on amplifier module.
occasion and have it be enjoyable. It would also be great All of these modules are quite efficient and would be
for public address (PA) applications, like haunted house easily powered by a lead-acid battery. Or, you could add a
Halloween projects such as the ones in Photo 23 and switching boost converter if you have a smaller project
Photo 24. If you're playing spooky sine waves or monster that's powered by some LiPo cells or other batteries with a
screams, it doesn't need to be super clear as much as it lower voltage but high power density. If you're like me,
needs to be loud. you probably have a few 12V mains power supplies lying
The flexible mounting options (the on-off/volume around already. An old computer power supply or even
control is able to be mounted separately from the discarded wall warts could easily power any of these
amplifier itself) mean this could fit into a variety of modules for your next built-in project.
enclosures, too — even with both boards, the footprint is The modules I’ve covered here will also integrate
considerably smaller than the other TA2024, so it could easily into an existing project, which is part of what makes
do well where audio was something of an afterthought. It them a good bargain. You can unlock your gadget's audio
might also make a good outdoor Bluetooth speaker set potential. Happy hacking! NV
March 2015 53
A Look at the
23rd Annual
"Last" Chicago
CoCoFEST!

The 23rd annual “Last” Chicago CoCoFEST! was held April 24-25,
2014 to celebrate RadioShack’s TRS-80 Color Computer — a
personal computer that was popular in the ’80s. So, why am I
writing about a vintage computer expo in this modern world of
Windows, Androids, and iPads? Because this fest not only
highlights the Color Computer, but also showcases a fusion of old
and new technology. Instead of tossing the old aside, the people
that make up the Color Computer community take cutting-edge
technology and use it to enhance and rebuild the TRS-80.
54 March 2015
By Salvador Garcia Post comments on this article at www.nutsvolts.
com/index.php?/magazine/article/march2015_Garcia.

Why is a ’80s Computer


Still Relevant?
With Mac OS, Linux, and Windows dominating PCs
today, anyone can ask why the Color Computer (or, CoCo
for short) would be relevant. After all, we are talking about
a computer that existed in an official capacity from
approximately 1980 to 1991, whose stated maximum
RAM capacity was 512 Kb with a maximum processor
speed of around 2 MHz. Today’s computers — with
advanced processors from Intel and AMD, plus gigabytes
of RAM and storage capacity — tower over the Color
Computer’s meager specs.
Still, when the Color Computer first debuted it was
one of the most innovative PCs of its class. This new entry The Cloud-9 exhibit.
into the home computer fray was based around the
Motorola 6809 microprocessor. The processor’s lineage cartridge slot (or Multi Pak Interface) and provide four
could be traced back to the PDP line of mini computers banks of 16K Flash memory to store ROM images. This
made by Digital Equipment Corporation. The 6809’s will eliminate the need to physically swap out ROM
architecture, instruction set, and addressing schemes were cartridges or OSes. The 16K memory banks will be
based on the PDP’s own. selectable via software or directly by hardware.
This characteristic alone made the 6809 one of the Another product provided by Cloud-9 is the DOS
more advanced microprocessors of its time as compared adapter. This is a small printed board that plugs into the
to others such as the MOS 6502 and the Zilog Z80 — Color Computer’s 24-pin EPROM socket and allows the
perhaps the two most commonly used processors in use of 28-pin EPROMs. The 28-pin EPROMs are easier to
home computers. In 1980, when the TRS-80 debuted find, plus they have an increased capacity over their 24-
using this processor, it was a big deal. It is thanks to pin counterparts.
innovative technology such as the 6809 that we have the The DOS adapter also incorporates a switching
powerful systems that we use today. mechanism so that the larger capacity EPROMs can be
Let me share with you some of the exhibitors that divided into two banks, meaning that the user can burn
were present at last year’s CoCoFEST! the contents of two 24-pin devices into the larger capacity
EPROM. Cloud-9 updated this product recently, improving
Cloud-9 its presentation by including a solder mask and silkscreen
on the printed circuit board.
Cloud-9 (www.cloud9tech.com) is a company that A PS/2 keyboard adapter is another product available
was founded in 1994 by Mark Marlette, and provides from this company. The adapter is a CoCo keyboard
hardware and software for the three versions of the Color hardware emulator that allows the use of any PS/2
Computer. Noted products include an IDE interface that
plugs into the TRS-80’s cartridge slot, memory expansion
modules, and NitrOS9. The latter is a full-fledged multi-
user Unix-like operating system that runs on the Color
Computer.
In addition, DriveWire is available free of charge (as of
this writing) as a download from their site. Drivewire
information is found in the next section.
Cloud-9’s display at the 2014 event included a few
decked out Color Computers showcasing their products.
This company has been busy supporting the TRS-80
community by providing innovative products that bring
new technology and capabilities to this computer. They
have not been stagnant. Cloud-9 reported updates to
existing products, as well as new development. Here’s a
brief summary of some of what has been going on.
The company is finalizing the design of miniFLASH.
This will be a product that will plug into the CoCo’s Open-case CoCo showcasing Cloud-9’s products.
March 2015 55
will be supported by using SPI (Serial Peripheral Interface)
controlled by the AVR. Using this platform, Ethernet
connectivity will be possible. Lots of firmware that
supports various protocols is ready for action, with more
on the way.
Another useful feature will be the implementation of
AES 128-bit encryption for the firmware files. This allows
Cloud-9 to post updates to the firmware on their website.
The SuperSD owner only needs to download these files
and store them in the SD per instructions. SuperSD will
decrypt these files and update its firmware.

HAWKSoft
HAWKSoft — owned and operated by Christopher
Hawks — had a display at the CoCoFEST! HAWKSoft is a
vendor that provides hardware and software for the Color
HAWKSoft’s Raspberry Pi CoCo 3. Computer. Some noted products include an RGB to S-
video converter and software that allows NitrOS-9 to read
keyboard with the TRS-80. This device also supports PC CD-ROMs.
keyboard macros and correctly resets the Color Computer By far the most interesting item at the HAWKSoft
when the Ctrl-Alt-Delete sequence is keyed in. booth was the Raspberry Pi (RPi) Color Computer. At first
Another innovative product that Cloud-9 has is the glance, it looked just like any other Color Computer 3
SuperSD. This device — a complete embedded system with its full travel keyboard and white case, but as Chris
with the ATMEL AVR Xmega 128a1 as its heart — allows explained it was anything but just another Color
using an SD memory card with the TRS-80. Computer 3.
The SD card behaves as though it were a solid-state First of all, there was no CoCo 3 motherboard or
hard drive, and can be used to store files or ROM images. electronics inside the case. Instead, there was a Raspberry
SuperSD can load these images into the CoCo’s memory Pi that booted into Linux. A CoCo emulator ran within the
space emulating a 32K ROM, provided that Tandy’s Linux environment to provide the familiar green welcome
specifications are followed. This will make it easy to load screen.
OSes whose image is stored in the SD card in a Next, Chris built a small circuit based on the Atmel
predetermined folder. tinyAVR microcontroller to interface the Raspberry Pi to
SuperSD is compatible with the FAT file system, using the TRS-80’s keyboard. The small circuit sensed whatever
the onboard 64K of fast static RAM to hold the FAT file key was pressed on the keyboard and sent the relevant
handle buffers. This means that files can easily be read information via the USB interface to the Raspberry Pi.
and written by a DOS/Windows computer, and read or Chris also added a USB hub and installed it inside the
written by the SuperSD. In addition to holding file Color Computer case. The various USB ports could be
allocation table information, the memory is also used for seen peering out of the computer’s cartridge slot.
the Ethernet buffers and extended memory for the AVR The emulator software took care of correctly
microcontroller. interpreting the pressed keys and taking the corresponding
SuperSD will use the DriveWire protocol to action. Chris used the MESS CoCo emulator which works
communicate between it and the TRS-80. In addition, this under Linux. MESS is Multiple Emulator Super System, and
device will also provide a Wiznet expansion slot. Wiznet is capable of emulating various computer systems.
Chris mentioned that the version running on the
RPi was a stripped down adaptation that only
emulated the Color Computer. This helped reduce
the size of the application to something more
manageable.
At the time of this writing, Chris was working on
putting the software in a publicly available DropBox
resource, along with an article that will describe how
anyone can build their own RPi Coco. The article will
be published in the Glenside Color Computer Club
newsletter. The club makes the newsletter available to
everyone free of charge. Go to www.glensideccc.com
Richard Crislip’s exhibit showcasing DriveWire. to find out how you can receive it.
56 March 2015
DriveWire
Richard Crislip had a display demonstrating the virtues
of DriveWire. This is a software/hardware combo that is
used to transfer files between the CoCo and a Windows
PC. The software is run on both the host (Windows PC)
and the client (the Coco). They communicate via a serial
cable (this being the hardware component). Aaron Wolfe
is the person behind DriveWire and responsible for a
major part of its development.
DriveWire is more than just a way to transfer files
between both systems. Tt is also a client/server setup that
allows the CoCo to store files on a remote system. This is
a great example of how a technology that is considered
obsolete is augmented by current technology. By utilizing
DriveWire, the user can have storage that is accessible to
the CoCo on a remote system. Storage is no longer limited
to the physical hardware that can be connected directly to Altera DE1 FPGA CoCo 3.
the TRS-80.
In addition to file transfer, DriveWire can perform standard VGA output, Richard used a video converter that
some TCP/IP networking functions such as Web hosting, accepted the CoCo’s video signal and converted it to
Telnet access, and BBS services. This means that given the VGA. Again, the fusion of old and new technology was
right software, the Color Computer can connect to the present. To see a video of DriveWire in action, go to
Internet through DriveWire to perform specific tasks (no, a www.youtube.com/watch?v=HU85qTOhWx8.
graphical Web browser is not one of them). The official DriveWire website is
The setup that was used to demonstrate DriveWire https://sites.google.com/site/drivewire4/.
was also unique. Richard had two monitors to show the
CoCo’s screen. The first was an old NTSC monochrome FPGA Color
monitor. The second was a modern VGA LCD flat panel
display. By using a video switch, Richard was able to have
Computer Emulator
both the CoCo and the Windows PC hooked up to this Another perfect example of the fusion of old and new
single LCD monitor. Since the TRS-80 does not have a

The Glenside Color Computer Club proudly announces the


24th Annual “Last” Chicago CoCoFEST! Highlights of this year’s
event will include:
Back to Basics theme: This year’s theme celebrates the
BASIC programming language and its recent 50th anniversary.
Various devices — including the Dartmouth College Time-
Sharing System (DTSS) emulator — will be on display. All BASIC are challenged to create the best BASIC program possible. The
programmable computers are welcomed. only rule is that the program has to run in the emulator.
Auction: This event is a staple of the CoCoFEST! that allows BASIC Programming Contest #2: Contestants are
attendees to bid on a wide variety of hardware and software for challenged to write a BASIC program that will run in the first
the TRS-80 and, in some cases, for other vintage computers. Color Computer that RadioShack made available to the public.
DriveWire: This unique piece of software allows the CoCo How much functionality can you squeeze into 4K of RAM using
and some other vintage computers to use a modern computer only the original Color Basic?
as a storage device and communications hub. After-hours Rowdiness: The fun does not end when the fest
Linux: Vintage computer collectors can see how this closes in the afternoon. Exhibitors and attendees get together for
popular operating system can be leveraged to provide an a fun evening of food, anecdotes, and conversation. Friendships
expansion path and operating environment for a favorite vintage and long-lasting relationships are celebrated and valued as much
computer. as the CoCo.
Projects in Development: These include a CoCo App store,
hardware to connect the CoCo to the Internet, Raspberry Pi Event Information:
integration (emulator, DriveWire server), and SD card integration April 25-26, 2015 from 9:00 AM to 5:00 PM
for added storage in a reliable and modern medium. HERON POINT CONVENTION CENTER
Vendors: People passionate about preserving our 645 West North Avenue
computing past have developed expansion boards and Lombard, IL 60148
accessories for the CoCo using cutting-edge technology. These
include — among others — video adapters for modern displays, Entry fee: $5; includes both days/kids under 12 free
memory expansions, and disc storage. Lodging: Special overnight fest rates of $93.24 at the
BASIC Programming Contest #1: John G. Kemeny and Fairfield Inn & Suites, Lombard. The inn is adjacent to the
Thomas E. Kurtz first conceived the BASIC language using a convention center. See the website for more information at the
mainframe and the DTSS. Using a DTSS emulator, contestants CoCoFEST! link at www.glensideccc.com.

March 2015 57
was the Altera DE1 FPGA that was programmed to act as Mobley and Chris Hawks (of HAWKSoft). LogiCall runs on
a Color Computer 3 emulator. The Altera DE1 is a “blank” all versions of the CoCo, plus some other computer
Field Programmable Gate Array (hence, FPGA). The systems (such as the Sinclair 2068), and provides the user
programmer can build a system that will allow the DE1 to with a basic shell that allows him or her to navigate the
mimic a computing device. Once the FPGA is file system structure of the attached drives using a menu
programmed, it behaves as the computer it was based system.
programmed to be. Additionally, LogiCall can also accept commands from
In this case, the programmer put together software for the user to perform some file operations such as copy,
the Altera DE3 that emulates a Color Computer. Its rename, delete, and move, and some administrative
compatibility — although not 100% — is impressive as it operations such as backup and diskette format.
runs most software available for the Color Computer 3. The objective of this software is to make using the
The person behind this project is Gary Becker, and he has Color Computer more visual and intuitive. This is
a Yahoo! Group dedicated to the FPGA CoCo 3 at accomplished through the menu structure and its
http://groups.yahoo.com/group/CoCo3FPGA. innovative use of one-keystroke commands.
Here‘s an introductory overview of the Altera DE1: The app’s source code is provided so that individuals
www.youtube.com/watch?v=aPXMkTJxD_s. This next link can customize the software to their unique needs. As an
presents a short demo of the Altera DE1 Color Computer: added bonus to registered attendees, LogiCall provided a
www.youtube.com/watch?v=ttf82tPXUko. 16 GB USB Flash drive so that everyone could try it out.

LogiCall History of the


LogiCall 7.0 is a software application that has a history
Color Computer
of almost 20 years, and was mainly written by Bob Swoger Both Boisy Pitre and Bill Loguidice were at the
with crucial and extensive collaboration by John Mark CoCoFEST! to promote their new book, CoCo: The
Colorful History of Tandy's Underdog Computer, published
in December 2013 by CRC Press. This book presents the
reader with a detailed history of the CoCo from its
conception to its production.
The authors had a round-table discussion that went
overtime. Attendees were interested in hearing the stories
behind the book and behind the Color Computer. The
discussion closed with a question and answer session.
Both authors were eager to share experiences and answer
the public’s questions.
Their book is available through Amazon and can be
located easily by searching its title.

The authors share anecdotes and answer questions. More CoCo Stuff
Another interesting display was by John Linville. He
had a fully functional LED array display system connected
to a Color Computer. This project was built following
instructions from an article that appeared in an issue of
Nuts & Volts dating back to 2000.
A central and strategic fundraising event was the
annual CoCoFEST! auction where all sorts of CoCo and
some non-CoCo stuff was auctioned off. This event is the
highlight of the first day of the event (not counting the
festivities that go on after the show). Alas, I had to leave as
the auction was getting started, so I can’t report a play-by-
play of that event.

All in all, everyone had a great time, celebrating


friendship and a small underdog computer of the ’80s that
left a spirit of community and collaboration which is still
going strong today. NV
John Linville’s LED array using a CoCo.
58 March 2015
THE HAM’S WIRELESS WORKBENCH ■ BY WARD SILVER N0AX
PRACTICAL TECHNOLOGY FROM THE HAM WORLD [email protected]

Oscillators
Figure 1B shows a pendulum All this creates two requirements
Every signal begins which is an example of a non- for our general-purpose oscillator:
electronic oscillator.1 Given a push, First, the amplifier has to have
with an oscillator — the pendulum will swing back and enough gain at the oscillation
forth at a constant frequency until frequency to overcome losses in the
the topic of this friction and air resistance bring it to a feedback circuit. Second, the filtered
halt at the rest position in the center. signal fed back to the input has to
column. In ham radio, The frequency-determining element arrive with just the right phase so as
of the pendulum oscillator is its to reinforce and not cancel the input
the oscillator is a key length, L. (Interestingly, the mass of signal.
the pendulum doesn’t matter!) These two conditions make up
element in generating The amplifier is whatever delivers the Barkhausen Stability Criterion:2
the push — such as you. Obviously,
signals, mixing them the amplifier has lots of gain because Loop gain =|Aβ| = 1
you are very strong! By delivering and
together, and feedback in the form of just the right Loop phase shift = ∠β = 0°, 360°,
strength push at just the right time, 720° ... 360° x 0, 1, 2, etc.
extracting the you can keep the pendulum swinging
forever — or at least until dinner. (The symbols | | mean
information from Switching back to Figure 1A, “magnitude of,” and the symbol ∠
let’s imagine an electronic circuit in means “phase shift of.” If you are
them. This month, each block. The idea is for some working with radians instead of
fraction, b, of the amplifier’s output degrees, the loop phase shift
we'll make an audio signal to be fed back and reinforce its requirement is stated as β = 2πn, with
input signal. That input is then n being an integer value.)
oscillator and learn amplified with some fed back, so that So, just how does the oscillator
the output eventually becomes self- start up? Noise! Random noise at the
sustaining; this is called oscillation. frequency for which the phase shift is
about common types Furthermore, to get oscillation only at
the design frequency and not just
of RF oscillators. produce random noise, the system
must include a filter to provide
here is an old saying: “Amplifiers selectivity; meaning that its response
T are oscillators that don’t and
oscillators are amplifiers that do.” An
is dependent on frequency. The filter
can be an LC circuit, a crystal, or a
B.

amplifier is at the heart of every timing circuit — something that is


oscillator, as shown in the block time- or frequency-sensitive.
diagram of a basic
oscillator in Figure 1A.
Every single oscillator —
even the digital versions,
multivibrators like the
555 IC, and the ones in
the little metal cans — FIGURE 1. The block diagram (A)
describes an oscillator as three circuits:
has this same basic one providing gain and the other two
structure: an amplifier, feeding back a fraction of the output
some feedback, and a signal into the input through a filter. B
frequency-determining A. shows a pendulum which is a mechanical
filter. version of the system in A.
March 2015 59
Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/index.php?/magazine/article/march2015_HamWorkbench.

FIGURE 2. The phase-shift oscillator reduces the amplitude of the input


circuit. Each pair of 10 KΩ resistors and signal by half. If three sections are
0.1 µF capacitors in the feedback connected back to back, then the
network adds 60° of phase shift at the total reduction in signal level is 1/2
frequency of oscillation.
x 1/2 x 1/2 = 1/8 = 0.125, which is
our value of β.
To make |Aβ| at least 1, A must
then be at least 8, and that is
controlled by the ratio of Rf to Ri. Rf
is made variable to allow for
adjustment in gain to account for
component variations and other
effects as we shall see.

Building a Phase-Shift
Oscillator
For this circuit, you will need a
just right builds a little bit more oscillator. To be sure, there are other power supply that can provide both
around the loop each time. Noise circuits with better performance, but positive and negative DC voltages of
with a phase that isn’t just right this one is the closest to the basic 6V to 12V. Since current draw is low,
eventually dies out because it is not circuit we’ve just discussed. you can use batteries to provide
reinforced. As a result, the output Let’s start with the feedback and power. An oscilloscope (stand-alone
builds up to a sine wave at the filter circuit formed by the three pairs or sound-card based) is required to
desired frequency. of 10 KΩ resistors and 0.1 µF see the waveforms produced by the
To keep the oscillator from capacitors. Each pair forms a low oscillator and to make adjustments.
building up to an infinite output pass RC (resistor–capacitor) filter that
voltage (or trying to), the circuit is shifts the phase of the input signal • Start by building the circuit of
usually a little non-linear so that loop from 0° to 90° as frequency is Figure 2. The 10 µF capacitors
gain stabilizes precisely at one when increased. At some frequency, the filter out noise to prevent
the output reaches the desired phase shift will be 60°. feedback through the op-amp
voltage. The frequency at which each RC power supply pins. Set the 1
section contributes 60° of phase shift MΩ potentiometer for the
A Phase-Shift is: highest resistance between its
connections. A 10-turn trimpot
Oscillator f = (tan 60°) / 2πRC = 1.73 / will be the easiest to adjust,
Gain is easy to obtain over a 6.28 RC = 0.28 / RC but a single-turn panel pot will
wide range of frequencies. What work if you use a knob to
about phase shift? The required For our combination of 10 KΩ make adjustment smoother.
phase shift of 360° can be distributed and 0.1 µF, that frequency is 275 Hz. • Connect power; you should
around the circuit. For example, if the When three identical sections are see something that looks like a
amplifier is an inverting amplifier, it cascaded, each contributes its own square wave at the output of
contributes 180° of phase shift. This 60° of phase shift, making up the the op-amp. This shows the op-
leaves the remaining 180° to be remaining 180° to form a 275 Hz amp output swinging back and
created in the feedback circuit oscillator. forth between the power
and/or the filter. At the frequency for which 60° supply voltages as the circuit’s
Figure 2 shows a phase-shift of phase shift occurs, the filter also gain of 1M/10K = 100 is too
high for the current in Rf to
Two Spurious Emissions balance that coming through Ri
from the feedback network. As
The value of 2798 used in the January 2015 column to compute the “free-space” length of
a result, the output jumps
an antenna in inches was a typo. The correct value is 2952. In addition, the Wireless Institute of between the power supply
Australia (WIA — www.wia.org.au) is the world’s oldest national amateur radio society, voltages.
founded in 1910. It was followed by the Radio Society of Great Britain (RSGB –rsgb.org) in 1913, • Reduce the potentiometer
and only then by the ARRL in 1914. resistance to obtain an
60 March 2015
undistorted sine wave that network. That causes
peaks a volt or so below the an extra voltage drop
power supply voltages as seen and phase shift. The
in Figure 3. (This may be a op-amp also
touchy adjustment with a contributes its own
single-turn pot.) If you have a small amount of phase
dual-channel oscilloscope, shift, meaning that the
observe the input and output total phase shift
voltages of each RC section, needed from the
and verify that each feedback circuit will
contributes approximately 60°. not be exactly 180° at
• Measure the period, T, of the the frequency of
output waveform (one oscillation. These two
complete cycle) and calculate effects result in a
the frequency of the oscillator higher frequency for
(f = 1/T). Measure the the actual circuit at
resistance of the potentiometer which |Aβ| = 1.
(Rf) after removing it from the To see the effects FIGURE 3. The oscilloscope traces show the output
circuit. Compute the of op-amp gain signal from the op-amp and the smaller phase-shifted
magnitude of the amplifier’s limitations at higher signal at the output of the first RC filter section.
gain (|A| = resistance / 10 frequencies, change
KΩ). the feedback capacitors from 0.1 µF Because the voltage follower
to 0.001 µF, increasing the 60° phase- presents its very high input
You probably observed that the shift frequency for each RC section impedance to the preceding circuit,
frequency was a lot different than the to about 27.5 kHz. At this frequency, each RC section can act more like
initial calculation of 275 Hz — my a 741 op-amp can’t cause its output the ideal filter we envisioned during
oscillator’s frequency was 476 Hz. to change rapidly enough to create a the design process.
The voltage drop across each RC sine wave. (The maximum rate at The resulting frequency of
filter section was probably greater which the op-amp can change its oscillation and the gain required to
than half. My sections reduced the output voltage is called the slew rate, achieve oscillation should change to
output to about 0.27 of the input. which is measured in V/µsec.) As a be within 20% of the originally
The gain of the amplifier will also be result, the output waveform will calculated values. (The tolerance of
found to be greater than eight to change to something that looks more most 0.1 µF and 0.001 µF capacitors
compensate for that extra reduction. like a triangle wave — no matter how is typically 10% to 20%, allowing a
My potentiometer’s resistance was you adjust the amplifier gain. lot of variation as well.)
603 kΩ, for a gain of 60.3 — The phase-shift and voltage drop
approximately equal to 1 / (0.27 x errors caused by the loading effects RF Oscillators
0.27 x 0.27). of each RC section can be eliminated
These discrepancies result by adding a buffer amplifier between The circuits used in RF oscillators
primarily from things we overlooked each section. Replace the single op- are different than those used for
in the design process. Each RC amp with a quad op-amp such as the lower frequencies. RC phase-shift
section does not contribute exactly LM324. One op-amp section will circuits aren’t generally used above a
60° of phase shift because it is replace the existing LM741. Add a few MHz. The values of R or C
loaded by the next section in the voltage follower between each RC become impracticably small, which
section with an op-amp’s leaves the oscillator susceptible to
Circuit Construction Tutorials output connected stray resistances and capacitances
Learning how to build and test circuits at RF is a useful directly to its inverting that compromise stability and
skill but it does take a little practice. Chuck Adams K7QO input, and connect the consistency. In the MHz range, it’s
wrote an excellent and detailed tutorial, Manhattan Building input signal to the non- much easier to use inductors and
Techniques, that can be downloaded from the QRP ME
website, whose products are popular with low power ham
inverting input. (This capacitors to form the phase-shifting
operators (www.qrpme.com/docs/K7QO%20Manhattan.pdf). circuit is shown as Figure circuits which are referred to as
In addition, you can find all sorts of building tips and 7 in the Texas resonators.
instructions by clicking the Radio Technology Topics link at Instruments applications Most RF oscillators use discrete
arrl.org/tech-portal and in my own Circuitbuilding for note, Design of op-amp devices such as a bipolar transistor or
Dummies Do-It-Yourself. sine wave oscillators.3) FET since most integrated op-amps
March 2015 61
References
1. http://en.wikipedia.org/wiki/Pendulum
2. http://en.wikipedia.org/wiki/Barkhausen_stability_criterion
3. www.ti.com/sc/docs/apps/msp/journal/aug2000/aug_07.pdf

Meet The Hartley and Colpitts


Hartley oscillator circuits are very similar in
behavior, but their differences
and influence the designer’s preferred
Colpitts choice. For example, the Hartley has
a wider tuning range and fewer
Back in the components than the Colpitts.
1920s, two The Colpitts, however, is less
FIGURE 4. The Colpitts and Hartley oscillators work on the
same principles but use different connections to the LC filter fellows by the expensive because it avoids the
and feedback circuit, which is called a resonator. (Biasing name of Hartley tapped inductor, and has several
circuitry is omitted for clarity.) and Colpitts popular variants with good stability.
came up with We’ll cover RF oscillators in more
aren’t designed to have the necessary the different circuits in Figure 4 that detail in the next column.
gain at high frequencies. Of more became popular in radio designs.
practical concern, a high gain wide In each, the feedback is provided Prototyping at RF
bandwidth op-amp is much more by routing part of the emitter circuit
expensive than discrete transistors through a voltage divider created by Most electronics builders and
such as the 2N3904 (bipolar NPN) or two reactances (L or C). If the experimenters are very familiar with
J310 (N-channel JFET). reactive divider is a pair of solderless breadboards. They’re very
Those parts cost mere pennies capacitors, it’s a Colpitts oscillator. convenient and easy to work with for
and have gain at frequencies up to If the reactive divider is a pair of a variety of circuits, but they aren’t
several hundred MHz. As a result, at inductors or — more frequently — a very good for analog circuits at
RF above 1 MHz, the most effective single inductor with a tap part way frequencies above a couple of MHz.
circuits use a transistor amplifier with along the turns, the circuit is a The strips of contacts add too
feedback and the required phase shift Hartley oscillator. These same circuits much capacitance to the circuit in
provided by a resonator such as a are in wide use today nearly 100 unpredictable ways; the wires and
parallel LC circuit. years later! leads of the components start to get
long enough to have significant
amounts of inductance; and
controlling your grounding can be
very difficult.
Hams have come up with an
excellent substitute for working with
RF circuits called “ugly” or
“Manhattan-style” construction. In
this style of prototyping, a blank
piece of copper-clad printed circuit
board (PCB) is used as a ground
plane. Components needing a
ground can be soldered directly to
the ground plane.
To create ungrounded junctions
ugly style, high value resistors
(typically, 1 MΩ or more) are used as
standoffs, costing only pennies. In
addition, Manhattan-style uses small
pads of PCB material as isolated
connection points.
The pads are either soldered to
the ground plane (requires double-
62 March 2015
FIGURE 5. A typical RF prototype Once you gain a little experience
using “ugly” construction in which with this type of construction for RF
ground connections are made directly circuits, you’ll find it’s a quick and
to the copper PCB ground plane. This
is a Hartley oscillator for the amateur effective way to prototype even
40-meter band around 7 MHz. complex RF circuits before
transferring them to an actual PCB or
building them into an equipment
enclosure. NV

M E A S U R E M E N T C O M P U T I N G

Great 16-Bit
sided PCB pads) or hot-glued to the
DAQ Solutions
ground plane. Easy to Use • Easy to Integrate • Easy to Support
Figure 5 shows a typical “ugly
construction” example. This is a NEW
Hartley oscillator for the amateur 40-
meter band around 7 MHz. In fact, I
used a telegraph key to turn this
oscillator on and off, making a
couple of “QSOs” or contacts with Ethernet, Multifunction High-Speed, Multifunction
nearby hams using the few milliwatts
of power (also known as QRP power) E-1608 USB-1608GX-2AO
from this mighty peanut whistle! Only $499 Only $799
If you are envisioning doing • 8 SE/4 DIFF analog inputs • 16 SE/8 DIFF analog inputs
some RF building yourself, an RF • 250 kS/s sample rate • 500 kS/s sample rate
prototyping board is a useful • 2 analog outputs • 2 analog outputs
workbench addition. You’ll need a • 8 digital I/O, 1 counter • 8 digital I/O, 2 counters
large piece of single- or double-sided
PCB (at least 8” x 8”) and a thick
piece of wood as big as or slightly
larger than the circuit board.
Drill mounting holes in the
corner of the PCB and attach it to
the wooden base with wood screws. Simultaneous Sampling Low-Cost, Multifunction
This gives you a large surface on
USB-1608FS-Plus USB-231
which to work, plus the base makes it
Only $399 Only $249
heavy enough to not be dragged
• 8 simultaneous analog inputs • 8 SE/4 DIFF analog inputs
about by test leads and cables. I
• 400 kS/s overall sample rate • 50 kS/s sample rate
attached rubber feet to the bottom of
• 100 kS/s max for any channel • 2 analog outputs
my wooden base.
Once you’ve finished (and before • 8 digital I/O, 1 counter • 8 digital I/O, 1 counter
each use), scrub the board with a
Scotch-Brite™ pad to remove mccdaq.com
fingerprints and oxidation. A swab
with some rubbing alcohol will also Contact us
clean the board of oils or greases. 1.800.234.4232
The goal is to have an easy-to-solder ©2015 Measurement Computing Corporation, 10 Commerce Way, Norton, MA 02766 • [email protected]
surface.
March 2015 63
OPEN COMMUNICATION ■ BY LOU FRENZEL W5LEF
THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES

New Short-Range Wireless


Standards Target IoT Applications
Revised Bluetooth and ZigBee versions feature
Internet interconnectivity.

T he Internet of Things (IoT)


movement is underway and
HOW IT WORKS convenient way to connect to the
Internet.
In most applications, the device That is now changing. Both of
already products are beginning to be monitored or controlled has the widely used Bluetooth and
to show up. It is still early in an integrated sensor and wireless ZigBee technologies now offer new
this trend, with billions more transceiver that connects via the versions that are tailored to Internet
cellular system, Wi-Fi, or other connectivity.
devices to be built and
wireless link to the Internet. Cellular
connected. However, now it is links connect directly to the
easier than ever thanks to some Internet, while Wi-Fi or other
BLUETOOTH 4.2
updated wireless standards. wireless technologies connect by Bluetooth is a short-range radio
way of a gateway or router that technology that operates in the
First, if you are not familiar
links to the Web. unlicensed 2.4 GHz industrial-
with IoT, you should see my The Internet connection scientific-medical (ISM) band.
June 2014 column on this contacts a remote server that Bluetooth is a standard of the
topic. In way of review, IoT is a contains the application software. Bluetooth Special Interest Group
Then, the monitoring device (like a (SIG). It has a range up to about 30
communications technology laptop, tablet, or smartphone) feet. The basic output power is 1 mW
that is used to monitor and/or makes an Internet connection to (0 dBm), but you can use two other
control practically any device the server to complete the service. power levels for longer ranges: 2.5
by way of a communications Data is then captured and mW (4 dBm) and 100 mW (20 dBm).
displayed or stored, or some The 4 dBm version is the most
link including the Internet. IoT control commands are issued. popular, but the higher power version
or the Internet of Everything All devices are assigned an can reach out to about 100 meters
(IoE) — as some call it — Internet Protocol (IP) address. under line-of-sight conditions.
includes machine-to-machine Thanks to the latest IPv6 protocol, Bluetooth has a raw data rate of
up to 2,128 addresses are possible. 1 Mb/s, but some of that is overhead
(M2M) communications, as That should be more than enough that goes to headers and error
well as machine-to-human or to handle the largest collection of correction so the net data rate is 723
human-to-machine. While the IoT devices possible. kb/s. The modulation is Gaussian FSK
IoT movement is just In almost every case, a wireless in a frequency hopping spread
link is used for communications. spectrum (FHSS) scheme. The carrier
beginning, many in industry Cellular connections are common hops from one of the 79 channels to
predict that from 20 to 100 for M2M applications like vehicle another in a random sequence.
billion devices could possibly tracking, pipeline monitoring, or the The hop rate is 1,600 hops per
be connected by 2018 or 2020. like. Wi-Fi is popular for home or second for a dwell interval of 625
business applications since home microseconds. During each hop
You may already own one of routers and office access points are interval, some data is transmitted. The
these devices, such as my video common. FHSS method makes the data very
camera that I can monitor via The fact is that any short-range secure.
my smartphone from wireless technology can be used. A newer version of Bluetooth is
However, many of the most 2.1 -- called Enhanced Data Rate
anywhere. popular standards do not provide a (EDR) -- and it uses π/4-DQPSK
64 March 2015
THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES
Go to www.nutsvolts.com/index.php?/magazine/article/March2015_OpenCommunication
to comment on this article.

modulation that gives a data rate to applications are the heart rate profile called 6LoWPAN with IPv6 to let a
2.1 Mb/s. With 8DPSK modulation, and the temperature profile. Both are Bluetooth device connect through a
the data rate tops out at 3 Mb/s. designed to enable the wireless compatible gateway. This feature —
Version 3.0 -- known as Bluetooth monitoring of body functions. They called the Internet Protocol Support
High Speed -- uses the same provide a simple way to collect, Profile (IPSP) — is an application for
transmission protocol, but employs a interpret, and display heart rate and 4.2 devices. This now makes
Wi-Fi 802.11 radio link to get a data temperature data for training Bluetooth a prime candidate for IoT
rate up to 24 Mb/s. purposes. Other similar applications applications.
Version 3.0 was created as a way are on the way.
to let the Bluetooth protocol operate Aside from the health and fitness
over a Wi-Fi connection if available. areas, the Bluetooth 4.0/4.1 versions
ZIGBEE 3.0
Bluetooth radios incorporate an also find use in PC peripherals like ZigBee, like Bluetooth is another
alternate MAC/PHY that is able to mice and keyboards, or smart home short-range wireless standard that has
dynamically select either the monitoring and control. BLE is been around a while. It is based on
Bluetooth radio or the Wi-Fi radio incorporated into smart watches that the IEEE’s popular 802.15.4 standard.
based on the need for faster link to a smartphone, and is also at This standard provides the basic PHY
transmission, or not. the heart of beacons — wireless and MAC layers of the protocol,
More recent additions to devices that sense when another while ZigBee adds more layers to
Bluetooth are versions 4.0/4.1. They Bluetooth device is nearby, and implement the applications. The
feature ultra-low power consumption transmit location or other information 802.15.4 standard permits operation
and encrypted connections. Also like ads. ICs like the one shown in in the 868 MHz band in Europe, the
called Bluetooth Low Energy (BLE), Figure 1 make BLE/smart applications 902-928 MHz band in the US, and
these radios use very little power and easier to develop. the 2.4 GHz band worldwide.
can run for months — even years — The latest version of Bluetooth is The most popular version shares
on a single coin cell. BLE is also 4.2. It offers greater privacy, security, the 2.4 GHz band with Bluetooth,
known as Bluetooth Smart. and reliability of data transfers — Wi-Fi, and a bunch of other wireless
The BLE versions target anything even lower power consumption, technologies.
mobile or portable, including people. increased speed, and IP connectivity. The standard provides 16 5 MHz
The goal is to create wearable It includes BLE features and is bandwidth channels. Modulation is
wireless devices in watches, running backward compatible with previous direct sequence spread spectrum
shoes, and medical monitoring versions. The main data rate of BLE (1 (DSSS) with BPSK or O-QPSK. The
devices. Many of the newer Mb/s) is boosted to 2.5 Mb/s. access mode is carrier sense multiple
Bluetooth chips contain the standard However, the big feature of 4.2 is the access with collision avoidance
Bluetooth transceiver in addition to a ability of a Bluetooth device to (CSMA-CA). The power level is
BLE transceiver. connect to the Internet. typically 0 dBm, but up to +20 dBm
Two newer BLE profiles or This new feature uses a protocol can be used.
The range is 10 to 100 meters,
depending on the power level and
the environment. The data rate is 250
kb/s. A key feature of this standard —
and ZigBee — is its very low power
consumption.
ZigBee is a standard of the
ZigBee Alliance. It adds network and
application layers to the PHY and
MAC layers of 802.15.4. It
implements enhancements such as
authentication of valid nodes,
encryption for security and data
routing, and forwarding capability
that permits mesh networking.
■ FIGURE 1. This is Nordic Semiconductors’ nRF51822 integrated circuit Mesh networking lets any node
incorporating a complete Bluetooth smart transceiver, an ARM 32-bit Cortex
M0 processor with RAM, and special software that makes BLE applications talk to any other node (if not directly,
easier to implement. then indirectly) by relaying messages
March 2015 65
example. Plus, control of devices by smartphone,
ZigBee can fitness and health care monitoring,
connect to the control of LED lighting, and many
Internet. It uses a more.
variation of the The latest version of ZigBee is
6LoWPAN 3.0. What it does is unify many of the
protocol. available applications into one piece
A key feature of software. This is especially
of ZigBee is that it attractive to IoT developers as it
offers specific allows communications and
applications for interoperability among as many as
common 130 different smart devices (Figure
operations. These 2). ZigBee 3.0 is compatible with
are like the ZigBee PRO, which is a popular
Bluetooth profiles. version. In addition, 3.0 supports
Some of these both easy-to-use DIY installations, as
applications include well as professionally installed
building systems.
■ FIGURE 2. ZigBee 3.0 makes creating home automation for For more details on these new
automation and control applications for the Internet of
Things faster and easier than ever. control and versions, go directly to the sources at
monitoring of www.bluetooth.org and
through other adjacent nodes. Mesh facilities, RF remote controls for www.zigbee.org. NV
networks can be huge and cover a home electronics, home energy
large area. Sensor networks are an monitoring, home monitoring and
Create Your Own Custom Antenna!

66 March 2015
ELECTRONET
For the ElectroNet
online, go to



www.nutsvolts.com
click Electro-Net





)

USB
USB-FIFO
Add USB to your next project--
It's easier than you might think!
USB-UART USB/Microcontroller Boards
RFID Readers Design/Manufacturing Services Available
Absolutely NO driver software development required!
www.dlpdesign.com

HobbyEngineering
Kits, Parts and Supplies
www.HobbyEngineering.com
www.servomagazine.com

 RoHS

COMPONENT LEDs • LED BULBS • LED ACCENT LIGHTS

GET THE DISCOUNT!


Mention or enter coupon code NVRMZ142
Wanna learn more about electronics? and receive 10% off your order!

www.nutsvolts.com AM/FM Broadcasters • Hobby Kits


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

March 2015 67
For complete product details, visit:
The Nuts & Volts WEBSTORE
GREAT FOR DIYers!
Electronics from the Ground Up: The TAB Book of Arduino Projects for Amateur
Learn by Hacking, Designing, Arduino Projects Radio
and Inventing by Simon Monk by Jack Purdum, Dennis Kidder
by The ultimate Boost Your
Ronald Quan collection of DIY Ham Radio's
Arduino projects! Capabilities Using
Are you fascinated In this easy-to- Low-Cost Arduino
by the power of follow book, elec- Microcontroller
even the smallest tronics guru Simon Boards
electronic device? Monk shows you
Electronics from the how to create a Do you want to
Ground Up guides wide variety of fun increase the
you through and functional functionality and
step-by-step experi- gadgets with the value of your ham
ments that reveal Arduino Uno and radio without
how electronic circuits function so you can Leonardo boards. Filled with step-by-step spending a lot of
advance your skills and design custom instructions and detailed illustrations, The money? This book will show you how!
circuits. You’ll work with a range of circuits TAB Book of Arduino Projects: 36 Things Arduino Projects for Amateur Radio is
and signals related to optical emitters and to Make with Shields and Proto Shields filled with step-by-step microcontroller
receivers, audio, oscillators, and video. provides a cost estimate, difficulty level, and projects you can accomplish on your own,
Paper back 544 pages. list of required components for each no programming experience necessary.
$30.00 project.
$30.00 $30.00

Make Your Own Build Your Own Beginner's Guide to Reading


PCBs with EAGLE Transistor Radios Schematics, 3E
by Eric Kleinert by Ronald Quan by Stan Gibilisco
Featuring detailed A Hobbyist's Guide to High
illustrations and Performance and Low-Powered Navigate the roadmaps
step-by-step Radio Circuits of simple electronic
instructions, Make Create sophisticated circuits and complex
Your Own PCBs with transistor radios systems with help from
EAGLE leads you that are inexpensive an experienced
through the process yet highly efficient. engineer. With all-new
of designing a Inside this book, it art and demo circuits
schematic and offers complete you can build, this
transforming it into projects with hands-on, illustrated
a PCB layout. You’ll detailed schematics guide explains how to
then move on to and insights on how understand and create
fabrication via the generation of standard the radios were high-precision
Gerber files for submission to a PCB man- designed. Learn electronics diagrams.
ufacturing service. This practical guide how to choose Find out how to
offers an accessible, logical way to learn components, identify parts and connections, decipher
EAGLE and start producing PCBs as construct the different types of radios, and element ratings, and apply diagram-based
quickly as possible. troubleshoot your work. information in your own projects.
*Paperback, 496 pages
$30.00 $49.95 $25.00
How to Diagnose and Fix Programming PICs in Basic Programming Arduino
Everything Electronic by Chuck Hellebuyck Next Steps: Going Further
by Michael Jay Geier If you wanted to learn with Sketches
how to program by Simon Monk
Master the Art of microcontrollers, then
you've found the right In this practical guide,
Electronics Repair book! Microchip PIC electronics guru Simon
microcontrollers are Monk takes you under
In this hands-on being designed into the hood of Arduino
guide, a lifelong electronics throughout and reveals professional
electronics repair the world and none is programming secrets.
guru shares his tested more popular than the Also shows you how
techniques and eight-pin version. Now to use interrupts,
invaluable insights. the home hobbyist can manage memory,
How to Diagnose and create projects with these little program for the
Fix Everything microcontrollers using a low cost Internet, maximize seri-
Electronic shows you how to repair and development tool called the CHIPAXE
system and the Basic software al communications,
extend the life of all kinds of solid-state perform digital signal
devices, from modern digital gadgetry to language.Chuck Hellebuyck introduces
how to use this development setup to processing, and much more. All of the 75+
cherished analog products of yesteryear. build useful projects with an eight-pin example sketches featured in the book are
$24.95 PIC12F683 microcontroller. $14.95 available for download. $20.00

68 March 2015
Order online @ www.nutsvolts.com
Or CALL 1-800-783-4624 today!
EDUCATIONAL CD-ROM SPECIAL

March 2015 69
CALL 1-800-783-4624 today!
Order online @ www.nutsvolts.com
PROJECTS
No Nonsense Annunciator Kit Seismograph Kit 3D LED Cube Kit

Now you can record your own


The no nonsense/no microprocessor shaking, rattling, and rolling.
annunciator is a great little circuit that This kit shows you how to build a
The Poor Man's Seismograph is a great really cool 3D cube with a 4 x 4 x 4
helps you get your message out without project/device to record any movement in
spending too much money. Put two monochromatic LED matrix which has a
circuits together and you’ll have a an area where you normally shouldn't have total of 64 LEDs. The preprogrammed
six letter annunciator! any.The kit includes everything needed to microcontroller that includes 29 patterns
This kit is also a fun project to refine your build the seismograph. All you need is your that will automatically play with a runtime
soldering skills with its 102 socket pin PC, SD card, and to download the free of approximately 6-1/2 minutes.
connection points. WOW, that’s a software to view the seismic event graph. Colors available: Green, Red, Yellow & Blue
lot of soldering!
$79.95 $57.95
$19.95
Solar Charge Controller Kit 2.0 Geiger Counter Kit Super Detector Circuit Set

This kit is a great project for high


If you charge batteries using solar school and university students The unit Pick a circuit!
panels, then you can't afford not to have detects and displays levels of radiation, With one PCB you have the option
them protected from over-charging.This and can detect and display dosage levels of detecting wirelessly:
12 volt/12 amp charge controller as low as one micro-roentgen/hr. temperature, vibration, light, sound,
is great protection for the money. It is The LND 712 tube in our kit is capable motion, normally open switch, normally
simple to build, ideal for the novice, and of measuring alpha, beta, and closed switch, any varying resistor
no special tools are needed other than gamma particles. input, voltage input, mA input, and tilt,
a soldering iron and a 9/64" drill! Partial kits also available. just to name a few.
$27.95 $159.95 $32.95

FOR BEGINNER GEEKS!

$59.95 $49.95 $39.95


These labs from LF Components show simple and interesting experiments and lessons, all done on a solderless circuit board.
As you do each experiment, you learn how basic components work in a circuit, and continue to build your arsenal
of knowledge with each successive experiment.
For more info and lab details, please visit our webstore.

70 March 2015
CLASSIFIEDS
SURPLUS WIRE/CABLE ROBOTICS

 

ANAHEIM WIRE, INC.


KITS/PLANS AUDIO/VIDEO Master distributor of
electrical and electronic
wire and cable since
QKITS LTD ICEpower MODULES 1973. Items available from
[email protected] 50W x 2 (50ASX2) or stock: Hook up wire, Shrink
tubing, Cable ties, Connectors,
1 888 GO 4 KITS 170W x 1 (50ASX2BTL) etc. Wire cut & strip to specs,
Arduino • Raspberry Pi Just add AC & speaker(s) twisting, striping. If interested,
Power Supplies $99 USA $119 Worldwide please call 1-800-626-
MG Chemicals www.classicaudioparts.com 7540, FAX: 714-563-8309.
RFID Visa/MC/Amex. See us on
the Internet: www.anaheim
$8.50 wire.com or email: info@
  
flat rate anaheimwire.com.
shipping MISC FOR
SALE
Visit us at: SERVICES HARDWARE
www.qkits.com SPEAKER BUSINESS CLOSED WANTED
AFTER 35 YEARS.
SELLING $250,000 INVENTORY OF Sandpiper Electronics Services LLC
"design of custom electronics instrumentation" DEC EQUIPMENT
Subscribe today! SPEAKERS, SPEAKER PARTS AND
MANUFACTURING EQUIPMENT AT A
FRACTION OF COST. ALL OFFERS
Circuit design & drawings. PCB layout, fabrication & population
Prototype development for research, industry and inventors.
39 years experience in electronics development for research &
WANTED!!!
Digital Equipment Corp.
www.nutsvolts.com CONSIDERED. ISE, SAN BENITO, TX.
Info www.iseliquidator.com
956-444-0004, 888-351-5550
flight applications , laser systems & laboratory research

FREE no obligation consultations


www.sandtronics.com
and compatibles.
Buy - Sell - Trade
CALL KEYWAYS 937-847-2300
or email [email protected]

LIGHTING

CONTROLLERS

Join The

from $119

TRi SUPER PLCs


Powerful & Easy Ladder
+BASIC Programming
Ethernet integrated
MODBUS TCP/IP
DI/Os & AI/Os integrated

tel : 1 877 TRI-PLCS


web : www.triplc.com/nv.htm

TRIANGLE
RESEARCH
INTERNATIONAL

March 2015 71
THE DESIGN CYCLE
■ BY FRED EADY

A Blueprint for Embedded Wi-Fi


Let's face it. You are a Nuts & Volts reader
because you compute. You compute with a
PC that utilizes large microprocessors,
spinning disk drives, and megabytes of
memory. You also compute with
microcontrollers and relatively small
amounts of memory. Each compute
platform has a mission. Normally, the larger
PC platform is used to craft smaller
microcontroller-based solutions. Once the
microcontroller application is spawned, the
larger mothership compute platform is
jettisoned. The microcontroller hardware
then assumes all responsibilities of the
resultant application. We have become
accustomed to having the target
microcontroller perform the bulk of the
application activity. However, the paradigm
is changing. Smart peripherals are assuming ■ Photo 1. The Moray is based on the AMW006 Numbat
Wi-Fi module. All of the support needed to communicate
communications, control, and sensing with the Numbat can be found on the Moray
functions that were normally relegated to printed circuit board.

the microcontroller in charge of the


application. In these cases, the Hardware — From the Beginning
microcontroller becomes a simple We have full access to the slave device which, in this
mouthpiece that shouts out commands to case, will be the Moray Wi-Fi module you were
introduced to last month. So, we know what the Moray
the attached smart peripheral. The smart wants to hear and how the Moray will respond. As you
peripheral performs the work and reports its can see in Photo 1, the Moray is a self-contained
results to the requesting microcontroller. As embedded Wi-Fi platform. Power and serial connectivity is
provided via the Moray’s integrated FTDI USB interface.
a result, the microcontroller does not have Our host microcontroller does not have native USB
to be endowed with a huge amount of host support in its arsenal, so we will have to get our serial
compute resources. In this installment of signal into the Moray the old fashioned way. To do this,
we will have to perform some surgery. However, before
Design Cycle, we will create a bit of we start cutting traces, we will make sure that we have all
mouthpiece microcontroller hardware our ducks in a row on the microcontroller side of the
supported by C application code generated creek. We can line up our duckies by emulating the
Moray signals with a terminal emulator.
by the CCS C compiler. The microcontroller mouthpiece hardware design is as
72 March 2015
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS

■ Photo 3. The screw


terminal at J2 allows
us to easily move
between the
PmodUSBUART
module and the
■ Photo 2. Those of you that have previously visited the Moray's serial
Design Cycle space will recognize this little device as a interface.
workhorse I use very often to add instant USB connectivity
to embedded projects.

simple as it gets. As you can see in Schematic 1, our In this design, we’ve added what I call an “activity”
mouthpiece hardware design consists of a PIC, two LED that can be used for general-purpose debugging or as
resistors, three capacitors, a couple of connectors, and an an “I’m alive!” indicator. The PICkit3 has proven to be a
LED for fun. To facilitate easy communications to a reliable and popular programmer/debugger device. J1 is
terminal emulator that will be running on my Lenovo wired to allow a PICkit3 to be directly plugged into the
laptop, J2 is wired to directly interface a Digilent design for programming and debugging.
PmodUSBUART module. The PmodUSBUART is shown in The PIC18F27J13 is a very capable microcontroller.
Photo 2. However, the objective here is to not have to utilize any of
The heart and soul of our mouthpiece design — a 28- the PIC’s native resources. The Moray can sense analog
pin PIC18F27J13 — is shown with the PmodUSBUART voltages for us. It can also perform general-purpose I/O
mounted in the J2 screw terminal in Photo 3. Once we’ve functions via commands issued by the PIC. The Moray’s
verified that our firmware is working as designed, we can PWM engine allows us to utilize it in applications such as
replace the PmodUSBUART module with a connection to light dimming or digital-to-analog voltage generation. In
the Moray’s serial interface. essence, we are holding the PIC’s resources in reserve.
Note the crossed Rx and Tx signals between the Any task that the Moray cannot perform can be
PmodUSBUART module and the PIC’s serial interface. We performed by compute and I/O resources native to the
must also connect to the Moray’s serial interface in this PIC.
manner. A serial port is always good to have in any case For instance, the Moray does not support SPI master
as it can act as a debug device. mode. So, we would call upon the PIC18F27J13 to step

■ Schematic 1. Absolutely no rocket


science is applied here as far as we
are concerned. All of the technology
is packed into the goo that connects
to the PIC's 28-pin frame.
March 2015 73
Post comments on this article and find any associated files and/or downloads at www.nutsvolts.com/
index.php?/magazine/article/march2015_DesignCycle.

■ Screenshot 2. Right now, all we need are


the resources provided by the PIC18F27J13's
native serial port (Tx1-Rx1) which resides at
■ Screenshot 1. This is a screen capture of the CCS C pins C6 and C7, respectively.
Project Wizard. This window is where the clocking, watch
dog timer, and debugger information is entered for our
selected device. Our entries automatically generate the
necessary configuration code, which we will plug into our the PIC18F27J13’s 4x PLL to kick the MCU clock
application's C source code.
frequency up to a maximum of 32 MHz. Our alternative
PLL-boosted frequency is derived from the 4 MHz internal
up and perform any SPI master tasks the application clock setting and is presented to the MCU as 16 MHz.
would require. The Moray’s strength lies in its ability to We don’t need lightning in a bottle. So, we’ll drive our
communicate via Wi-Fi radio. The Moray’s GPIO PIC18F27J13 at 8 MHz.
capabilities are gravy on the biscuit. We can construct the proper C source by hand to
define our PIC selection and the clock speed of 8 MHz.
Firmware — From the Beginning However, that is not necessary. The C compiler comes
standard with a Project Wizard that does a lot of this
To be successful, we must think out our firmware manual coding work for us. Take a look at Screenshot 1.
design in the same way we have to plan and prepare our In this screen capture, we enter the PIC type, the desired
hardware design. The CCS C compiler is super capable clock frequency, and clock source. We also specify if we
and super easy to use. Thus, our firmware thought process want to debug this project’s code. A watch dog timer
shouldn’t produce a lot of ear smoke. (WDT) check box lets us decided if we want to enable the
Let’s take it from scratch. We know our target WDT or let is sleep quietly in the dog house.
microcontroller is a PIC18F27J13. According to Schematic If we move methodically and logically in our Project
1, there is no external clocking device (such as a crystal) Wizard path, the next configuration item will be
incorporated into the design. So, we can bet on using the Communications. Recall that the Moray is perfectly
PIC’s internal clocking mechanism. Since there are no capable of performing any analog functions that we know
predetermined crystal frequencies specified in the we may need at this moment. We configure the PIC’s
schematic, we can call the shots ourselves. communications resources within Screenshot 2, which is a
The PIC18F27J13 is equipped with an internal screen capture of the Project Wizard’s Communications
oscillator that ranges from 31 kHz to 8 MHz. We can use configuration window. All we need is simple RS-232
capability in a three-wire configuration (RX, TX, GND).
As you can see in the screen capture, we have
selected the PIC18F27J13’s native RS-232 port at pins C6
Lemos International
Wi-Fi Development RESOURCES and C7. The PIC18F27J13’s serial port configuration is set
for eight data bits, no parity, and one stop bit. The Moray
Board
defaults to 115200 baud and we have set our PIC serial
www.lemosint.com port up likewise. In the event that we need to use the
Microchip PIC18F27J13’s other serial port, we can provide another
CCS PICkit3 unique Stream name other than MORAY.
CCS C Compiler PIC18F27J13 Streams allow us to direct serial I/O to a specific serial
www.ccsinfo.com www.microchip.com port by name. In this case, we are only using the default
74 March 2015
■ Screenshot 4. According to Schematic 1, we
have an LED hanging on I/O pin A2. So, here we
name the LED and specify the I/O pin it is
attached to as an output pin.

■ Screenshot 3.
This may seem
trivial, but it sure
beats looking up
the interrupt
handler syntax in
the CCS C compiler
user manual.

serial port. So, we can opt to use MORAY in a stream announce its presence to the firmware. Normally, we
statement if we wish. Otherwise, we can successfully would simply code an alias for the LED and set up the I/O
execute serial operations using the PIC18F27J13’s pin that services the LED as an output. Nothing changes
EUSART without specifying a Stream name. with our C compiler except we instruct the Project Wizard
The selections you see in Screenshot 2 will generate
the necessary code to initialize the PIC18F27J13’s

One Compiler for any PIC MCU


EUSART as we have specified. The baud rate calculation ®

will use the 8 MHz clock speed we defined in Screenshot


1. One of the biggest strengths of the CCS compiler is its
built-in delay functions. By simply declaring the delay time,
the compiler can produce the code necessary to delay in
CPU cycles, milliseconds, or microseconds. The delay
functions are also based on the CPU clock speed.
Now that we have laid the groundwork for our RS-232
communications portal, we’ll need to build a framework to
deal with the data it will handle. The best way to corral
incoming RS-232 data is to use an interrupt at the corral CCS C Compilers for Microchip
gate. The CCS compiler’s Project Wizard will generate the PIC® MCUs & dsPIC® DSCs
interrupt handler skeleton, but it will not generate our
Easy to Use & Quick to Learn Highest Level of Optimization
interrupt handler code. We’ll worry about the interrupt
handler code later. Right now, let’s just get the posts in the Code is easy to port between C-Aware IDE and debugger
ground. PIC processors ZLWKFRGHSURƜOLQJ
Our corral post hole digger can be found in the Extensive & Easy-to-Use Libraries for:
Interrupts shed of the Project Wizard. All we have to do is USB Timing Serial EEs DACs Segmented LCDs
check the correct box in Screenshot 3. How do we know I2C E-mail ADCs PWM ZĞĂůͲƟŵĞĐůŽĐŬƐ
which check box to select? We are calling the shots, SPI Telnet RS232 TCP/IP ĂƉĂĐŝƟǀĞdŽƵĐŚ
remember? Let’s choose to only interrupt on received  tĞďWĂŐĞ,ŽƐƟŶŐΘŵŽƌĞ͊
characters. There is no real need to interrupt on WƌŽŐƌĂŵŵĞƌƐĞŶĂďůĞƉƌŽĚƵĐƟŽŶŝŶƚĞŐƌĂƟŽŶĨŽƌ
transmitted characters. We know what we’re sending. It’s ƐĞƌŝĂůŶƵŵďĞƌŝŶŐΘƉƌŽĚƵĐƟŽŶƟŵĞĐĂůŝďƌĂƟŽŶ͊
the responses from the Moray that are important to us.
So, we must build a firmware mechanism to capture and Download FREE Full Evaluation:
store the Moray’s responses until we’re ready to process www.ccsinfo.com/NV315
them. That’s a to-do we’ll take care of a bit later. 262-522-6500 x 35
If you add hardware, odds are you’ll also be adding [email protected]
code. If we’re going to use that “activity” LED, we have to PIC® MCU is a registered trademark of Microchip Technology Inc.

March 2015 75
■ Screenshot 5. The CCS C Compiler Project
Wizard is an interlocked set of selection
windows. If we decide to do something that
affects the decisions available elsewhere in the
process, the Project Wizard takes care of the
details.

■ Screenshot 6. There's not


a bunch to comment on
here. The check box
selections say it all.

to generate the alias and pin direction code for us. You Most of the time, the less extra fluffy stuff you see in
can see how tough an assignment this is in Screenshot 4. your source code, the better. However, I’m the kind of
All we have to do is name pin A2 (provide an alias) and guy who likes to have total visual access. So, I chose to
designate it as an output pin. That’s all there is to it. display all of the PIC18F27J13’s fuse settings. I’m also a
Now, you’re thinking we have those RS-232 pins fan of placing the opening braces of functions and such
defined. What if I accidentally “reassign” their functions? on the following line. All of that is evident in Screenshot 6.
Well, the CCS compiler software folks are way ahead of Now that you know I’m a configuration fuse freak, I verify
you. Check out Screenshot 5. The I/O pins that are this extremism by electing to populate the check boxes in
natively assigned to the EUSART have been reserved for the Fuses area of the Project Wizard. My personal fuse
that purpose. preferences are reflected in Screenshot 7.
Pins C6 and C7 are multiplexed with other functions.
Our specifying their functionality in Screenshot 2 carries What Have We Done?
over to the I/O pin definitions that reside in Screenshot 5.
Well, nothing much yet. However, with the click of
the Create Project button, an include file and a main
project file are created. Each of the newly generated files
contains code and definitions based on selections we
made in the Project Wizard windows. Here are the
contents of the main.h file:

#include <18F27J13.h>
#device ADC=16

#FUSES STVREN
//Stack full/underflow will cause reset
#FUSES NOXINST
//Legacy mode
#FUSES NOPROTECT
//Code not protected from reading
#FUSES SOSC_DIG
//Digital mode, I/O port functionality of
//RC0 and RC1
#FUSES NOCLOCKOUT
//I/O function on OSC2
#FUSES NOFCMEN
//Fail-safe clock monitor disabled
#FUSES NOIESO
//Internal External Switch Over mode disabled
#FUSES DSWDTOSC_INT
■ Screenshot 7. I really could have left these check boxes //DSWDT uses INTRC as reference clock
alone, but NOOOOO.
76 March 2015
#FUSES RTCOSC_T1 have to do is compile the code and load it into your
//RTCC uses Secondary Oscillator as reference
//source version of the PIC18F27J13-based hardware described in
#FUSES NODSBOR this text.
//BOR disabled in Deep Sleep
#FUSES NODSWDT
//Deep Sleep Watchdog Timer disabled
#FUSES DSWDT2147483648
Connecting to the Moray
//DSWDT uses 1:2147483648 Postscale
#FUSES IOL1WAY You can download the Moray schematic from the
//Allows only one reconfiguration of Ackme website (https://ack.me). You will see that all you
//peripheral pins really have to do is bypass the Moray’s USB portal. You
#FUSES ADC10
//ADC is 10-bits can power the Moray with an external +5 volt power
#FUSES MSSPMSK7 supply if you decide to tap in before the Moray’s onboard
//MSSP uses 7 bit Masking mode
#FUSES WPFP voltage regulator. You will only need a +3.3 volt supply if
//Write/Erase Protect Page Start/End Location you bypass the regulator all together. The Moray’s UART
#FUSES NOWPCFG Rx and Tx signals are available at the Moray’s male I/O
//Configuration Words page is not
//erase/write-protected header.
#FUSES WPDIS The Moray technical documentation describes in
//All Flash memory may be erased or written detail the commands and responses that pass over the
#FUSES WPEND
//Flash pages WPFP to Configuration Words serial connection. You can emulate the sequences by
//page protected sending them to the PIC18F27J13 using the terminal
#device ICD=TRUE emulator. The CCS C compiler IDE debugger allows you
#use delay(internal=8000000) to peek into the PIC18F27J13’s EUSART receive ring
#use FIXED_IO( A_outputs=PIN_A2 ) buffer and examine the Moray’s responses.
#define user_led PIN_A2
Thanks to the CCS compiler and a PIC18F27J13, you
#use rs232(baud=115200,parity=N,xmit=PIN_C6,rcv= can now add embedded Wi-Fi to your Design Cycle. NV
PIN_C7,bits=8,stream=MORAY)

Following the inclusion of the PIC hardware definition


file 18F27J13.h, all of the fuse settings we selected and the The Convenient All-in-One Solution
default fuse settings are exposed to the compiler. Recall
for Custom-Designed Front Panels & Enclosures
that we opted to have a means of debugging the code,
which resulted in the #device ICD=TRUE directive. You
FREE
can also see the obvious declarations alluding to the delay Software
functions’ time base, the LED I/O pin, and the LED alias,
respectively. The final line of code in the main.h file sets ONLY $90.24
up the PIC18F27J13’s EUSART with a CCS compiler #use with custom
logo engraving
rs232 directive. All of the directive code that follows the
fuse declarations replaces code we would normally write
to set up the CPU clock and LED I/O pin. You d
Y design
i it We machine it
to your specifications using and ship to you a
our FREE CAD software, professionally finished product,
To-Dos No More Front Panel Designer no minimum quantity required

I’ve filled in the blanks. The receive interrupt skeleton  ost effective prototypes and production
O
C
generated by the Project Wizard has been populated with runs with no setup charges
a nifty serial receive interrupt handler that feeds a 256- OPowder-coated and anodized finishes in

byte circular buffer. I’ve also written a function called various colors
recvchar that pulls characters out of the circular buffer in O
Select from aluminum, acrylic or provide
the order in which they arrive. There’s also a routine to your own material
check for characters in the circular buffer that are yet to O Standard lead time in 5 days or express
be retrieved. The main application blinks the activity LED manufacturing in 3 or 1 days
every 100 mS and looks for incoming characters. All
incoming characters are echoed back to the sender.
So, all you have to do is hook up the PIC18F27J13/
PmodUSBUART combination to a PC USB port and kick FrontPanelExpress.com
off your favorite terminal emulator. I’ve provided the C
1(800)FPE-9060
source code for download at the article link, so all you
March 2015 77
TECHFORUM READER-TO-READER

>>> QUESTIONS >>> ANSWERS here are three possible causes to


check:
X10 Cable Build [#2152 - February 2015] 1. Is the output voltage correct?
I have an early X10 Home Control Battery Dilemmanator Check with a DVM; anything from
Timer (Model CP-290) to which I have About three years ago, I put 1.35V to 1.6V should be okay for LCD
lost the programming cable. Does together a 1.5 volt battery eliminator or quartz clocks.
anyone know where I can get the using a wall wart feeding into an 2. The power supply has excessive
pinout so I could fashion my own LM4120 regulator to power the clocks AC in the output, e.g., a bad capacitor.
replacement cable? I have around the house. The clock Though you could check this with an
#3151 Leigh Guzman that I started with is a Howard Miller audio amplifier or oscilloscope, it's
Oxnard, CA mantle clock that a company awarded easier to just put a 500 microfarad or
to me for busting my ass for 25 years. larger electrolytic cap across the out-
Lightning Protector After installing the eliminator, I set put and see if that fixes the issue.
In a recent thunderstorm, a the clock to the time of my crack 3. AC or RF leakage from the power
nearby lightning strike took out some atomic wristwatch and let'er go. The supply — either from the mains or from
of the electronics at my neighbor’s clock ran for almost three years with a nearby radio transmitter — is making
house. Is there anything a DIY'er like phenomenal accuracy, matching my its way into the clock. The clock cir-
me can build to protect my delicate watch within a few seconds but finally cuitry is very low power, so any AC
electronics — other than unplugging died — probably from exhaustion — could flip some flip-flops a few extra
everything? Something with MOVs having gotten no rest between battery times per second. To check this, you
maybe? exchanges. could make a Faraday cage (e.g., win-
#3152 Matthew Hodges Well, I thought, what are you dow screening) around the clock and
Wichita, KS waiting for. Get with it with the other connect it to one side of the supply.
cheap clocks cluttering up our house; This is to satisfy your intellectual
PCB Chem Disposal so, I did. To my amazement, none of curiosity, though it's probably not a
I’m interested in photo etching the clocks running on the eliminator convenient way to run a clock.
copper-clad PCBs. Most guides don't could keep time anywhere near what B. Bresnik
say what to do with the chemicals could be termed accurate — no matter via email
when I'm done. Do I just pour them how much I adjusted the voltage
down the drain or will it hurt the (usually, the clocks ran fast). #3 First off, I suggest the following:
environment (or my pipes?). So, what gives? Why does a 1. Measure the OPEN-CIRCUIT out-
#3153 Gerardo Rios battery work and my eliminator won't? put of your eliminator before connect-
Phoenix, AZ ing it to the clock you want to run.
#1 I recommend looking at the 2. Connect the eliminator to the
Arduino Remote LM4120 output with a DC coupled clock, then measure the voltage out-
My Sony BluRay/DVD player oscilloscope and checking for noise or put again.
came with a very complicated remote voltage drift, either short-term or long- If the difference between the "no-
control. I don't need half the buttons! term. I think you will see the problem. load" voltage and "load" voltage is
Is it possible to make a simplified John Keller more than 0.5 VDC, it's entirely possi-
replacement remote using an Arduino via email ble your wart isn't delivering enough
and simple buttons with an IR-LED? current to properly operate the regula-
#3154 Terence Rodriquez #2 Without more information, it's tor. In this case, try a similar-voltage
Raleigh, NC difficult to give a definite answer, but wart with higher current output (say,
1.5-2X of your current wart). This may
All questions AND answers are by readers and NO GUARANTEES solve the problem as wall wart outputs
submitted by Nuts & Volts readers and WHATSOEVER are made by the tend to droop severely once you
are intended to promote the exchange publisher. The implementation of any
of ideas and provide assistance for answer printed in this column may re- approach their maximum current
solving technical problems. All quire varying degrees of technical capability, resulting in severe output
submissions are subject to editing and experience and should only be instability (i.e., the regulator won't
will be published on a space available attempted by qualified individuals. "regulate" well), increased ripple, noise
basis if deemed suitable by the Always use common sense and on the DC output, and severely short-
publisher. Answers are submitted good judgment! ening the life of the wart (i.e., over-
78 March 2015
> > > 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 [email protected]


or via the online form at www.nutsvolts.com/tech-forum
heating and such). too much current from the wart. in this application. My personal choice
If the "no-load/load" voltage differ- Ken Simmons would be the 1N60 because the doc-
ence is negligible (<0.1 VDC), try Auburn, WA umentation available for this device is
adding a filter capacitor (start with a superior, with V-I curves to show the
470 µF electrolytic — watch the volt- [#2153 - February 2015] typical forward voltage characteristic.
age rating of the cap!) paralleled with Diode Decision Peter A. Goodwin
a 0.01 µF mica or polyester to filter out Can you PLEASE indicate which Rockport, MA
high-frequency hash that may be on germanium diode would best fit this
the DC output feeding the clock. This SW radio? Either a 1N34A or 1N60? #2 Either should work well. Both
may give you the stability you're look- have a conduction knee starting
ing for as most — if not all — warts are #1 Both diodes — 1N34 and 1N60 around 0.15 or 0.20 volts. The
half-wave unregulated types with very — are germanium diodes, and both are IN60 — being slightly newer — proba-
minimal filtering to begin with. Adding of similar physical size. The important bly has more tightly-controlled specs.
more filtering (larger electrolytic) and thing is that this diode family has the Here’s a source for diodes and their
bypass (small value) caps to the DC smallest forward voltage characteristic, specifications: http://store.american-
output greatly improves their overall which is important for rectification of microsemiconductor.com/1n60.html
stability and cleanliness of the DC out- small voltages. They both will operate and http://store.americanmicrosemi-
put voltage. at radio frequencies. The forward cur- conductor.com/1n34a.html. BTW, for
Finally (as you already know), hav- rent rating and the reverse voltage better Q of the tuner, connect the
ing a regulator between the wart and characteristics are unimportant in this diode to a tap on the coil.
your device guarantees a rock solid application. B. Bresnik
DC source, as long as you don't pull Bottom line: Either one will work via email

March 2015 79
TECHFORUM
READER-TO-READER

Send all questions and answers by email to [email protected]


or via the online form at www.nutsvolts.com/tech-forum
#3 You can use either type and column labeled Measured Vr: ed to selectivity) — with this type of
expect the same results. Both diodes http://wiki.waggy.org/dokuwiki/crys- circuit, as you increase frequency, the
are germanium and both have a for- tal_radio/detector. However, long bandwidth increases. This means it
ward voltage drop (often called “turn- before the sensitivity of the diode lets through more and more stations at
on” voltage — where a diode begins becomes the limiting factor, four other the same time.
conducting) of about 0.3V. A diode factors will limit the performance of If you haven’t had the opportunity
with even lower forward voltage is the the radio you propose. Those are: to read them, you’ll probably find the
1N5817 — a Schottky diode — which Selectivity — only one tuned circuit insights in the Wiki entry on crystal
has a forward voltage of about 0.16 is used and it is not impedance radios time saving. Especially note the
volts. The forward voltage determines matched at input or output. sections on tuned circuits, impedance
how weak a signal can be heard. Antenna length — definitely use matching, and the problem of selectiv-
The author at the following URL more than 10 feet — a goal would be ity. It can be found at http://en
presents a comprehensive table of 50 feet and as high as possible. .wikipedia.org/wiki/Crystal_radio.
1N34 and 1N60 subtypes and a few Ground losses — connect a wire to The following URL shows how to
Schottky diodes used as detectors in earth or to a large expanse of metal. connect your tuning circuit and diode
crystal radios. If you view it, look in the Frequency of operation (also relat- directly to your LM386 without
the LM741 you have in the middle of
the circuit: http://makerf.com/posts/
an_lm386_powered_crystal_radio_in
_an_altoids_smalls_tin.
You specified a number of turns
for your coil but I didn’t see any diam-
eter for it. Starting coil designs would
be 56 turns for a five inch diameter
oatmeal box or 75 turns on a 2-1/8
inch diameter coil — each of which
could be used with your 365 pf vari-
able capacitor; 22 to 24 AWG bare
enameled wire would work for the 5"
diameter; 28 to 30 AWG would work
for the 2-1/8" diameter.
To help optimize selectivity, you
want what's called a "square coil." This
means the coil length is about equal to
the diameter. Not critical, but helpful.
Small diameter wire increases resist-
ance which degrades selectivity. It’s
likely to be less frustrating to first
get your design working at the lower
AM broadcast band frequencies
before pushing up into the shortwave
frequencies.
Last, it looks like you might put
taps on your coil. The following
URL has photos that might give you
helpful ideas: www.midnightscience
.com/downloadfiles/XSOB1-manual-
050108.pdf. Once on the website,
click on the “Oatmeal box crystal set.”
Please accept my apologies if I've
included too much information. Best
wishes for your success.
David Tancig
Columbia, SC
80 March 2015
READER FEEDBACK
programming my PICAXE projects for
Continued from page 45

function effectively as a breadboard Notice to Smiley’s


several years now, and I've never had power supply.
a problem that was caused by the Even so, I appreciate your Workshop column fans:
USB power supply. (I do include a drawing attention to this issue. If I see Unfortunately, Joe Pardue will not be
bypass capacitor on each of the two any USB power-related problems in able to continue his popular series at
sets of breadboard power rails.) Based the future, I'll report them in the this time. However, we do hope to
on the results I saw on the scope, I Primer. Thanks!
have his column back in as soon as
think a 5V USB wall wart would also Ron Hackett
it is possible for him to return.

■L O O K F O R ■S E A R C H F O R
Find your favorite advertisers here!
■F I N D
ADvertiser INDEX
AMATEUR RADIO DATA ACQUISITION MISC./SURPLUS Accutrace Inc.. .....................17
AND TV Measurement Computing ...........63 All Electronics Corp. ....................9
All Electronics Corp. ..............9
Alpha Node Hub ........................66 Front Panel Express LLC ..........77
National RF ................................20 DESIGN/ENGINEERING/ Weirdstuff Warehouse ...............20 Alpha Node Hub ..................66
Ramsey Electronics ................82-83 REPAIR SERVICES Anaren ...................................5
Accutrace Inc.. ..........................17 PCB ASSEMBLY AP Circuits ...........................44
ANTENNA Cleveland Institute of Electronics.66 Accutrace Inc.. ..........................17
Alpha Node Hub ........................66 ExpressPCB ..............................29 Boxed Kit Amps ...................20
Front Panel Express LLC ..........77 PROGRAMMERS CH Robotics ........................17
BATTERIES/CHARGERS Images Co. ................................28 M.E. Labs ...................................35 Cleveland Institute of
Cunard Associates ....................20 National RF ................................20 MikroElektronika ..........................3
PCB Pool ...................................28 Electronics ...........................66
BUYING ELECTRONIC RF TRANSMITTERS/ Command Productions ..........7
SURPLUS DIGITAL RECEIVERS Cunard Associates ..............20
All Electronics Corp. ....................9 OSCILLOSCOPES Anaren .........................................5 Custom Computer Services 75
Earth Computer Technologies .........6 Rigol Technologies ...................16 National RF ................................20
Weirdstuff Warehouse ...............20 Dimension Engineering ........62
EDUCATION ROBOTICS Earth Computer Technologies ...6
CCD CAMERAS/VIDEO Boxed Kit Amps .........................20 Cleveland Institute of Electronics.66 Electronix Express ...............34
Ramsey Electronics ................82-83 Cleveland Institute of Electronics.66 Robot Power .............................20
Command Productions ................7 ExpressPCB ........................29
CIRCUIT BOARDS LF Components..........................71 SATELLITE Front Panel Express LLC ....77
Accutrace Inc.. ..........................17 NKC Electronics ........................20 Team Synergy Moon .................79 Images Co. ..........................28
AP Circuits ................................44 Poscope .....................................29
Cunard Associates ....................20 SENSORS LF Components....................71
Dimension Engineering ..............62 EMBEDDED TOOLS CH Robotics ..............................17 Maker Faire ..........................21
ExpressPCB ..............................29 NetBurner ....................................2
M.E. Labs .............................35
Front Panel Express LLC ..........77 TEST EQUIPMENT
PCB Pool ...................................28 ENCLOSURES Dimension Engineering ..............62
Measurement Computing .....63
Saelig Co. Inc. ............Back Cover Front Panel Express LLC ..........77 MikroElektronika ....................3
Images Co. ................................28
Measurement Computing ...........63 National RF ..........................20
COMPONENTS ETHERNET NKC Electronics ........................20
Custom Computer Services ......75 NetBurner ..............................2
All Electronics Corp. ....................9 Poscope .....................................29
Anaren .........................................5 Rigol Technologies ...................16 NKC Electronics ..................20
EVENTS
Electronix Express ....................34 Maker Faire ................................21 Saelig Co. Inc. ............Back Cover PanaVise .............................17
LF Components..........................71 RoboGames ..............................80 PCB Pool .............................28
Trenton Computer Show ............45 TOOLS
COMPUTER MikroElektronika ..........................3 Poscope................................29
Hardware HI-FI AUDIO NetBurner ....................................2 Ramsey Electronics ..........82-83
Earth Computer Technologies .........6 Boxed Kit Amps .........................20 PanaVise ...................................17 Rigol Technologies .............16
Weirdstuff Warehouse ...............20 Poscope .....................................29
RoboGames ........................80
KITS & PLANS
Microcontrollers / Boxed Kit Amps .........................20 WAVEFORM Robot Power ........................20
I/O Boards Custom Computer Services ......75 GENERATORS Saelig Co. Inc. ......Back Cover
Custom Computer Services ......75 Earth Computer Technologies .........6 Rigol Technologies ...................16 Team Synergy Moon ...........79
Images Co. ................................28 LF Components..........................71
M.E. Labs ...................................35 NetBurner ....................................2 WIRELESS PRODUCTS Technologic Systems ...........15
MikroElektronika ..........................3 NKC Electronics ........................20 Anaren .........................................5 Trenton Computer Show ......45
Technologic Systems ................15 Ramsey Electronics ................82-83 Measurement Computing ...........63 Weirdstuff Warehouse .........20

March 2015 81
Four-Mode Keyless
Entry Test Set
Just like the days of "plugs,
points, and condenser" are
over, so are the days of having
the hardware store grind
out a spare key for your
Super-Pro FM Stereo Radio Station SPRING! car!
✔ PLL synthesized for drift-free operation SA LE
✔ Built-in mixer - 2 line inputs and one microphone Now when your keyless
input, line level monitor output! access system doesn't work,
✔ Frequency range 88.0 to 108.0, 100 kHz steps you need to accurately detect what part of the system
✔ Precision active low-pass “brick wall” audio filter! is malfunctioning. This could be anything from a dead
✔ Dual LED bar graph audio level meters! battery in the key fob, a "brain-dead" key fob, to mal-
✔ Automatic adjustable microphone ducking! functioning sensors, antennas, or other system compo-
✔ Easy to build through-hole design! nents in the vehicle. Until now there was no way to
determine where the system was failing.
The true professional workhorse of our FM Stereo transmitter line, the FM100B has
become the transmitter of choice for both amateurs and professionals around the world. From the Testing your system is easy. To test the complete 125
serious hobbyist to churches, drive-in theaters, colleges and schools, it continues to be the leader. Not just a kHz/315 MHz communications path just stand close to
transmitter, the FM100B is a fully functional radio station and provides everything but the audio input and anten- the vehicle with the WCT3 and your key fob in hand.
na system! Just add that and you’re on the air! Press the test button and the WCT3 will detect and
display the presence of the vehicle's 125kHz/20KHz
This professional synthesized transmitter is adjustable directly from the front panel with a large LED digital read- signal and, if they "handshake", will also detect and
out of the operating frequency. Just enter the setup mode and set your frequency. Once selected and locked display the presence of your key fob's 315MHz return
you are assured of a rock stable carrier with zero drift. The power output is continuously adjustable throughout signal. You can independently test key fob only sig-
the power range of the model selected. In addition, a new layer of anti-static protection for the final RF amplifi- nals (panic, lock, trunk, etc.) by holding the key fob
er stage and audio inputs has been added to protect you from sudden static and power surges. near the WCT3, pressing the test button, and pushing
the function button on the key fob.
Audio quality is equally impressive. A precision active low-pass brick wall audio filter and peak level limiters give
your signal maximum "punch" while preventing overmodulation. Two sets of rear panel stereo line level The same functionality testing can be done with IR key
inputs are provided with front panel level control for both. Standard unbalanced “RCA” line inputs fobs. The modulated IR signal is detected and will
are used to make it simple to connect to the audio output of your computer, MP3 player, DVD illuminate the IR test LED on the test set.
player, cassette deck or any other consumer audio source. Get even more creative and use
our K8094 below for digital storage and playback of short announcements and ID’s! In addi- If you know a few "secrets" you can also see if the tire
tion to the line level inputs, there is a separate front panel microphone input. pressure sensors/transmitters are generating signals or
the built-in garage door opener in your rear view mir-
All three inputs have independent level controls eliminating the need for a separate audio mixer! ror is transmitting a signal! Runs on a standard 9V
Just pot-up the source control when ready, and cross fade to the 2nd line input or mic! It’s that battery. Also available factory assembled & tested.
simple! In addition to the dual stereo line inputs, a stereo monitor output is provided. This is perfect to drive
studio monitors or local in-house PA systems. The FM100B series includes an attractive metal case, whip anten- WCT3 Keyless Entry Test Set Kit $59.95
na and built in 110/220VAC power supply. A BNC connector is also provided for an external antenna. Check
out our Tru-Match FM antenna kit, for the perfect mate to the FM100B transmitter. We also offer a high power
kit as well as an export-only assembled version that provides a variable RF output power up to 1 watt. The 1 Air Blasting Ion Generator
watt unit must utilize an external antenna properly matched to the operating frequency to maintain a proper Generates negative ions along with a
VSWR to protect the transmitter. hefty blast of fresh air, all without any
(Note: The FM100B and FM100BEX are do-it-yourself learning kits that you assemble. The end user is responsible for complying with all FCC noise! The steady state DC voltage
rules & regulations within the US or any regulations of their respective governing body. The FM100BWT is for export use and can only be
shipped to locations outside the continental US, valid APO/FPO addresses or valid customs brokers for documented end delivery outside the generates 7.5kV DC negative at 400uA,
continental US.) and that’s LOTS of ions! Includes 7 wind
tubes for max air! Runs on 12-15VDC.
FM100B Super-Pro FM Stereo Radio Station Kit, 5uW to 25mW Output $239.95
FM100BEX Super-Pro FM Stereo Radio Station Kit, 5uW to 1W Output $299.95 IG7 Ion Generator Kit $64.95

Digital Voice Changer Collinear Vertical FM Antenna HV Plasma Generator


This voice changer kit is a riot! Our 5/8 wave omni antenna has been the Generate 2” sparks to a handheld
Just like the expensive units you standard for LPFM insallations worldwide. screwdriver! Light fluorescent tubes
hear the DJ’s use, it changes your voice Provides 3.4dB gain while keeping the sig- without wires! This plasma genera-
with a multitude of effects! Features a nal radiation low to the horizon for maxi- tor creates up to 25kV at 20kHz from a
built-in microphone and both a speaker and line out- mum range. Field tuneable over the entire FM range solid state circuit! Build plasma bulbs from
put. Runs on a standard 9V battery, not included. for a perfect match. SO239 connector for PL259 plug. regular bulbs and more! Runs on 16VAC or 5-24VDC.
MK171 Digital Voice Changer Kit $14.95 FMA200E Omnidirectional FM Antenna $119.95 PG13 HV Plasma Generator Kit $64.95

Audio Recorder & Player Logic Interface Module Signal Magnet Antenna
Record and playback up to 8 minutes of Interface your digital output to the The impossible AM radio anten-
messages from this little board! Built-in real world with an on-board SPDT na that pulls in the stations and
condenser mic plus line input, line & relay rated at 240V at 10A! It takes a digital removes the noise, interference,
speaker outputs. Adjustable sample rate low (.5VDC or less) or a high (+1 to +12VDC) and and static crashes from your radio! Also
for recording quality. 4-switch operation that can be provides your choice of an active low or high closure! helps that pesky HD AM Radio stay
remote controlled! Runs on 9-12VDC at 500mA. It’s that simple! Runs on 12VDC at 60mA. locked! Also available factory assembled.
K8094 Audio Recorder/Player Kit $32.95 RI1 Logic Interface Kit $17.95 SM100 Signal Magnet Antenna Kit $89.95

!
Passive Aircraft Monitor ATENTED Tunable AM Radio Transmitter Broadband RF Preamp
P Need to “perk-up” your counter or
The hit of the decade! Our patented receiv- The AM1 is a great first kit and a fine
er hears the entire aircraft band without any low power AM broadcaster for other equipment to read weak sig-
tuning! Passive design has no LO, therefore the hobbyist on a budget. It’s nals? This preamp has low noise and
can be used on board aircraft! Perfect for a great way to learn the basics yet provides 25dB gain from 1MHz to well
airshows, hears the active traffic as it hap- of AM broadcast technology, over 1GHz. Output can reach 100mW! Runs on
pens! Available kit or factory assembled. not to mention basic soldering 12 volts AC or DC or the included 110VAC PS. Assmb.
and component identification (if PR2 Broadband RF Preamp $69.95
ABM1 Passive Aircraft Receiver Kit $89.95 you’re a beginner!). The transmitter can be
tuned to broadcast anywhere in the AM band (550 to
Laser Trip Sensor Alarm 1600 kHz). Setting frequency is simple. Active Receive Antenna
True laser protects over 500 With 100 mW of output power, range can be up to ¼ The popular antenna for the serious
yards! At last within the mile. Connect any line level audio source from your DX’ers works on all bands - shortwave,
reach of the hobbyist, this neat kit uses a standard HF, VHF, and UHF yet performs like a
laser pointer (included) to provide both audible and CD player, tape deck, or mic mixer to the RCA input on 60’ long wire antenna! Provides over
visual alert of a broken path. 5A relay makes it simple the rear panel of the AM1C and you’ll be on the air. 15dB of gain, and includes auto-off
to interface! Breakaway board to separate sections. It’s that simple! RF bypass and front panel gain control.
LTS1 Laser Trip Sensor Alarm Kit $29.95 AM1C Tunable AM Radio Xmtr Kit $34.95 AA7C Active Antenna Kit $59.95

There’s only so much room on these two


pages, so check it all out in our new vir-
tual electronic catalog! Flip through the
Follow Us and SAVE $$
Follow us on your favorite network site and
pages and search with ease! Visit look for a lot of super deals posted frequently...
www.ramseycatalog.com exclusively for our followers!
8-Channel Remote Ethernet Controller
Now you can easily control and monitor up to 8 separate circuits via the standard Ethernet network in your home
or office. Connection wise it couldn't be simpler. The controller functions as an IP based web server, so it can
be controlled by any internet browser that can reach your network! There are no drivers or proprietary software
required, just access the controller like any web page from your PC, laptop, or even your smartphone!
Security is assured allowing up to 4 separate user credentials. The controller can be set to a specific static
IP within your network subnet or can be set to DHCP (auto negotiate). The controller can even be pro-
grammed to send you an email to notify and confirm power up and status changes!

To simplify the connection of your equipment to the controller, 8 separate and isolated relay outputs are provided! This
gives you internet or network control of up to 8 separate functions. No need to worry about interfacing a logic high
or logic low, or burning up the interface! The applications are endless! From something as simple as turning on and moni-
toring lights at your house with a normal latched closure to advanced control of your electronic gadgets, radio equipment, or
even your garage door! Each relay contact is rated at 12A at 30VDC or 16A at 230VAC. Each of the 8 channels has built-in timer and
scheduler programs for day, weekend, working days, every day, and every day except Sunday. Relay control functions are programmable for on, off,
or pulse (1-99 seconds, 1-99 minutes, or 1-99 hours). In addition to control functions, the web interface also displays and confirms the status of
each channel. Each channel can be custom labeled to your specific function name. The controller operates on 12VDC or 12VAC at 500mA or our
new AC121 global 12VDC switching power supply below. Factory assembled, tested, and ready to go! Even includes a Cat-5 cable!
VM201 8-Channel Remote Ethernet Controller, Factory Assembled & Tested $169.95

Laser Beam Audio Communicator


Now you can talk to your friends over one of the most secure long-distance transmission types
available, a laser beam! The transmitter uses a microphone or external audio to modulate a laser
beam on and off at a rate of more than 16kHz so the audio fidelity is much better than that of a stan-
dard 3kHz telephone line!

The receiver includes filtering to remove the 16kHz carrier and leave behind the high quality audio, and then boost its level for use with earphones. Transmitter audio AGC
keeps your level perfect! Includes transmitter, receiver and laser pointer. Each runs on a 9V battery (not included).
LBC6K Laser Beam Audio Communicator Kit $59.95

Precision PC Plane Antennas Stereo Ear Super Audio Amp Tone Encoder/Decoder
Our LPY series PC antennas con- This “Stereo Ear” amp is one of the Encode and decode with the
tinue to be the favorite for virtu- neatest and handiest high gain same kit! This little mini-kit
ally all RF and wireless applica- amps you will find! Dual high sensi- will simultaneously encode
tions. From microwave links, tivity electret mics are amplified 50x and/or decode any audio frequen-
wireless mics, to RFID, we’ve got you cov- to provide the ultimate stereo source! cy between 40Hz and 5,000 Hz!
ered. Check our site for details! Output is 3.5mm jack, runs on 3ea AAA’s. Precision 20-turn trim pot adjustment! 5-12VDC.
LPYSeries Precision PC Plane Antennas from $29.95 MK136 Stereo Ear Audio Amplifier Kit $9.95 TD1 Tone Encoder/Decoder Kit $9.95

Tickle-Stick Shocker Laser Light Show Optically Isolated Module


The kit has a pulsing 80 volt tickle Just like the big concerts, you The hobbyist's headache solver!
output and a mischievous blink- can impress your friends with Converts any AC or DC signal to
ing LED. And who can resist a your own laser light show! logic level. The beauty is that
blinking light and an unlabeled Audio input modulates the the input and output are totally iso-
switch! Great fun for your desk, “Hey, laser display to your favorite music! lated from each other! Output can drive
I told you not to touch!” Runs on 3-6 VDC. Adjustable pattern & speed. Runs on 6-12VDC. up to 150mA at 40VDC.
TS4 Tickle Stick Kit $9.95 LLS1 Laser Light Show Kit $49.95 OM2 Optically Isolated Module Kit $16.95

RF Preamplifier 12VDC Regulated Switching Supply Classic Nixie Tube Clocks HOT SELLER!
The famous RF preamp that’s been Go green with our new 12VDC 1A
written up in the radio & electronics regulated supply. Worldwide input
magazines! This super broadband preamp 100-240VAC with a Level-V efficien-
covers 100 KHz to 1000 MHz! Unconditionally stable cy! It gets even better, includes DUAL
gain is greater than 16dB while noise is less than 4dB! ferrite cores for RF and EMI suppression. All this
50-75 ohm input. Runs on 12-15 VDC. at a 10 buck old wallwart price! What a deal!
Our next generation
SA7 RF Preamplifier Kit $16.95 AC121 12VDC 1A Regulated Supply $9.95 of classic Nixie tube
clocks perfectly mesh
today's technology with
Touch Switch 12VDC Worldwide Supply the Nixie era technology of the 60's. Of course, fea-
The ultimate touch switch! It gets even better than our AC121 tures you'd expect with a typical clock are all support-
Touch once - it’s on, touch again above! Now, take the regulated ed with the Nixie clock... and a whole lot more!
- it’s off, or use the momentary Level-V green supply, bump the cur-
outputs that stay on only as long as rent up to 1.25A, and include multi- The clocks are programmable for 12 or 24 hour mode,
touched. Two switch circuits on each board. Drives ple blades for global country com- various AM/PM indications, programmable leading
loads up to 100mA. Runs on 6-12VDC. patibility! Dual ferrite cores! zero blanking, and include a programmable alarm with
snooze as well as date display, 4 or 6 tube, kit or
TS1 Touch Switch Kit $9.95 PS29 12VDC 1.25A Global Power Supply $19.95 assembled!

Tri-Field Meter Kit Electronic Watch Dog We then jumped the technological time line of the
60's Nixie displays by adding the latest multi-colored
“See” electrical, magnetic, and RF fields as A barking dog on a PC board! And you LEDs to the base of the Nixie tubes to provide hun-
a graphical LED display on the front panel! don’t have to feed it! Generates 2 different dreds of illumination colors to highlight the glass
Use it to detect these fields in your selectable barking dog sounds. Plus a built-in tubes! The LED lighting can be programmed to any
house, find RF sources, you name it. mic senses noise and can be set to bark when color and brightness combination of the colors red,
Featured on CBS’s Ghost Whisperer to it hears it! Adjustable sensitivity! Unlike my green, or blue to suit your mood or environment.
detect the presence of ghosts! Req’s 4 AAA batteries. Greyhound, eats 2-8VAC or 9-12VDC, not fussy!
Then we leaped over the technological time line by
TFM3C Tri-Field Meter Kit $74.95 K2655 Electronic Watch Dog Kit $39.95 integrating an optional GPS time base reference for
the ultimate in clock accuracy! The small optional GPS
Telescopic Whip Antenna Sniff-It RF Detector Probe receiver module is factory assembled and tested, and
plugs directly into the back of the clock to give your
Ideal for handheld portables, receivers, and communi- Measure RF with your standard Nixie clock accuracy you could only dream of!
cations test equipment. Professional chrome finish DMM or VOM! This extremely sensi-
with integral swivel mounted BNC connector matches tive RF detector probe connects to The clocks are available in our signature hand rubbed
virtually any application whether top mounted or 90 any voltmeter and allows you to Teak & Maple, or futuristic clear acrylic bases. You also
degree rear panel mounted. Whip extends 5.25” to measure RF from 100kHz to over 1GHz! So sensitive it have your choice of IN-14 or highly sought after IN-8-2
27.75” to cover a wide variety of frequencies. can be used as a RF field strength meter! nixie tubes (for the 6-tube clock).
WA10 Telescopic Whip Antenna, BNC $14.95 RF1 Sniff-It RF Detector Probe Kit $27.95 NIXIE Classic Nixie Tube Clock Kits From $229.95

GET THE
Mention or enter the coupon code
DISCOUNT! 800-446-2295 RAMSEY ELECTRONICS®
590 Fishers Station Drive
NVRMZ142 and receive 10% off www.ramseykits.com Victor, NY 14564
(800) 446-2295
your order! Prices, availability, and specifications are subject to change. Not responsible for typos, mistakes, stupids, or confusion that Spring is
even approaching! Robin gave me an extra week to dig out of “Storm Juno” and prepare this Spring ad! How ironic is that! Visit (585) 924-4560
®
www.ramseykits.com for the latest pricing, specials, terms and conditions. Copyright 2015 Ramsey Electronics .. so there!

You might also like