Sie sind auf Seite 1von 68

D930SW D954SW D955TW

Operating Voltage Range 4.8V ~ 7.4V


No Load Speed Range 0.11 ~ 0.07 Sec @ 60 0.19 ~ 0.12 Sec @ 60
8.0 ~ 13.0 kg-cm 18.0 ~ 29.0 kg-cm 18.0 ~ 29.0 kg-cm
Peak Torque Range
112 ~ 182 oz-in 251 ~ 404 oz-in 251 ~ 404 oz-in
Maximum Current Draw 5,200mA
Dimensions 40.0 x 20.0 x 37.0mm / 1.57 x 0.78 x 1.46 in
Weight 66g / 2.33 oz 68g / 2.40 oz 66g / 2.33 oz

Hitec continues to expand our innovative D-Series servo line with the latest introduction of our Premium trio, the D930SW,
D954SW and D955TW. Powered by our 32-bit MCU (Microcontroller Unit) and 12-bit ADC (Analog to Digital Converter)
industrial science, this high-resolution, ultra-durable gear group delivers exactly what you need and have come to expect
from Hitec. Our D930SW is the perfect upgrade from the HS-8330SH; the D954SW replaces the HS-7954SH while the
D955TW is the advanced version of the HS-7955TG. Servo Engineering Reimagined!!!

Hitec RCD USA, Inc. | 12115 Paine Street | Poway, CA 92064 | (858) 748-6948 | www.hitecrcd.com |

Full Page.indd 2 7/4/2017 7:02:54 PM


Full Page.indd 3 7/4/2017 7:08:39 PM
TOC - Aug 17_TOC NV Mar 15.qxd 7/4/2017 6:24 PM Page 4

Subscription Information

August 2017 Nuts & Volts PO Box 15277


North Hollywood, CA 91615-9218
Call 877-525-2539 or go to www.nutsvolts.com
Subscribe Gift Renewal Change of Info
For more details on subscribing, see our ad on Page 64.

20 An NV Total Eclipse of the Sun 31 Build a Geiger Counter to


Use a 3D printed Nuts & Volts (or SERVO Magazine!)
pinhole solar projector to view the total eclipse of the sun Monitor a Radioactive Cat
happening in the US this month. When my cat, Maxwell, needed radiation for an over-
By Dave Prochnow active thyroid, a Soviet era surplus Geiger tube and an
Arduino Uno were pressed into service to monitor the
cats (and cat poop!) radiation levels to determine when
24 Use Wi-Fi and X-10 in a Bi- Maxwell was safe to handle and the treatment was
complete.
Lingual Approach to Light and By Eric Bogatin

Appliance Control
Breathe new life into your X-10 home control system by 42 Solar Intensity Monitor
using a combination of the ESP8266 Wi-Fi module, some Applying a data acquisition system (DAQ) to record
off-the-shelf SmartSocket Wi-Fi modules, and the ever sunlight intensity throughout the day makes for a fun and
popular Arduino Uno. This project gives you web-based interesting project. By using an Arduino Uno and the
control of your legacy system. MakerPlot Data Acquisition software, the required
By Ronald hardware is minimal, and working through the related
Gladney software
challenges is a
great learning
experience.
By Ken Fisher

Columns
08 Q&A 51 Open Communication
Reader Questions Answered Here The Latest in Networking and
Topics discussed this month: Wireless Technologies
NiCd Charger Options for Battery Longevity Going the Distance with Wireless
A Closer Look at Different Types of LCD Display Theres a growing need for wireless technologies that can
Technologies cover longer distances. Such applications are usually
12 Near Space industrial in nature. The traditional wireless standards
generally do not have the range capability to handle such
Approaching the Final Frontier use cases. As a result, a whole new batch of wireless
Factors Controlling Balloon Flights and technologies has emerged to fulfill the need for longer
Predicting Balloon Landing Zones range. Here is a summary of these new standards.
Near space flight equipment is too expensive for a single
flight, and students want to get their data after all the 54 The Design Cycle
work they put into creating their BalloonSats. One way to Advanced Techniques for Design Engineers
insure a near spacecrafts recovery is to make predictions Try the RAD B4R for ESP8266 Coding
of the balloons flight prior to launch. The ESP8266 has become a very popular way to
implement Wi-Fi in embedded devices. If youve ever

05 DEVELOPING
Departments 60 NV WEBSTORE
programmed in Visual Basic, youll be able to put an
ESP8266 to work in a hurry using a free Rapid Application
Development tool call B4R. This month, well write some
PERSPECTIVES 62 TECH FORUM
Easing Into Tube 65 CLASSIFIEDS
B4R code to enable a connection between an Android
06 READER FEEDBACK 65 ELECTRO-NET phone and an ESP8266-equipped WeMos D1 Mini.
18 NEW PRODUCTS 65 AD INDEX
19 SHOWCASE
Nuts & Volts (ISSN 1528-9885/CDN Pub Agree #40702530) is published monthly for $26.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID AT
CORONA, CA AND AT ADDITIONAL MAILING OFFICES. POSTMASTER: Send address changes to Nuts & Volts, P.O. Box 15277, North Hollywood, CA 91615 or Station A, P.O. Box 54, Windsor ON N9A
6J5; cpcreturns@nutsvolts.com.

4 August 2017
Bergeron - Developing Perspectives - Aug 17_Dev Perspectives - ReadFeed Feb15.qxd 7/4/2017 6:26 PM Page 5

Published Monthly By
T & L Publications, Inc.
430 Princeland Ct.
Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
DEVELOPING
PERSPECTIVES
by
Bryan
Bergeron,
Editor

Webstore orders only 1-800-783-4624


www.nutsvolts.com Easing Into Tube
Subscription Orders
subtle. Generally, the component
Toll Free 1-877-525-2539
Outside US 1-818-487-4545
P.O. Box 15277
W ant a break from
microcontrollers and MEMS
devices? Try tubes. Theyre
values remain the same, but the type
of capacitor is changed; for example,
North Hollywood, CA 91615 deceptively simple to work with, but from a disc ceramic to a silver mica.
as with most things take years to The result is a change in tone that
FOUNDER may or may not be better than the
Jack Lemieux
fully master. If youre a guitarist or
know of a guitarist who plays with original. The decision about what
PUBLISHER capacitor technology to use for a
Larry Lemieux
tube amplifiers, then the easiest way
publisher@nutsvolts.com to work with tubes is to perform a given tone is simplified by vendors
modification or mod. There are that sell basic mod kits and advertise
ASSOCIATE PUBLISHER/
ADVERTISING SALES dozens of guitar amp mod shops on a certain tone, such as Fender
Robin Lemieux the web; some offering individual Tweed or Bluesy that theyre
robin@nutsvolts.com component upgrades and others targeting.
EDITOR offering extensive kits. I just finished modding my
Bryan Bergeron Mercury Magnetics is my go-to Fender Blues Junior amp with a
techedit-nutsvolts@yahoo.com
source for transformer and choke capacitor kit from Fromel Electronics
VP OF OPERATIONS mods. Theyre not the cheapest (www.fromelElectronics.com) and it
Vern Graner
vern@nutsvolts.com
option on the Web, but Ive modded was easy. This mod together with
four amps with their power, output, swapping out a Mercury Magnetics
CONTRIBUTING EDITORS
Fred Eady Kristen McIntyre
and choke upgrades with great for the output transformer
Lou Frenzel Paul Verhage success. By upgrade, I mean that the essentially gave me a new amplifier.
Ken Fisher Dave Prochnow replacement transformer is beefier, A basic capacitor kit from Fromel or
Ronald Gladney Eric Bogatin
has a higher quality core, more similar suppliers is about $35. Ive
CIRCULATION DEPARTMENT current carrying capacity, and in also used a basic tube amp mod kit
subscribe@nutsvolts.com general results in a better sound. from http://billmaudio.com: a one-
SHOW COORDINATOR More affordable sources for tube man shop specializing in Fender
Audrey Lemieux amp magnetics are available on the amps. The basic mod sells for about
WEBSTORE MARKETING Web, but cheap rarely means the same price as the Fromel kit.
COVER GRAPHICS upgrade. Of course, you can also mod a
Brian Kirkpatrick More invasive modding involves tube amp by changing the speaker,
sales@nutsvolts.com
changing components in the amp installing a different brand of tubes,
WEBSTORE MANAGER/ especially the power supply and by moving the entire assembly to
PRODUCTION electrolytic filter capacitors, the a high quality cabinet made of real
Sean Lemieux
sean@nutsvolts.com capacitors in the primary signal path, wood. (Im just focusing on the
and the tube bias circuitry. For power circuitry mods here.)
ADMINISTRATIVE STAFF supply capacitors, the goal is usually The next step in a tube journey is
Re Gandara
to provide greater capacitance, lower a full tube amp kit. The most popular
Copyright 2017 by T & L Publications, Inc. internal resistance to AC, and guitar amp kits are patterned after
All Rights Reserved increased longevity. This usually the Fender 5F1 and 5E3 amps. The
All advertising is subject to publishers approval. We
are not responsible for mistakes, misprints, or means going from a $3 capacitor to 5F1 is a small 5W bedroom amp
typographical errors. Nuts & Volts Magazine assumes a $5 or $6 electrolytic capacitor. Of with a single output tube, and is
no responsibility for the availability or condition of
advertised items or for the honesty of the advertiser.
course, you could opt for a gold usually paired with an 8 or 10
The publisher makes no claims for the legality of plated component with a super speaker. The 5E3 is a full practice
any item advertised in Nuts & Volts. This is the sole audiophile rating, but that would be amp, with 15W output to a 12
responsibility of the advertiser. Advertisers and their
agencies agree to indemnify and protect the publisher a waste of $20. speaker. There are at least a half
from any and all claims, action, or expense arising from Modding the capacitors in the dozen domestic sources for these
advertising placed in Nuts & Volts. Please send all
editorial correspondence, UPS, overnight mail, and
signal chain of a tube amp is more kits; my favorite being Boot Hill
artwork to: 430 Princeland Court, Corona, CA 92879.
August 2017 5
Reader Feedback - Aug 17_Layout 1 7/4/2017 6:28 PM Page 6

Amps (www.boothillamps.com). components dangling in space, but whether tube or silicon-based its
Expect to pay about $130 for the many players swear by the design. impossible to compete on price
components, circuit board, and Although I dont have first-hand alone. Youre paying for the
chassis for a 5F1 kit, and $200 for the experience with full kits that contain experience and satisfaction of
5E3. Youll have to add magnetics, a everything from a cabinet, tubes, building it yourself. A complete 5F1
speaker, and a cabinet. These three speaker, and components, this is amp from Monoprice sells for $99,
items can easily overshadow the basic usually more economical than cherry which is about $250 less than what
amplifier kits in cost. picking from several suppliers and you would pay for the parts in kit
Even so, the 5F1 and 5E3 kits are then paying shipping fees for each form. However, when its time to
simple to build. The schematics are group of components. Ive heard replace a blown capacitor or tube on
easy to locate on the Web, and they good things in the forums about the the Monoprice, you wont know
sound great when completed. 5E3 guitar amp kit from Tube Depot where to begin to look. With a DIY
Moreover, most of the kits out there (www.tubedepot.com). At $600, tube amp, you know every wire,
use the old school point-to-point however, the cost begins to overlap component, and solder joint.
wiring found in boutique amplifiers. I with current off-the-shelf Fender tube Please consider sharing your tube
cant hear a difference between an amps not to mention amps on the journeys with others in the Reader
amp with components mounted on a secondary market. Feedback section. NV
printed circuit board vs. one with When it comes to DIY electronics

READER FEEDBACK
1) The LM355 shows a lead going Generosity was not something I
Wire(s) Crossed left to NO connection. ever associated with Microsoft.
I made a small error in the original 2) The 24LC256 shows a lead Eventually, I realized what at least part
schematic for my July 2017 brain going right to NO connection. of the catch was. Successive Windows
hacking project that I provided Nuts & Ted Mieske 10 service packs uninstalled some of
Volts, in which I showed pin 4 of the Crescent City, CA the Windows utilities and other
7660 connected to ground. In this programs which I had used under
configuration, the device is functional, That's correct for the LM355. The Windows 7 and before. Other bug-
and will put out the minimum voltage third lead in the LM355 is a laden updates disabled Windows 10
required for a good tDCS session. temperature adjust pin and not needed. features which were supposed to work,
However, you can choose the Since the temperature is being digitized e.g., I cannot get Windows Store to
higher voltage output recommended in by the PICAXE, any necessary adjust to function and the only solution is
the article by simply moving the ground the sensor reading can be made by the apparently to do a clean install and in
wire from pin 4 to pin 3 on the 7660. PICAXE code or in a spreadsheet. the process lose all of my software.
(Pin 4 will be left unconnected.) Pin 7 of the 24LC256 is a write There is added pressure to only
A small number of articles detailing protect pin. It prevents the memory use software purchased (or leased!)
tDCS research have indicated that chip from being written to in an through the Windows Store.
"more is not necessarily better," and accident. That pin should be connected Fortunately, a lot of what I need is
that finding the minimum voltage that to ground to enable the write, so that is available as free or open source
works for you actually produces a mistake on the schematic. software for Linux. Unfortunately, I am
stronger results. Thanks for asking. a software developer with customers
So, I've decided to pretend this Paul Verhage using software I developed for
was a fortuitous error, and mention that Windows. So, there will be no new
you might like to give it a try both Getting Real Again computer on my immediate horizon.
ways. If you do, I hope you'll let us Bergerons comment about having
know what you think. I sure can identify with Bryan
been a proponent of SDR also struck a
My apologies to the readers of Bergeron on the movement to
chord. I recently attended a local Mini-
Nuts & Volts for the schematic error. subscription software as he talked
Maker Faire. The reason I went was
Walt Noon about in his June 2017 Developing
because there was someone from the
Perspectives editorial. I refuse to use it.
local ham radio club exhibiting. I was
Last year, I took advantage of the free
No Connection Windows upgrade to move my five
hoping to see some actual ham
Did I overlook something on page communication and some neat gear,
year old computer to Windows 10. At
55 in the June 2017 Near Space etc.
the time, I had a queasy feeling that
column? I was pretty disappointed when the
there was going to be a catch.
6 August 2017
Reader Feedback - Aug 17_Layout 1 7/4/2017 6:28 PM Page 7

gear consisted of an antenna another business model to generate the email lands at its destination.
connected by a length of coax to a tiny more revenue without putting forth any It gets better ... since all of our
USB SDR plugged into a laptop. Where effort. I am still a beta tester for licensed software requires a daily okee-
is the fun in that? I, too, like electronic Microsoft and I find that irksome. This dokee from galactic central, when our
stuff with parts and wires and some "cloud" model collapsed a few years soda straw collapses, we are
wow-factor and personality oh, and ago, and like the beast that won't die, completely shut down. We actually pay
longevity. Seems to be a vanishing has been resurrected once again. for the privilege of getting substandard
breed. At my employer's place of service. Sweet!
Hardware seems to be going the business, we recently switched from Another benefit to profit-no-matter-
way software did in the 90s when inhouse mail servers to having our how-insane, there must be whole
using Visual Basic, anybody could email served from the cloud. Wow, departments whose sole purpose
cobble together a program using what a giant leap forward! I send a seems to be making software look and
wizards and downloaded code, never document to a co-worker five feet from operate differently, just to screw with
knowing how the stuff worked. Now it my desk and it crawls through us. How much has Microsoft Office
seems there is a shield and Comcast's soda straw, up to a "cloud" changed since the version I use (2003)?
downloadable code for almost every somewhere in Elbonia, where it is then I have identified some missing
electronic need. The only skill and resent to my co-worker five feet away, functionality in the newer stuff but have
knowledge required are the ability to through that same straw. not stumbled onto any new feature that
download and plug something into a Before this remarkable cloud made me smile and ask "Cool! Why
USB port. service, emails used to go from one didn't I think of that?"
I am not complaining even if it worker bee to another in about three All of the menus were changed to
sounds that way, but I just feel like seconds. Previously, there was no make it look different, but why is there
people miss out on so much when they wasted time while the messages rattled no menu entry for "make this thing
just follow instructions and never learn around our mail server as the clocks work like before"? The program is
the underlying basics. It seems like tick away at those three long seconds. fundamentally the same as it was
Nuts & Volts and a rare few other With the new and improved cloud previously.
publications like SERVO and Everyday model, I can go get a coffee, take a Excel still grinds through the math I
Practical Electronics are the last leak, and be back at my desk before Continued on page 23
sanctuary for us (presumably older)
folks who enjoy understanding how
things work right down to the metal.
And that, as Gump said, is all I
have to say about that.

Keep up the good work and be
guarded in your use of the IoT.
    
Keith Ujvary 

  
Gibsons, BC 
 


Thanks for taking the time to share  
 


your thoughts/experiences with
subscription software and the like. I

 

agree with you completely. At some
point, we won't actually own any of the
"smart" devices in our homes they'll
own us and most of us won't know
how to get out from under the
technology.
Bryan Bergeron

Real-ality Check
I enjoyed reading Bryan Bergerons
comments in his June 2017 editorial on !#  # ####"### # #
Real Electronics and his spot-on ! # # #
 ###
observations. As I rarely write to
anyone in the media, I will stumble a
 
 
 


bit, but hopefully the gist of what I am
thinking will be conveyed.   

The idea of repeatedly buying what
I already own is offensive on face    
 
! !!! !!!  !!!
!  !
value. Like many things, this is just
August 2017 7
Q&A
n WITH KRISTEN A. McINTYRE

In this column, Kristen answers questions about all aspects of electronics, including computer
hardware, software, circuits, electronic theory, troubleshooting, and anything else of interest to
the hobbyist. Feel free to participate with your questions, comments, or suggestions. Send all
questions and comments to: Q&A@nutsvolts.com.
hydride (or NiMH) batteries.

More on NiCd Chargers Your simple charger is probably doing a


reasonable job when the cells are healthy. The
resistor limits the current and the transformer
LCDs: How They Work provides an upper bound on the voltage, given
the characteristics on how voltage is induced in
transformer windings (actually a consequence
More on NiCd Chargers of Faradays Law of induction).
Figure 1 reproduces this simple circuit. The peak

Q
I am an Ophthalmologist and a long time Nuts current is approximately expressed by (Vp - 0.6 - 3Vb)/R =
& Volts reader. I use several hand diagnostic I, where Vp is the peak voltage from the transformer and
ophthalmic instruments that are powered by Vb is the cell voltage; typically 1.2V. The approximation
rechargeable 3.5 volt NiCd batteries that are results from the diode drop voltage of ~0.6.
well charged constantly by a transformer, a resistor, and We dont know the transformer voltage or the value
a diode. They are under a constant voltage charge of 3.5 of the limiting resistor, but we can say with certainty that
VDC in a well charger. The batteries are made up of 3-1/2 if the battery voltage decreases, then the current flowing
size AA cells in series. Is there a better charger for the 3.5V into the batteries will increase. So, how could the battery
NiCds since they remain on constant charge? voltage decrease beyond discharge?
John Haley NiCd cells are prone to internal shorts resulting from
chemical filaments growing inside; particularly if they

A
This is similar to another recent question I got are stored without charging. If one of the three cells you
about NiCd vs. NiMH charging. Just to repeat a have shorts internally, the current through the remaining
bit of what Ive written before: cells increases. The current equation changes to (Vp - 0.6
For a NiCd, as you mention, a constant - 2Vb)/R = I. Notice the factor of 2 instead of 3 on Vb.
current is generally adequate, as long as the current is kept This might or might not be a really significant change,
relatively low. Charging at a rate like 1C (or the capacity of depending on the resistor and transformer voltage. There is
the battery in one hour) can cause overheating, but lower the potential to overheat the remaining batteries, perhaps
rates are fine. damaging them.
Please keep in mind that everything Im about to say What can we do better? The easiest approach is to
only applies to NiCd batteries, and not to nickel metal avoid charging the batteries in series. Instead, use three
separate resistors to
limit the current to
the cells individually,
making it so that one
cells failure wouldnt
significantly affect the
next (Figure 2). This
could be impractical,
though, because the
batteries have to be
reconfigured from
their normal use
topology for charging.
n FIGURE 1. Simple n FIGURE 2. NiCd
NiCd trickle charger.
One other
trickle charger for approach might
individual cells.
be to use a current
source that would
deliver roughly the
same current even
8 August 2017

McIntyre - Q&A - Aug 17.indd 8 7/4/2017 6:33:47 PM


QUESTIONS and ANSWERS
Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/magazine/issue/2017/08.

if one or more cells shorted (Figure 3). Youll lose a little


voltage headroom in doing this, though. To do even better
would require a more sophisticated charging scheme using
delta-V monitoring, looking for the slope change in the
voltage, and/or temperature monitoring delta-T charging.
Then, you can do fast charging safely.
Theres a great little device made by Linear
Technology: the LTC4060. With a few external
components, it forms a nice delta-V charger for NiMH or
NiCd. You can find information about it at www.linear.
com/product/LTC4060.

n FIGURE 3. NiCd trickle


LCDs: How They Work charger with current source.

Q
I love to use liquid crystal displays (LCDs) in my
projects involving PIC microcontrollers. When
shopping for LCDs at large component retailers,
I came across some terminology that I do not
understand. Im hoping you can enlighten me. the polarization properties of the liquid crystal molecules.
If I understand correctly, a reflective LCD uses a This, in turn, changes how much light is transmitted.
mirror behind, and a transmissive LCD has a backlight. It is similar to stacking two polarizing filters and
Can you tell me how a transflective LCD (which is also twisting them relative to each other, and observing how
backlit) is different from a transmissive display? Can you you can darken the filters. Its actually an example of
explain what the differences are between TN (twisted Quantum Electrodynamics, or QED (dont miss Feynmans
nematic), STN, FSTN+, and FSTN- LCDs? What qualities do wonderful book on this subject, titled QED).
the different display types bring to our finished projects The net effect of this is that areas where the electric
that would cause us to select one over another? field is applied to the liquid crystal material are generally
Judy May W1ORO made to appear darker. With this in mind, lets first look at
Union, KY how light is directed through the filters and material, and
then back to your eye (Figure 4).

A
Lets see what we can find out. While I know First, without any internal light source, we have to
some of the answers to this question, Im going have light from the external environment enter through the
to educate myself at the same time regarding front surface, which is usually a polarizing filter oriented
the other parts. (Thats the best way to learn, one way. Lets say vertically for this discussion (layer 1).
isnt it?) Ive had a long history with these devices even Then, there is an electrode layer (layer 2). This is a clever
building a watch kit using some of the
earliest commercial seven-segment
displays in the mid-1970s.
Starting from the beginning, the aim
with various kinds of LCD displays is to
control the transmission of light (as you
alluded to in your question) in regions of
the display. Whether thats pixels for a
certain color filter or just a fixed segment
in a display, the principle is the same.
This is accomplished by using the
polarization property of electromagnetic
wave propagation along with some
interesting materials. There are films
that can be used to only permit certain
polarizations of light (an example of n FIGURE 4. LCD optical layers
electromagnetic waves) to pass through. (source Wikipedia, CC BY-SA 3.0,
The actual liquid crystal material user Ed g2s).
responds to an electric field and changes
August 2017 9

