Nutsvolts201503 DL
Nutsvolts201503 DL
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
EVOLUTION.
2005
1945
1905
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
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
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
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.
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
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.
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
www.CHRobotics.com
ww
www.CHRobotics.com
w.CHRobotics.com
March 2015 17
■ HARDWARE
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
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.
BUILD A FREQUENCY
COUNTER
By Jim 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
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
YEARS
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
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.
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.
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
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.
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.
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.
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.
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.
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
PHOTO 2.
The
PAM8610
amplifier
module,
with its all
surface-
mount
construction.
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.
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
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 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
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.
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
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.
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.
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.
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
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
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
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
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
70 March 2015
CLASSIFIEDS
SURPLUS WIRE/CABLE ROBOTICS
LIGHTING
CONTROLLERS
Join The
from $119
TRIANGLE
RESEARCH
INTERNATIONAL
March 2015 71
THE DESIGN CYCLE
■ BY FRED EADY
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
■ 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
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.
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)
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
March 2015 79
TECHFORUM
READER-TO-READER
■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
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
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
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
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!