McIntyre - Q&A - Aug 17.indd 9 7/4/2017 6:33:47 PM


bit of materials science, as the electrodes must be mostly similar to a half-silvered mirror (between layers 5 and 6). It
transparent. The material used is ITO, or Indium Tin Oxide both transmits the light from the backlight and can reflect
(a transparent conductor). It is deposited on the surface light from bright ambient light. So, the display effectively
in the shape to be displayed. The liquid crystal is the next switches modes depending on the relative brightness of the
layer (layer 3), and is followed by a common layer of ITO ambient light. Such displays are often used in applications
on glass that only overlaps the first layer where the display where the ambient light is variable, like in a car.
shape is desired (layer 4). Lastly, there is another polarizing Now, on to the acronyms. TN (twisted nematic)
filter that is polarized the opposite way to the first; refers to the alignment of the molecules when there is
horizontal in this case (layer 5). no applied electric field. The TN material naturally forms
In the reflective case, as you say, light passes through a helical structure which twists the polarization of light
these layers to be reflected by a mirror-like substance and energy passing through by 90. When a field is applied,
reflected back to your eye (layer 6). Since light travels the molecules untwist and the polarization is not changed,
through everything twice, a fair amount of light is absorbed causing light in the above example to be blocked by the
in the layers. In the transmissive case, again, youre spot front vertical filters interaction with the back horizontal
on. A uniformly lighted surface is placed behind the stack filter. Varying the field strength, different brightness levels
of filters (in the layer 6 position), electrodes, and liquid can be achieved.
crystal, and the vast majority of the light only passes in one This is a great first-order design, but it has some
direction making the display bright and allowing it to be problems. TN material is not that responsive and does
seen when there is no outside light source. Most modern not have a clear threshold of operation. STN (or super-
displays are transmissive. twisted nematic material) has a larger polarization twist
Transreflective displays attempt to have their cake of 180 or 270 degrees, and has a better contrast-voltage
and eat it too! When the external light source is rather characteristic that is more suitable to using in a pixel matrix
bright, the backlight in a transmissive display can be with row and column control. The original STN material
overwhelmed such that the display is dark and difficult to can be slow to respond, though, so its not that popular
see. A transreflective display uses a special polymer that is these days.

10 August 2017

McIntyre - Q&A - Aug 17.indd 10 7/4/2017 6:33:47 PM


FSTN- and FSTN+ (F is for filtered) are variants of STN that use an
additional layer between the STN material and the rear polarizer to
get better contrast and sharpness. And while you didnt mention it, I
wanted to bring up IPS and TFT displays.
IPS means In-Plane Switching, where the electrodes are to the
sides of the pixel so that the electric field is parallel to the glass. This
significantly increases the viewing angle, and thus the color consistency
for color displays. This is because the electrodes are not covering the
transmissive area, and because of the way the molecules are moved by
the field. They also dont react nearly as much to your finger distorting
the electric field an important characteristic for touch displays.
TFT stands for Thin-Film Transistor, and is often combined with
IPS. These displays include transparent FETs on the glass for row and
column control. That allows much more current to be moved around
to change the electric field quickly. Since the electrodes form a parallel
plate capacitor, there is charge there that must be moved to change
the field strength, and we do that with current: the time rate of change
of charge.
Ive always found it amazing that we are looking through huge
numbers of transparent transistors when we stare at our computer
screens (Figure 5). NV

n FIGURE 5. Transistors in a TFT LCD (bottom) (source Wikipedia, CC BY-SA


3.0, user Gabelstaplerfahrer).

Best Value
prototype PCBs online TS-4900
Turnkey Assembly available! Computer on Module
i.MX6 ARM CPU
WiFi & Bluetooth
Serving over 10,000 PCB 1 GHZ
Solo or Quad Core
Designers and Buyers
since 2003

Made in USA
www.PCBFabExpress.com

408-522-1500 Actual Size

Support3@pcbfabexpress.com www.embeddedARM.com
August 2017 11

McIntyre - Q&A - Aug 17.indd 11 7/4/2017 6:33:49 PM


Verhage - Near Space - Aug 17_Near Space - Aug 15.qxd 7/4/2017 6:29 PM Page 12

NEAR SPACE BY L. PAUL VERHAGE


paul@nearsys.com

Factors Controlling Balloon Flights


and Predicting Balloon Landing Zones
Unless one is going to
get their weather
balloon back, theres
no sense launching a
near space flight for a
school. All that tracking
equipment is too
expensive for a single
flight, and students
want to get their data
after all the work they
put into creating their
BalloonSats. One way
to insure a near
spacecrafts recovery is The Forces Acting On a winds act primarily in the horizontal
direction. Both weight and drag act in
to make predictions of Balloon the downward direction (during
A balloon rises due to its ascent). Lets start with buoyancy.
the balloons flight buoyant force overcoming its weight.
prior to launch. The Drag further acts on a balloon to Buoyancy
keep it climbing at a constant rate.
factors affecting a Once a balloon is airborne, its a Buoyancy occurs when an object
balloon flight are captive of the wind. (like a balloon) displaces more fluid
The effects of these forces are weight than its own weight. In this
pretty simple to simple to understand, although case, the fluid is the air. Sometimes
understand and they determining the amount of drag we forget to treat the air as if it has
acting on an object can be tricky, as weight. Its weight comes from the
make for a great youll read. The effects of these earths gravity acting on the
science project itself. forces make understanding a molecules of nitrogen and oxygen
balloons flight behavior relatively and atoms of argon in the
This months article simple and its flight easy to predict. atmosphere. There are other gases,
discusses some of the So, lets spend a little time discussing but they make up so little of the
the forces acting on a balloon, and atmosphere that their contribution is
factors and physics then applying that understanding to negligible to the three mentioned
affecting a balloons the prediction of a balloons flight above.
profile. How can we calculate the weight
flight, and then shows Balloons experience four forces of the atmosphere? If we make the
how anyone can in flight: buoyancy, weight, drag, and assumption that were flying a
winds. Buoyancy is the sole one balloon in an atmosphere under
predict a balloon flight. acting in the upward direction, while standard temperature and pressure,
12 August 2017
Verhage - Near Space - Aug 17_Near Space - Aug 15.qxd 7/4/2017 6:29 PM Page 13

APPROACHING THE FINAL FRONTIER


To post comments on this article and find any associated files and/or downloads, go to
www.nutsvolts.com/magazine/issue/2017/08.

or STP (one atmosphere of


pressure and a temperature
of 25oC), then one mole of
atmosphere occupies 22.4
liters.
Wait. Did I hear you say
moles? Recall your high
school chemistry class where
you learned that a mole is an
amount of anything just like
a dozen is an amount of 12
of anything. In the case of a
mole, its 6.022 x 1023 of
those things. This is called An example of the HabHub
Avogadros number, and its Burst Calculator page.
The four forces
the conversion factor acting on a
between atomic mass units balloon during
(one AMU is the weight of ascent and their velocity and spends most of the flight
one proton) and grams. direction. ascending at a constant speed. So,
An online search shows what is preventing a balloon from
that the atmosphere consists constant acceleration? It is drag the
of 78% nitrogen, 21% second downward-directed force
oxygen, and 1% argon. The chemical hydrogen (H2) has a density of two experienced by a balloon and unlike
formula for nitrogen is N2; for grams per 22.4 liters or 0.006 pounds the other forces, its dynamic.
oxygen, its O2; and for argon, its Ar. per cubic foot, and helium (He) has a Drag is dynamic because its
So, the mass of one mole of nitrogen, density of four grams per 22.4 liters magnitude depends on the speed at
oxygen, and argon is 28 grams, 32 or 0.011 pounds per cubic foot. which an object travels through a
grams, and 40 grams respectively Taking the difference between fluid, whereas weight and buoyancy
(Im rounding to whole numbers). the densities of hydrogen and helium are static forces since they remain
That means 22.4 liters (or one mole) to the density of the atmosphere, we constant during a balloons ascent.
of atmosphere has a weight of calculate that hydrogen will lift 0.074 You can see the dynamic nature of
0.78(28) + 0.21(32) + 0.01(40), or 29 pounds per cubic foot of gas and drag in this equation:
grams. helium will lift 0.069 pounds per
Converting liters into cubic feet cubic foot of gas. So, a typical near D = Cd * p * (V2/2)* A
(0.035 cubic feet per liter) and grams spacecraft carrying 12 pounds of
to pounds (0.0022 pounds per gram), equipment, a one pound parachute, where Cd is the coefficient of drag (a
we find that the atmosphere has a a 1,200 gram balloon, and having number without units)
mass of 0.08 pounds per cubic foot three pounds of positive lift needs p (rho) is the density of the fluid
at STP. Therefore, we can determine 252 cubic feet of hydrogen, or 270 V is the velocity of the object
that any gas weighing less than 0.08 cubic feet of helium (squared in this case)
pounds per cubic foot is a gas A is the reference area (which
capable of lifting a balloon. The Weight and Drag surface area is chosen for the object
lower the mass of a gas per volume, influences the Cd for the object)
the greater the weight a given Weight is the force that a
volume of that gas can lift. balloons buoyancy must overcome. Note that Cd * p *(V2/2) is the
A better term for weight per However, if weight were the only dynamic pressure. This means drag
volume is density, so well use that downward directed force acting on a equals dynamic pressure times the
term from here on out. However, balloon, then a balloon with more area, which gives drag the unit of
well convert back to pounds of lift buoyancy than weight would force. The important property about
after the volume is specified. accelerate upwards according to drag is that it increases in magnitude
Popular lifting gases are Newtons laws. as the velocity of the object
hydrogen and helium (methane and Data collected from flights show increases (in fact, its proportional to
ammonia are other lifting gases). that a balloon doesnt accelerate. In velocity squared). This is the property
Assuming STP again, we find that fact, it quickly reaches terminal of drag that prevents a balloon from
August 2017 13
Verhage - Near Space - Aug 17_Near Space - Aug 15.qxd 7/4/2017 6:29 PM Page 14

The landing page of the HabHub prediction I moved and zoomed the map around until I found an
application. Since HabHub is located in the UK, airport near my house. Afterwards, I clicked Set With
the default location is also located in the UK. Map. Now, I can use my mouse to pick the exact
location of the launch.
accelerating upwards at an ever- to 1,000 feet per minute; a typical feels a wind force that accelerates it
increasing speed. ascent rate for my balloons). The to match the wind speed and
How can one predict the ascent calculator then determined that the direction. As the balloon catches
rate of a balloon? Rather than run the 1,200 gram balloon needed 314 up to the wind speed and direction,
calculations yourself, go to cubic feet of helium. the wind force experienced by the
http://habhub.org/calc and have the What if youre using hydrogen balloon decreases, and the balloon
website run the calculations for you. instead of helium? Click on Constants travels ever more closely to the
HabHub is a UK website dedicated (Advanced) and there you can winds speed and direction. Ideally
to high altitude ballooning (HAB), change the gas from its default of then, a balloon is always traveling in
and the Balloon Burst Calculator is its helium. After selecting hydrogen, the the direction and speed of the wind.
online tool for calculating the amount calculator determined that only 285 The winds aloft are measured by
of gas needed to achieve a specific cubic feet of gas was needed for this the National Weather Service (NWS)
climb rate or burst altitude for flight. every 12 hours from about 100 sites
balloons. Youll need to remember the across the US. The measurements are
burst altitude of the balloon in order made using radiosondes, or balloons
Determining the Ascent to predict its flight. So, after carrying a sensor package to
determining the balloons ascent rate, measure pressure, temperature, and
Rate and Burst Altitude also record its burst altitude. relative humidity. By measuring the
of a Balloon Youll find theres an inverse azimuth and elevation of the
relationship between ascent rate and radiosonde over time, the NWS can
The only thing that makes burst altitude. The higher a balloon determine the wind speed and
HabHub difficult for Americans to can reach before burst, the slower it direction at specific altitudes
use is that the UK (like the rest of must ascend to that altitude. Thats (nowadays, the NWS is starting to
Europe) uses the metric system. Still, because a fast ascending balloon has use GPS enabled radiosondes).
its a great site for anyone launching a large initial gas load and therefore The data from radiosondes
high altitude balloons. less volume available for the gas to becomes an input into a model used
Lets look at a calculation that I expand into. Once the gas has to calculate future weather
ran for this article. A typical balloon expanded to the maximum volume conditions. Near space explorers use
for high altitude ballooning is the the balloon can hold, the balloon will the results of this computer model to
Kaymont 1,200 gram balloon burst. predict future balloon flights. One of
(http://kaymontballoons.com). A those models is the GFS, or Global
payload weight of 13 pounds (this Wind Forecast System. The important data
includes the one pound parachute) is from the GFS model is the speed and
5,900 grams. I adjusted the Target The remaining force acting on a direction of the winds at various
Burst Altitude field until the webpage balloon is the wind. Anytime a altitudes.
generated an ascent rate of five balloon is not traveling at the same A prediction of a balloon flight
meters per second (this is equivalent speed and direction as the wind, it divides the balloons ascent into
14 August 2017
Verhage - Near Space - Aug 17_Near Space - Aug 15.qxd 7/4/2017 6:29 PM Page 15

Heres the webpage as Im making a prediction for The results of a balloon flight prediction.
the weekend.

slices, and then calculates the effect altitude, and parachute descent to Set With Map.
the winds have in each slice on the speed. Now, were ready to go online After pinpointing the exact
balloons flight. Easy. However, dont and run some predictions. launch site, enter the remaining
be in a hurry to do this for yourself fields. I chose a burst altitude of
because Ill show you shortly how to Predicting the Path and 27,000 meters based on the output
do this online. from the HabHub Burst Calculator
Recovery Zone of a Near (and my experience). An ascent and
Descent Under a Space Mission descent rate of five meters per
Near space predictions can be second is right around 1,000 feet per
Parachute made at http://predict.habhub.org. minute and typical of my near space
The final phase of a near space Youll notice the inputs to the missions.
flight is the parachute descent. A prediction application are the latitude Be sure to select the correct
parachute functions by significantly and longitude of the launch site; the launch day and time. The prediction
increasing the drag of a falling object. launch time and date; the balloons application defaults to the current
Once the speed of descent is high ascent rate; the balloons burst day and time. If you dont notice this,
enough, the parachutes upwards altitude; and the parachutes landing you may be greatly surprised when
drag equals the weight of the object speed. I feel the Launch Altitude is the actual flight doesnt match
downward, letting the object not a significant field to fill in since predictions. Now all I need to do is
descend at a constant (and safe) the balloon will climb much higher click the Run Prediction button.
speed. Recall, however, that drag is than any possible launch (or landing) The output of the balloon flight
also proportional to air density. This altitude. prediction webpage is a Google Map
means that unlike a balloon, a One can move to the location of of the balloons travels. The red circle
parachutes descent speed at high the launch by zooming out the map, is the launch site, the spiky circle is
altitude is greater than its descent dragging close to the desired launch the burst point, and the green circle
speed at low altitude. location, and then zooming back in is the landing site.
The parachutes speed at altitude for precision. Alternatively, if the As you can see from this
is easy to calculate if the landing latitude and longitude of the launch prediction, a launch from my nearby
speed of the parachute is known (by site is already known, those values airport on June 2nd and reaching an
using a model of the atmospheres can be entered. altitude of 27,000 meters would end
density as a function of altitude). Notice theres an option called up in the Boise Mountains near the
Most people dont calculate the Set With Map. If clicked, this option town of Prairie. Obviously, were
landing speed of a parachute. The lets you click on a point on the map going to have to pick a different
landing speed is normally stated by to use for the launch site. The launch site for this flight.
the manufacturer of the parachute. latitude and longitude fields are Thats the beauty of the balloon
That covers the four things we automatically filled in when using this flight predictor; you can move the
need to know about a balloon flight, option. I normally zoom out, drag, launch site and time around until you
ascent rate, winds aloft, burst and then zoom back in before opting get a flight that will work for you.
August 2017 15
Verhage - Near Space - Aug 17_Near Space - Aug 15.qxd 7/4/2017 6:29 PM Page 16

A good flight is one extra buoyancy increases


that begins some place the ascent rate
near a major road, so significantly, resulting in a
chase crews can quickly shorter flight. It does not,
get ahead of the balloon however, change the
or at least keep up with it. maximum altitude of the
A good launch site also balloon significantly.
has a landing area that has The maximum altitude
good access to roads doesnt change much
while not ending up in because theres already a
cities, mountains, forests, large volume inside the
nuclear power plants, and balloon. So, adding
prison yards. enough gas for an extra
Due to the pound of buoyancy will
mountainous nature of A Google Earth image of a near space flight; this one increase the initial fill of
Idaho, we must deal with traveled from west to east (left to right in the image). gas by only about 5%.
mountains and poor road Notice that the slower ascent portion covers nearly twice
access at each launch. So, as much ground as the faster descent portion. Try out the HabHub
its not uncommon to balloon prediction
make half a dozen predictions before disorganized. The balloon will often webpage. Youll have fun seeing how
each near space mission. backtrack during ascent. changing some of the parameters can
2. Dont launch a balloon when make a big change in the balloons
Some General the jet stream is overhead. The jet flight.
stream is often a boundary between If youre in the process of starting
Observations a cold air mass to the north and a your own near space flights, then its
Here are some observations Ive warmer air mass to the south. very important you become familiar
made over the years. You might find Balloons can experience wind speeds with this webpage.
them useful for your near space in excess of 100 MPH while In fact, its critical that a near
flights: ascending through the central core of space flight be preceded with a flight
a jet stream. prediction in order to make the flight
1. Launching balloons inside a So, wait until the jet stream has as safe as possible.
high pressure system normally results shifted north or south before
in shorter flights. Thats because the launching. Onwards and Upwards,
winds tend to be light and 3. An additional pound or two of Your near space guide NV

Introducing the ME Labs D-Stick!


$29.99
The ME Labs Standard D-Stick provides all the functionality of Microchips 40-pin PIC16F1937 in a hardware module
that includes a USB on-board programmer and virtual COM port. The D-Stick is a compact, simple and easy to use
alternative to connecting a serial port, programmer, power supply, etc. to a solderless breadboard for project
development. After development, simply replace the D-Stick with the pinout-compatible PIC16F1937 for volume
production.
- Pinout is identical to Microchips standard 40-pin DIP
- Round, machined pins are easy on spring contacts allowing for multiple insertion cycles
- Built-in micro-USB port supplies power, a programming connection and a virtual com port
- Suitable for serial in-circuit debugging
- Compatible with all ME Labs Trainer programs
- Standard version based on PIC16F1937 compatible with the FREE PBP Student Edition
- Advanced Version based on PIC18F compatible with PBP Gold Edition (Sold Separately)
coming soon!

Available now at melabs.com contact us at info@melabs.com


PICBASIC PRO is a trademark of Microchip Technology Inc. in the USA and other countries.
PIC is a registered trademark of Microchip Technology Inc. in the USA and other countries.

16 August 2017
Page 17 - Aug 17_Layout 1 7/4/2017 6:32 PM Page 17

www.poscope.com

FREE
PCB Layout Software &
PCB Schematic Software

- USB #" 
- Ethernet - Encoders
- Web server - LCD
- Modbus #" "
- CNC (Mach3/4) #"" 
- IO

- up to 256 - up to 32
microsteps microsteps
- 50 V / 6 A
3 PCBs 3 PCBs 3 PCBs #"! ""
- 30 V / 2.5 A

$
41 $
61 $
81
- Isolated
+ shipping + shipping + shipping
 ""
2-layer 2-layer 4-layer  ""
MiniBoard MiniBoardPro MiniBoardPro
(Shipped in 1 business day) (Shipped in 2 business days) (Shipped in 3 business days)

1 DOWNLOAD our free CAD software


Now Offering
2 DESIGN your 2 or 4-layer PCB

3 CHECK your design with xCHECK DRC


SMT
4 SEND us your design with just a click
STENCILS - up to 50MS/s
- resolution up to 12bit
Nano Coating available - Lowest power consumption

5
#" ""
RECEIVE top quality boards in just days - 7 in 1: Oscilloscope, FFT, X/Y, Recorder,
"""  
" "
" """"
"
MADE IN THE USA | www.expresspcb.com

August 2017 17
New Products - Aug 17_Mar15 -NV - NewProducts.qxd 7/4/2017 6:33 PM Page 18

HARDWARE

NEW PRODUCTS SOFTWARE


GADGETS
TOOLS

PRECISION SPUR
GEAR MOTORS
P recision spur gear motors from ServoCity are available
now for $34.99. There are eight available choices offering
a wide selection of RPMs (from 6-90 RPM).

D-SERIES HITEC
SERVOS
S ervoCity is also offering Hitecs D-Series servo line which
sets new standards for advanced programmable
technology. Powered by their 32-bit MCU (Microcontroller
Unit) and 12-bit ADC (Analog-to-Digital Converter) industrial
science, these powerhouses dominate the servo arena. Their
potent combination of wide voltage capabilities, high
resolution, rapid response, and patented Smart Sense
technology brings maximum performance to all radio control
applications. Members of this particular D-Series group are all
designed with extremely durable titanium gears; the D941TW,
D946TW, and D951TW trio boast full metal cases. Pricing is
$157.99.

For more information, contact:


ServoCity
www.servocity.com

ONLINE COURSE TO and will accept almost any


value that occurs in a real
BRUSH UP situation enabling the user
SKILLS to explore the colorful
graphics that are

D eveloped in association with


Books to Courses, EPTSOFT
Limited is offering an online self-study
immediately updated on
their phones or tablets.
Existing employees
course on electronics that addresses requiring a basic
the problem of key employment skills grounding in electronics
shortages especially among young for their work or those just
workers in STEM (Science, looking to refresh their
Technology, Engineering, and Math) existing knowledge can
subjects. benefit from this series.
With no time off work or classes All EPTSOFT courses
to attend, those joining the course are comprehensive and
can study on their mobile devices by aimed at both the
working through a series of lessons beginner (a basic level of
where they assess their own progress understanding in Electronics is the basics, and is extremely
through to completion, and are assumed) and more advanced interactive, encouraging exploration
awarded a certificate at the end. students looking for a refresher. The and experimentation.
All lessons are fully interactive course is menu-driven, beginning with Included with each lesson is an
18 August 2017
New Products - Aug 17_Mar15 -NV - NewProducts.qxd 7/4/2017 6:33 PM Page 19

Stock Drive Products


Setting Ideas Into Motion

assignment or discussion question. the longer an individual continues to One-Stop Shop for
Normally in electronics textbooks, subscribe, enabling the maker to M
readers would find a number of always feel challenged and to
questions to test their understanding encourage them to constantly learn EX
EXPLORE
of the topic. The interactive nature of and innovate. DE
DESIGN
the EPTSOFT courses means they can Thimble is the invention of two BU
BUY ONLINE
take a much more exciting approach young Buffalo entrepreneurs: a
with a broader assignment, computer engineer and a former w
no minimum requirement
encouraging students to explore the college admission officer who came
topic further and learn by testing their together to share their passion for
own inputs/measurements within the STEM (Science, Technology,
apps. As these courses are self- Engineering, and Mathematics)
evaluated, users do not have to satisfy education and to make it more
an instructor only themselves that accessible to the masses. The
they fully understand the topic before company started as a grassroots
moving on. Kickstarter campaign, and offers the
Businesses can purchase these kits both through individual sale and
courses as an employee benefit or monthly subscriptions. The first kit
around which to develop their own received comes with a reusable
trainees and apprentices. Parents Arduino-compatible microcontroller
wanting to provide a little extra help and the option to purchase a toolkit
to their children can buy the course that will help novices to hit the
as a gift. ground running.
In addition to the online course Through Thimble, we hope to
content, EPTSOFT is giving a free PC inspire all individuals from budding
based app (Electronics, Mechanics, hackers to semi-professional hobbyists
Maths & Computing; worth around to fulfill their curiosity and interest
$150 and available on Amazon). First in building electronics, says Oscar
published in 1992 as PC based Pedroso, CEO and co-founder of
Educational Software, these apps Thimble. DC loads can draw max power up to
have since been developed and Individual kits are available for 350W, 150V, and 60A, providing the
installed on thousands of computers $89 or can be as low as $59 each baseline performance required for
by individuals, schools, and colleges when they are part of a 12 month most current mainstream designs.
worldwide. subscription. Pricing includes US What differentiates the DL3000 is its
shipping. industry leading 5A/us slew rate, 30
For more information, contact: kHz dynamic frequency, unique 4.3
EPTSOFT Limited For more information, contact: inch TFT display, as well as LAN and
www.eptsoft.com Thimble remote control capability.
www.thimble.io Whatever a user's power analysis
MONTHLY requirement, the DL3000 will provide

KIT SERVICE PROGRAMMABLE DC a measurement mode that meets


their needs by delivering four
ELECTRONIC
T himble a monthly subscription
service and learning platform is
now shipping learn-and-build
LOAD
constant modes (Current, Voltage,
Power, and Resistance) as well as four
more advanced transient modes
electronics kits. The kits are a part of
a direct-delivery monthly service to
empower kids (as well as adults) to
R IGOL Technologies, Inc.,
announces an expansion of its
Power Analysis test portfolio. The
(Continuous Pulse, Timed Pulse,
Toggle, and List) and three
applications modes. When combined
understand the fundamentals of new DL3000 series of DC electronic with the high resolution, fast slew
electronics including building, loads gives engineers evaluating rate, and high frequency capabilities,
embedded programming, and power, optimizing power efficiency, the DL3000 will allow customers to
advanced manufacturing design and maximizing battery life as a new build advanced power consumption
techniques. powerful and affordable solution to models, determine power budgets,
Each kit includes step-by-step quickly determine their power needs, and optimize battery life.
instructions for the maker to code, debug their designs, and reduce their For customers integrating
build, and hack a DIY electronic time to market. batteries into mobile or IoT designs,
device. Kits build in level of difficulty Starting at just $499, the DL3000 Continued on page 40
August 2017 19
Prochnow - Eclipse Pin Projector - Aug 17_Blank Project NV.qxd 7/4/2017 6:34 PM Page 20

BUILD IT YOURSELF
By Dave Prochnow

A Nuts & Volts


TOTAL
ECLIPSE OF
THE SUN

A total eclipse of the sun will


sweep across a wide swath of
the US this month (August).
Watch all of the sun fun with
this 3D printed Nuts & Volts
(and SERVO Magazine too!)
pinhole solar projector
project.

20 August 2017
Prochnow - Eclipse Pin Projector - Aug 17_Blank Project NV.qxd 7/4/2017 6:34 PM Page 21

Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/magazine/issue/2017/08

FIGURE 1. This unique map shows the path of the moons umbral shadow in which the sun will be completely
obscured by the moon during the total solar eclipse happening August 21, 2017, as well as the fraction of the
suns area covered by the moon outside the path of totality.The lunar shadow enters the US near Lincoln City,
OR at 9:05 a.m. PDT.Totality begins in the US in Lincoln City, OR at 10:16 a.m. PDT.The total eclipse will end in
Charleston, SC at 2:48 p.m. EDT.The lunar shadow leaves the US at 4:09 p.m. EDT. A partial eclipse will be
visible throughout the United States. Credit: NASA/Goddard/SVS/Ernie Wright.

P
repare yourself for the cows coming home early, Wright of NASA Goddard Space Flight Center in
chickens roosting, and a renewed search for the Greenbelt, MD used LRO-generated elevation maps for
lost planet, Vulcan. These are just a handful of accurately showing the continuously varying lunar profile.
historical snippets from colorful past events that have He then combined this lunar data with earthly terrestrial
surrounded a total solar eclipse blackout. On Monday, elevation maps for an accurate observer sighting
August 21, 2017, millions of Americans will need to have depiction.
their eyes safely glued to the ground! We couldnt have done visualizations like this even
Not since 1918 when a total solar eclipse swept 10 years ago, Wright said. This is a confluence of
across the United States spanning from Washington to increasing computing power and new datasets from
Florida have the residents of the US been able to remote sensing platforms like LRO and the Shuttle Radar
witness such a visual treat. In fact, according to NASA, Topography Mission.
everyone in North American will be able to experience Wright was also able to accurately illustrate the shape
this eclipse. of the moons umbra as it races across the topography
Coupling the moons elevation data obtained from the here on earth. Gone are the days of the umbra being
NASA Lunar Reconnaissance Orbiter (LRO) with NASAs represented as a clean disc-like shape. Wrights new NASA
detailed earth topography maps has enabled anyone and lunar umbra is an irregular polygon featuring slightly
everyone to have the most detailed and precise maps ever curved edges (see Figure 2).
created for predicting all of the eclipse data along the path
of totality (see Figure 1). Make a Pinhole Solar
In order to create such precise predictions, Ernie
Projector
Eclipse map/figure/table/predictions courtesy of Fred In the areas of totality, you can expect a central
Espenak, Emeritus, NASA/Goddard Space Flight duration of approximately two minutes and 40 seconds. If
Center, from eclipse.gsfc.nasa.gov. youd like to visually experience this celestial spectacle,
August 2017 21
Prochnow - Eclipse Pin Projector - Aug 17_Blank Project NV.qxd 7/4/2017 6:34 PM Page 22

FIGURE 2. This map shows a detailed image of the moon's umbral shadow as it passes over the US during the
August 2017 total solar eclipse. Credit: NASA/Goddard/SVS/Ernie Wright.

youre gonna need some special eye protection


equipment. Nothing fancy here; just an opaque sheet
of cardboard with a 5 mm hole drilled in its center.
You then hold the projector about 3-4 feet off a
smooth light colored surface (e.g., concrete sidewalk)
and a viewable image of the sun can be watched
throughout the duration of the eclipse.
Since this is Nuts & Volts, however, a piece of
pedestrian cardboard just isnt going to cut it for
viewing the eclipse. Therefore, we designed a special
pinhole solar-viewing projector that you can print on
any 3D printer (see Figure 3). The printable files for
these projectors can be downloaded from the link for
this article.
You will find four different projector files: two for
Nuts &Volts and two for SERVO Magazine (Nuts &
Volts sister publication on robotics). These projectors
come in either a solid filled version or a more stylish
hollow version.
Just print your preferred projector, stand with the
sun coming over your back shoulder, hold the
projector 3-4 feet above a sidewalk, and enjoy
watching the astronomical event of the decade.
Remember: NEVER look directly into the sun
especially during a solar eclipse.

For more information about the upcoming 2017


solar eclipse, visit https://eclipse2017.nasa.gov or
FIGURE 3. Print your own 3D pinhole solar projector, https://www.nasa.gov/eclipse. NV
available in four fun shapes.

22 August 2017
Reader Feedback - Aug 17_Layout 1 7/4/2017 6:28 PM Page 23

READER FEEDBACK Continued from page 7

laid out more than a decade ago, and editorial on Real Electronics ... April A combination open source and
Word still works with the same this year, I switched one Dell 1737 free-to-use software is the only way I
template I devised back in 2003. So, laptop to Ubuntu Studio for my audio have found to stop the continued cost
what is my incentive to pay an annual and SOC work. The other Dell laptop increases of software.
fee to Microsoft because some dirt-toe still has OEM Vista installed on the hard For hardware, the Rasberry Pi 3
rearranged everything to make it drive, but is set to boot a USB drive and ESP8266 have worked well for IoT
"better" and "more efficient." directly to an up-to-date unregistered and media services.
As an old guy, I can tell you that Win 10. Not the best solutions, but I have found VNC combinations to
there are a finite number of brain cells. useful in my volunteer work as sound work well. I use NoMachine for audio
Most brain cells cannot be and system technician for the Happy
Continued on page 40
reprogrammed for long-duty service, as Feet Cloggers.
happened when I was much younger.
My neurons are all filled. So stop
changing stuff that does not need
changing!
Sure, young people are enamoured
by the constant churn and changes.
Just wait until those little smarties start
to get old and figure out just what
grandpa was bitching about. Hah!
When young, you memorized
things you will never use again. I still
know how to use Micropro's WordStar
for crying' out loud. Heck, I could still
use ED.COM as delivered in CP/M 1.4!
B#T<CR> I23<CR> the quick brown fox
jumped in front of the truck
123456789 times<CR> B#T<CR>. And,
I could probably still write in "ENGLISH"
on a Microdata minicomputer using the
Pick operating system.
However, I cannot "unlearn"
ED.COM commands in order to make
room for more Microsloth's same old
Word with a facelift, just to screw with
your mind! Does anybody care about
that? Nope.
I had a couple more paragraphs
but the Internet ate it. Since Windoze is
so bloated with updates and Kaspersky
won't let me type, I switched over to
my Linux box so I could communicate.
Sometimes Linux and Firefox do not
play nicely together. I guess that
anything else I had was probably
unimportant.
Tom Farrand

A great read! And I completely


agree! I'm tired of relearning how to do
tasks simply to feed the coffers of the
software manufacturers. Thanks for
taking the time to write (I'm not really in
the media this isn't my day job).
Bryan Bergeron

More Real-ality
In regards to the June 2017
August 2017 23
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 24

BUILD IT YOURSELF
By Ronald Gladney

Use Wi-Fi and X-10 in a


Bi-Lingual approach to
Light and Appliance Part 1
CONTROL Breathe new life
into your X-10 home
control system by
using a combination
of the ESP8266 Wi-Fi
module, some off-the-
shelf SmartSocket
Wi-Fi modules and the
ever popular Arduino
Uno.

Web-based control of your legacy X-10 system


y solution was to develop a new light
For many years, I have used an X-10 remote
control system to give my house an occupied
appearance when I am away. Also, during the
M timer system that could overcome the
X-10 issues. I had recently retired and
have been exploring the Arduino Uno and
ESP8266, as well as several other
Christmas season, I have used X-10 to control microprocessor platforms. I decided I wanted to
decorative candle lights in all of my windows, develop the timer and remote control modules
using the Arduino family and ESP8266, and add
my front porch lights, and my Christmas tree a Wi-Fi capability for remote control.
lights. Several years ago, I bought a new single I chose Wi-Fi because I already have a Wi-Fi
level house. I discovered that my old X-10 light backbone that functions in all rooms of my
house. I chose the Arduino compatible family
timer had problems working reliably in some because many experimenters and hobbyists
areas of my new location. I have known the X- already have familiarity with these
10 limitations caused by weak or shunted microcontrollers, and I thought others might be
interested in implementing their own home
signals for many years, but this time I was not timer system.
able to easily work around that limitation. I As I researched protocols to use for Wi-Fi
tried many of the recommended solutions to communication, I found that the most common
protocol for home automation was Message
improve signal strength, but the bottom line Queue Telemetry Transport (MQTT), but the
was that some areas still would not work using Arduino Uno did not have the processing power
or the internal memory to perform as a MQTT
X-10 power line communication. server.
24 August 2017
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 25

To post comments on this article and find any associated files and/or
downloads, go to www.nutsvolts.com/magazine/issue/2017/08.

I looked at other protocols, and realized that I could


easily implement my timer system using Hypertext Transfer
Protocol (HTTP) based commands since I would simply be
transmitting on and off requests.
Therefore, I chose to develop my timer using the
HTTP protocol to send an on or off command using two
independent on/off zones. Each zone could communicate
with up to 10 Wi-Fi modules, or the 10 modules could be
divided among the two zones. More Wi-Fi modules could
be added by expanding the Arduino software, but for my
purposes 10 modules met my need.
In addition, each zone would communicate with X-10
modules configured to a selected channel and house
code, and many X-10 modules could be utilized in my
house in areas that have demonstrated reliable X-10
powerline communication. More timing zones can be
added (if desired) by including the needed timing sections
and menus to the Arduino software.
I envisioned designing a Wi-Fi based wall switch using FIGURE 1. Itead S20 Smart Socket Wi-Fi switch.
the ESP8266, so I purchased several of these modules and
3.3 volt relay modules. During my research, I found several
brands of Wi-Fi switches already on the market, but all of
them were programmed to communicate with the
manufacturers website for control.
I was concerned with network security, so I did not
want a web service to have access to my router SSID and
password (if the web service was attacked, the hacker
would have access to my home network). I also did not
want any web service having control capability or access
inside my house network. The beauty of the ESP8266 is
that it can easily be reprogrammed utilizing the Arduino FIGURE 2. Itead Sonoff Wi-Fi switch.
Integrated Development Environment (IDE). After much
research, I settled on the S20 Smart Socket Wi-Fi module the manufacturer configured and mounted the internal
by Itead because it is designed with an internal header circuit boards. Refer to Figures 1 and 2.
that can be utilized to easily reprogram the modules. The
price of these modules was reasonable and would provide Where Should I Begin?
a professional looking unit to be deployed around my
house. I decided to develop replacement code for the Itead
If a particular application would benefit from installing Wi-Fi switch modules as my first step, to confirm the
the remote control modules in a central location, Itead reliability of communications and control. I chose the
also offers a Sonoff Wi-Fi switch in a configuration that aREST library for ease of communication with the
has screw terminals for the power in and out that also has switches. The aREST library is available on GitHub as a
the reprogramming header. The two Itead modules are free download and was ported to Arduino by Marco
slightly different in configuration, so I have a slightly Schwartz. Please download aREST and aREST_UI from
different programming sketch for each when using the GitHub.com to ensure you have the latest version, and
Arduino IDE. add them to your Arduino IDE library.
During my research, I discovered that Itead had I chose to assign fixed Internet Protocol (IP) addresses
incorrectly configured their S20 Smart Socket Wi-Fi to each switch so I didnt have to worry about my home
modules (made for the US market) with the fuse and relay router arbitrarily changing the IP address of a switch. My
on the neutral wire. I contacted Itead and discussed the timer issues commands to these fixed IP addresses. This
wiring error, and they agreed to reconfigure the circuit adds a small complication in Wi-Fi switch programming
board to fuse and switch the line wire instead of the where different IP addresses must be programmed into
neutral wire. There are many other Wi-Fi switches that can each switch, but this is very easy during the programming
be reprogrammed, but identifying the power, ground, phase.
send, and receive lines may be difficult depending on how The IP addresses I chose to use are outside the range
August 2017 25
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 26

The affected section of a typical server


program code and my revised code are:
Typical server example code:
while(!client.available()) {
delay(1); }

Revised server code:


unsigned long loop=millis();
while(!client.available()) {
delay(2);
unsigned long loopchk=
millis();
if (loopchk-loop >130)
{ return; }
}

The S20 Smart Socket and the


hardwired version (Sonoff) can be
programmed by soldering in a four-pin
header into the four holes provided on the
circuit board. The circuit board is not easily
removable from the Smart Socket, but you
can solder the pins from the topside of the
circuit board.
I suggest sliding the header pin support
FIGURE 3A. S20 with FIGURE 3B. S20 revised factory bracket to the top of the pins and bending
programming header installed. AC wiring.
the pins near the bottom at a 30 to 45
degree angle before soldering so the
that my router automatically assigns to clients, so no installed pins will not interfere with the top cover
potential conflict will occur. Each Wi-Fi switch must also pushbutton. After soldering, remove the pin support
be programmed with your home network SSID and bracket to allow wires to be plugged onto the pins. (An
password so the Wi-Fi switches can log in during their alternate approach would be if the top and bottom of the
startup and be recognized by your home router. pin headers are identical; you can bend the long end of
I used standard web browsers to confirm that the the pins and solder them into the circuit board. Then,
revised code would reliably operate the Wi-Fi switches. remove the pin support bracket.)
The reprogrammed Wi-Fi switches would stop responding Figure 3A shows the original S20 with the
at random times. I was using different browsers to talk to programming header installed. Figure 3B shows the S20
the switches because I have several different devices revised factory wiring that moved the fuse from AC neutral
(phone, tablet, and desktop). to AC line in, and prior to soldering in the programming
Upon further troubleshooting, I discovered that the header. Figure 4 shows the Sonoff circuit board with the
switches only became non-responsive if I used Chrome on programming header installed. Programming pin
any of my devices as the browser. This would occur on designations are shown in Figures 3A and 3B for the S20
about 10% of the attempts to talk to the ESP8266 Wi-Fi and in Figure 5 for the Sonoff Wi-Fi switch.
switch. If Chrome was used in incognito mode, the My software sketch provides the capability to control
problem would not occur. each individual Wi-Fi switch by logging into the web page
I performed diagnostics on the C++ example server that each module hosts. For example, if I want to energize
program that was provided with the aREST library and my module at IP address 192.168.1.180, I would simply
found that the module was getting trapped in a loop. So, I open my Internet browser and enter that address in the
added diagnostics to my code to detect and recover from search bar. The module would respond with an On and
that trap. Many ESP8266 server example programs use Off button. You can see an example of the web interface
similar code, which leaves them vulnerable to this when in Figure 6.
Chrome is used as the browser. I can turn on the output by clicking the On button or
After adding the trap recovery software, I used turn off the output by clicking the Off button. This web
Chrome to communicate with the module in excess of 75 interface works on computers, tablets, and smartphones.
times without a communication failure. During this test The web page also provides diagnostic information
run, I also included print statements to the console that showing the received Wi-Fi signal strength and the
showed the module would repeatedly enter the trap and number of times the module has lost and restored its Wi-Fi
then recover without any observable problem in Chrome. connection since it was powered up.
26 August 2017
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 27

FIGURE 6. Example web page from FIGURE 4. Sonoff with programming header installed.
reprogrammed S20 or Sonoff Wi-Fi switch.

An alternate approach to logging into the interconnecting wiring, and then


web page is to issue a command string developing the Arduino sketch for
192.168.1.180/digital/12/1 to turn on the the timer and programming control
module, or 192.168.1.180/digital/12/0 to turn interface. During this research, I
the module off. This command string is what is could not find a library for the Uno
being sent by my timer to control each module. with an Ethernet shield that readily
I chose to use the aREST library as FIGURE 5. Sonoff header supported communication to
discussed previously because it provided a web pin assignments. multiple IP addresses without
page for control and a very simple command significant programming effort. My
string that could be transmitted over Wi-Fi for control of solution was to program an ESP8266-01 as the Wi-Fi
my Wi-Fi switches. There are many other ESP8266 libraries transmitter.
that already exist, and I am sure many are currently under I programmed the Wi-Fi transmitter to send on
development that also provide Wi-Fi control. You are free commands when it received capital letters A through J
to choose a different library, but to do so would require a from the Uno, and off commands when it received lower
rewrite of the software for the Wi-Fi switches and the Wi- case letters (a through j). These upper and lower case
Fi transmitter (ESP8266) located inside the timer. letters correlate to Wi-Fi modules 1 through 10,
respectively.
Next Big Step: Build and Developing the clock and timer code was relatively
straightforward. The majority of my time was spent
Program the Timer developing display and menu functions for programming
I started by selecting the hardware and developing the the timer and ensuring all modules would go to the

PARTS LIST DC-DC converter max 12V input to 3.3 VDC capable of
at least 700 mA P/N 1083356
Itead S20 Smart Socket Wi-Fi switches P/N 120 VAC to 9 VDC at one amp adapter to power the timer
IM160308002 purchased from Itead.cc.com P/N 916174

Itead Sonoff hardwired switches (option)(Wi-Fi only) X-10 (CM17A) Firecracker module purchased from eBay
P/N 1019971 Banggood.com (also available at (also available from X10.com)
Itead.cc.com)
Misc Parts:
Note: There is also a Wi-Fi version that includes 433 MHz Hookup wire to connect components
remote control. The software has not been tested on the Miscellaneous pin sockets salvaged from old electronics
version of this switch that includes a 433 MHz remote, 10K ohm 1/4W resistors (interface to ESP8266)
and my software would disable the remote control (Note: 1K ohm or 4.7K ohm resistors are also acceptable.)
functions. 1K ohm 1/4W resistor (Voltage divider for ESP8266
Receive pin)
Available from Banggood.com: 2K ohm 1/4W resistor (Voltage divider for ESP8266
Arduino Uno R3 ATmega 328P P/N 964163 Receive pin)
LCD/keypad shield for Arduino P/N 937405 (Note: A 2.2K ohm resistor is also acceptable.)
ESP8266-01 P/N 958131 1N4148 diode (To enable reset of ESP8266 from
DS3231 AT24C32 IIC real time clock for Arduino LCD/keypad reset button)
P/N 81066 100 mfd 15 volt capacitor (filter for DC-DC converter
output)
August 2017 27
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 28

RESOURCES
GitHub.com Locations for add-on libraries that must be
installed
https://github.com/marcoschwartz/aREST
https://github.com/marcoschwartz/aREST_UI
https://github.com/espressif
https://github.com/adafruit/RTClib
https://github.com/ekstrand/ESP8266wifi

Marco Schwartz website


www.openhomeautomation.net
FIGURE 7. ESP8266-01 pinout. https://arest.io

correct state if power was lost and restored while lights 3D printed enclosure
were either on or off. The X-10 control was added after www.thingiverse.com/thing:142282
everything else was functioning because it seemed a Itead
shame not to take advantage of the many X-10 modules www.itead.cc
that I presently own. Refer to Figure 7. www.itead.cc/smart-socket.html
I selected the Arduino standard serial port to www.itead.cc/sonoff-wifi-wireless-switch.html
communicate to the ESP8266 module. This kept the
Arduino
Arduino code cleaner because only one serial bus www.arduino.cc
communication channel was needed, and it avoided the www.arduino.cc/en/Main/Software
potential pitfalls that exist with the Software Serial
Library. The only limitation of this approach is that the ESP8266
ESP8266 must be unplugged or have its serial port https://espressif.com/en/products/hardware/esp8266ex/
overview
disconnected during any reprogramming effort on the https://kbeckmann.github.io/2015/06/28/Tinkering-with-the-
Uno. Once the timer is up and running, I anticipate a ESP8266
few cases where I will reprogram the Arduino.
If you choose to use my serial methodology but Banggood.com
www.banggood.com/UNO-R3-ATmega328P-Development-
later add diagnostic [Serial.write()] commands, be sure to
Board-For-Arduino-No-Cable-p-964163.html?rmmds=search
comment out those diagnostic messages before www.banggood.com/LCD-Keypad-Shield-V2_0-LCD-
connecting the ESP8266 serial bus. Any time an upper Expansion-Board-For-Arduino-p-937405.html?rmmds=search
or lower case letter (a through j) appears on the serial www.banggood.com/3Pcs-ESP8266-Remote-Serial-Port-WIFI-
port, it will cause the associated Wi-Fi module to Transceiver-Wireless-Module-p-958131.html?rmmds=search
www.banggood.com/DS3231-AT24C32-IIC-High-Precision-
respond. The ESP8266 draws more current (up to 300 Real-Time-Clock-Module-For-Arduino-p-
mA) than the Arduino 3.3 volt regulator can supply. 81066.html?rmmds=search
Therefore, I added a DC-to-DC converter to power the www.banggood.com/DC-DC-12V-5V-to-3_3V-Step-Down-
ESP8266 directly from my AC-to-DC adapter. Voltage-Regulator-Power-Module-p-
The Arduino provides a direct pin connection to the 1083356.html?rmmds=search
www.banggood.com/9V-1A-Power-Supply-Adapter-US-Plug-
9 VDC input (Vin header pin), so no cutting and splicing 2-Flat-Pin-For-Arduino-p-916174.html?rmmds=search
of the adapter power supply is required. There are many
DC-DC converters on the market. Be sure to choose X-10 CM17A Firecracker interface
one that can accept your maximum DC input voltage http://web.archive.org/web/20040326214130
with some operational margin. Also, if you choose a http://www.geocities.com/ido_bartana/Firecracker_protocol.htm
www.x-10.com
variable output DC-DC converter, be sure to adjust it to www.6502.org/mini-projects/firecracker/firecracker.htm
3.3 VDC before connecting the ESP8266 module.
The schematic (Figure 8) shows all component BroHogan
wiring required for this project. I incorporated the DC- http://playground.arduino.cc/X10/CM17A
DC converter and all ESP8266 support components on http://brohogan.blogspot.com
a small breadboard with an eight-pin header to plug in Location for Arduino.cc libraries
the ESP8266-01. R5 and R6 are required because the www.arduino.cc/en/Tutorial/EEPROMWrite
ESP8266 cannot accept +5 VDC that could be supplied www.arduino.cc/en/Tutorial/Wire
on the serial transmit pin from the Arduino. The serial www.arduino.cc/en/Tutorial/LiquidCrystal
receive pin on the Arduino will accept the 3.3 VDC
Installation of ESP8266 boards into Arduino IDE
signal from the ESP8266 transmit pin, however. https://learn.sparkfun.com/tutorials/esp8266.../installing-the-
My software does not require data to be transmitted esp8266-arduino-addon
28 August 2017
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 29

from the ESP8266 to the Arduino, but the wiring is


included to support potential software upgrades in
the future. My Wi-Fi network connects upon power-
up within about four seconds. My program allows
seven seconds for this connection. If your router
takes longer than seven seconds for connection of a
fixed IP device, I suggest you adjust the time delay to
encompass your router requirement.
I added this time delay to prevent the timer from
starting immediately because the software checks to
see if lights should be turned on at power-up. This
was needed because the timer and Wi-Fi modules
might have lost power and turned off. This check will
again turn on the Wi-Fi modules when power is
restored, but it will wait to allow the Wi-Fi link to be
established with the router.
My real time clock (RTC) module arrived
assembled with its backup battery connected. The
RTC was pre-programmed, but code in the setup
section of the Arduino sketch has the ability to
program the RTC if necessary during software
installation if power was lost to the RTC. I also added
a menu function to set the hours and minutes on the
RTC. If you choose to do so, the menu could be FIGURE 8. Schematic showing all connections to the
expanded to program the year, month, and day. I Arduino Uno.
didnt add these to my code because my timer
program does not utilize these features. (CM17A module). I chose to modify my Firecracker
My version of the Arduino Uno had an unpopulated module by removing the case and DB9 connectors so I
header that provides access to all of the pins needed for could mount it inside my timer case. I inserted my
the RTC. I chose to solder right angle pins into this header modified Firecracker board into a piece of heat shrink to
because I could bring out all RTC connections from prevent contact with other components. You can do the
underneath the LCD/keypad shield. This approach is not a same, or connect the Firecracker module to your Arduino
requirement, and not all Arduino Uno boards have this with a mating DB9 connector. If you choose to remove
unpopulated header. All connections required for the RTC the DB9 connectors, be aware that this is a tedious
are available on standard Arduino header pins. operation because the pins from the connectors are stiff
To and are soldered on both sides of the circuit board.
implement X- All pins must be unsoldered as a group before any will
10 control, I move, and the solder will wick between the pad and pin
selected the as you try to unsolder each pin. I recommend using a
X-10 Dremel tool or similar rotary cutter to slice through the
Firecracker DB9 pins at the inside edge of the DB9 connector body

FIGURE 9. Firecracker. FIGURE 10. Modified Firecracker.


August 2017 29
Gladney - Bi-Lingual Timer - Part 1 - Aug 17_Blank Project NV.qxd 7/4/2017 6:36 PM Page 30

remaining DB9 connector to identify the now


FIGURE 11. Typical X-10 exposed solder tabs for pins 4, 5, and 7 as
modules.
shown in Figure 8.
Remove the remaining DB9 connector
after soldering on the wires. The Firecracker
module is de-energized between commands
by setting DTR (Arduino pin 3) and RTS
(Arduino pin 2) to a low state. If you want to
implement additional X-10 commands, I
recommend you study the comments
included in my software sketch as it provides
more detail on the Firecracker
communications protocol, and includes a
reference to the developer of the Arduino
commands that I implemented. Refer to
Figures 9, 10, and 11.
so each pin can be unsoldered easily. This technique will Next month, I will discuss the LCD/keypad shield, the
create conductive dust, so be sure to remove the dust Bi-Lingual Timer user menu, and the case I selected. I will
after completion and before energizing the Firecracker also offer some helpful tips on programming. If you are
module. interested in building this timer, I have provided Arduino
Alternately, you could wrap the circuit board prior to sketches of all the software and additional information in
cutting to minimize metallic dust accumulation. I the resources available for download from the article link.
recommend removing one DB9 connector and using the NV

30 August 2017
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 31

BUILD IT YOURSELF
By Eric Bogatin

Build a Geiger Counter


to Monitor a
RADIOACTIVE CAT

FIGURE 1. Maxwell near his Geiger counter in its plastic housing.

My cat, Maxwell (Figure 1), has an overactive thyroid; a condition called


hyperthyroidism. The cure for him (at least for the last two years) has been
giving him pills of Methimazole. All cat owners know that giving a cat a pill is
no fun for anybody. When he requires four pills a day and each one costs
$0.50, its like shoving two dollar bills down his throat every day. Its even more
expensive when the pills are ground up in tuna.
August 2017 31
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 32

Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/magazine/issue/2017/08

A
web search revealed there is another treatment used to image deep tissue. This is the basis of PET
for hyperthyroidism with a 95% success rate in (Positron Emission Tomography), for example. Youre
cats, based on radioactive Iodine-131. The idea injected with a biologically active material that emits
is to kill off the overactive regions of the thyroid with positrons an anti-electron. As soon as it is emitted, it
radiation. Because the thyroid selectively absorbs iodine, a immediately annihilates with the first electron it
radioactive form of iodine is injected into the cat. It encounters, and the pair gives off two gamma particles
concentrates in the thyroid and over a few weeks, kills off which make their way out of the body and are detected.
some of the thyroid. When done correctly, this is a Iodine-131 decays into Xenon-131 by emitting a beta
permanent cure. However, it means making him particle with energies ranging from about 190 keV to 606
radioactive, but only for a few weeks. keV. This is what does all the medical work. This is a lot of
energy to be deposited locally into the targeted tissue. The
Radioactivity and Iodine new Xenon nucleus is created in an excited nuclear state.
Immediately after the neutron emits the beta particle and
Every element on the periodic table has just one decays into a proton, the new proton jiggles around, drops
unique atomic number. This is the number of protons in its down to a ground state, and emits a gamma particle with
nucleus; the same as the number of electrons in the atom. an energy of 364 keV.
The atomic number of iodine is 53. Iodine can have a By comparison, a dental x-ray may be as high as 70
wide range of neutrons in its nucleus. We call these keV. This 364 keV gamma ray particle makes its way
different forms of iodine (with different numbers of outside the body and we see it as radiation. With I-131,
neutrons) isotopes. we get a 2-for-1. The beta particle does the therapeutic
There are 37 known isotopes of iodine all with 53 work and the gamma particle allows us to see it in action.
protons in the nucleus, but with 55 to 93 neutrons. We Every gamma particle we detect means there was a beta
track the total number of particles in the nucleus as the particle killing off thyroid tissue.
atomic weight. For iodine, it varies from I-108 to I-144. The half-life of I-131 is eight days. This means every
All of these isotopes are radioactive except I-127, eight days, the number of I-131 atoms left is reduced in
which is stable. Iodine-131 has special use in medical half, and the rate of decay has decreased by half. After 16
treatments. This is partly because iodine is biologically days, there are about 1/2 x 1/2 or 25% of the starting
active and is selectively taken up by the thyroid. It is a number of I-131 atoms left, which means the radiation
beta and gamma emitter with a half-life of eight days. This emitted is reduced to 25%. After 60 days (or about eight
is perfect for targeted radiation attacks on thyroid cells. half-lives), there is only 1/ 2^8 = 0.4% of the radiation
There are three types of radioactive particles emitted levels as initially.
in radioactive decay: alpha particles, which are two I expected Maxwells radiation levels to drop off faster
protons and two neutrons; beta particles, which are high than an eight day half-life because he was constantly
energy electrons; and gamma particles, which are high losing radioactive iodine from his body as it cycled
energy light photons. through. It was flushed out of his system and ended up in
Alpha particles have the potential to produce the his kitty litter, which would also be radioactive.
most biological damage, but they dont penetrate much The vets at the clinic warned us not to spend much
more than the thickness of a piece of paper. However, if contact time with Maxwell until his radiation levels
the radioactive source is ingested or inhaled, it can do a dropped and to not throw his litter out in the trash. They
lot of local cell damage. said the radiation levels in his used cat litter might set off
Radon is a noble gas which decays and emits alpha radiation detectors at municipal dumps.
particles. Breathe it in and it decays in your lungs, and you I wanted to build a radiation detector to see how hot
have a higher chance of contracting lung cancer. This is Maxwell was initially, and how quickly his radiation levels
why we test for radon in basements where it is a decay (and his used cat litter) dropped off.
product of uranium into radium, and then into radon,
naturally occurring in bedrock. Detecting Radiation
Beta particles dont penetrate more than a quarter of
an inch in tissue. This means that if they can be placed Since I was only going to detect gamma particles, a
strategically in tissue you want to kill off, they will deposit Geiger counter was the obvious detector choice. The
all of their lethal effects very localized. Beta emitters make original name for the detector is really a Geiger Muller
the perfect surgical strike killers. tube, named after Hans Geiger and Walther Muller, who
Gamma particles are just a form of light but of very developed the detector in 1928. Its sometimes referred to
short wavelength, or high energy per photon. They travel as a GM tube, including both inventors.
much farther through the body and through air than beta A GM tube is basically a vacuum tube with about
particles. These will make it out through the body and are 1/10 an atmosphere of air. A central wire (the anode) is at
32 August 2017
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 33

a high positive voltage, while the outer metallic cylinder


(the cathode) is at a lower voltage. When a particle like
a gamma particle or beta particle passes through the
thin gas, it leaves a trail of ions and electrons behind it.
The ions accelerate to the lower voltage outer shell (the
cathode).
If the voltage is high enough and the gas pressure
is just right, the ions collide with more air molecules
and ionize them; they get accelerated and ionize more;
and we get an avalanche and a large current burst. This
avalanche multiplies the original number of ions created
by the gamma particles by a factor of 100 or more. It
self-terminates in a micro second or so.
There are Geiger tubes for sale from scientific
supply houses, but they range in price from $100 to
more than $300. However, when you do a web search FIGURE 2. Soviet military surplus Geiger tubes and
for Geiger tubes, the first items that come up are their packaging.
vintage Soviet military Geiger tubes on eBay for only
$5-$20. These were used by Soviet soldiers when never damaged an Uno. Until this project.
investigating potentially hot areas. I blew two Arduinos by accidently touching a digital
I went ahead and purchased two of the STS-5 Geiger pin to the 50V on the low side of the high voltage supply.
counter tubes (shown in Figure 2) which had never been I was very careful after this.
used. I paid $16 for each one. The Geiger tube takes about 300V. This voltage level
The specs say the Geiger tube operates between with its capacitance can be lethal! DO NOT ATTEMPT
280V to 390V. The background rate is about 25 counts THIS CIRCUIT UNLESS YOU ARE EXTREMELY CAREFUL!
per minute, with a max count rate of about 150,000/min. As a special precaution, I built the entire circuit inside
These units are shipped from the Ukraine. When the a plastic box (Figure 3) which I could seal up, and keep
package arrived with the Ukraine return address and fingers and cat noses and tails from touching anything that
Cyrillic writing, my wife warned me that we were probably might be high voltage. This also made the project
on a Homeland Security list somewhere. When I transportable and easily handled.
mentioned I might be ordering some radioactive samples This circuit has three parts: the high voltage generator;
to test my Geiger counter, she drew the
line and told me she did not want a visit
from Homeland Security. I had to make do
with something else.
The next step was to build the
electronics to power-up the Geiger counter
and count current pulses, record the
counts, and convert to counts per minute
to be plotted directly into Excel.

The High Voltage


Circuit
Since I am enamored with the power
of the Arduino, my detector was going to
be Arduino based. I didnt need anything
very sophisticated so decided on an Uno,
which is my workhorse general-purpose
Arduino. I use this microcontroller in the
workshops I teach at our local hackerspace,
Tinkermill. In my three years of teaching
this workshop with more than 300 FIGURE 3. The Geiger counter circuit and tube are inside a sealed
participants and all of my playing around, plastic box for safety and convenience. Note the battery connection
plus Maxwell as my ESD tester I have for portable operation.
August 2017 33
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 34

simple: A short 5V digital pulse from an Arduino pin


turns the transistor on briefly. This sends current
through the inductor. The voltage across the
inductor is clamped by the 5V supply on one side
and on its other side, the low impedance of the on-
transistor tied to ground.
When the transistor turns off, the current
through the inductor suddenly stops and the back
EMF voltage generated across the inductance of the
primary winding goes very high, limited by the
maximum collector-emitter breakdown voltage of
the transistor. This is about 50V for the transistor I
am using.
This means I get a 50V voltage pulse on the
primary winding, or a 500V pulse on the secondary
windings. The turns ratio for this simple audio
transformer is 10:1. This 500V pulse on the high side
is rectified by the initial diodes and then gets
FIGURE 4. RadioShack 273-1380 audio output transformer. dumped into a 10 nF capacitor. The capacitor
smooths out the pulses into a more steady value.
Since I am using potentially 500V, I made sure my
the detector circuit; and the pulse output circuit. I wrote diodes and capacitors had a 1 kV rating.
the sketch to control the high voltage, count the pulses, This is basically a peak detector circuit with a little
and print the counts per minute directly into Excel. voltage boost. I added a 10 meg load resistance so there
I wanted to generate a stable voltage across the would be a constant bleed off of voltage from the last
anode and cathode with low noise and an adjustable capacitor. The time constant of the 4 x 10 nF capacitor
value from about 250V to 400V. When I looked at high and 10 meg resistor is 0.4 sec. This means once pulses
voltage generator circuits for Geiger counters on the Web, stop entering the transistor, the voltage across the GM
they were almost all based on a boost circuit and tube would drop to nearly zero in about two seconds. This
transformer using a 555 timer with a fixed frequency. This is a good safety feature!
would be okay if I just wanted a fixed voltage, but I didnt Each pulse dumps a little charge into the capacitors. If
know what voltage would work best with these Soviet the transformer pulses dump charge into the capacitors
Geiger tubes. faster than the 10 meg resistor drains it off, the voltage
So, I decided to design my own boost circuit, but take increases. I had to send pulses often enough to charge up
advantage of the audio transformers used in most of the capacitor. I read the voltage across the capacitor with
these. I used to be able to get these small form factor 10:1 an analog channel. I only send pulse trains out to the
transformers from RadioShack (Figure 4). I visited the only transistor when the voltage on the capacitor is below the
RadioShack left in our town and bought the last three set-point voltage.
units. I figured I was going to use an Arduino anyway, so Of course, I couldnt connect the ADC (analog-to-
why not use it to control the pulses through the boost digital converter) input pin directly to 500V. Im limited to
circuit based on the voltage on the supply. It would act as a max of 5V on the ADC pin. I used a 1,000:1 attenuator
a smart digital power regulator. using the 10 meg bleed resistor and a 10K resistor in
The circuit is shown in Figure 5. The principle is series. The voltage across the 10K resistor is 0.001 x Vcap.

FIGURE 5.
Circuit for the
high voltage
power supply.

34 August 2017
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 35

A 100V rail is recorded as 0.1V on


the ADC pin. With 10-bit resolution
on the ADC, I have a resolution of
5 mV on the ADC. This translates
to 5V resolution on the voltage rail.
This is plenty good.
I added one other feature. I
wanted a clean stable voltage on
the Geiger tube. With all these
pulses, I was getting too many
spikes. I added a three-stage RC
filter on the output of the rail. Each
capacitor is 10 nF, and I wanted a
1 ms time constant, so I used 100K FIGURE 6. Voltage pulses into the transistor and the output voltage rail
resistors in each stage. with just background counts.
By experimenting around, I
found that a pulse width driving the
transistor of about 0.5 ms was the
minimum width to get the full
voltage across the inductor. The
fastest they would be generated is
1 kHz.
For these sorts of pulses, a
scope is an essential lab instrument
tool. One of my favorite lower end
scopes is the Picoscope 2204A: an FIGURE 7. Current pulses from the Geiger tube with a source nearby
eight-bit 100 Msample/sec scope showing current peaks from 0.4 mA to 2 mA.
with a list price of $129 shipped
with their standard scope software. Figure 6 shows the through the Geiger tube to ground. To measure this
voltage on the rail with the 1,000x attenuator and the current pulse, I passed the current through a 10K resistor
pulses to the transistor, while the voltage is being and measured the voltage pulses on my scope. A 1V pulse
regulated at 310V. Each pulse increased the voltage on means 0.1 mA of current. Figure 7 shows a few of these
the rail; while between pulses, the voltage drooped due to pulses. The scope limit is 20V on this scale.
the 10 meg bleed resistor. The pulses are typically greater than 0.5V across the
I like feedback. I added an LED in series with the 10K resistor. Just to give a little bit of margin, I used a
digital signal to the transistor that triggers the high voltage. 100K resistor across the transistor base in the detector
This way, I can glance at the board and confirm by the lit circuit. The exact value wasnt important, as long as the
LED that pulses are going to the high voltage generator. voltage pulses were above 0.6V enough to turn on the
transistor and pull the Arduino pin down.
Pulse Detection Circuit I set up the Arduino digital pin as an input using the
INPUT_PULLUP mode. This ties the input receiver on the
Each ionization avalanche causes a brief current pulse pin to the +5V line through a 10K resistor. Normally, when
the transistor is off, the input voltage read is a logic 1 at
QTY ITEM 5V. When the transistor turns on from a detected current
1 Arduino Uno pulse, the input to the pin is pulled low and seen as a low
1 Solderless breadboard by the Arduino.
1 RadioShack 273-1380 audio output transformer
1 TIP31 NPN transistor I used an interrupt function to react to the falling edge
2 Red LEDs signal picked up on one of the digital input pins. When a
3 1N4007 1 kV diodes falling edge is detected, the function in the interrupt
5 10 nF 1 kV ceramic capacitors increments a counter and waits for 8 ms as a dead time.
5 100K resistors In the avalanche process, sometimes double pulses are
1
1
10 meg resistor
1 meg resistor PARTS created due to secondary breakdown in the gas. Adding
1
1
10K resistor
1K resistor
LIST this 8 ms delay avoids any double counting. It also
increased the dead time.
1 Arduino piezoelectric buzzer For example, if in 60 seconds, there are 600 counts,
August 2017 35
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 36

the count rate is 600 counts per


minute. The dead time is 600 x 10 ms
= 6 sec, or 10%. For lower count
rates, the dead line is less. For higher
count rates above 600 counts/min, the
dead time will increase and we may
not get an accurate count rate.
Each time I detect a pulse, I also
flash an LED pulse and I click a
buzzer. After all, whats a Geiger
counter without a clicking sound?

Exporting to
Excel
I love numbers. If math is the
language of theoretical science,
measurements are the language of
FIGURE 8. Count rate
experimental science. Measurements
measured while Maxwell are especially valuable when we can
was in his cat apartment. bring them into Excel and analyze
He can be seen inside the them. In searching on the Web, I
top hole in the photo to came across an invaluable free tool
the left.The Geiger which allows me to write data directly
counter is right above him.
into an Excel spreadsheet. Ive written
about this in Nuts & Volts a few times
(see Resources).
The application is called PLX-DAQ v2 and is basically an Excel file
with a macro that reads the serial port and parses the printed values
into cells (see Resources for a link to download an Excel file with this
macro embedded).
I wrote a sketch to count pulses in 10 sec intervals, then calculate
the counts per minute and print these values every 10 seconds to Excel.

Resources Geiger tube on eBay:


www.ebay.com/itm/28190022811
9?_trksid=p2057872.m2749.l2649
Why You Need an Analog Front &ssPageName=STRK%3AMEBID
End and How to Set It Up, Eric X%3AIT.
Bogatin, Nuts & Volts, February
2016, p. 38. RadioShack audio transformer
(like this one):
Turn Your Microcontroller into a https://www.radioshack.com/pro
Precision Data Acquisition ducts/radioshack-audio-output-
System, Eric Bogatin, transformer.
Nuts & Volts, June 2017.
Pictotech P2204A scope:
Special Day for Physicists Cats, https://www.picotech.com/oscillo
Eric Bogatin, EDN news portal, scope/2000/picoscope-2000-
August 12, 2013 specifications.
(www.edn.com/electronics-
blogs/test-voices/4419602/Happy- Arduino Based Data
birthday-Schrodinger). Acquisition, Eric Bogatin,
Nuts & Volts, June 2015, p 34.
Iodine 131 treatment:
https://vcahospitals.com/alameda Link to download PLX-DAQ v2:
-east/specialty/services/internal- http://forum.arduino.cc/index.php
medicine/radioactive-iodine- ?topic=437398.msg3172623#msg
therapy-for-feline- 3172623.
hyperthyroidism.

36 August 2017
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:37 PM Page 37

FIGURE 9. Example of building a relatively


complex circuit using a solderless breadboard.
The entire circuit took about three hours to
design, build, debug, and optimize.

In Excel, I plot the count rate over time. Figure 8 is


an example of the count rate measured over a
period of six hours while monitoring Maxwell in his
cat tree apartment.

My Prototyping
Philosophy
From my years of experience in startups and
product development programs, Ive embraced the
motto, Fail often and fail early. This means I want
to design and build a prototype with the best
practices I can think of, but get it done quickly.
Then, I can use the prototype to test my approach. I
want to use my prototype to help me find the things
I could not anticipate, so the next versions get better
and better.
When I build Arduino circuits, I always start out
building them on a solderless breadboard. It takes
minutes to put something together and test out. Figure 9 to see, but was it really detecting radiation?
is the prototype Geiger counter that I put together in I needed a radiation source to test my Geiger counter
about three hours. It is so much quicker than designing a (remember my wife forbade me from ordering anything
circuit board, sending it out to get made, and assembling that could potentially trigger a Homeland Security alert).
it. When I have a final stable design and may want to Turns out, I could buy one at Walmart.
make multiple units, I will design a board at that time. There are two types of smoke alarms: photoelectric
The downside to using a solderless breadboard is that based and ionization based. The ionization based smoke
it may have more noise and not as good signal integrity as detectors have a small piece of Americium-241. It is
a multi-layer circuit board. This is one reason I mount my radioactive, and emits an alpha particle and a very low
solderless breadboards on a copper base connected to energy gamma particle. The gamma particle has an energy
ground. I keep wires short and route signal lines close to of 59 keV which is in the range of dental x-rays. I had no
the copper base, and pay attention to all signal return hope of detecting the alpha particle, as it would be
paths. In other projects, Ive been able to keep voltage stopped by the metal wall of the Geiger tube. However, I
noise levels from AC and RF pickup below 1 uV RMS. thought I might be able to detect the low energy gamma.
My designs may not look pretty, but I can construct I bought an ionizing smoke detector for $7 and took it
them quickly, make changes on-the-fly, and optimize the apart. I found a piece of metal that looked like it could be
design in hours instead of weeks. They have surprisingly the ionizing source. I pulled this off the detector and
good performance.

Testing My
Geiger
Counter
When I turned on the voltage
to my Geiger counter, I
immediately began detecting pulses
when the applied voltage was
above 290V. I settled on 310V as
giving a steady rate of pulses, at
about 30-50 counts per minute. FIGURE 10. Americium source pulled from a smoke detector and placed
This was the background I expected on top of the Geiger tube.
August 2017 37
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:38 PM Page 38

brought it close to the Geiger counter (shown in


Figure 10). To my delight, the buzzer starting
buzzing and the LED light started flashing. When
the source was right on top of the Geiger tube, the
count rate was 950 counts per minute, as
compared to about 45 counts/min as background.
My detector was working! A recording of this
source is shown in Figure 11.

Maxwell is Hot
One week after his injection of I-131, we
picked up Maxwell at the vet and brought him
home. It was a little hard to get him to stay still
long enough to measure his count rate. I had cut
the counting interval down to 10 seconds, but I
FIGURE 11. Background count rate and when the smoke still needed the cat to stay still for a few minutes to
detector source is on top of the GM tube. get good statistics. Figure 12 shows my first
attempt to get a reading on Maxwell.
I found early on that his count rate was
strongly dependent on how close he was to the
detector. To get stable and reproducible readings
and compare his count rate changes each day, I
decided on measuring him with a fixed distance of
12 inches from his neck. I also waited for him to
settle down in one of his favorite napping
locations. Figure 13 shows the typical setup I used
to get reproducible measurements.
On his fourth day home, his count rate was
about 850 counts per minute at 12 inches. Figure
14 shows these initial stable readings.
On day 11, Maxwell was down to 160 counts
per minute. By day 13, he was down to 92 counts
FIGURE 12. First reading of counts from Maxwell. He was at per minute only twice above background.
more than 6,000 counts per minute almost at the Unfortunately, his poop wasnt.
measurement limit!
What Do You Do with
Radioactive Kitty
Litter?
Part of the reason Maxwells counts dropped so fast
was that he was excreting a lot of the radioactive iodine.
This meant his kitty litter was radioactive. I scooped up
the first sample and kept it in a bag to use as a reference.
The decay rate of this clump should reflect the decay rate
of I-131. I kept this around my lab and measured it
periodically, trying to be careful to keep it the same
distance from the detector each time.
I used the lid of the plastic box of the Geiger counter
as the reference position. Figure 15 shows the sample
resting in the detector box while I took readings for an
hour to get good statistics. With a count rate of about 600
counts/min over one hour, I collected about 36,000 total
FIGURE 13. Maxwell napping while I measured his counts. The standard deviation on this is about
count rate with the detector 12 inches from his neck. sqrt(36,000) = 190 counts/per hour = 3 counts/min. My
38 August 2017
Bogatin - Radioactive Cat - Aug 17_Blank Project NV.qxd 7/4/2017 6:38 PM Page 39

FIGURE 14. Maxwell at 12 inches, with about an 850


counts-per-minute average reading on day four.

hot. I was getting counts of more than 500 counts/min


with the detector close to the bag. I had a five gallon pail
with a sturdy lid in the back yard to store the used kitty
litter until the count rate dropped down. I estimate this
will be in about four half-lives, or about one month. The
count rate will be just above the background by then and
I can send it to the municipal dump.

FIGURE 15 Measuring the first kitty litter sample


with a precision distance from the detector.
Prognosis
Maxwell came through his procedure with no
statistical noise on the decay rate for this sample was complications. One month after his treatment, his thyroid
about 3 counts/min, or a little less than 0.5%. and blood work had him almost back to normal. The vet
Using the first sample as a reference, I can measure says we have to wait six months after the procedure for
the half-life of I-131. Every few days, I measured the count the final verdict.
rate of this sample over a one hour period. This gave good In the meantime, I have some other experiments
statistics. I then plotted up the count rate in counts per planned with my Soviet military surplus Geiger counter.
minute, averaged over at least one hour. This is plotted on Assuming Homeland Security doesnt come knocking.
a semi-log plot in Figure 16. When plotted on a semi-log NV
plot, the exponential decay rate is a straight line.
I fitted an exponential decay rate and got a
decay rate of 10.75 days.
The half-life is calculated as the exponential
decay rate x ln(2) = 7.45 days. This is pretty
close to the 8.03 day reported half-life of I-131. I
might have gotten a more accurate value if I was
more careful in preparing the sample instead of
just casually throwing it on top of the lid. The
position of the sample and the distance to the
detector is an important factor influencing the
measured count rate.
In addition, I did not do a very good job of
tracking the exact time of day I performed the
measurement. The precise time of each
measurement could be off by as much as 0.25
days.
After the first few days, Id collected enough FIGURE 16. Decay rate of the first kitty litter sample averaged
used kitty litter to bag up. Sure enough, it was over one hour, measured for three weeks.
August 2017 39
New Products - Aug 17_Mar15 -NV - NewProducts.qxd 7/4/2017 6:33 PM Page 40

READER FEEDBACK Continued from page 23

pass-through with TeamViewer on an "Real Electronics ..." to the new computer and go online to
iPad 6s to access my laptops in the Here is a different solution to the VMware and download a new driver
garage from my rocker in the living constant change in computers and program.
room or from the porch in cooler operating systems that may be of An interesting side note is that
weather. Tightvnc and Tigervnc also interest to your readers. VMware is a subsidiary of Dell
work well with SOCs. Copy your old computer onto your Computer (ref: www.vmware.com).
Since the iPad has an Internet data new computer to run as a program An old old reader from the
connection, I can also connect away using VMware (Virtual Machine Ware). Popular Electronics age
from home if needed using a single I had a local computer service Gary Bates
open port on the router. convert the contents of my old
Frank Townsend computer onto a new computer to run Excellent solution!
as a program. I've used VMware in the past with
Thanks for sharing. I'm not aware of All I do now is click on a program some success. It happened to be with a
everything that you mentioned, and will icon to run my old computer and its CAD program as well (killer prices!), but
put them on my 'must investigate' list. old programs. that was over a decade ago. Still works
Bryan Bergeron This saved me over $7,460 in today, I imagine. Thanks for the
upgrades on just two CAD programs suggestion. I'm sure many readers will
Real Solutions alone and cost me $99 to have the be appreciative.
Regarding Bryan Bergerons conversion done. Bryan
editorial in the June 2017 issue titled Now when I get a new computer, (also a past fan of Popular Electronics)
all I need to do is copy the program file

NEW PRODUCTS Continued from page 19

AUDIO/MIDI anywhere. The integrated Class-A


preamp features a precision input
INTERFACE gain control to handle a wide array of

I K Multimedia announces its iRig


Pro I/O: a pocket-sized mobile
audio/MIDI interface for iPhone,
input signals, giving it a tremendous
amount of flexibility in a super-
compact design. iRig Pro I/O features
iPad, Mac, PC, and Android a multi-color LED indicator for visually
devices. optimizing the input gain level and
iRig Pro I/O (the successor to IK's monitoring the input signal to prevent
iRig PRO) raises the bar for personal clipping.
mobile interfaces with a new set of iRig Pro I/O includes MIDI input
features and included software and and output ports offering connectivity
optimizing battery life is key. The apps. iRig Pro I/O is an ultra-compact,
DL3000's integrated Battery Test plug-and-play, portable interface that
Mode allows users to complete lets musicians hook up all their gear
battery discharge testing, letting them guitars, basses, studio mics, vocal
see live capacity in mAh and service mics, keyboards, and more to their
time. The DL3000 comes with a free mobile devices or computers and
UltraLoad software application that record 24-bit/96 kHz pro-quality
allows for full instrument monitoring audio and MIDI tracks anywhere.
and control over USB or LAN, giving iRig Pro I/O features a high
users more flexibility in how they set quality 1/8" headphone/line out with
up and monitor experiments, as well level control for use with the latest
as easy access to data for offline Apple devices (like the iPhone 7) to
analysis. connect to headphones, mixers, or
Available in four configurations, powered monitor speakers.
the DL3000 provides a solution for Additionally, iRig Pro I/O includes
customers looking for a highly built-in device charging for extended
capable but affordable programmable playing sessions, using an optional
DC load. power supply.
iRig Pro I/O gives players the
For more information, contact: ability to record 24-bit audio at
RIGOL Technologies sample rates of up to 96 kHz and
www.rigolna.com provides stunning audio quality
40 August 2017
New Products - Aug 17_Mar15 -NV - NewProducts.qxd 7/4/2017 6:33 PM Page 41

with MIDI keyboards, controllers, and and T-RackS Deluxe with Mic Room. generate output signals at up to 12
synths to record MIDI tracks, control iRig Pro I/O is available for MHz.
virtual instruments, use control $149.99. Prices exclude taxes. The IO-Warrior56 is available as a
surfaces, pedalboards, and connect plug-in PCB module or as a 56-pin IC
outboard sound modules and more. For more information, contact: for installing on a custom board. Also
The multi-color LEDs on iRig Pro I/O IK Multimedia available is a new IOW56 Starter Kit
provide visual feedback of MIDI www.ikmultimedia.com with a large breadboard area,
in/out activity. designed specifically for the IO-
For real time monitoring on the UNIVERSAL USB I/O Warrior56.
go, iRig Pro I/O features a high Warrior ICs from Code
quality 1/8" headphone/line output CONTROLLER Mercenaries are a family of universal
with level control. Users can plug in
their headphones, connect to a mixer,
or hook up a set of powered
S aelig Company, Inc., has
announced an improved USB
I/O controller the IO-Warrior56
I/O controllers for USB that handle all
complex USB protocol details without
requiring special Windows drivers
monitors like iLoud Micro Monitor. now with 50 I/O pins as well as since Warrior ICs appear to the OS as
With any connection, the integrated complex functionality. In HID Device Class (Human Interface
headphone/line output delivers addition to I2C, SPI, 8x8 key matrix, Device).
crystal-clear audio for accurate 64 x 8 LED matrix, and support for This means that Warrior ICs are
representation of the audio program. most alphanumeric and graphic LCD controlled without screen prompting
iRig Pro I/O features a Neutrik modules, the new version also offers for additional software; standard
XLR/1/4" combo input that lets users system drivers allow access to
plug in all their gear; from dynamic, Warrior ICs directly from
condenser, or ribbon microphones to application programs. A Linux
unbalanced Hi-Z or line level driver is also available.
instruments like guitars, basses, and All of the modules work with
more. iRig Pro I/O features a 48V standard HID system drivers, so no
phantom power switch for powering special installation software is
condenser or active ribbon needed; just hook up to a USB port
microphones. and connection is immediate.
With the adjustable numeric IO-Warrior56 technical data is
input gain control, users can easily as follows:
recall the gain settings for their
recordings. Full speed USB (12 Mbit/s, 1,000
iRig Pro I/O can operate on 2x reports/s)
AA batteries (included) when Works with built-in system drivers
connected to an iPhone/iPad, or on 50 I/O pins for general use
USB power when used with a Mac or I2C master, 50/100/400 kHz
PC. iRig Pro I/O also features a new Direct control for most
DC in port that when used with its alphanumeric and graphic LCD
dedicated power supply unit an eight-channel 14-bit A/D converter modules
charges a connected iPhone or iPad and a 16-bit PWM generator. SPI master up to 8 Mbit/s
while in use for unlimited playing or The IO-Warrior56 handles the LED matrix up to 64 x 8 with
recording time, whether on stage and control of more complex signals external shift registers
in the studio. internally in order to reduce USB 8 x 8 key or switch matrix
iRig Pro I/O comes with Mini- traffic and CPU programming burden. 16-bit PWM generator (up to 12
DIN to USB and Mini-DIN to With the addition of an A/D MHz output)
Lightning cables along with two five- converter, the IO-Warrior56 is now Available as chip, module, or starter
pin MIDI to 2.5 mm cables for capable of handling analog signals. kit
connection to standard MIDI gear. Each of the eight analog channels can
iRig Pro I/O comes with more be sampled every 385 s. When The IO-Warrior56 Starter Kit is
than $500 worth of included IK running in single channel mode, the priced at $44.
software. sample rate is 7,800 Hz.
Users get full versions of IK's titles A new 16-bit PWM generator For more information, contact:
like AmpliTube 4, AmpliTube for uses an internal 1 kHz, 250 kHz, 2 Saelig Company, Inc.
iPhone and iPad, SampleTank 3 SE, MHz, or 48 MHz clock and can www.saelig.com
August 2017 41
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 42

Solar Intensity Monitor


An Arduino Uno/MakerPlot Data Acquisition Project

A system will be described which generates a


plot of solar intensity on a PC monitor over
the period of a 10 hour day. It can be armed to
start the plot at any specified future time.
monitor as my user interface, but the MakerPlot package
MakerPlot (data acquisition and graphical as an alternate approach provides a much more visually
plotting software for microcontrollers) interesting display capability. Plus, MakerPlot can provide
Real Time Clock (RTC) services to the Arduino
replaces the Arduino built-in text based serial microcontroller, which is an important requirement for
monitor with a visually interesting display of implementing the sort of scheduling functionally
graphical components consisting of meters, envisioned for this project.
The hardware and software described here comprise a
switches, and text/numeric display fields. small real time DAQ that currently measures and plots
Data collected is preserved for further study sunlight intensity over a period of time. Instead of sunlight
intensity, the system could plot anything that can be
both graphically (automatic plot screen converted to a 0-5 VDC signal level for the Arduino Unos
captures) and in text based log files. analog inputs (for example, greenhouse light levels and/or
temperature, aquarium temperature, weather station data,
Significant tutorial Arduino/MakerPlot or even the RPM of a hamsters exercise wheel!).
interaction aspects will be discussed, as well Although only one analog variable is tracked in the current
as hints to bypass delays or bugs in future application, expansion up to 10 is trivial. Digital on/off
data can also be plotted.
development or enhancement activity. The Arduino/MakerPlot/Time library package
described here is a perfect platform to collect data from

A
pplying a data acquisition system (DAQ) to record or otherwise monitor the behavior of small laboratory
sunlight intensity throughout the day makes perfect projects.
sense to me. Required hardware is minimal, and
working through the related software challenges is Application Detail
a great learning experience.
I first considered using the standard Arduino serial Besides creating a 10 hour profile plot of sunlight
intensity, I wanted the application to provide a means to
set up the next day data collection start time the night
before, and then have it capture the required solar
intensity data for the desired 10 hour period without any
further attention from me. After the plot start time is
entered, a numeric display field shows remaining minutes
in the countdown period until plot start.
The application captures a jpg image of the data plot
and Event Log, and saves it to the PCs hard drive prior to
shutting down at the end of the plot period. A collection
FIGURE 1. A collection of of recent 10 hour plots can be seen in Figure 1.
recently captured sunlight
intensity plots. Finally, for reassurance that all is in sync, a display
field on the MakerPlot user interface shows what time
the Arduino is using so it can be visually checked for
agreement with PC time.
42 August 2017
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 43

By Ken Fisher
To post comments on this article and find any
associated files and/or downloads, go to
www.nutsvolts.com/magazine/issue/2017/08.

FIGURE 2. A complete data acquisition system: an Arduino in the black


plastic enclosure and MakerPlot on the laptop. The wiring goes to the
solar cell in the window.

FIGURE 3. Plugboard
junction box, MakerPlot
Arduino Uno, and
duplicate of window As mentioned, MakerPlot is a collection of
mounted solar cell. control components such as meters, switches,
input/output text fields, data plots, and the like
which you can place and size as desired on your display
Primary Components screen. MakerPlot replaces the text based serial monitor
that is part of the Arduino IDE (integrated development
Please refer to Figure 2. The Arduino Uno environment) with something much more colorful and
microcontroller is mounted in the small black dust cover visually interesting.
enclosure near the center of the figure. As most readers The Arduino and the PC communicate using serial
will already be familiar with the Uno microcontroller ASCII data over the same USB cable link that is used by
(except for unique project specific aspects), further the standard Arduino IDE to download a new program
overview information will not be included here. into the microcontroller module. No physical cables need
The plugboard (which can be seen in greater detail in to be switched to use MakerPlot; just be aware that you
Figure 3) serves as a junction box for the various can only do one of two tasks at a time: either display
component interconnections required. The white wire with MakerPlot app data or download code to the Arduino
alligator clip connections leads to the solar cell taped to controller.
an 8 x 12 piece of cardboard which is propped against a This is the same constraint as when using just the
sunny window pane above the workbench. A duplicate of Arduino IDE; sharing the data link between program
the window mounted solar cell is included in the photo. downloads to the controller and displaying data on the
The DVM (digital voltmeter) is not
required, but you should check to see
that your solar cells output stays under
the Arduinos analog input max voltage
spec of 5 VDC when exposed to
maximum levels of sunlIght before FIGURE 4. Wiring diagram.
connecting it to the Uno. The
MakerPlot user interface runs on any
Windows based PC and will be
discussed further in the next section.
Component interconnections are very
simple (Figure 4). The 100 ohm load
resistor is not absolutely necessary, but
its presence will result in an overall
lower impedance circuit. We will
therefore gain higher noise immunity.
August 2017 43
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 44

need to! MakerPlot can provide the PCs time and date
information to the Arduino program. Additionally, using
the Arduino Time library makes it easy.
The Arduino Time library (contributed by Michael
Margolis) is a key factor in simplifying adding real time
monitoring and control capability to projects such as
this one. You can easily add this optional library to
your library collection from inside the Arduino IDE
(Sketch > Include Libraries > Library Manager ...); refer
to Figure 6.
The library is built around a software clock. It has
all of the functions you would expect to retrieve;
typical date/time variables such as month(), day(),
year(), hour(), min(), and sec(), plus many others that
you will more fully appreciate when you start
FIGURE 5. User control panel. developing your own software with it. To make this
clock into a first class time reference, you will want to
serial monitor. You can do one or the other, but not both. periodically synchronize it to an accurate time source; in
To allow MakerPlot to use the link, simply click the our case, the PCs internal clock via the MakerPlot/PC
CONNECT switch at the lower left of the user display comm link. (Example code will follow.)
(Figure 5) which causes the switch to turn green. That will Because your PCs clock is almost certainly synced
give MakerPlot control of the link. To give the link back to with an Internet Time Service (or could be), you now have
the Arduino later for another program download, simply an excellent real time capable data acquisition and control
click the CONNECT switch again. MakerPlot will give up system at your fingertips!
control of the link and the switch color will turn red. As a test, I set the software to sync the Arduino clock
If you do forget and leave the link connected to to the PC/MakerPlot clock once per hour and logged the
MakerPlot while simultaneously attempting to download a resulting hourly drift data for an 11 hour period
new program to the Arduino, no harm will be done. (SYNC_TIME_INTERVAL = 60). This setting was sufficient to
However, the download will fail and the Arduino IDE will keep the hourly interval drift errors to one second or less
protest. (I have done this by mistake more times than I can over the entire period.
count!) Many specific examples of coding for
Arduino/MakerPlot data transfer in both directions will be First Use
described later in this article.
Any data acquisition system needs to know real world Lets take one trip through a first use scenario. Then,
time. The Arduino has no built-in facility for this. You we will look at software detail.
could add an additional RTC module based on (for
example) a DS1307 chip to the system, but you dont 1. Install the Arduino Time library, and compile and
download the .ino file to the
microcontroller using the Arduino IDE.
2. Assuming you have already installed
MakerPlot on your PC, double-click the
MakerPlot sim.spm file as furnished in the
downloads at the article link. That should
open the user interface for the project on
your PC. (The location of the sim.spm file is
not important. Just put it in an appropriate
place in your Arduino projects folder after
expanding the ZIP file.)
3. For this first test, use the X axis
controls to set the X axis for a 60 sec total
span. (Normally for a 10 hour plot, this
would be set for 600 min.) Also, click the
Stop Max button which will freeze the
FIGURE 6. Use the Library Manager to install a copy of the Arduino Time plot when it reaches the right margin.
library on your PC. 4. Click the red CONNECT rocker
44 August 2017
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 45

switch at the lower left to give the Arduino/MakerPlot


communications link to MakerPlot, which will then The F-Macro
establish a connection to the Arduino Uno and cause your Arduino old timers will be familiar with the F-Macro.
sketchs setup() code to run. You should see the Arduino Newcomers may benefit from this short explanation.
Arduino microcontrollers have three kinds of memory:
time field update after a few seconds, and the system state Flash memory (program memory) which is relatively
should show IDLE. plentiful (the Uno has 32K); EEPROM; and SRAM, which is
5. The Event Log will open to the right of the plot, and fast but relatively scarce. (The Uno has only 2,048 bytes of
prompt you to enter a plot start time. SRAM.)
6. Press the Start in 30 sec button. It should turn The best use of valuable SRAM memory is for the
bright blue and stay that way for a few seconds until the storage of local variables.
Arduino code sees the flag, services your request, and The problem is that the Arduino compiler stores literal
strings ("This is a literal strIng") in SRAM, which is a waste
then resets the switch back to a dark blue color again of a scarce resource. Literal strings don't even change!
7. In a few seconds, the system state will change to When SRAM usage gets up to 80% or so, hard-to-find
COUNTDOWN and you should soon see the countdown program bugs can really ruin your day!
time field begin updating. The F-Macro causes literal strings to instead be stored
8. When the countdown reaches zero, plotting will in cheap relatively plentiful Flash/program memory. All
begin. After a few more seconds, you should see a black you have to do to use the F-Macro is to insert #include
line begin to work its way across the plot grid. (You can <avr/pgmspace.h> at the top of your program, and instead
of writing something like the following:
test this even without a solar cell connected. An
unconnected Arduino analog input will float at around 1.5 Serial.println("Setpoint reached!");
volts and you can use that as your test input.)
9. When the plot reaches the right margin, plotting Write this instead:
will stop.
10. Click the green Open Folder button. You should Serial.println(F("Setpoint reached!"));
be able to see a screen capture snapshot of your recently
made plot there. Watch the compilation report text on the Arduino IDE
after a successful compile, and download to see how you
11. Click the now green CONNECT switch again to
are doing with these critical resources. Program memory
turn it red and disconnect MakerPlot from the and SRAM usage are both reported there.
microcontroller; thus relinquishing the link back to the When I first started developing the solar intensity
Arduino IDE. monitoring software, I was not using the F-Macro, and
12. To repeat, wait about 10 sec, click the now red SRAM usage got up as high as 73%. However, at this
CONNECT switch turning it green. This will also have the point, the project was only about halfway done with the
same effect on the microcontroller as pressing the reset development work!
To relieve this situation, I edited in the F-Macro
switch. The Arduino program will restart and run the
wherever I could, and SRAM usage dropped to 25%. Now
setup() code again. If desired, enter a new plot start day with the development work mostly complete, SRAM usage
and time, then click one of the two blue buttons and walk is only at about 30%.
away. Youre done!
13. To abort at any point, click the green CONNECT Arduino/MakerPlot coding technique, but you will see it in
switch, turning it red and disconnecting MakerPlot from the example code that will follow shortly. The need for the
the Arduino. F-Macro is related to how the Arduino compiler handles
memory assignment for literal data. See the F-Macro
Software Detail sidebar for more information.
Machine State: At any point in time when it is
Source comments were freely applied throughout the running, the solar intensity monitor is in one of four states:
Arduino code listings. If your intent is a more thorough IDLE, COUNTDOWN, PLOTTING, or STOPPED. The
understanding of this implementation or to go on and current state determines what variables are monitored for
generate your own tailored version, spending time looking enabling progression to the next state. (For example, user
through the source code would be rewarding. A few key entry of a plot start time triggers progression to the
aspects thought to merit additional emphasis are COUNTDOWN state.)
highlighted next. Command Termination: Arduinos and MakerPlot
Most of the comments offered here are directed communicate with short ASCII messages (command
toward the reader intending to modify and enhance our strings) which must be formatted as a single text string and
sunlight intensity monitoring project, targeting his or her terminated with a carriage return. In building a lengthy
own new but similar application. command string with several substrings and print
F-Macro: The F-Macro has nothing to do with statements, this means that only the last one should be
August 2017 45
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 46

FIGURE 8. A simple text box shows which of the machine's


four states (IDLE, COUNTDOWN, PLOTTING, STOPPED) is current.

one of these four fields with a mouse-click first; then use


the arrow keys to move or resize the object.
Sixteen object properties/functions/values are listed
for this meter and are read/write accessible to Arduino
code (must scroll to see them all). Three of the 16 are
used in this project: Value which is updated once during
every loop() scan; and Max and Label which were
FIGURE 7. This meter is a typical MakerPlot control object. Each configured and saved when the display was originally
has a set of object properties and a unique name. built. The code fragment which is used to update this
meter and also the plot is:

Serial.println(). Other previous substrings will use // service the plot grid and meter
float v1 = (5.0 * analogRead(A0))/1024;
Serial.print(). See the example shown under Plot Grid. Serial.println(v1);
Example of an Arduino command sent to MakerPlot: // Bare numeric values like this go directly
// to the plot
(e.g., Reset Plot, Label Y Axis, Stop Plotting). These // Update the meter
commands are prefixed with a !. A complete listing of Serial.print(F(!POBJ voltMeter.value = ));
MakerPlot commands can be found in the MakerPlot User Serial.println(v1);
Guide (Section 15: Control instruction Summary; see
Resources) Examples are: Note the use of print() vs. println() in the last line
above. Very important!
Serial.println(F(!SPAN 0, 5.0)); Another example of MakerPlot object update coding
Serial.println(F(!PLOT OFF));
Serial.println(F(!YLBL VOLTAGE)); is the fragment below where the red IDLE status text
display (Figure 8) is updated to instead show a blue
Example of Arduino sending an update to a COUNTDOWN system state indication.
MakerPlot Control object: For instance, updating a meter Only four properties are available in this text object
to move its pointer from its current position to 74 on the for updating by the Arduino, and we will use three of
meter scale, or to display a switch in the ON rather than them:
OFF position. The meter shown in Figure 7 is typical. In
this case, the object name voltmeter was manually Serial.println(F(!POBJ sStatus.Back Color =
9)); // Blue
assigned, but if the developer chooses not to assign one, Serial.println(F(!POBJ sStatus.Text Color =
MakerPlot will assign its own unique identifier. 15)); // White
Serial.println(F(!POBJ sStatus.Text =
The four numeric coordinates (Left, Top, Width, and
COUNTDOWN));
Height) can be manually changed, but it is more likely you
will use your mouse to move and resize the object. Select This is very similar to the voltmeter example above. A
46 August 2017
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 47

little simpler perhaps since no variable like voltage in the library clock. Most of the time, if you want current-instant
previous example is involved. It is all static data! data, you should instead use the library hour(), minute(),
Plot Grid: The second statement in the previous second(), etc., functions to get the desired data relying on
voltmeter fragment updates the plot grid. Up to 10 points sufficiently frequent PC/Arduino sync activity to ensure
can be plotted simultaneously. If you wanted to plot four that this locally-maintained software clock time data is
points, for example, the statement would be expanded to accurate.
something like this: For example, refreshing the Arduino Time as displayed
on the MakerPlot user interface display is as simple as
Serial.print(v1); Serial.print(,); executing the following code fragment on every pass
// building comma separated string
Serial.print(v2); Serial.print(,); through the loop() code in your Arduino sketch:
Serial.print(v3); Serial.print(,);
Serial.println(v4); // Update MakerPlot display of Arduino time and
// println on ONLY the last one! date
void updateMPlotTime() {
For illustrative purposes and assigning arbitrary char aTime[25];
sprintf(aTime, %02d/%02d/%4d
example values for v1 through v4, the carriage-return- %02d:%02d:%02d,
terminated ASCII string MakerPlot would accept and plot month(), day(), year(), hour(),
minute(), second());
would look something like: Serial.print(F(!pobj aTime.text = ));
Serial.println(aTime);
1.37,2.5,3.00,0.54CR }

Receiving data from MakerPlot: We have looked at Syncing the library software clock: The following
example code for sending commands (e.g., !PLOT ON) to function is called initially by setup() to initialize the
MakerPlot and also for sending updates to a MakerPlot software clock and later by loop() every
object (!POBJ sStatus.Text = COUNTDOWN). SYNC_TIME_INTERVAL minutes to re-synchronize it:
What about the Arduino getting data from MakerPlot?
How would you get the current date and time from // Synchronize the Arduino Time Library software
// clock with the PC clock via the MakerPlot
MakerPlot? (Im sure by now you have guessed that a // comm link. First get current date & time data
bunch of Serial.print() and Serial.println() statements are // from the PC via MakerPlot.
flushBuffer();
involved!) Serial.println(!Send [(DATE),Trim] );
MakerPlot always has the current date and time String dateStr = Serial.readString();
available (as determined by the PCs clock) in its DATE int yr = dateStr.substring(6,8).toInt();
int mo = dateStr.substring(0,2).toInt();
and RTIME variables. So, int day = dateStr.substring(3,5).toInt();
you would ask it to send flushBuffer();
Serial.println(!Send [(RTIME),Trim] );
the current values (already String timeStr = Serial.readString();
formatted as mm/dd/yy int hr = timeStr.substring(0,2).toInt();
and hh:mm:ss strings) int min = timeStr.substring(3,5).toInt();
int sec = timeStr.substring(6,8).toInt();
back using the MakerPlot
!SEND or !READ // Set the Arduino s/w clock == PC clock
FIGURE 9. Temporary test of
Arduino current date and time commands as shown in setTime(hr, min, sec, day, mo, yr);
display in two unused spare the following code
user interface text boxes. fragment. As you can see, we first ask MakerPlot to send the
Also shown is how PCs current date string (mm/dd/yy), parse it for month,
you might then use those results to update text field day, and year, converting from ASCII to integer at the
objects on your user display (Figure 9): same time. Then, we do the same for the time (hh:mm:ss)
string. Finally, we call the Time library setTime() function to
Serial.println(!Send [(DATE),Trim] ); actually set (or update) the software clock.
String dField = Serial.readString();
Serial.println(!Send [(RTIME),Trim] ); Persistent Offered Start Time: I wanted to make it as
String tField = Serial.readString(); easy as possible to arm the system for countdown to the
Serial.print(!POBJ dField.text = );
Serial.println(dField.c_str()); next plot start time. You can enter any future date and
Serial.print(!POBJ tField.text = ); time you like. However, tomorrows date with the start-
Serial.println(tField.c_str()); time equal to the previous start-time entered is offered as
the default subject to your edits.
Note, however, that you will only infrequently request Make your desired changes to the date and time first,
time related data from the PC via MakerPlot; for example, then click the blue Start as per below... button.
when you are originally setting or later syncing the Time The Arduino startup() function increments todays date
August 2017 47
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 48

FIGURE 11. Shrink the plot grid


to make room for more
control objects.

in a MakerPlot folder under


your Arduino folder.
FIGURE 10. Uncover a hidden experimental area behind the plot grid. Double-click your copy
of the file and it will open in
by one day, and posts it to the plot start time date entry MakerPlot. To free up a small work area, reduce the size
field at the lower right. It also retrieves the previously used of the plot grid. Open the Object editor (second button
start time from the Unos EEPROM and restores it to the from the right on the toolbar) and set the Plot Percent to
start time field. 50% in the X direction and 80% in the Y direction
The need for flushBuffer(): Misinterpretation of data (Figures 10 and 11).
and commands in the serial communications queue Time to experiment!
between the Arduino and MakerPlot can happen. You
must ensure that the queue is empty before the Arduino 1. Drag a control (e.g, a meter) from the Controls 1 or
initiates a transaction. Controls 2 tab of the Object Editor to the recently freed
That is the reason for the frequent use of flushBuffer() area of the display.
that you see in these examples and in the downloaded 2. Once in place, shift-right-click to select it. Click the
source code. See page 108 in the MakerPlot Users Guide left field in the Object Editor; then use the arrow keys and
for more information. shift-arrow keys to experiment moving the object.
3. In a similar manner, select the Height field and use
Building Your Own MakerPlot User the arrow keys again this time to resize the object.
4. Give your control a more memorable name than
Interface Display the one assigned by MakerPlot. Dont forget to hit ENTER
It is possible to start from scratch and build your own to terminate your entry.
user display utilizing MakerPlot control objects, but I dont 5. Take a test drive:
recommend starting there. A. In the Object Editor assuming your test object is
Consider that an .spm file is to MakerPlot like an .xls a meter select the value property and try entering a few
file is to Excel (or like a .doc file is to Word). It is the data different values to see it animate.
file that MakerPlot uses to build the control surface display B. Assuming that worked, select
you see on your screen. The .spm file is an ASCII text file menu>View>LOG(Debug/Immediate), or click the fourth
and can be examined with Notepad. button from the right end of the toolbar and enter the
All of the MakerPlot example user interface screens following command at the bottom (assuming the object
can be found at C:\Program Files\MakerPlot\Macro name was kMeter):
\interfaces as .spm files. To use one of them as a starting !POBJ kMeter.value = 25.
point for your personalized display, go there and copy (for C. Were on a roll! Lets try to write a simple sketch to
example) the mp_alarming_meters.spm file to your normal ramp the meter up and down. Put the following code in
Arduino work area. You should rename it also, but make the setup() section of a new sketch and leave loop()
sure you keep the .spm file extension. I suggest you put it empty.
48 August 2017
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 49

Dont forget to click the red/green CONNECT button


on the MakerPlot display to get things started: RESOURCES
More information on the Arduino microcontroller can
while (true) { be found at:
for(int i=0; i < 50; i+=5){
Serial.print(!POBJ kMeter.value = ); www.arduino.cc
Serial.println(i); www.sparkfun.com/products/11021.
delay(1000);
} Dust cover/plastic protective enclosure for the Arduino
Serial.print(!POBJ kMeter.value = 0);
Uno:
}
www.sparkfun.com/products/12839.

6. Save your work! If you make any additions or MakerPlot is described by the manufacturer as a Data
changes to your user interface (.spm file) that you want to Acquisition and Graphical Plotting Software Package for
Microcontrollers. A free 306 page user guide and a free 30
keep, YOU MUST EXPRESSLY SAVE your work before day trial installation is available, as well as a discount for
closing MakerPlot. Nuts & Volts readers who decide to purchase MakerPlot at
You will NOT be prompted to do so when you click http://store.nutsvolts.com/books/sku17212.
the red x at the upper
right to close Nuts & Volts published a 10-part series of articles on
MakerPlot between October 2013 and July 2014
MakerPlot. (You might (MakerPlot The DIY Software Kit, by John Gavlik and
find that a little Martin Hebel). If you have a Preferred Subscriber Network
shocking, but you will subscription to Nuts & Volts, you already have digital
probably decide as I access to these archived issues. Or, you can purchase
did after getting used individual back issues at the Nuts & Volts web store at
www.nutsvolts.com.
to MakerPlot, that this
makes sense in normal More information on Arduino SRAM and use of the F-
.spm file use.) Macro can be found at:
To save the http://playground.arduino.cc/Learning/Memory.
changes in this special
The solar cell used in this project was part of a small
screen development solar USB charger kit available from KipKay Kits. However,
situation, follow these there is no need to purchase the entire kit just for the tiny
steps: solar cell included in it. Any small solar cell should work;
A. Open the perhaps with the addition of a small two-resistor voltage
divider if the cells rated output is greater than the 5V max
Macro Builder by of an Arduino analog input. The 4.2 volt cell (PN 228030)
clicking the last toolbar available from Jameco Electronics should work fine
button on the right (www.jameco.com).
(wrench symbol).
B. Some of your I try to leave them in place across the bottom, and
changes at this point use the right side for my specific control objects. Shrink
exist only in memory. the plot grid to make more space if necessary using the
You must also click the Object Editor Plot Percent configuration fields mentioned
FIGURE 12. Save a copy of your
recent user interface display wrench symbol at the earlier.
changes with the Macro Builder top of this Macro
control panel. Builder window to Log(Debug/Immediate) Window: Unfortunately, you
rebuild the macro still have to write special debug code yourself when
prior to saving it. needed, but MakerPlots separate Log/Debug window is
C. Now, click the DOWN ARROW button and very helpful to watch debug variables as the program runs,
complete SAVE AS to your hard drive (Figure 12). helping you track down inevitable bugs.
D. In the future, double-click this new .spm file to start You already saw one way previously to use this
MakerPlot. You will find all of your previously made window in the immediate mode (Step #5b above) to
changes in place when it opens. simulate commands from the Arduino code and see if
7. At some point, you will want to delete some of the MakerPlot reacts as you expect. In that scenario, whatever
original control objects from the starter example screen to you type is immediately acted on by MakerPlot.
make room for new ones of your own choice. I have The second use is more like as a log file. You can add
found that most of the groups of controls across the Arduino code to display status messages or variable values
bottom of the mp_alarming_meters.spm interface display of your own choosing in the debug window. Example
are quite useful. statements are:
August 2017 49
Fisher - Solar Intensity Monitor - Aug 17_Blank Rough NV.qxd 7/4/2017 6:40 PM Page 50

As you might have guessed from the eight checkboxes


Serial.println(!DBUG About to enter the along the bottom of the debug window, you can
statusRefresh function );
Serial.print(!DBUG Old DPOINT counter eavesdrop on a subset or essentially all Arduino/MakerPlot
value: ); Serial.println(oldDpoint); communication messages. This is an immense help in
Serial.println(!DBUG (RTIME) Plotting
debugging the type of errors that might arise from
stopped); // Timestamped message
development efforts in this and similar projects. Typical
More ambitious debug listings are also possible. output would be similar to that shown in Figure 13.
Perhaps something that displays an ASCII string in hex It is also possible to limit the display of debug
format. messages to only those containing a target text string
entered into the filter text box at the
bottom of the window (not visible in
the figure).
A L L Closing Thoughts
E L E C T RON I C S This simple project actually
ignores a lot of MakerPlots
www.allelectronics.com Order Toll Free 1-800-826-5432 capability. It is aimed at the reader
who is interested in how Arduino
2-DIGIT COUNTER KIT AC POWER CORD W/ INLINE code and MakerPlot functionality can
Advances one digit, from 0 to ROCKER SWITCH interact, and what the result might
99 each time button is pushed.
2.75" digits, each with of 21
70" power cord with on-off rocker look like in the context of a simple
switch mid-way. Two-conductor working project.
red 5mm LEDs. 5" x 4.18"
polarized AC plug. Black SPT-2
black display board. 4.25" x
18 AWG zip cord rated 300V,
If you are serious about applying
2" controller board. Resettable these techniques to future
105C, cULus.
to zero. Requires two momen-
CAT# LCAC-456 microcontroller projects, the next
tary pushbutton switches and
$ 50 step is to spend some time with the
9 Vac power (see our CAT# ACTX-940).
CAT# CTR-20
2 each 96 for $2.20 each
rather hefty MakerPlot Users Guide!
$ 50 10 for $2.25 each Good luck and happy plotting!
2 each 80 for $2.00 each
12 VDC SPDT 40A RELAY, NV
PC MOUNT - Reduced Price!
SPECIAL, 12 VDC Song Chuan 822U-1C-S 12VDC.
12 vdc 90 ohm coil. S.P.D.T.
3 AMP POWER automotive relay. N.O. 40 amps/
SUPPLY 14vdc, N.C. 20 amps/14 Vdc.
6' output cable w/ 26.6mm x 21.4mm x 21.8mm high. PC pins.
2.1mm coax plug, center+. cULus. CAT#RLY-573 $2.00 each
CAT# PS-1272 $ 25
$ 65
7
60 for $7.30 each
120 for $7.00 each
1 each
10 for $1.10 each
100 for 90 each
each

PROJECT BOX,
3.7V 1800MAH LI-ION
4" X 3" X 1.6"
RECHARGEABLE BATTERY Black ABS plastic.
PKCELL# LP103450. Interlocking lid secured
3.7Vdc 1800mAh Lithium- with self-tapping screws.
$ 00
ion rechargeable battery.
1.9" x 1.3" x 0.4". 2" leads.
Interior slots for pc boards.
Includes hardware.
3 each
Charging protection circuit. CAT# MB-173 10 for $2.75 ea.
Note: Ground Shipping Only.
CAT# LBAT-1801
$ 95
10 for $5.50 each 5 each
100 AMP BRASS BUSS BAR
Bocatech Inc BTMH-15B
100 Amp, 48 Vdc / 300 Vac FIGURE 13. The Log (Debug/Immediate)
35MM PIEZO ELEMENT 2 feed terminals window is helpful in development
2" pigtail leads. 10 distribution terminals activity. Use it to display debug
Solid brass on insulated base $ 95 variables or to test proposed Arduino
CAT# PE-63
5-3/4" x 1-1/4" x 1-1/16" 6 each command formats to MakerPlot.
2 for $ 00
1 100 for 40 each CAT# BR-100 10 for $6.50 ea.

50 August 2017
BY LOU FRENZEL W5LEF OPEN COMMUNICATION

Going the Distance with Wireless


Long range IoT and M2M technologies make it possible.

W hen you think of an application of the Internet of Things (IoT) or


machine-to-machine (M2M) technologies, you typically think that it
deploys one of the common wireless standards like Bluetooth or Wi-
Fi. The connection of a thing or device is usually via a wireless link that takes
place within a room, house, car, or ofce building. Total range from the device
to the access point or gateway is typically no more than a few hundred feet,
and usually much less.
Now, theres a growing Long range varies considerably receiver sensitivity, antenna gains,
need for wireless technologies with the application. It is typically and signal wavelength (l). Remember
that can cover longer distances. longer than the 10 to 100 meters that wavelength (l) is determined by
Such applications are usually maximum of the more common short frequency:
industrial in nature. The range standards like Bluetooth, Wi-Fi,
traditional wireless standards or ZigBee. It could be hundreds of l = 300/fMHz
generally do not have the range meters within a factory or several
capability to handle such use kilometers in smart grid or agriculture For example, the wavelength of a
cases. As a result, a whole new monitoring. The distance may be as 400 MHz signal is:
batch of wireless technologies long as 30 miles in some rare cases.
has emerged to fulfill the Most of the new standards can easily l = 300/fMHz = 300/400 = 0.75 meters
need for longer range. Here handle such distances.
is a summary of these new Remember that a meter is just
standards. How to Get More Range over three feet or 39.37 inches.
Rearranging the formula:
The distance covered by a
The Distance Factor wireless signal depends on multiple f = 300/l
Who needs longer range factors. These are transmitter power,
anyway? The general answer is any
organization that wants to remotely
monitor or control some distant
device or facility. The smart grid
is an example where the utility
company needs to keep track of
what is happening at substations
or other segments of the electrical
grid. Remote metering of electricity,
gas, or water at homes or buildings
is another instance. Agriculture
monitoring of fields or orchards, or
city street light control are other
examples. Long distances in factories
and process control plants would
be another application. A consumer
application might be drones. The
question is, what exactly is long FIGURE 1. This is the Microsemi ZL70550 transceiver IC that is designed for
ISM band IoT LPWAN applications. The 32-pin QFN package is only 5 x 5 mm.
range?
August 2017 51

Frenzel - Open Communication - Aug 17.indd 51 7/4/2017 6:23:20 PM


THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES
Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/magazine/issue/2017/08

LOS means the transmit and receive antennas can


see one another. This is important as the usual IoT
operating frequencies are all UHF or microwave,
and these signals travel in a straight line. The lower
frequencies do better in a non-LOS environment with
some signal blockage by trees, etc. Lower frequencies
penetrate walls better than higher frequencies.
All this adds up to one thing: Lower frequencies,
lower data rates, simpler modulation schemes, use of FEC,
and a clear LOS signal path will greatly extend the range
potential.

The Long Range Technologies


FIGURE 2. The ublox SARA-R410M LTE Cat M1 module
consumes low power and is housed in a 16 x 26 mm The new wireless standards for longer range
package designed to be embedded in IoT or M2M incorporate the characteristics mentioned earlier. In
products. addition, all of them feature low power consumption. Most
of the products like sensor nodes are battery powered and
The frequency corresponding to a wavelength of 0.33 for industrial applications, batteries must last 5 to 10 years
meters is: to maximize replacement intervals. Because of this, these
new standards are called low power wide area networks
f = 300/l = 300/0.33 = 909 MHz (LPWAN). Networking refers to connections of multiple
wireless sensors to a single collection source. Usually, the
The wireless path loss formula clearly shows the effect star network topology is used.
of higher frequencies: In no particular order, here are the most popular long
range LPWAN standards:
dB path loss = 37 dB + 20log(f) + 20log(d) ISM Band. ISM means industrial-scientific-medical, and
band refers to frequencies set aside for data transmissions
Here, f is frequency in MHz and d is distance in miles. in unlicensed segments of the spectrum. Common US
ISM frequencies as examples are 315 MHz for garage
If all of the above factors are held constant, then range door openers and remote keyless entry fobs; 433 MHz for
is directly related to wavelength; the longer the wavelength, home weather stations; 902-928 MHz for telemetry data
the lower the frequency and therefore the greater the transmission; and 2.4 -2.483 GHz for networking.
range. A 433 MHz signal will travel farther than a 2.4 GHz The most popular choice is the 902-928 MHz band.
signal for a given transmit power, receiver sensitivity, and ISM-based systems are usually single-purpose and simple;
antenna gains. no complex protocols and low data rates. They use
There are also some other considerations such as simple ICs and low power. Figure 1 shows a typical IC:
noise, type of modulation, data rate, encoding, and line of the Microsemi ZL70550. It can be set to operate in the
sight (LOS) conditions: 779 to 965 MHz range with a power level of 0 dBm (one
If the noise level is high, the signal will get weaker with milliwatt), and a -106 dBm receiver sensitivity. The data rate
distance, so will be smaller compared to the noise and choices are 50, 100, or 200 kb/s.
may be lost in the noise. LoRa. This is short hand for long range. It defines the
Higher levels of modulation like QAM are more chip and module products of Semtech Corporation. This
sensitive to noise as they use more amplitudes and phase standard uses 915 MHz and an FM chirp spread spectrum
shifts, so are less likely to be received reliably. Simpler modulation scheme. The use of spread spectrum permits
basic methods like FSK (frequency-shift keying) or BPSK multiple users to share a common band. Data rates can be
(simplest form of phase shift keying) fare better in noise. anything from several hundred bits per second to 50 kb/s.
The higher the data rate, the greater the chance for bit Estimated range is 2 to 15 km depending upon the terrain.
errors. Low data rate signals go farther. A low data rate SIGFOX. SIGFOX is a French company that uses the
is typically anything less than 100 kb/s, down to a few 915 MHz frequency. Their ultra narrow bandwidth BPSK
hundred bits per second. modulation produces data rates from 100 to 1,000 bps.
Encoding like forward error correction (FEC) fixes bit Transmissions from sensors are short and infrequent.
errors on-the-fly, but lengthens transmission time. FEC Simple modulation and narrow bands of 200 kHz with low
really helps extend range in a noisy channel. data rates minimize the impact of noise, so a range up to
52 August 2017

Frenzel - Open Communication - Aug 17.indd 52 7/4/2017 6:23:21 PM


THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES

30 to 50 meters is possible. SIGFOX sells the hardware Category 0 and 1 are available to address the needs of IoT.
technology and sets up networks to operate and maintain. One of the new LTE versions is called LTE-M. Instead
Ingneu. Ingenu does not use the lower frequencies of using a full 10 or 20 MHz LTE band, it only occupies 1.4
as do the other long range standards. It uses the popular MHz. This greatly simplifies the radio, yet it can achieve a
2.4 GHz band. It gets its long range capability by using its data rate of up to 1 Mbps and uses very low power. It uses
own special modulation technique called Random Phase the standard LTE network for communications.
Multiple Access (RPMA) that is a form of direct sequence Figure 2 shows an LTE-M radio module for embedding
spread spectrum (DSSS) with differential BPSK. It also relies in IoT or M2M products. It is ubloxs SARA-R410M LTE
on low data rates, special coding techniques, and highly Cat M1 module. It operates in any one of four LTE cellular
sensitive receivers to achieve wide area coverage. Ingenu bands.
also builds and operates their own networks. A second version is called NB-IoT. This standard uses a
Weightless. Weightless is a group of long range narrow band (NB) of only 180 kHz and even lower power.
wireless technologies specifically targeting IoT and Data rates to 250 kbps can be achieved. Both LTE-M and
M2M applications. It is an open family of specifications NB-IoT use OFDM but with more limited modulation
with different capabilities fitting a variety of use cases. choices to keep power consumption low.
Weightless N, for example, is a simplex (one way) standard Both of these new LTE versions fit a wide range of
for sensor monitoring. It uses the less than 1 Gbps ISM uses. Radio module prices are reasonable so can be readily
bands for long range using differential BPSK. With low incorporated into other products or systems. Just keep in
speeds, it can achieve a range of up to 5 km. mind that you do need to pay for access to the cellular
Weightless P is the two-way standard. It uses low data network with a service contract.
rates of 200 bps to 100 kbps, and GMSK or offset QPSK Watch for increased use of these technologies as the
modulation to reach out about 2 km. An interesting version field of IoT grows. Even newer standards are likely to show
is Weightless W that uses the TV white space spectrum; up. NV
unused 6 MHz TV channels in the 470 to 790 MHz range.
With wide channels, data rates up to 10 Mbps are possible
at a range up to 5 km thanks to the low frequencies. All the
Weightless standards are available royalty free.
Wi-Fi. Standard Wi-Fi like 802.11n/ac or other current
versions are not really long range technologies. Their Innovative Holding Solutions
advantage or benefit is very high speeds with multiple
users. However, some special versions of Wi-Fi have been
created for long range work. These are the IEEE 802.11f
and 802.11h standards. The 802.11h version is referred to
as HaLow. It uses the 902-928 MHz ISM band. Modulation
is OFDM with BPSK, QPSK, or QAM to achieve data rates
up to 1 Mbps. Range can extend to a kilometer or more
even with low power.
The 802.11f version (like Weightless W) uses the
TV white space frequencies. Known as White-Fi, this
standard can produce data rates of up to 24 Mbps in a 6
MHz channel. Range can be up to 10 miles if the lower
frequency TV bands are used. These new standards are not
widely utilized yet, but are expected to be more attractive
alternatives as the Wi-Fi Alliance gets certification programs
in place.
Cellular. Perhaps an unexpected technology for IoT
projects is the current fourth generation (4G) cell phone
standard called Long Term Evolution (LTE). It is generally
considered to be too complex and expensive for simple
sensor monitoring and like applications. On the other
hand, IoTs close relative M2M technology has used older
2G and 3G cellular networks for low speed applications,
and especially for its relatively long range (several
kilometers) capability. Now, new LTE versions designated
August 2017 53

Frenzel - Open Communication - Aug 17.indd 53 7/4/2017 6:23:24 PM


Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 54

THE DESIGN CYCLE


BY FRED EADY

Try the RAD B4R for ESP8266 Coding


The ESP8266 has become a very popular way to add a Wi-Fi communications link
to almost anything. The ESP8266 hardware is easy to use, and firmware
development for it is widely supported by multiple development suites. Python
seems to be a popular development tool for the ESP8266. However, if you dont
do C, odds are you dont do Python either. If you have the sand (cowboy talk for
bravery), you can code for the ESP8266 using the native development
environment offered by the manufacturer. Then theres LUA. Ive tried them all.
However, my favorite is a Johnny-come-lately tool called B4R.

B4R
B4R aimed at Arduino program development is a
cousin to B4A (formerly called Basic for Android). B4R is
also related to B4J, a Java based RAD (Rapid Application
Development) program development environment. You
pay for a B4A license. B4R and B4J are free. B4R uses the
resources provided by the Arduino family of libraries. B4R
also provides native support for the ESP8266 and can be
used to develop firmware for many Arduino boards. The
ESP8266 support is why we are here.

B4R Setup
The Arduino IDE (integrated development
environment) must be installed before you can use B4R.
PHOTO 1. The WeMos D1 Mini is based on the
Youll need to install the latest and greatest Arduino IDE. ESP8266. Everything we need to program and use the
The next step is to install B4R and configure the paths. ESP8266 are on the WeMos D1 Mini PCB.

This is done within B4R and simply sets the directory path
to the Arduino IDE. You can also optionally specify
directories for additional libraries.
Once you have your Arduino paths laid out, the next
step is to load some target hardware support information
into the Arduino settings as you can see in Screenshot 1.
Adding the Additional Boards Manager URL enables
support for our target hardware, which happens to be the
WeMos D1 Mini smiling in Photo 1.
We can now dive back into the B4R IDE and
introduce our new WeMos D1 Mini to the B4R IDE. We
have done just that in Screenshot 2. The B4R IDE sensed
the WeMos D1 Mini via the COM port connection
between it and the Mini. At this point, we can use the
B4R IDE to produce ESP8266 firmware and load it into
the WeMos Mini using a simple USB connection.
SCREENSHOT 1. Performing this
operation adds support for our target
hardware.
The WeMos D1 Mini
The WeMos D1 Mini circuitry is not at all
54 August 2017
Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 55

ADVANCED TECHNIQUES FOR DESIGN ENGINEERS


To post comments on this article and find any associated files and/or downloads,
go to www.nutsvolts.com/magazine/issue/2017/08.

SCREENSHOT 2. The work we performed in Screenshot


1 produces fruit here. We obviously now have support for
our target hardware: the WeMos D1 Mini.
complicated. The Mini components are shown in PHOTO 2. This is the flip side of the WeMos Mini that
hosts the programming and power supply components.
Schematic 1. Everything we will need to load our firmware
into the ESP8266 is mounted on the D1 Mini printed the flip side of the WeMos Mini are captured in Photo 2.
circuit board (PCB). The ESP8266 support components on USB-to-serial conversion is provided by the CH340G USB-

SCHEMATIC 1. The ESP8266 is supported by a USB-to-


serial IC and a linear power supply. All we need is a USB
connection to a host PC to load code into the ESP8266.

August 2017 55
Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 56

schematic is an LED that is connected to


the Minis Arduino-defined pin 2 (WeMos
D1 Mini D4).
B4R incorporates a library that defines
all of the D1 Mini pins for use in a B4R
program. The universal pin definitions for
the Mini are shown in Screenshot 3. As
you can see, the Mini pin definitions
depend on the platform you are using. The
B4R rESP8266 library definitions for the
D1 Mini can be seen in Screenshot 4. In
SCREENSHOT 3. The addition to ESP8266 I/O pin control, B4R
WeMos D1 Mini pin
definitions depend on the is also supported by another library that
platform you are using. enables the ESP8266s Wi-Fi engine. The
members of the ESP8266WiFi library are
displayed in Screenshot 5.

Blinking with B4R


Coding B4R applications is very
to-serial IC. similar to coding a VB6 application as B4R is event driven.
The ESP8266 Lets walk through a simple B4R program that blinks the
program/run switching LED attached to the WeMos Minis I/O pin D4:
duties are performed by a
pair of transistors in Sub Process_Globals
These global variables will be declared
conjunction with the once when the application starts.
modem control signals. Public variables can be accessed from
all modules.
Power for the D1 Mini is Public Serial1 As Serial
provided by the ME6211 Private Timer1 As Timer
voltage regulator and Private pin2 As Pin
End Sub
associated filter capacitors.
Not shown on the Since the Mini needs a serial connection for
programming, we must declare a Serial
object in our B4R code. As you can see,
we spawned a Serial object and called it
Serial1. Using Serial1, we can call upon all
of the members and methods associated
with the Serial object.
Well be blinking the WeMos Mini
LED at a steady rate. To do that, we need
to bring a timer into play. So, again we
declare and spawn an object. This time
its a Timer object and well call it Timer1.
Our LED blinker code is not using
either of the ESP8266 libraries we
SCREENSHOT 5. previously examined. So, the Pin object is
The members of
this library allow us not official B4R. It leans more to the
to use B4R to Arduino side of the fence. However, it
enable the works because B4R has access to the
ESP8266s Wi-Fi
SCREENSHOT 4. This is capabilities. Arduino resources via the Arduino IDE
a screen capture of the B4R we installed earlier.
library definitions of the Now that the objects in the
WeMos D1 Mini pins. We Process_Globals subroutine are set up,
can also use this library to
programmatically reset the well need to initialize them. As with any
WeMos D1 Minis ESP8266. other programming language, we should
56 August 2017
Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 57

initialize variables and objects at the beginning of the Private Sub Timer1_Tick
Dim currentState As Boolean =
application. In this case, well do our initializations in the d4.DigitalRead
AppStart subroutine: Log(CurrentState: , currentState)
Dim NewState As Boolean =
Private Sub AppStart Not(currentState)
Serial1.Initialize(115200) Log(NewState: , NewState)
Log(AppStart) d4.DigitalWrite(NewState)
pin2.Initialize(2, pin2.MODE_OUTPUT) End Sub
Timer1.Initialize(Timer1_Tick, 1000)
1000mS = 1 second
Timer1.Enabled = True Both sets of code end up at the same destination.
End Sub They both blink the Minis LED. The really cool thing is
that no special programming hardware is required. A
This looks a lot like Arduino. However, the Log simple USB connection between B4R and the WeMos D1
statement is B4R and prints the argument in the B4R Log Mini is all we need.
window. The Timer1 statements are also B4R. Weve
directed the Timer1 object to roll over every 1,000 ms. At B4R Wi-Fi
each Timer1 roll-over, the Timer1_Tick subroutine is called:
Lets blend in the rESP8266WiFi B4R library and
Private Sub Timer1_Tick program the Mini to join the EDTP lab network. Like all
Dim currentState As Boolean =
pin2.DigitalRead B4R programs, we begin by populating the
Log(CurrentState: , currentState) Process_Globals subroutine:
Dim NewState As Boolean =
Not(currentState)
Log(NewState: , NewState) Sub Process_Globals
pin2.DigitalWrite(NewState) Public Serial1 As Serial
End Sub Private server As WiFiServerSocket
Private d1 As D1Pins
Private espWifi As ESP8266WiFi
All of the LED blinking action occurs within the Private astream As AsyncStreams
Timer1_Tick subroutine. The current state of the D4 Private timer1 As Timer
output pin is read and logged. Then, the current state is Private inputPin As Pin
Private ser As B4RSerializator
inverted, logged, and written to the D1 Minis D4 output End Sub
pin. As a result, the Minis LED blinks at a one second
interval. The Serial object is the same one we used to blink the
Lets write our LED blinker code with a bit more of Minis LED. Its primary purpose is to bridge the WeMos
B4R seasoning: Mini and the B4R IDE. The WiFiServerSocket is a member
of the rESP8266WiFi library as is ESP8266WiFi. As you
Sub Process_Globals would imagine, all of the Wi-Fi and networking stuff lies
These global variables will be declared
once when the application starts. within the rESP8266WiFi library.
Public variables can be accessed from AsyncStreams is a component of the
all modules.
Public Serial1 As Serial rRandomAccessFile library. AsyncStreams is the conduit in
Private Timer1 As Timer which we can send and receive data using pipes or
Private d4 As Pin streams without blocking the application flow.
Private d1Pins As D1Pins
End Sub B4RSerializator is part of B4R and its job is to convert
bytes to objects for transmission and convert the objects
back to bytes at the receiving end. These converted data
In this version, we have included the rESP8266 library streams are logically transported by AsyncStreams.
and can call upon the definitions laid down in D1Pins. The inclusion of D1Pins tells us that the rESP8266
Only a single line changes in the B4R-flavored AppStart library is also part of this solution. At this point, its time to
subroutine: craft the code that will make up the AppStart subroutine:
Private Sub AppStart Private Sub AppStart
Serial1.Initialize(115200) Serial1.Initialize(115200)
Log(AppStart) Log(AppStart)
d4.Initialize(d1Pins.D4,d4.MODE_OUTPUT) If espWifi.Connect2(edtp,password)
Timer1.Initialize(Timer1_Tick, 1000) Then
1000mS = 1 second server.Initialize(51042,
Timer1.Enabled = True server_NewConnection)
End Sub server.Listen
Log(Waiting for connection.)
The changes in the Timer1_Tick subroutine are small as Log(My ip: , espWifi.LocalIp)
Else
well:
August 2017 57
Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 58

Log(Crapped Out.) The servers incoming data is expected to be in byte


End If form. The astream_NewData subroutine is designed to
timer1.Initialize(timer1_Tick, 1000)
inputPin.Initialize(d1.D0, convert the incoming byte stream into an array of objects
inputPin.MODE_INPUT) using B4RSerializator. Any incoming data from the client is
End Sub
converted and logged. If things go south:
The AppStart code starts the serial port, logs a
message, and attempts to connect to the EDTP wireless Sub Astream_Error
Log(Error.)
network. If the connection is successful, a server is created server.Listen
on port 51042 and an event handler subroutine called timer1.Enabled = False
End Sub
server_NewConnection is established. The server is put
into listen mode and the servers IP address is logged. To
top it off, we also initialize the D1 Minis D0 pin as an The error subroutine
input pin. logs the obvious, makes
After the Mini server is up and listening, any incoming sure the server is still up,
connection fires the server_NewConnection subroutine: and turns off the
transmitter timer.
Sub Server_NewConnection (NewSocket As
WiFiSocket)
astream.Initialize(NewSocket.Stream,
astream_NewData, astream_Error)
The Other Side
timer1.Enabled = True
End Sub Lets take a look at the
code that would be written
The new connection is actually a socket. A socket is using B4A to allow an
nothing more than an IP address and port number Android phone to act as a
combination. In the server_NewConnection subroutine, client to the WeMos Mini
we initialize AsyncStreams to build a data pipe that server. The B4A
services the newly formed connection (socket). Incoming programming model
data will be processed by the astream_NewData consists of a Starter
subroutine and if things crap out, the astream_Error Module and a Main
subroutine will be called. Activity. The networking
The D1 Mini server is set up to send the state of the stuff is written into the
D0 input every 1,000 ms. This is accomplished within the Starter Module and the
Timer1_Tick subroutine: phone GUI is handled in
the Main Activity.
Sub Timer1_Tick The Visual Designer
PHOTO 3. This is a simple
astream.Write(ser.ConvertArrayToBytes(Array(ESP that is part of B4A was GUI that was generated by
Pin State, inputPin.DigitalRead))) used to generate the the B4A Visual Designer.
End Sub
Android phone GUI shown
in Photo 3. Lets begin by looking at the Starter Modules
AsyncStreams is used to send data converted by the Process_Globals code:
B4RSerializator to the client. Note that the B4RSerializator
is converting an array of objects into bytes for Sub Process_Globals
Private astream As AsyncStreams
transmission. The array that is transmitted consists of a Private socket As Socket
string object and a Boolean object based on the D0 pin Public connected As Boolean
Private watchdog As Timer
state. Private lastValueTime As Long
Data received by the server is handled by the Private ser As B4RSerializator
astream_NewData subroutine: End Sub

Sub astream_NewData (Buffer() As Byte) Nothing new here. The Android code will be using
Dim be(10) As Object
used as a storage buffer. AsyncStreams and B4RSerializator for compatibility with
Dim objects() As Object = the D1 Mini code. We will need to initialize the Timer
ser.ConvertBytesToArray(Buffer, be)
Log(Received:) object we call watchdog and the B4RSerializator:
For Each o As Object In objects
Log(o) Sub Service_Create
Next watchdog.Initialize(watchdog, 1000)
End Sub ser.Initialize
End Sub

58 August 2017
Eady - Design Cycle - Aug 17_Design Cycle - Sep 15.qxd 7/4/2017 6:43 PM Page 59

The watchdog is nothing more than a regular Timer


object that we have set up to overflow every second. The Public Sub StateChanged
If Starter.connected Then
code within the watchdog subroutine checks to see if 10 lblState.Text = Connected
seconds have passed since the last incoming data. If so, Else
lblState.Text = Disconnected
the AsyncStream pipe is shut down, the watchdog timer End If
object is disabled, and the connection is terminated: End Sub

Private Sub Watchdog_Tick Input and output AsyncStreams pipes are constructed
If DateTime.Now - lastValueTime > 10 *
DateTime.TicksPerSecond Then for the new connection (socket.InputStream,
Log(Watchdog closing socket.OutputStream) and astream subroutines are defined
connection.)
If astream.IsInitialized Then (astream). The Android GUI is updated by calling the
astream.Close Main Activitys StateChanged subroutine and the
Astream_Error watchdog timer is enabled.
End If
End Sub When data is received from the D1 Mini server, the
Astream_NewData subroutine is called:
Private Sub Astream_Error
Log(Disconnected) Private Sub Astream_NewData (Buffer() As Byte)
connected = False CallSub2(Main, NewValue,
CallSub(Main, StateChanged) ser.ConvertBytesToArray(Buffer))
watchdog.Enabled = False lastValueTime = DateTime.Now
End Sub astream.Write(ser.ConvertArrayToBytes
(Array(Android Time,
Before we let the dog out, we must establish a DateTime.Time(DateTime.Now))))
connection between the Android client and the D1 Mini End Sub
server. This is done by touching the connect button on the
Android GUI, which kicks off the Connect subroutine: The incoming data from the D1 Mini server is
converted from bytes to an array of objects using
Public Sub Connect(ip As String) B4RSerializator and is logged using the Main Activitys
If astream.IsInitialized Then
astream.Close NewValue subroutine:
End If
socket.Initialize(socket) Public Sub NewValue(data() As Object)
socket.Connect(ip, 51042, 30000) If data.Length = 0 Then Return
End Sub For Each o As Object In data
Log(o)
Next
The Connect subroutine code is self-documenting and End Sub
takes advantage of the socket objects resources (Initialize
and Connect). After the watchdog timers lastValueTime variable is
It is assumed that the user knows the WeMos Minis updated, the Android phone client sends the current time
IP address (ip). An attempt to connect to the D1 Mini back to the Mini server as a byte stream using
server will time out in 30 seconds. AsyncStreams and B4RSerializator.
Once the Android phone client connects with the As we already know, the Mini server receives the data
Mini server, the Starter Modules Socket_Connected from the Android phone as a byte stream and uses
subroutine is called: B4RSerializator to convert the incoming data to an array of
objects.
Private Sub Socket_Connected (Successful As
Boolean)
If Successful Then
connected = True
B4R and Your Design Cycle
astream.Initialize(socket.Input
B4R does more than enable
Stream, socket.OutputStream,
astream) ESP8266 modules. Take a look
B4R
CallSub(Main, StateChanged) at the documentation index on B4J
watchdog.Enabled = True
the B4x website and youll B4A
lastValueTime = DateTime.Now
End If discover that B4R supports Anywhere
End Sub
multiple products offered by Software
Adafruit and Seeed Studio. www.b4x.com
The Starter Modules connected variable is an If its Arduino that rows
argument in the Main Activitys StateChanged subroutine your boat, then youll need to WeMos D1 Mini
and is used to change the Connected/Disconnected text add B4R to your Design Cycle. Amazon
on the Android GUI: NV www.amazon.com
August 2017 59
NV Webstore - Aug 17 working_NV Webstore June 2016 working.qxd 7/4/2017 6:50 PM Page 60

For comple t e pr oduct de t ails, visi t us online!!


The Nuts & Volts WEBSTORE
GREAT FOR DIYers!
Arduino Project Handbook, Vol. 2 Electronics Workshop 20 Makey Makey Projects
by Mark Geddes Companion for Hobbyists for The Evil Genius
Each project by Stan Gibilisco by Aaron Graves,
includes cost and In this practical Colleen Graves
time estimates, guide, electronics This hands-on guide is
simple instructions, expert Stan filled with DIY projects
colorful photos and Gibilisco shows you, that show readers step-
circuit diagrams, a step by step, how to by-step how to start
troubleshooting set up a home creating and making
section, and the workshop so you cool inventions with the
complete code to can invent, design, Makey Makey invention
bring your build to build, test, and kit. Each project
life. With just an repair electronic features easy-to-follow
Arduino board and circuits and gadgets. fully-illustrated
a handful of Electronics Workshop instructions and detailed photographs of
components, youll make gadgets like a Companion for Hobbyists the finished gadget. Readers will see how
rainbow light display, noise-level meter, provides tips for constructing your to apply these skills and start building their
digital piano, GPS speedometer, and workbench and stocking it with the tools, own Makey Makey projects.
fingerprint scanner. This collection of components, and test equipment youll No prior programming or technical
projects is a fast and fun way to get started need. Clear illustrations and interesting experience is required
with microcontrollers thats perfect for do-it-yourself experiments are included Basic enough for beginners, but
beginners, hobbyists, parents, and throughout this hands-on resource. challenging enough for advanced makers
educators. $24.95 $25.00 $25.00
Make Your Own Programming the Raspberry Pi, Beginner's Guide to Reading
PCBs with EAGLE Second Edition: Getting Started Schematics, 3E
by Eric Kleinert with Python by Stan Gibilisco
Featuring detailed by Simon Monk
illustrations and Navigate the roadmaps
step-by-step An updated guide of simple electronic
instructions, Make to programming circuits and complex
Your Own PCBs with your own RaspPi systems with help from
EAGLE leads you projects an experienced
through the process engineer. With all-new
of designing a Learn to create inventive art and demo circuits
schematic and programs and fun games you can build, this
transforming it into on your powerful hands-on, illustrated
a PCB layout. Youll Raspberry Pi with no guide explains how to
then move on to programming experience understand and create
fabrication via the generation of standard required. This practical high-precision
Gerber files for submission to a PCB book has been revised to fully cover the electronics diagrams.
manufacturing service. This practical guide new Raspberry Pi 2, including upgrades to Find out how to
offers an accessible, logical way to learn the Raspbian operating system. DIY identify parts and connections, decipher
EAGLE and start producing PCBs as projects include a hangman game, RGB element ratings, and apply diagram-based
quickly as possible. LED controller, digital clock, and information in your own projects.
RasPiRobot with an ultrasonic rangefinder.
$30.00 $15.00 $25.00

How to Diagnose and Fix Programming PICs in Basic Programming Arduino


Everything Electronic by Chuck Hellebuyck Next Steps: Going Further
by Michael Jay Geier If you wanted to learn with Sketches
A Fully Revised how to program by Simon Monk
Guide to microcontrollers, then
you've found the right In this practical guide,
Electronics book! Microchip PIC electronics guru Simon
Repair all kinds of microcontrollers are Monk takes you under
electrical products, being designed into the hood of Arduino
from modern digital electronics throughout and reveals professional
gadgets to analog the world and none is programming secrets.
antiques, with help more popular than the Also shows you how
from this updated eight-pin version. Now to use interrupts,
book. The Second the home hobbyist can manage memory,
Edition offers expert create projects with these little program for the
insights, case studies, and step-by-step microcontrollers using a low cost Internet, maximize
instruction from a lifelong electronics guru. development tool called the CHIPAXE
system and the Basic software serial communications,
Discover how to assemble your workbench, perform digital signal
use the latest test equipment, zero in on and language.Chuck Hellebuyck introduces
how to use this development setup to processing, and much more. All of the 75+
replace dead components, and handle example sketches featured in the book are
build useful projects with an eight-pin
reassembly. $24.95 PIC12F683 microcontroller. $14.95 available for download. $20.00

60 August 2017
NV Webstore - Aug 17 working_NV Webstore June 2016 working.qxd 7/4/2017 6:50 PM Page 61

Order online @ store.nutsvolts.com


Or CALL 1-800-783-4624 today!
EDUCATIONAL CD-ROM SPECIAL

August 2017 61
TECHFORUM READER - TO - READER

intend to put the results out in the


>>> QUESTIONS clouds because oftentimes when I between 4.4 and 6 VDC to the input
Laser Color Choice look to the clouds, there be vultures terminals of the Ringing Generator
I want to convert a 3D printer to about. and it will ring the phone. You can
a laser burning station to work with #8173 T. A. Rooks use four D cells in series to supply 6
wood veneers and leather goods. Chelsea, AL VDC. Or a 5-6 VDC power supply.
Any advice on the best type and The Generator input terminal with the
color of laser to get? Ive heard brown red dot should be connected to the
wood and leather reflect more red >>> ANSWERS plus voltage. DO NOT CONNECT
light and so I should use a blue laser. POTS Ring Generator THE POWER WIRES BACKWARDS!
#8171 Kyle Hoyos I need a circuit to generate 20 Typically, a phone rings for two
Walkerton, IN Hz 90 VAC to ring a POTS telephone seconds, then off for four seconds,
on a theater stage. Thats Plain Old then on for two, off for four, etc.
Oil Filled Caps Telephone System vs. Pretty Advanced Be sure to test it at home before
Im trying to bring an old tube New Stuff (PANS) for the younger you use it on stage. Try to use an
transmitter back to life. The power readers. older heavy pushbutton or rotary
supply uses oil filled capacitors, telephone because it will contain real
which don't seem to have handy #1 Well, years ago when I was bells and the ringing will sound better.
replacements. Assuming that I can involved in theater, we just connected David Goodsell
change the oil to reduce the leakage the ringer to regular 110V 60 Hz Apple Valley, CA
current, what kind of oil is used? utility power through an offstage
Will motor oil work, for example? switch. You might have to futz with [#4173 - April 2017]
#8172 William Helm the clapper spacing and spring Warm Cows Are Happy Cows
Eugene, OR tension to get a good ring. We had My daughter is in 4H and has a
a regular telephone bell in a small calf we are raising in a shed behind
PCB Layout Software box which we rang; we hid it on the house. The bulb burned out on
I am a retired Field Service the stage near the set phone, which the heat lamp we leave on to keep the
Engineer. Over a decade and a half wasnt connected. If you want to cow warm. Is there a simple circuit to
after early retirement from IBM, a ring the actual bell in the phone remotely monitor the temperature and
friend asked if an idea he had could on stage, Id suggest using a 1:1 alert me if it drops below a set point?
be built. I assured him it could. isolation transformer for safety. One I know there are remote temperature
He offered me partnership time during a rehearsal when there gauges but I need one with an alert or
if I would design and build a was a phone on set that an actor a way to hack one to add an alert.
demonstration system. I designed, was supposed to dial, for a spoof we
built, and programmed a system that connected it to a phone line. When #1 Sounds like a job for the
works just like he wanted it to. An the actor picked it up and heard the Raspberry Pi 3 computer connected
existing patent that I could find no dial tone, he completely lost it. to a DS18B20 temperature sensor
work-around for expires this year. John Schmidt with Cayenne software installed on
We'd like to have systems ready to go Hempsted, NY both the Raspberry Pi and mobile
before we start doing demonstrations. phone. Cayenne is a software
Now, I need to convert my proto- #2 To ring a POTS phone, you platform from MyDevices that acts
board to a more compact layout to can buy a Black Magic Telephone as a gateway to the Internet of Things
be mass produced. The problem is Ringing Generator on eBay for $26. (IoT); the service is free. You can
that all the design software I've found Connect one output terminal of the view temperature data from your
requires that work be done online. Generator to the red wire of the mobile phone, or configure Cayenne
Not even a simple schematic design POTS phone. Connect a 330 ohm to send a text message alert when
without being on the Web. resistor to the other output terminal the temperature drops below a set
I need recommendations for of the Generator and the other end threshold. The Raspberry Pi can be
offline software to generate a file for of the resistor to the green wire of the connected to your home network
use by a production service. All I'll POTS phone. The phone should not using Wi-Fi or a wired connection.
need is a library of templates for basic be connected to anything else!!! Norman Ma
TH mounting components. I do not Use a pushbutton to apply Calgary, Alberta
62 August 2017

Tech Forum - Aug 17.indd 62 7/4/2017 8:10:11 PM


>>>YOUR ELECTRONICS QUESTIONS ANSWERED HERE BY N&V READERS

Send all questions and answers by email to forum@nutsvolts.com


or via the online form at www.nutsvolts.com/tech-forum

#2 Simplest is a standard (cheapest I be better off with a modern Fluke the two-way radio field and personally
bimetallic) house thermostat, battery, meter with true RMS reading? prefer analog meters for several
and a simple DC bell. You dont have reasons; the first is that it is easier to
to drill holes or screw anything up, #1 The question is not average vs. detect a peak or a null with a needle
and the wire can be taken through RMS. When dealing with tuning, the on a meter than it is trying to read
a window into the house. Im sure question is the measuring of peaks changing numbers on a digital display.
you could also rig up something like and deeps. You cant measure peaks In fact, I have never seen a grid dip
an Arduino with HATs and Bluetooth and deeps with a digital voltmeter. To oscillator with a digital display.
or Wi-Fi with phone messaging, but do it, you need an analog device. The second reason is that while
unless you want to do extensive About 50 years ago, Fluke came working on a circuit board and
datalogging, I cant see the point. out with a nice digital multimeter that looking for voltages, I can glance up
However, thats often beside the couldnt be used for tuning. After at an analog meter and watch the
point in hobbyist systems. some time, Fluke added an analog needle move, and with the proper
Sally Jelfs bar graph that helps a lot for tuning range set, I have a good idea what
Brackley/Northants purposes. the voltage is with just a glance. With
Try to look for the Fluke Series some analog meters such as the B&K
[#5171 - May 2017] 170 and you will find what you need. 290 electronic VTVM that I use on
Looking For HV Field Analyzer By the way, tuning is mainly done in the bench, there is a scale on the
I am building a mid-size Tesla RF equipment and not in audio. bottom with zero centered mid-span
coil. I want to study the frequencies Avnerdee which allows me to see if a voltage/
produced and map the EM field Tel-Aviv, Israel current varies from what I have set as
potentials produced. Considering the the standard I am using, which allows
voltages and frequencies involved, #2 There are many differences me to set voltage/current to that
typical RF measuring gear will not between DMMs and VOMs. The two standard.
work. Does anyone have suggestions which might justify the old timers' While I am an analog guy, there
or links to help me build the device I advice are that VOMs have lower are times when I use a digital meter.
need to do my experments? input impedance than the typical When setting VCO voltages, you
DMM and the dial display of a VOM need a digital meter to accurately
For voltage, use a bunch of NE2 display is easier to interpret for noisy set the voltages. Another use where
neon bulbs wired in series on a long or changing amplitude signals than digital is better (in my opinion)
wood stick. Each lamp lit stands for a digital display. The higher input is reading the values of resistors
about 100 volts. For frequency, the impedance of a DMM may make and capacitors. A DMM has the
coil probably operates at or below the readings from old documentation advantage of reading capacitors,
broadcast band. If you cant hear it on based on using a VOM slightly which analog cant do. Although, it
a standard AM radio, buy or borrow inaccurate. can be a pain to read resistors on an
a set with the long-wave band. None Neither of these characteristics analog meter due to the logarithmic
of this is lab quality, but I assume you really justifies spending lots more scale and crowding at the high end of
want cheap and easy. money. Many DMMs include a bar the scale, it does excel at testing pots
Chip Veres graph display which emulates a dial, to see if the operation is smooth by
Miami, FL mooting this difference. watching the needle.
Finally, analog meters from lesser On my bench, I have the B&K
[#5173 - May 2017] makers are still available in economy 290 analog electronic VTVM, a NLS
DMM vs. AVOM markets and auction sites. If you do TT-21 digital meter, and (for field
I do mainly audio work and have find those two differences compelling, work) a Triplett model 60 VOM. What
been told by a few old timers that you can satisfy that need at costs works for me may not necessarily
analog VOMs are the only way to go comparable to most DMMs. work for you. Its based on what you
for testing and tuning gear. Problem Warren Wilderson prefer and what your requirements
is, I can get a new DMM for $20 Eagle Point, OR are. Try borrowing a digital and
on Amazon vs. an ancient Triplet or analog meter and see what works
Simpson analog VOM on eBay for up #3 The use of analog versus digital best.
to ten times that. Is it worth it? Would to me is a personal choice. I work in If you do go the analog route, go
August 2017 63

Tech Forum - Aug 17.indd 63 7/4/2017 8:10:11 PM


>>>YOUR ELECTRONICS QUESTIONS ANSWERED HERE BY N&V READERS

for a meter that has 20K ohms/volts time, then going back and reviewing metering system calibrated in dB is
or better; the higher the ohms/volts it can be very helpful in tracking indispensable.
the better as it will not load down a down certain problems that cant be Jim Lacenski
circuit under test as a lower range seen using other tools. Bellevue, WA
would. Andrew Ayers
Craig Kielhofer Glendale, AZ #6 Audio work can require the
Plaineld, IL measurement of voltages down to
#5 As an audio engineer, I find the millivolt range. It can also require
#4 New analog VOMs are certainly that an AC millivolt meter calibrated measurement of varying signals such
available, but quality is likely nowhere in decibels is essential for audio as voice and music. To best measure
near what used to be standard. What engineering and repair; for example, these, use an AC VTVM.
the cheap DMMs wont show you to validate the dB attenuation of a This is an electronic device with
are fast transient signals; they will Linkwitz-Riley crossover network, or a large analog meter driven by an
either average out the spurious signal to gauge flatness of a preamp. My electron tube. They usually have
(you wont see it), or they will just '80s vintage Leader LMV-187 is what I a high input impedance and wide
completely miss it due to a slower use for this work. frequency range often into the 100
sampling rate. That said, it is easy to build much kHz range. Their input voltage range
A high quality Fluke DMM can cheaper and available alternatives. is usually from one millivolt full scale
be a good choice, but there isnt any Dual channel VU meter driver boards to 300 volts full scale. The meter has
reason not to have an analog meter and decent VU meters calibrated in scales in both volts and dB with dB
on your bench if you can find a good dB are available on eBay. Front-end making it easy to measure amplifier
one (tested, calibrated, and known to one of these boards with the Low gain.
work well), along with a Fluke. cost PC Two Channel Oscilloscope Want to know what the output
Sometimes, the slight tremble circuit of the August 2016 N&V, and voltage of a microphone will be for a
(noise or hum over the signal) of an one has a decent AC metering system particular sound? Put the microphone
analog movement can be seen better for audio engineering. Be sure to AC at the desired location in relation to
by a human than a DMM can update. couple the input to the circuit; for the sound and hook it directly to an
For most things, though, you could example, with 2.2 F non-polarized AC VTVM. Then, just watch the meter
use the Fluke. electrolytic capacitors. scale. (A digital meter will just wildly
Another option to consider I use my DMMs for checking blink random numbers.)
would be a digital o-scope; being able power supply voltages, etc. For Mark Peterson
to sample a signal over a period of audio signal level work, an analog Plymouth, MN

64 August 2017

Tech Forum - Aug 17.indd 64 7/4/2017 8:10:11 PM


ElectroNet - Classified Ads - Index - Aug 17_Mar15 -NV - NewProducts.qxd 7/4/2017 6:51 PM Page 65

ELECTRONET
For the ElectroNet online, go to
www.nutsvolts.com and click Electro-Net USB
USB-FIFO USB-UART
Add USB to your next project--
It's easier than you might think!
USB/Microcontroller Boards
RFID Readers Design/Manufacturing Services Available
Absolutely NO driver software development required!

CLASSIFIEDS www.dlpdesign.com

LIGHTING HARDWARE
WANTED
DEC and VME
Equipment WANTED!
Digital Equipment Corp
and
Motorola VME Systems
and Parts
Wanna read even more about electronics?
Buy - Sell - Trade Check out our book selection at
Subscribe today! CALL KEYWAYS 937-847-2300
or email buyer@keyways.com
store.nutsvolts.com

ADvertiser INDEX
L O O K F O R S E A R C H F O R F I N D Find your favorite advertisers here! Accutrace ..............................67

All Electronics Corp. .............50


BATTERIES/CHARGERS EDUCATION Hitec ...............................................2
Hitec ...............................................2 Command Productions ...................7 SDP/SI ..........................................19 Clear-Com .............................23
M.E. Labs .....................................16
BUYING ELECTRONIC PoLabs .........................................17 Command Productions ...........7
SURPLUS ROBOTICS
All Electronics Corp. ..................50 EMBEDDED SYSTEMS Hitec ...............................................2 ExpressPCB ..........................17
Saelig Co. Inc. .............................3 SDP/SI ..........................................19
CIRCUIT BOARDS Technologic Systems .................11 Hammond Manufacturing ......10
Accutrace .....................................67
TEST EQUIPMENT
ExpressPCB ..............................17 ENCLOSURES Hitec ........................................2
PCB Fab Express .........................11 PoLabs .........................................17
Hammond Manufacturing .............10
Saelig Co., Inc. ............................3 Saelig Co., Inc. ............................3
M.E. Labs ..............................16
JOB OPPORTUNITIES
COMPONENTS Clear-Com ....................................23 TOOLS Measurement Computing .....BC
All Electronics Corp. ..................50
Saelig Co., Inc. ............................3 PanaVise ...................................53
LCDs/DISPLAYS PoLabs .........................................17 PanaVise ...............................53
Saelig Co., Inc. ............................3
DATA LOGGING
PCB Fab Express ..................11
Measurement Computing .........BC TRANSFORMERS
MICROCONTROLLERS /
I/O BOARDS Hammond Manufacturing .............10 PoLabs ..................................17
DESIGN/ENGINEERING/
M.E. Labs .....................................16
REPAIR SERVICES
Technologic Systems .................11 WIRE, CABLE AND Saelig Co., Inc. .......................3
Accutrace .....................................67
ExpressPCB ..............................17 CONNECTORS
MISC./SURPLUS SDP/SI ..................................19
All Electronics Corp. ..................50
DEVELOPMENT All Electronics Corp. ..................50
ServoCity ..............................66
PLATFORMS/TOOLS
Technologic Systems .................11 MOTORS / MOTOR WIRELESS PRODUCTS
Technologic Systems .................11 Technologic Systems ............11
CONTROL
August 2017 65
LITTLE ACTUATORS

G PO SSIBILI TIE
BI S
UP TO 67 LB THRUST

UP TO 200 MM STROKE

AVAILABLE AS LINEAR
ACTUATORS AND AS
LINEAR SERVOS

PRICES $
STARTING AT
7999
duct
Pro !
Info

AVAILABLE AT SERVOCITY.COM
sales@servocity.com 620-221-0123

Full Page.indd 66 5/31/2017 12:11:07 PM


SAM / ITAR Registered I SO 9001:2008 UL Approved

Full Page.indd 67 7/4/2017 7:14:56 PM


WebDAQ
Internet Enabled Data Loggers from MCC
Remote Configuration and Monitoring

Virtually Unlimited Storage

Integrated HW and SW

Flexible Triggers, Built-in Web Server,


Alarms, Emails, and Easy-to-Use
SMS Texts

Buy with Confidence with a 30-Day Money-Back Guarantee


MODEL INPUTS SAMPLE RATE RESOLUTION DIGITAL I/O

WebDAQ 316
16 Thermocouple 75 S/s Max 24-Bit 4
Temperature Logger

WebDAQ 504
4 IEPE 51 kS/s/Ch Max 24-Bit 4
Vibration/Acoustic Logger

MCCDAQ.COM/WebDAQ
Contact us
1.800.234.4232
2017 Measurement Computing Corporation, 10 Commerce Way, Nor ton, M A 02766 info @mccdaq.com

Full Page.indd 68 7/4/2017 7:00:43 PM


N&V-BACK-COVER-Final.indd 1 6/23/17 3:30 PM

Das könnte Ihnen auch gefallen