Prévia do material em texto
2 CIRCUIT CELLAR • OCTOBER 2020 1363
OUR NETWORK
(• drcuit cellar f i I [. ftHxpress
VOICE•t COIL
~ LinuxGizmos Ll SLOUDSPEAKER INOUil•Y SOURCEBOOK
All Electronics Corp. 77
CCS, Inc. 77
congatec, Inc. 25
EasyOEM 13
Micro Computer Control Corp. 77
IAR Systems, Inc. C3
Newhaven Display International, Inc. 11
PCBWay 9
Pico Technology 17
SlingShot Assembly 43
Technologic Systems, Inc. C4, 77
University of Cincinnati Online 67
NOT A SUPPORTING COMPANY YET?
Contact Hugh Heinsohn
(hugh@circuitcellar.com, Phone: 757-525-3677, Fax: 888-980-1303)
to reserve space in the next issue of Circuit Cellar.
THE TEAM
PRESIDENT
KC Prescott
CONTROLLER
Chuck Fellows
FOUNDER
Steve Ciarcia
COLUMNISTS
EDITOR-IN-CHIEF
Jeff Child
SENIOR ASSOCIATE EDITOR
Shannon Becker
TECHNICAL COPY EDITOR
Carol Bower
GRAPHICS
Grace Chen
ADVERTISING COORDINATOR
Nathaniel Black
ADVERTISING SALES REP.
Hugh Heinsohn
PROJECT EDITORS
Ken Davidson
David Tweed
Jeff Bachiochi (From the Bench), Bob Japenga (Embedded in Thin Slices),
Robert Lacoste (The Darker Side}, Brian Millier (Picking Up Mixed Signals),
and Colin O'Fiynn (Embedded Systems Essentials}
1111Uel63 October 2020 IISS111521-06011
QRCUIT CELLAR® (ISSN 1528-0608) Is publish~ monthly by:
KO< Media Corp.
PO Box 417, <Mse City, VA 23924
Periodical rates paid at <Mse Oty, VA, end additioiKll offiCI!S.
One-)'l!llr (12 issue<) sub<criptlon ralr! US and possessions
$50, Canada $65, Foreign/ P!JW $75. AI SIJbscription orders
payable in US funds only via Vtsa, MasterCard, inWIKltional
postal money order, or check drawn on US bank.
SUBSCRIPTION MANAGEMENT
OniiM "-llllt .._ ........... ,, circuitcellar.com/ac00101t
Renew I Change Address/E-mail 1 Check Status
CUSTOMER SERVICE
1!-tu•: customerservlce4Pclrcuitcellar.ccm
Phone: 434.533.0246
Mlolt Circuit Cellar, PO Box 417, Chase City, VA 23924
Postmaster: Send addross changos to
OmJit Cellar, PO Box 417, Chase Oty, VA 23924
NEW SU!lSCRII'HONS
drcuitx:ellar.ccm/SIJbscription
ADVERTISING
Contact: Hugh Heinsohn
Phone: 757-525-3677
Fu: 888-980-1303
E-mail: hheinsohnOclrcultceller.ccm
Advertising rates and terms available on request.
NEW PRODUCTS
E-md: editor@clrcultcellar.com
HEAD OFFICE
KO< Media Corp.
PO Box417
Cha~ City, VA 23924
Phone: 434-533-0246
CDPYRIGitT NOTICE
Entire contents copyright 11:) 2020 by KCK Media Corp.
All rights reserved. Circuit Cellar Is a registered trademark
of KCK Media Corp. Reproduction of this publication In
whole or in part without written consent from
KCK Media Corp. Is prohibited.
DISCLAIMER
KCK Media Corp. makes no warranties and assumes no
responsibility or liability of any kind for errors In these
programs or schematics or for the consequences of any such
errors printed in Circuit Cellar®. Furthermore, because of
possible variation in the quality and condition of materials and
workmanship at r!!ader-os~mbled projects, KCK Media Corp.
disdaims any responsibility for the sofe and proper function
of reader-assembled projects bas~ upon or from plans,
descriptions, or irlormation published in Circuit Cellar®.
The irlormation provided in Circuit Celar® by KCK Media
Corp. is for educational purposes. KO< Media Corp. makes
no claims or warrants that readers have a right to build
things based upon these lde1ts under pat:l!nt or other
relevant intelectual property law In their jurisdiction, or
that readers have a rl!lht to construct or operate any of
the devices described herein under the relevant patent or
other intellectual property law of the reader's jurisdiction.
The reader assumes any risk of Infringement liabifity fur
constructing or operating such devices.
© KCK Media Corp. 2020 Printed In the United States
E mbedded system design is a broad landscape. For a large segment of applications, microcontrollers are the main computing and control element-a
key focus for Circuit Cellar obviously. But when you
move above that realm, into the so-called mid- and
high-end ranges of embedded computing, single-board
computers (SBCs) have been the traditional center of
gravity. By center of gravity I mean that all the elements
of a system needed to revolve around the SBC. Because
most systems needed a variety of functions beyond the
SBCs, an SBC would often need to be in some standard
form factor, and connect with compatible I/0 boards,
DSP boards or whatever over some sort of standards-
based parallel bus-or serial buses in more recent
times. This meant choosing a bus architecture, a card
cage and an SBC, plus any additional I/0 to fulfill your
system requirements.
In some high-end systems-or legacy systems-
such slot-card style systems are still popular. But as
levels of chip and module integration progressed, such
systems no longer made sense for many applications.
Instead, what's emerged are a myriad of box-level
systems. These complete system boxes provide a
complete, tested and enclosed computing solution that
eliminate complex integration for customers. Because
they are often sold as turn-key "ready-to-run" systems,
system developers can begin creating their application
software to run on these systems immediately.
What's interesting is that box-level systems haven't
replaced SBCs by any means. SBCs are still vitally
important in lots of mid- to high-end embedded
computing applications. That said, I'd argue that box-
level systems have become-alongside SBCs-a second
set of gravity in the embedded computing world.
At one time, these box-level systems were mainly
sold as fully custom offerings, built for specific customer
needs. But around 10 years ago, give or take, these box-
level embedded computers started to become standard
catalog products. In fact, SBC vendors were among the
leaders of this new trend. Fast forward to today, and
you see that box-level systems as a product category
has exploded-driven by many traditional SBC vendors
as well as companies specializing in such systems.
circuitcellar.com 3
The Box as a Component
It's difficult to get one's arms around all the
variations in today's box-level systems. In this issue's
Datasheet section, we focus narrowly on the "embedded
PC" segment, but it truly is a vast arena that's hot with
design activity. Beyond the generic embedded PC type,
there are flavors of box-level systems of all kinds-
vehicle computers, vision systems, AI/IoT processing
systems, systems targeted for railway applications,
digital signage boxes and more.
Box-level systems are often being used and upgraded
in much the same ways that SBCs have been. When
new levels of processing and memory are available,
system developers can swap in a new box. Connectivity
has become simpler too in these days where IP-based
Ethernet networking is a straightforward way for box-
level subsystems to communicate and interoperate with
each other.
Another advantage of box-level systems is that they
off-load whole phases of engineering from your system
development process. Instead of integrating hardware
and OS software yourself, it's already done for you.
Meanwhile, environmental testing-for temperature,
vibration and so on-are done by box-level system
vendors (although not always, and not always to the
same extent). Again, to be clear, SBCs and box-level
systems are the stars of what I call the mid- to high-end
of embedding computing. In the more deeply embedded
realm, MCUs and embedded processors remain the king
of the castle.
The bottom line is that box-level embedded computing
systems have evolved to the point where embedded
system developers can think of them as components. Like
nearly every other advance in electronics technology,
these solutions let you move up a level in your perspective
and focus more on broad concerns like your application
software, user interfaces and so forth. Circuit Cellar will
continue to follow this exciting area oftechnology. e
4 CIRCUIT CELLAR • OCTOBER 2020 #363
DATASHEET
50 Embedded PCs Integrated Solutions
By Jeff Child
56 Embedded in Thin Slices
LoRa (Part 7)
Building a Prototype LoRa Device
By Bob Japenga
60 From the Bench
White Hot: Measuring
Color Temperature
Using an Arduino Mega
By Jeff Bachloch/
68 The Darker Side
An Introduction to Stub Filters
A Wire to Nowhere
By Robert Lacoste
TECH THE FUTURE
7 The Future of Modular Edge Processing
Three Real-World Intelligent
Infrastructure Applications
By Dan Demers
75 : PRODUCT NEWS 78 : TEST YOUR EQ
ci rcuitcellar. corn 5
6 Building a Power Rail Probe An Exercise in Low-Noise Design
By Andrew Levido
14 Design a Wireless Tracking Device
Smart Antenna Choices
By Geoff Schulteis
18 A Review: VS Plus Drone Flight Controller
Hands-On Evaluation
By Raul Alvarez-Torrico
26 Code Size vs. Memory Footprint And Why They Matter
By Steve Graves
30 Balancing a Ball on a Touchscreen Using a PID Controller
By Gregory Kaiser and Samuel Feibel
SPECIAL FEATURE
35 Smart Cities Leverage loT Building Blocks
Chips, Systems and Services
By Jeff Child
44
TECHNOLOGY SPOTLIGHT
Raspberry Pi Roundup
A Bounty of HATs and Clones
By Jeff Child
~ @editor _cc .:31
' @cirtuitcellar a • cirtuitcellar
W hy would someone spend several thousand dollars on a probe just for power rails?
The reason is that standard
passive oscilloscope probes are not really
suited to the task. Let's see why. In probing a
power rail with an oscilloscope, you probably
want to do one or more of three things: (1)
look at the level of ripple and noise on the rail;
(2) chase fast spikes or switching artifacts or
(3) look at load transients such as over- or
under-shoots, settling times and so forth.
These are all usually millivolt-level signals
riding on top of the DC rails, with periods
ranging from nanoseconds to seconds.
You might try to use a standard passive
probe with your oscilloscope switched to
DC coupling, and rely on the vertical offset
controls to center the waveform on screen.
Unfortunately, you will find that at millivolt-
per-division resolution, you are limited to just
a volt or two of offset range, so you may not
even be able to get a 3.3V rail on the screen,
let alone a 12V rail.
If you flick the AC-coupling switch, you
will be able to get the trace on the screen
with millivolt resolution, but you will have
just introduced a high-pass filter with a -3dB
cut-off at a few tens of Hertz. You therefore
will not be able to make much sense of load
transients with a time constant of longer than
a few tens of milliseconds.
ADC NOISE
If we are interested in measuring the noise
on the power rail, the displayed noise will
include that introduced by the oscilloscope's
analog-to-digital converter (ADC), your chosen
attenuation path and the input probe. There
is not much you can do about the ADC noise
(except buy a more expensive oscilloscope),
but the attenuation path and probe noise are
things we can control. With most oscilloscopes,
the lowest noise is achieved when you switch
in the SOn input termination. This is not
practical with power rail measurements, since
son would impose a significant load on the
power supply, and the SOQ input is usually only
rated to :!::SV to limit the power dissipation in
the termination resistor.
A dedicated power rail probe is designed
to overcome these limitations. It presents a
relatively high-impedance load to the power
rail, and provides a means to inject a DC offset
to the signal, so the DC coupling can be used
with high vertical sensitivity. It should have a
very wide bandwidth, from DC to at least the
oscilloscope's bandwidth, be compatible with
the son input and should introduce as little
additional noise as possible.
The commercial units I could find seemed
to be specific to each manufacturer's
proprietary active probe interface, and were
integrated into the oscilloscope's on-screen
user interface. I wanted to see what would
be involved in rolling my own version of a
power rail probe, so I did a quick survey of
the available units to come up with a basic
specification for mine.
1. It should be able to null out DC offsets of
±20V, and be safe to connect to ±60V.
2. A DC input impedance of SOkQ seems to be
the de-facto standard.
3. I aimed for an attenuation of 1:1.2 or
better, and flat to <ldB over the range DC
to lGHz.
4. It should accommodate an active signal
range of ±lV, and be designed to operate
into a SOQ load.
5. I set myself an ambitious target of the probe
contributing no more than 10% additional
noise beyond a typical oscilloscope's noise
floor.
DESIGN
This design turned out to be an interesting
exercise in low-noise design, and included a
little bit of AC circuit analysis into the bargain. I
think it might be interesting to walk through the
highlights of the design process step by step.
I did not think a low-noise active circuit
with a bandwidth in the gigahertz range was
a practical proposition. Instead, I looked at
splitting the probe into two parallel signal
paths-an active, low-frequency path that
deals with the DC offset, and a passive, high-
Jl
In
V-
Oft>«
RI
50k
.... ~ .,..._...,.--.~vv......._.~
FIGURE 1
V•
R3
OUl I
V•
V-
Re
200
frequency path. I started the design with the
low-frequency path. This can be an ordinary
summing amplifier followed by an inverting
stage to restore the polarity of the output
signal, as shown in the schematic (Figure 1).
This circuit pretty much designs itself,
because we know the input impedance must
be 50kQ, and the feedback resistor R2 must
be the same for a gain of -1. If we assume a
split SV supply (±2.SV), then we can choose
R2 to be SkQ for a gain of -10, giving an offset
range of ±25V, which is nicely in line with
our specification. Since we are connecting
R2 directly to the wiper of the potentiometer,
the input impedance we will see on the
offset summing input will only be SkQ at the
extremes of the potentiometer.
In the middle, the impedance will be SkQ
plus the two "halves" of the potentiometer
resistance in parallel, reducing the gain from
-10 to something less than that. For the SkQ
pot I used, the gain of the offset branch is
reduced to -8 at the center point. This means
we will have slightly increased sensitivity at
lower offset voltages. This is by no means
a bad thing, and the alternative of adding a
buffer between the pot and R2 is not desirable,
because it will add more noise to the circuit.
Because we are adding a high level of
offset on purpose in this circuit, for once we
do not have to be too concerned about the
input offset voltages or bias currents of the
op amps we will select. This also means we do
not need to add resistors in the non-inverting
inputs of the op amps, and can connect them
directly to our circuit ground. Similarly, for
the inverting amplifier, we just select R4 = RS
C l
J2
R6
SWIA 10 Ou1 l OOn
~ - 81
J-82
u 2 R7 DP.t r-
10, 10 DAV99V :
I
I
I
I
L .
I
V< J-a•
LEDl
~ .... SWl8
ci rcuitcellar. corn 7
l PI
C5:1 c~ • OV•
47~ ·~ 10V -::::-
GND
~
1P2
c1: eel I 0 \J ..
4 7~ lOOn+ lOV -:;-
Full schematic for the power rail probe. The DC path is a simple summing amplifier followed by an inverting stage. The AC path is a direct connection. The two paths are combined
via Cl and Ll. R6 and R7 ensure a flat frequency response.
B CIRCUIT CELLAR • OCTOBER 2020 #363
a} c
FIGURE2
The circuit on the left is a simplified
view of how the low and high
frequency paths combine. The
functionally equivalent circuit on the
right is instantly recognisable as a
classic LC notch filter.
FIGURE3
The RC and RL series combinations
on the left can be converted to their
parallel equivalents, as shown on
the right, via the transformation
equations. This transformation helps
us understand the impedance ofthe
network at resonance.
b) c
for a gain of -1. We will choose these values
a little later, since they will affect the noise
performance of our circuit.
We can now look at the high-frequency
path. Since we don't have to worry about
the DC offset, this path is just a direct
connection between the input terminal and
Cl. Figure 2a shows a simplified view of
how the low-frequency active path and the
passive high-frequency path come together.
The capacitor C and the load impedance RL
form a high-pass RC filter, and the inductor
l similarly forms a low-pass RL filter with RL.
This is functionally equivalent to Figure Zb,
which you may recognize as a classic LC notch
filter. A steep notch appears in the frequency
response at the resonant frequency given by:
1
fo = 21t./LC
The depth of the notch is determined by
the Q of the filter. Naturally, we do not want
this notch in our frequency response, so we
need to lower the Q of the filter by adding
some series resistors R5 to the circuit,
to provide some damping (Figure 3). We
also need to preserve the symmetry of the
branches, so each branch must have the same
resistor value.
These series resistors reduce the gain
of the circuit in each branch, in that they
form wideband voltage dividers with the
load resistance RL. How do we choose these
resistors for a flat frequency response? The
answer is not immediately obvious, but we
can make this easier by exploiting the series-
parallel transformation property of complex
impedances. This simply says that for every
series combination of real and imaginary
Series
impedances, there is a corresponding parallel
combination that will have the same overall
behavior when viewed from the terminals.
Figure 3 shows how this looks for our circuit. The
series C5 + R5 and L5 + R5 combinations become
parallel Cp 11 Rp and Lp 11 Rp combinations.
At DC, our series circuit will look like an
impedance of R5, since the capacitor C5 is
essentially open, and the inductor L5 a short.
Similarly, at very high frequencies, the series
circuit will also look like an impedance of R5,
because the inductor L5 will be essentially
open and the capacitor C5 essentially a short.
It is not obvious from the series circuit what
the impedance will be at resonance.
This is where we need to look at the
equivalent parallel circuit. We can see here that
at resonance, when the lp 11 Cp combination is
presenting an infinite impedance, the end-to-
end impedance will be the parallel combination
of the two resistors. If we want the gain to
be flat across the spectrum, this should also
be equal to R5• Substituting Rp = 2R5 into the
series-parallel transformation equation for Rp
given in Figure 3, and using the expression
above for the resonant frequency, a little
algebra delivers the expression:
Rs= {& vc;
Now we can choose some values. Let's
start by choosing C to be lOOnF, which doesn't
seem like too much of an additional capacitive
load, given that power rails are generally
bypassed by many lOOnF capacitors. A value
of lOOnF will form an RC high-pass filter with
a corner frequency of around 31.8kHz.
We want to choose the inductor l such
that the corner frequency of the Rl low-pass
filter is considerably higher than this, but not
so high that we create an unnecessary op amp
design challenge. Choosing lMHz, for example,
gives us an L value of 7.91JH. Rounding this up
to a sensible value like l01JH gives a corner
frequency of around 796kHz, which should
work fine. We can now finally calculate Rp,
which turns out to be lOQ-a nice, round value
that gives us an overall gain through the probe
of 1:1.2, exactly our design brief.
Parallel
NOISE 101
Before we can we can select the op amps
for the circuit, let's look at the noise issues
involved. This op amp selection will be driven
largely by the need to add the lowest possible
amount of noise to the measurement. Low-
noise design is a whole field in itself, but let's
recap on some "Noise 101" basics. The three
main sources of noise we need to consider in
modern electronics are Johnson noise, shot
noise and 1/f or "flicker" noise.
Johnson noise is essentially the thermal
noise caused by the movement of electrons
with temperature. For example, a 10kQ
resistor lying unconnected on your bench at
room temperature will develop a noise voltage
across its terminals of 1.31JVRMS• if measured
with a voltmeter with 10kHz bandwidth.
This brings us to an important point
about noise. If we want to calculate a noise
voltage or current, we must always specify
the bandwidth over which we are concerned.
Because we don't always know what the band
of interest is when specifying components,
we tend to talk about noise densities, which
is a measure of the noise voltage or current
per unit of bandwidth. Noise densities are
expressed in terms of voltage or current
per square root Hertz. You just multiply the
voltage or current noise density by the square
root of the bandwidth to get the root mean
square (RMS) voltage or current.
While we are on the subject of noise,
another important thing to keep in mind is
how noise in a circuit adds. Since noise is
random, as long as the noise sources are
not correlated, the two sources don't add
arithmetically, but rather, as the square root
of the sum of squares:
en= ~e;l +e:2 + ...
With these two points covered, let's get
back to Johnson noise. The voltage noise
density of Johnson noise in a resistor is given
by:
where k is Boltzmann's constant and T is the
temperature in Kelvin. At room temperature,
this can be reduced to: en = 127 x 10·12 in
units of "V/...fHz". We will use this equation
later to calculate the noise produced by the
resistors in our circuit.
The two other sources of noise are
generally specific to semiconductors. Shot
noise is the noise produced by the discrete
nature of charge when charges are acting
ci rcuitcellar. corn 9
PCBWay -
PCBWay is a lead1ng PCB manufacturer m Shenzhen speciahztng tn PCB protolyptng and
assembly serviCe, and havmg been loved by over 1M engmeers around the world for tt
comprehensive advantages
•m• n------- lnsumt Ouo1e
Tumaround ltme can be as short as 24 hours - -
CIJ.!.fii
Pr~ee ts as low as 10 PCBs for only 5 USD
10 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE4
Noiseless
OpAmp
The noise model of an op amp has a voltage noise source in series with the input, and sources forcing current
noise out of the input pins. Op amp noise is specified in terms of these noise densities and the f recuency fc,
at which the flicker noise begins to dominate.
ABOUT THE AUTHOR
independently, as they do in semiconductors
(but not in conductors). 1/f or flicker noise is
an artifact of the materials used and methods
of construction of the devices.
Johnson and shot noise are called "white
noise," and have equal energy in every unit
of bandwidth. Flicker noise is "pink" noise
and has equal energies in every decade
of bandwidth. If you plotted the energy of
flicker noise versus frequency, we would see
the same energy in the 1-10Hz decade as
the 10-100Hz or 100Hz-1kHz decades. The
amount of energy therefore falls off with the
inverse of frequency-hence the 1/f name.
In a semiconductor device such as an op
amp, there will be a white-noise component
that is flat with frequency, and a pink-noise
component that will fall off at 1/f. The point
where the 1/f noise has the same value as
the white noise is designated fc. This figure is
used if the frequency of interest is low enough
that 1/f noise becomes important-as we shall
see later.
We don't need to concern ourselves with
the detail of all the noise sources in op amps,
since manufacturers specify the total noise in
terms of three parameters-a voltage noise
Andrew Levido ,(P'a-n""'dr_e_w_.l.-e-vi""'d,....o@.,..---m-a-;,il,.....c-o-m..,......arned a bachelor's degree in
Electrical Engineering in Sydney, Australia,in 1986. He worked for many
years in R&D for power elect ronics and telecommunicati on companies,
before moving into management roles. Andrew has maintained a hands-on
interest in electronics, particularly embedded systems, power electronics and
analog design. Over the years, he has written articles for various electronics
publications, and provides consulting services as t ime allows.
density and a current noise density referred
to as the op amp input, and an fc figure as
described earlier.
As shown in Figure 4, the noise model of
an op amp looks like a noise voltage source
en in series with the op amp input, and noise
current sources in driving current out of the
input terminals. These currents will create
noise voltages across the source resistance
as seen by the input terminal. There will also
be a Johnson noise component in the source
resistance itself. The noise that appears at
the op amp output terminal will be the sum
of these three sources multiplied through the
op amp gain. If there is noise on the op amp
power rails, this too will affect the overall noise,
as seen at the op amp output. I will ignore this
for now, but check whether this is reasonable
once we have designed the power supply.
COMPONENT SELECTION
We now need to choose the op amps. In
this case our primary requirement is for low
noise. We also need a bandwidth well above
the 796kHz corner frequency of the LC filter-
say SMHz or higher. We want to operate from
low voltage supply (:1::2.5V), and U2 needs to
be able to drive a volt into a SOQ load.
One candidate is the Texas Instruments
(TI) LMP7731. This has a GBW product of
22MHz, swings almost to the rails with a SV
supply, and has excellent noise figures with
en = 2.9nV/..JHz, in = 2.2pA/>/Hz and fc = 3Hz.
Quiescent current is 4mA, and it costs less
than $2. The only shortcoming is that its
output drive capability is not enough. Another
candidate is TI's TLV2460. This has a GBW
product of 6.4 MHz, good output swing, SOmA
drive capability, quiescent current of 1mA,
costs under $2, but has slightly worse noise
figures of en= 11nVNHz, in= 0.13pN..JHz and
fc =150Hz.
Given that we have control over the
values of the resistors around the inverting
amplifier, which will help us reduce the noise
in that stage, we will use the TLV2460 for
the inverting amp, and the LMP7731 for the
summing amp.
We can calculate the noise in the
summing amplifier by adding up the various
noise sources, as shown in Figure 5. At
the inverting input of U1 we will see three
sources of noise-the amplifier voltage noise,
the amplifier current noise reflected across
the source resistance, and the Johnson noise
of the source resistance itself. The source
resistance is simply the parallel combination
of R1, R2 and R3, which is around 4.2kQ.
Because the gain of the stage is 1, the output
voltage noise will be same as the input noise.
Remembering that we add noise as the
root sum of squares, the total voltage noise
density at the summing amplifier output can
be calculated to be 12.7nVNHz.
The calculation for the second stage is
similar, but this time we also have to add the
noise produced by the first stage. In this case,
we will choose the resistors R4 and RS to each
be 1kQ, so the source resistance is only 5000,
thus reducing the noise in this part of the
circuit. Again, the gain of the stage is 1, so the
output noise will equal the input noise. Doing
the math gives us a voltage noise density of
17.0nVNHz. The only other contributor to
the low-frequency path noise will be the lOQ
resistor, which will contribute just 0.4nVNHz.
This is negligible and can be ignored. Note
that we can't make this simplification in the
high-frequency path, as we shall see later.
NOISE AT OUTPUT
Now, to calculate the noise voltage at the
output of the low-frequency path, we need to
specify a bandwidth. The lower limit is DC, so
that is easy. You might think the upper limit
should be the -3dB bandwidth of the LC filter
(796kHz), but the reality is that the LC filter
is far from a brick-wall filter, so there will be
noise energy at higher frequencies. It turns
out that we must adjust this upper frequency
by a factor of n/2 to account for the gradual
roll-off. This means our upper frequency
Working together to design
the ideal display for your
application. Let's get started
on your next project.
~~ .. ~ •T::." .. ,
l!l.. . ~
bound is 1.25MHz. Crunching the numbers
gives a noise voltage of 19.01JVRMS·
We have not, however, taken the 1/f
noise into account at this stage. In our case,
bandwidth of interest straddles fc so we can't
ignore it. The 1/f noise of the TLV2460 will
dominate, because its fc is 150Hz, compared
to 3Hz for the LMP7731. The equation for
calculating the noise voltage where the
bandwidth of interest straddles fc is:
v, = e"~(f;, - J; + fcln(J, I J;)
Instead of just multiplying the noise
density by the square root of bandwidth fh
- f1 we now have an extra logarithmic term
that accounts for the 1/f noise. For obvious
reasons, we can't plug OHz into this equation
for the lower limit. So, we choose a suitably
ci rcuitcellar. corn 11
FJGURE 5
When calculating the noise in an
inverting amplifier, we add the root
sum of squares of the amplifier input
noise voltage, the voltage produced by
the input noise current in the source
resistance, and the Johnson noise
produced by the source resistance
itself-all multiplied through the op
amp st:lge gain.
12. CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE6
The finished PCB assembly. The input
is at the top, with the output and
controls at the bottom. The whole
assembly slides into an aluminum RF
screened case (not shown).
low frequency, say l~Hz, and again use
1.2SMHz for the upper limit. This gives us
a revised noise voltage of 21.2~V which just
tells us that the 1/f noise contribution is small
but not negligible.
Finally, we need to calculate the noise
voltage due to the high-frequency path. In the
same way as before, we need to extend the
lower frequency cut-off from the -3dB value
of 31.8kHz by a factor of n/2 to 20.3kHz. The
upper bound in frequency is our design limit of
lGHz. The only contributor to this noise is the
0.4nV/v'Hz Johnson noise in the 10n resistor.
Calculating this gives a voltage noise in the
high-frequency path of 22.5~VRMs-not too
different from that for the low-frequency path.
If we add these two together, using the
root of the sum of squares, of course, we get
a final noise figure of 30.9~VRMS· The noise
floor of a good oscilloscope will be in the
order of lOO~V - 300~V at lmV per division.
Adding our measurement noise to that of
the lower end of the range will increase the
For detailed article references and additional resources go to:
pww.clrcultcellar.com/artlde-materlals
RESOURCES
oscilloscope noise floor to lOS~V, well inside
the 10% figure we set ourselves.
POWER SUPPLY
The op amps we have chosen work over a
voltage range of 1.8 to S.SV and 2.7 to 6.0V,
respectively. The TLV2460 must be able to
drive 20mA into son, at which point it can
swing to ±400mV of the rails, so we need a
minimum supply of :!:1.4V and a maximum
of about ±2.SV. Adding up the quiescent and
load currents of the two op amps, we reach
a total of about 25mA. The alkaline AA cells I
looked at had a capacity of 3,000mA-hours at
2SmA, for a nominal life of 120 hours, which
should be enough.
Two cells in series for each rail would give
a voltage range of :1:3.0 to :1:2.0V over the
discharge life of the battery. Adding a diode
drop to each rail will reduce this range to
nominally :1:2.4 to :1:1.4V, which is pretty close
to what we need. The only downside is that
at low battery voltages, the maximum offset
we will be able to inject will reduce to :U4V. If
this is a problem for you, you can adjust the
value of R2.
The noise calculations above assumed
a perfectly noiseless powersupply. If there
were noise in the supply, it would appear at
the amplifier outputs, attenuated by the op
amp's power supply rejection ratio (PSRR).
This is typically in the order of -100 dB at
low frequencies, but gets a lot worse at high
frequencies. The ops amps we chose have a
PSRR of around -3SdB at lMHz.
Alkaline AA battery noise data is not easy
to find, but what I could find suggested a
noise density in the order of 0.2nV/VHz and
an fc of around 1kHz. After -3SdB of PSRR
attenuation, this is less than O.OlnV/v'Hz,
which confirms we were justified in ignoring
this noise in our analysis discussed earlier.
I added a battery-voltage-monitoring circuit
U3 in Figure 1, using a BU4828G voltage
detector (Rohm Semiconductor). When the
supply voltage falls below 2.8V (:1:1.4V),
LEDl lights up. This embellishment is not
strictly necessary, but does make for a more
practical instrument.
CONSTRUCTION AND RESULTS
I laid out a simple, two-layer PCB as
shown in Figure 6. The high-frequency path
is a straight son controlled-impedance trace,
running down the center of the board under
the batteries. The rest of the layout is not
super critical. It is important, however, to
enclose the circuitry in a well shielded case to
prevent stray noise from being coupled into
the circuit. I used a shielded aluminum case
from Hammond Manufacturing. It was the
most expensive component in the project.
To use the probe, simply connect to your
oscilloscope via a SOQ BNC-to-BNC cable,
and switch to SOQ input termination. For
the best results when using the probe, it
should be connected to the circuit through a
shielded cable soldered directly to the circuit
in question. Terminate the braid close to the
core (across a bypass capacitor is a good
place). Don't use a passive probe for critical
measurements.
So, how did it work out in practice?
Real-life components have tolerances and
parasitics, and the physica l construct ion
also inf luences their actual performance.
Measuring the gain over the 8 decades of
frequency shows a fairly f lat r esponse from
DC to just under l OOMHz, which is the limit
of my measu rement capabilities (Figure 7).
There is a dip centered on 160kHz, which
tells us that the matching of the damping
resistors to the capacitive and inductive
impedances is not perfect. This error is
less than ldB at its worst point, just on the
design target. Given that I used standard
components, this is not a bad result.
The noise f loor of my 200MHz oscilloscope
in the lmV-per-division range is around
1551.JVRMS• and adding the power rail probe
increases this to around 200~VRMs-noticeably
worse than my calculations suggest, but
not catastrophic. If I switch-in the 20MHz
bandwidth limit, the noise floor drops to
96~VRMS• and with the probe connected, the
noise increases to 108~VRMS• which is much
more in line with what I expected.
This suggests the noise is mostly in the
20-200MHz range, and most likely relates to
the imper fec t shield ing of the enclosure. I
might try to address this in a future itera tion
of the design, but to be frank, I am happy
enough with this result, given the type of
work I do, and the fact that total cost of par ts
is well under $100.
circuitcellar.com 13
FIGURE 7
Measured ga 1n o~~er tre frequency
range I could measure With my setup.
Tre gain is nat to Within !dB. Tre
slight d1p at tre resonant frequency of
around 160kHz IS due to the non-ideal
nature of real-life components.
Portable trackers offer a very particular set of
problems for designers. In this article, Geoff
takes a quick look at the design requirements of a
portable tracking device, the choice of embedded
antennas and some of the points to consider when
designing a product where the performance of the
antenna in situ could determine the commercial
success of the product.
D es1gmng portable trackers means facing some unique challenges, including selecting
the right antenna solution. By
their very nature, it is difficult to design for
Global Navigation Satellite System (GNSS)
frequency bands. Particularly in small devices,
where a whole host of issues can arise during
development. Here, we consider the factors
that make a successful design for a tracking
device.
Portable trackers need to be small enough
to be easily carried around and are often
used in applications where they are attached
to another item, or they may be used as a
portable or wearable device for a living being
such as a pet, a child or an adult person.
This means that the design needs to be neat
and discrete, because the whole idea of the
tracker is to provide an inobtrusive way to
monitor location. This means that the device
is likely to be small, and the antenna that
drives it should also be small (Figure 1). If the
antenna is to be embedded into the PCB, its
location needs to be planned right from the
very earliest stages of product design.
There are plenty of antenna options
available, including choices of network: LTE,
Bluetooth, WLAN and so on, and the satellite
options of GPS, GNSS which can pinpoint the
location for navigation, mapping, gee-tracking
and fitness trackers. For a design example
using a Bluetooth radio, see the sidebar "Design
Example: Smart Bike Lock" on p.17.
In selecting an antenna, you will need to
consider the ground plane requirements and
proximity loading of lossy bodies (such as
the human extremities), to be sure that the
design allows enough space for the antenna to
radiate effectively. You may want to consider
the different forms of antenna as well, which
could be a flexible printed circuit, ceramic or
an FR4 surface mount chip antenna.
ANTENNA DIRECTIONALITY
The antenna within a portable device needs
to be as omni-directional as possible, so that
it can send and receive signals from anywhere
in its environment (Figure 2). This might pose
a difficulty because it means that the RF
design will need to mitigate interference that
could affect the antenna from any direction.
Choosing the right antenna and arranging
the components correctly within the device
becomes particularly important. We have
sometimes seen trackers where the RF
functionality has been compromised by the
operating environment, so it is important
to design the RF circuity correctly and carry
out tests to be sure how the final device will
perform.
Portable trackers are generally small, so
the space on the PCB will be limited and the
antenna may be placed very close to other
components. Components such as batteries
and power regulators are known for creating
electrical noise, which could interfere with the
antenna signal. Some antennas are designed
to support eo-location with noisy components
and other antennas, but others require strict
"keep out" areas, which will be specified in the
datasheet for the antenna. Designers need to
be very aware of how the layout of the other
components will affect signal transmission and
reception. One way to be sure is to submit your
Gerber file for verification by an RF expert,
before proceeding too far with the design.
There are also human factors to consider.
Some trackers are used to track goods, such
as shipping containers or pieces of luggage.
However, if the device is a fitness tracker or
one that is going to be used to track pets or
livestock, it will be placed directly on the body.
The challenge is that the body reflects and
absorbs radio signals. This could potentially
prevent the device from operating in the real
world, even if it performs perfectly in a test
chamber.
Designers therefore need to consider
the environment where the tracking
application will be used and create their
designs accordingly. Here are some effective
solutions: some designs use antennas with
ceramic housing to isolate interference, or
some even use flexible antennas that can be
inserted within textiles and clothing. These
can be effective waysto ensure that a tracker
functions correctly when placed against the
body it will be tracking.
RANGE AND POWER
Consider the effective operational range
for the device you are building. A tracker
should be able to send and receive signals
continuously as it moves around. If the device
can easily be moved out of range, it has failed
in its mission. It is not easy to guarantee the
range for the antenna within a small tracker,
particularly when it is integrated alongside
other components, as discussed earlier. Real-
life use scenarios can be difficult to predict
and may reveal oversights in otherwise
theoretically "correct" solutions. The best way
to overcome this is to use an extensive range
of testing scenarios to discover the realistic
operational range of the tracker.
For an antenna to maintain a reliable signal
in large, noisy environments, it will inevitably
draw more power than devices operating in
smaller controlled spaces. Also, the volume
and frequency of the data transmitted has a
direct bearing on battery life.
The battery needs to be large enough
to keep a device operating for a reasonable
period of time, and there should be a clean
way to replace or recharge it. If the means of
providing power are not user-friendly, it can be
a frustrating user experience. Nobody wants to
have to remove and charge their dog's collar
every night when all they were hoping for was
ci rcuitcellar. corn 15
Wrist mounted we;moble exoomole ror Bluetooth aoolicatlon
an easy way to keep track of their new puppy.
One good way to help keep a tracking device
charged is to make it compatible with one of
the wireless induction chargers.
CERAMIC OR CHIP ANTENNA?
The latest tiny chip antennas for GNSS allow
even small devices to receive signals from
over 20,000km away. In RF terms, they have
taken strides pastthe traditional ceramic patch
antenna. A ceramic patch antenna will usually
provide superior performance in open space,
with plenty of ground plane, however, they
require a large antenna footprint. They are
also relatively cheap, but it is unlikely that your
design brief will be able to dedicate enough
space to accommodate one of these, and the
smaller ceramic patch antennas are limited by
their efficiency and rarely collect enough RF
energy to perform as well as the larger ones.
This means that smaller patches measuring
less than 17mm x 17mm will typically be
unable to achieve omni-directional gain. This
will limit their performance in devices that are
not operating parallel to the source radiation,
in this case, the sky. They are also moderately
difficult to amplify without allowing signal
1
5
FIGURE 1
Wearable devices with small PCBs
have limited space to provide
clearance between the antenna and
other components.
----------..... _ ---...
3 6
2
FIGURE2
A flexible antenna for GNSS showing antenna radiation in all six spatial directions
16 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE3
The Sinica SMD (surface mount device)
antenna fur 1559-1609 MHz measures
7.0mm x S.Bmm x 0.4mm. It is a low-
prufi le antenna with the performance
of a ceramic patch.
FIGURE4
M20047 is a 1.584GHz general purpose
integrated trace RF antenna.
FIGURE 5
This shows the antenna keep
out area on the PCB.
ABOUT THE AUTHOR
noise to impact the performance of the device.
In small tracker designs, a surface-mounted
antenna will have a smaller footprint, and will
usually outperform a ceramic patch at a lower
cost (Figure 3).
Ceramic patch antennas need line of sight
to the sky, which means they need to be
pointed upward wherever possible. Most cars
and drones operate parallel to the horizon so
this may not be an issue in those use cases,
Geoff Schulteis is RF Antenna Application Specialist with Antenova, Americas.
For more informat ion about antennas and their integ rat ion, please see
www.antenova.com.
For detailed article references and additional resources go to:
-w.circuitcellar.com/article-materials
RESOURCES
Antenova I www.antenova.com
but it does limit their usefulness for trackers,
wearables, handheld and other devices that
require an antenna with low directivity to
perform well for a quick time-to-first-fix.
There are many satellite frequencies
within GNSS and many devices support
multiple systems, but it becomes difficult
to achieve sufficient performance across
varying wavelengths with small ceramic patch
antennas. If the device is smaller than 25mm2,
ceramic patches will only effectively operate
on narrow frequency bands. In contrast, a
surface mount antenna can work effectively
on wide frequency bands. This may not pose
a design issue. If the device is to operate
parallel to the horizon, on a single frequency,
a small ceramic patch antenna may provide
sufficient performance.
ANTENNA GROUND PLANE
Due to the size of the satellite wavelengths,
an embedded patch antenna will require
a greater than normal ground plane size,
typically upward of 60mm x 60mm. Surface-
mount antennas allow more flexibility, and
some overcome this by operating on the
corner of the PCB, whereas the ceramic
patch antenna must be placed in the center
of the ground plane for omni-directionality.
It is important to select the most appropriate
antenna for your design and minimize the
challenges of RF integration.
The ground plan functions like a runway
for transmissions to and from the antenna,
reflecting signals into and away from the
antenna to minimize interference and optimize
the radiation pattern. For fixed antennas,
the Earth's surface functions as the ground
plane, reflecting radio waves into and away
from the antenna. For portable antennas, the
ground plane must be part of the PCB itself.
This can become a real issue when designing
small GNSS tracking devices. Space confines
and proximity to other components can
compromise the efficiency of a ground plane.
Figure 4 shows the M20047, a 1.5B4GHz
general purpose integrated trace RF antenna.
In order for the ceramic antenna to be
effective, a ground plane needs to have a
radius of at least a quarter wavelength of
the radio waves the antenna is tuned to. For
GNSS and GPS, which broadcast at either
1575.42MHz or 1227.60MHz, this means a
ground plane with a radius of around Scm.
This space needs to be planned in your design
early on. It can be problematic if it is not
considered early in the design process.
The antenna uses the host PCB ground to
effectively radiate. As such, a GND plane must
be placed on the host PCB on at least two
layers. In the example shown in Figure 5, the
only area void of GND is the antenna keep-out
area. The solder mask is removed to make the
copper visible.
If it proves tricky to allow sufficient space
for the antenna and its ground plane, it
may help to consider the options of surface-
mounted antennas and flexible printed circuit
(FPQ antennas. It is crucial that the layout of
your PCB does not affect the ground plane.
This is a particular issue in GNSS tracking
devices, where space is at a premium and
components need to be close to one another.
REAL-WORLD TESTING
The ground plane will allow effective signal
transmission and minimize interference, but
the antenna may still receive reflections from
glass and buildings in the surrounding area,
which could compromise functionality.
Portable tracking devices are particularly
vulnerable to this. They may be carried into
all sorts of environments, including potentially
hostile ones, but they still need to be capable
of transmitting and receiving reliably, so we
would recommend that designers keep this in
mind and plan a test program accordingly. G
ci rcuitcellar. corn 17
Design Example: Smart Bike Lock
The antenna choice is crucial in the design of the bike lock because
the Bluetooth low Energy (BLE) radio is the only way to communicate
with the smart phone a pp that monitors the lock. In a real-world design
alongthose lines, the design required the Bluetooth signal to be as
strong as possible, to maintain the connection between the bike and
the smart phone so that the users can monitor the security of their bike
from a distance.
BLE solutions typically use a chip antenna eo-located on a radio
module, but this may not be a reliable solution. Depending upon how
the antenna is integrated, it may work next to a plastic surface but not
on a metal one. The challenge was to work within the small dimensions
of the host PCB and accommodate the antenna in close proximity to the
lock mechanism and the bike itself. The antenna was shielded below the
electronics, but the integration did not allow a eo-located antenna on
the BLE radio module.
The antenna was therefore located away from sources of interference
on the main board, where it could be protected from knocks and bumps
during day-to-day use. For the design, the engineers chose Antenova's
Weii ceramic antenna, which measures just l.Omm x O.Smm x O.Smm,
with the matching network tuned for the application. This achieves good
efficiency-good enough to operate at a range of a few hundred feet.
It uses an antenna topology known as magnetic-dipole, which remains
very stable and on-frequency in this application.
The NEW PicoScope® 6000E Series
Smarter scopes for faster debug r~,
-,_
•' • e: · t • •
By
Raul Alvarez-Torrico
Over the past year, Raul has written several articles about drone
design. Here, he offers a product review of CUAV Tech's VS Plus drone
flight controller and its associated NEO V2 GNSS module. Raul dives into
specifications and functions of these devices in great detail, then shares
the results of some flight tests using the products.
T his is a product review article for the VS Plus drone flight controller and the NEO V2 Global Navigation
Satellite System (GNSS) module-
both manufactured and distributed by CUAV
Tech. The VS Plus flight controller is promoted
by its manufacturer as an advanced drone
flight controller aimed at academic research
and commercial applications. It is based on
the Pixhawk FMUvS open hardware design
standard, and is modular, consisting of a core
plus a separate carrier board. It is compatible
with PX4 and ArduPilot firmware, supporting
a number of vehicle types and configurations.
The accompanying NEO V2 GNSS module
can concurrently process signals from GPS,
Galileo, GLONASS and BeiDou global satellite
positioning systems, and includes a digital
compass.
In this review, I begin by describing
the flight controller and GNSS module's
specifications and functionality in detail. Next,
I some introductory concepts about
Hardware-in-the-Loop (HITL) simulation,
to put in context some HITL tests I carried
out with the VS Plus. I also flight log
analysis review as a tool to assess aircraft
performance. Finally, I the results of
some field flight tests I made with the VS Plus
and the NEO V2 GNSS module, both installed
in a test quadrotor.
I received the VS Plus flight controller and the
NEO V2 GNSS module from CUAV Tech for free,
to test and evaluate. This review reflects my
personal experiences and opinions about these
products, in the context of the type of drone
applications I normally do as part of my day
job: advising undergraduate college students
with drone autonomous flight projects.
TECHNICAL SPECIFICATIONS
CUAV Tech is a Chinese company working
since 2012 in research and development,
production and salesofunmanned autonomous
vehicle (UAV) applications and system modules,
such as flight controllers, digital radio link
systems and global positioning devices. One
of their most recent products is the VS Plus
flight controller, designed in collaboration
with the PX4 autopilot team. CUAV Tech is
a "silver member" of Dronecode-the non-
profit organization governed by the linux
Foundation that oversees the development
of four open-source projects in the PX4
ecosystem: PX4 autopilot, MAVlink, MAVSDK
and QGroundControl.
The VS Plus is based on the Pixhawk
FMUvS (Flight Management Unit vS) open
hardware design standard, and uses Pixhawk
standard pinouts to interface with external
devices. It comes out of the box pre-installed
with PX4 firmware, but is also compatible
with ArduPilot firmware. Figure 1 shows the
VS Plus core module (in silver) attached to its
carrier board (in black). The detachable core
contains the flight controller's main hardware
components (microcontrollers (MCUs) and
onboard sensors), and the separate carrier
board contains the interfacing connectors to
external devices.
That modularity gives you the choice of
either using the core with one of the of-the-shelf
carrier boards from CUAV Tech, or designing a
custom one. CUAV Tech made available an open
carrier board reference design that can be used
as a starting point to design a custom one.
The main processor in the core module is the
STMicroelectronics STM32F76S MCU that runs
at 216MHz and contains 2MB of flash memory
and 512KB of RAM. This improves computation
power in comparison with previous flight
controllers, such as the Pixhawk V3x, also made
by CUAV Tech.
The core module implements multi-sensor
redundancy by combining five sets of sensors.
It has two TDK InvenSense integrated
circuits-the ICM-20689 and the ICM-20602-
each of which contain both a 3D accelerometer
and a 3D gyroscope. Additionally, it has a
Bosch Sensortec BM1055, which also contains
a 3D accelerometer and 3D gyroscope. An
iSentek Technology IST8310 3D compass and
a MEAS Switzerland MS5611 atmospheric
pressure sensor (altimeter) complete the set
of onboard sensors (the MSS611 is sold by
TE Connectivity). The flight controller reads
the multi-channel sensor data in real time,
and switches to a redundant sensor whenever
there's a failure in the previous one, thus
improving safety and reliability.
Figure 2 summarizes the hardware
specifications for the VS Plus flight controller.
Additional key characteristics worth
mentioning are: a secondary input/output
processor (the STMicroelectronics STM32F100
MCU); two battery monitoring systems;
support for high-accuracy, centimeter-level,
Real-Time-Kinematic (RTK) positioning,
with the use of corresponding modules and
support for LTE telemetry and video links-
which provide a much wider coverage area
than conventional ones.
The core module has a built-in damping
system that separates the sensors from the
main board and provides high-performance
shock absorption. This reduces signal noise
in the sensors due to mechanical vibration,
making unnecessary the use of external anti-
vibration systems (Figure 3). The VS Plus fully
adheres to the PX4 official standard, to ensure
compatibility and interoperability with other
hardware and software products in the PX4
ecosystem. Available VS Plus carrier boards
are also fully compatible with the new X7
flight controller cores announced by CUAV
Tech in May, 2020.
The NEO V2 GNSS module has a U-blox
MBN, 72-channel GNSS receiver and an
iSentek IST8310 digital compass (Figure 4).
The MBN sub-module is a dual-mode parallel
GNSS receiver than can concurrently process
signals from GPS/Galileo and GLONASS
FJGURE 1
ci rcuitcellar. corn 19
- VS Plus core and standard carrier boand
VS Plus Core
FJGURE2
Main FMU Processor: STM32F765
32 Bit Arm• Cortex•·M7, 216MHz, 2MB FLASH, 512KB RAM
10 Processor: STM32Fl00
32 Bit Arm• Cortex•·M3, 24MHz, 8KB SRAM
On-board sensors:
3 x Accei/Gyro: ICM-20689, ICM-20602, BM lOSS
1 x Magnetometer: IST8310
1 x Barometer: MS5611
Interlaces:
8·14 PWM outputs (6 rrom 10. 8 from FMU)
3 dedicated PWM/Capture Inputs on FMU
Dedicated R/C Input for CPPM
Dedicated R/C input for PPM and S.Bus
Analog / PWM RSSI input
S.Bus servo output
5 general purpose serial ports
4 12C ports
4SPI buses
2 CAN buses with serial ESC
2 battery monitoring inputs
Power System:
Power: 4.3-5.4V
U5B Input. 4.75-s.25V
Servo Rail Input: Q-36 V
Welcht and Dime nsions:
Weight: 90g
Dimensions: 85.5"42•33 mm
Other Characteristics:
Operating temperature: -20- 80 •c
VS Plus summary of specifications
ZO CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE3
VS Plus built-in damping system
FIGURE4
NEO V2 GNSS receiver and compass
module
FIGURES
VS Plus Hffi simulation running
or GPS/Galileo and BeiDou global satellite
positioning systems. This feature ensures
much better positioning accuracy in urban
canyons or any environment with weak GNSS
signal reception. It has an update rate of 10Hz
(maximum), a cold start acquisition time of
26 seconds and a hot start acquisition time of
1.5 seconds.
The NEO V2 module incorporates a safety
switch, a buzzer and RGB status lights,
otherwise separately added to the drone. I
received from CUAV Tech a kit containing the
VS Plus core and standard carrier board, the
NEO V2 module, an HV_PM power module,
a PW-Link Wi-Fi telemetry module, an IlC
expansion board, a USB to UART converter
and some additional accessories.
HITL SIMULATION
Hardware-in-the-loop (HITL or HIL) is a
simulation mode in which a real hardware flight
controller runs regular PX4 firmware to control
a computer modeled vehicle inside a simulated
environment. In contrast, Software-in-the-
Loop simulation (SITL) is the mode in which
the PX4 flight stack is run typically on the same
computer on which both the modeled vehicle
and virtual world are running. The benefit of
HITL over SITL simulation is that HITL allows
testing most of the actual PX4 autopilot flight
code on the real hardware. PX4 supports HITL
simulation for multi-rotor drones with jMAVSim
and Gazebo simulators.
SITL and HITL simulation are great tools,
not just for development, but also for teaching
and learning. For instance, they are useful for
autonomous drone application development.
You ea n write, test and debug your autonomous
flight code right in front of your development
computer, without needing to go outside with
a real drone until it is absolutely necessary.
This is particularly helpful when you integrate
other technologies-such as computer vision
and cloud data connections-to your drone
application, and you need to do indoor tests
simultaneously with your autonomous flight
code.
I tested the VS Plus in HITL simulation by
running some MAVSDK-Python autonomous
flight code examples I had on hand. For
example, it ran well with the write_my_initials.
py program example from my previous article
uwriting MAVSDK/PX4 Drone Applications"
(Circuit Cellar 361, August 2020) [1]. Figure 5
shows a screen capture of the HITL simulation
running. As I sometimes do with new drone
builds, I also made a couple of HITL tests
I•
---
-· --
_____ ,..
_....,. ..... ~ .. ---
flying the simulated drone with the real radio
control system connected to the hardware
flight controller, and it worked well.
In my previous article [1], I discussed
the installation procedure of the PX4 SITL
simulation environment for developing
autonomous flight applications with
the MAVSDK-Python library. The same
environment works for HITL simulation.
If you are interested in autonomous flight
application development, check that article
for a quick introduction to the subject. Once
you have the simulation environment correctly
installed, the procedure for running an HITL
simulation is as easy as for SITL when using
the jMAVSim simulator.
It is somewhat more involved for HITL with
--·
.. -. .. _.._
-..---·---
--
l x:M
__ ,
P-lt'""' : ~~ "";""--- l
1:- ....,.
_.J ~
-·- --
ci rcuitcellar. corn 21
FIGURE6
Plot examples from a flight log review
22 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE 7
Test quadrotor with the VS Plus and
NEO V2 module
the Gazebo simulator. For HITL simulation
to work, you typically connect the flight
controller with the USB cable to the computer
running the simulation, so the flight controller
can connect to the virtual environment. You
can use a stand-alone flight controller with
nothing else connected to it, or one in a finished
drone build. The file run_hitl_simulation.md
included in this article's materials details the
steps for running HITL with both jMAVSim
and Gazebo. The file is available via a link on
Circuit Cellar's article materials webpage or
via down load from Circuit Cellar's article code
and files page. If you've tried SITL before,
running HITL is almost the same.
FLIGHT LOG ANALYSIS
Pixhawk flight controllers store flight
logs on a Micro SD card. These flight logs
can be later analyzed to assess the drone's
performance and help debug issues. The
flight logs are stored in Ulog format and
contain data from sensors, actuators, control
algorithms, the radio control system, power
system, processor and memory and the data
logging system itself. Some examples of data
stored in log files are: altitude, roll/pitch/
yaw angles and angular rate, local position
(X, Y, Z) and velocity, manual radio control
inputs, actuator control and outputs, raw
acceleration, angular speed and magnetic field
strength, vibration level, GNSS uncertainty,
noise and jamming, thrust and magnetic field
(for correlation), power system, health report
(estimator watchdog), RC quality, CPU and
RAM, sampling regularity of sensor data and
logged messages (warnings, errors).
When a flight goes wrong, log analysis is
a great tool that can potentially help us find
issues in the aircraft build quality, as well as
hardware failures, flight controller wrong
parameter configuration or even issues with our
piloting skills. But even if nothing goes wrong
and your aircraft flies well, log analysis can help
you assess how well your aircraft is performing.
Figure 6 shows plot exam pies of data logged
by a Pixhawk flight controller. Of the many tools
for log analysis, one of the most commonly
used is Flight Review. This is a free online tool
available on the cloud that doesn't need local
installation and makes it easy to analyze flight
logs and share the results over the web. You just
need to go to the cloud application web address
ps: rev1ew. x .10, pload your flight log,
analyze the data and, if you want, share the
link with others. Flight logs are also handy
when asking for help in the official PX4 support
channels. Other flight log analysis applications
include pyulog, pyflightAnalysis, FlightPiot,
PX4Tools, MAVGCL and Plotluggler [2].
Understanding flight log plots isn't
difficult, if you have basic knowledge of how
a drone works and what roles are played by
sensors and actuators in the system, along
with a basic understanding of the main control
algorithms involved, such as PID. But even if
you know how to interpret the data graphs,
it will take a while until you understand what
values are acceptable in each case, and which
plots are better to look at when dealing with
specific problems, such as frame mechanical
vibration. The PX4 site has good introductory
information on how to analyze flight log plots
and identify common problems. On the Circuit
Cellar article materials webpage for this
article, I've provided links to PX4's website
pages containing more detailed information
about flight reporting and flight log analysis.
FIELD FLIGHT TESTS
Figure 7 shows the quad rotor drone I used
with the VS Plus for my flight tests in the field.
It has the following hardware:
• An SSOO frame
• Generic 2212/920KV brushless motors
• DYS 30A 2-SS Electronic Speed Controllers
(ESCs)
• DJI 9450 and Gemfan 1045 propellers
• A generic 5,000mA-hours, 3S, 30C Lithium
Polymer (LiPo) battery
• A FlySky FS-I6S radio control transmitter
paired to a FS-IA10B 10-channel receiver
• A PW-link Wi-Fi telemetry module
• The VS Plus flight controller with the NEO V2
GNSS module
I also made a couple of flights with another
quadrotor with the same type of hardware,
except for a DJI F450 frame.
For my firstflight tests with the VS Plus, I
used the HV_PM (High-Voltage Power Module)
that was included in the kit I received from
CUAV Tech. This power module supports
3S-14S batteries and voltages between 10-
60V. However, from the very beginning I had
an interesting issue with this power module.
After take-off of the quadrotor, the "low-
battery" warning was being triggered in
QGroundControl less than a minute into flight,
even though the batteries were fully charged.
Looking at QGroundControl's GUI, I noticed
the "battery voltage" indicator was dropping
from 12.6V to 10V in just 3-4 seconds, and
the "remaining-battery" indicator fell from
90% to 10% in just 8-10 seconds, making
QGroundControl emit audible "low-battery"
warnings. I tested the quadrotor with three
different batteries, which I knew were fine
because I had used them previously with
other quadrotors of similar configuration
without any issues-and got the same results.
Additionally, I had an external LiPo battery
alarm connected, which never got triggered
by the apparent low-voltage condition. I was
flying with PX4 firmware, but I also changed
to ArduPilot to check if the issue was specific
to PX4. I got the same instant "low-battery"
warnings with ArduPilot as well.
USER GROUP HELP
The CUAV Tech user group channel at PX4's
Slack workspace helped greatly to determine
the cause of the issue. The first hint I was
given was that perhaps the power cable
connecting the battery to the power module
was too long. And it was-around 15cm in
length-because of an adapter I was using to
connect my T-connector batteries to the XT60
connector in the HV_PM power module. From
my own flight logs, it also was brought to my
attention that apparently, the power cable
length was causing a considerable voltage
drop, which in turn was causing more current
to be sourced from the battery.
Referring to the gray curve in Figure 8,
you'll notice that the current sourced when
the quadrotor is hovering is around 22A on
average-with a peak as high as 52A! And
the measured battery voltage (the dark-
blue curve) drops from 12V to lOV almost
Power
50 -
40
30 -
instantly. Of course, in reality, the battery
wasn't getting discharged that fast, otherwise
my external LiPo alarm would have been
triggered as well. It was just that, for some
reason, the flight controller was apparently
getting erroneous readings from the current
and voltage sensors in the power module.
I got rid of the adapter cable and did a flight
test again. The flight time improved to around
4-6 minutes, before the warning signal sounded
again. It then appeared that the cause for the
early warnings was that the voltage and current
sensors in the HV_PM power module were not
working well with the 35 batteries. I was also
told that, apparently for a 35 LiPo battery, a
current of around 15A was normally expected
for the kind of quadrotor configuration I
had, instead of the 22A I was getting in the
flight logs. From past logs from other similar
quadrotors, I found that currents between 13A
to 15A were typical.
It was suggested that I try using a LiPo
battery with more cells, so I did tests with
45 batteries; the drone flew well but with a
bit of oscillation. Perhaps it would have been
fixed by tweaking the default PID calibration,
but I didn't go that route. I always tend to use
35 batteries with quadrotors of this size and
configuration, anyway.
Instead, I replaced the HV_PM power module
with a regular 25-85 Pixhawk 1 power module,
and the flight time increased easily up to 8-10
minutes with the default battery configuration
in the flight controller. This default configuration
causes the flight controller to do conservative
estimates of the remaining battery power and
available flight time. So, after tweaking these
battery parameters a bit, the flight time rose a
little more.
In retrospect, perhaps the HV_PM module
could work well with higher-voltage batteries,
but I didn't test it with more than 45 ones.
I had never previously encountered any issue
like this before, and it took me some days to
understand what was happening. As you know,
- Battery voltage [V]
- Battery voltage filtered [V)
- Battery current [A]
- Discharged amount [mAh / 1001
- Battery remaining (0 =empty, 10 =full)
SV
3.3 V
20 "' .A. }\ ,.....-"'\ /\.... /\ I \ ~
V
l ....... = / ~ ....... V - -
10
0
2:10 2:15 2:20 2:25 2:30 2:35 2:40
ci rcuitcellar. corn 23
FIGURES
V5 Plus "power" plot from a flight log
review. lh is graph is representEd
here in the same fonmat that it's in
the PX4 cloud application. But some
notes about the axis units are needed .
The Y axis displays both units of
Voltage M and Current (A) . The X axis
shows time in Minures: Seconds.
Z4 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE9
VS plus drone fiight test
failure is a master that treats roughly but
teaches well. Figure 9 shows the quadrotor
during a flight test.
CAN PDB CARRIER BOARD
Figure 10 shows an optional carrier board
for the VS Plus core, also made by CUAV Tech.
The CAN PDB carrier board is a combination of
a baseboard for connecting external devices,
a Power Distribution Board (PDB) and a Power
Management Unit (PMU). The PMU part of the
CAN PDB has a Universal Battery Elimination
Circuit or UBEC (which is really just a voltage
regulator) based on an Analog Devices LT86455
65V, 8A step-down regulator that provides a SV,
8A output, and a Texas Instruments TP554561
60V, SA step-down regulator that provides a
12V, 4A output. Both outputs are convenient
to power external devices, such as off-board
sensors and actuators, cameras, wireless
transceivers and companion computers.
Because of their specifications, they are even
more convenient for external devices that
consume relatively higher power.
For detailed article references and additional resources go to:
-w.circuitcellar.com/article-materials
References [1] and [3] as marked in the article can be found there.
RESOURCES
Analog Devices I www.analog.com
Ardupilot I https:f/ardupilot.org
Bosch Sensortec I www.bosch-sensortec.com
CUAV Tech I www.cuav.net
Dronecode I www.dronecode.org
iSentek Technology I www. isentek.com
PX4 Autopilot I https://px4.io
STMicroelectronics I www.st.com
TE Connectivity I www.te.com
Texas Instruments I www.ti.com
The PMU has its own dedicated MCU,
a 100MHz 5TMicroelectronics 5TM32F412
running CUAV Tech's Impedance Temperature
Tracking {ITT) algorithm. According to the
manufacturer, it accurately measures voltage
and current in real time, and uses CAN bus
communication and the UAV CAN protocol to
send power consumption data to the core.
The manufacturer says its ITT algorithm
corrects measurement errors caused by
impedance changes at different operating
temperatures, to maintain consistent high-
precision voltage and current measurements.
By adopting the UAV CAN dig ita I communication
protocol, attenuation and interference errors
are avoided. These can be present in regular
power modules that feed the flight controller
with voltage and current measurements in
analog format. To accurately calculate power
consumption, the PMU's MCU samples voltage
and current at a rate of more than 100Hz.
These data are then passed to the flight
controller. The PMU can accurately measure
currents between 0-180A.
CAN PDB supports input voltages from
lSV to 62V, which roughly correspond to LiPo
batteries from 45 up to 1S5, and the power
distribution board supports up to 180A of
continuous current [3]. The baseboard has 13
output channels and several connectors for
telemetry, radio control input, GNSS module,
ADC, I2C, CAN, UART, and the SV and 12V
high-current outputs, among other things.
The PDB power lines are built with 95cm2
of copper sheeting, which also acts as a
heatsink, helping reduce heat caused by the
lines' internal resistance when high currents
circulate. The CAN PDB carrierboard is
compatible with the VS Plus core and the new
X7 flight controller cores from CUAV Tech.
Because of their voltage and current specs,
CAN PDB can be suitable for big drones
carrying high payloads. CUAV Tech also sent
me a CAN PDB carrier board to test, but
I wasn't able to do a flight test because of
global health emergency restrictions due to
the COVID-19 pandemic.
CONCLUSIONS AND FURTHER
TESTS
The kit I received came well packed in a
fine box. From an aesthetic standpoint, the
VS Plus core, the standard carrier board and
CAN PDB carrier board, and the NEO V2 GNSS
module seem well crafted and robust, with a
nice-looking finish. When powered, both the
flight controller core and GNSS module emit
an elegant, halo-like status light surrounding
their bodies.
After changing the original power module,
I had no further "low battery" sudden
warnings, and the flight controller performed
well in the next flight tests. The sensor's
triple-redundancy gives confidence such that,
in the event of an accelerometer or gyroscope
failure, there are still two additional redundant
ones the flight controller can use to maintain
control of the aircraft. This highly reduces the
probability of a crash due to multiple-sensor
failure. This kind of reliability is important,
for instance when your aircraft carries
expensive remote sensing equipment, such as
professional video cameras, high-end LIDARs
or high-resolution thermal cameras. Likewise,
it is important when the drone has been given
a highly sensitive task and can't afford a
failure that would lead to a subsequent crash.
Currently I'm planning to test the VS Plus
with some autonomous flight applications that
integrate computer vision for object detection
and tracking. I tested the VS Plus mainly with
PX4, because it's the platform I generally use
for autonomous flight development, but I
flashed it with ArduPilot firmware as well and
made a couple of flight tests. The configuration
process is equally easy with both platforms.
With a price tag of around $3S8 for the
complete kit (flight controller core plus standard
carrier board, GNSS module, power module,
Wifi telemetry module and accessories), the
VS Plus is not cheap. But whether you work with
drones professionally, or you are a drone
enthusiast always eager to try new things,
perhaps you should take a serious look at the VS
Plus. It could be just the type of reliable flight
controller you are looking for. e
ABOUT THE AUTHOR
ci rcuitcellar. corn 25
FIGURE 10
CAN PDB <:ilrrier board
Raul Alvarez-Torrico has a BEng in electronics and is the f ou nder of
TecBolivia, a company offering services in physical comput ing and educational
robotics in Bolivia. In his spare time, he li kes to experiment with wireless
sensor networks, robotics and artificial intelligence. He is also committed
to publishing articles and video tutorials about embedded systems and
programming in his native language (Spanish), at thei r company's site
www.TecBolivia.com. You may contact him at raul@tecbolivia.com.
C onsider these two questions: 1. Are "footprint" and "code size" the same thing? 2. And, is either
relevant in the current age?
Answer 1: No. Code size is a subset of
footprint. In the context of an in-memory
database system, "footprint" consists of:
• Code size
• Stack memory used
• DRAM used for anything other than raw data
With respect to code size, we must have
an all-encompassing view. We're not the only
embedded database vendor that boasts about
a "small footprint." That said, eXtremeDB
from McObject might be the only embedded
database that has no external dependencies.
For purposes of this discussion, it means
that using the eXtremeDB core in-memory
database does not cause the application to
link in the C run-time library for things like
malloc/free, string operations and so
forth. A claim of "small footprint" is hollow
when the application is forced to link a
megabyte of the C run-time library.
Answer 2: Yes, these terms are relevant.
Code size matters. We can ascribe two things
to a small code size: The function call depth
and the number of CPU instructions for any
given operation. A core embedded database
engine with a code size of 150KB is going to
require fewer function calls, and each function
call is going to require fewer CPU instructions
than another embedded database engine
with a code size of 1.5MB. Whether you're
executing on a 200MHz Arm processor or a
3GHz Intel Sky Lake processor, a database
lockup that requires 100 CPU cycles is lOx
faster than a database lockup that requires
1,000 processor cycles.
STACK SIZE
Stack size in embedded/real-time
operating systems is quite limited. For
example, the default stack size with VxWorks
is just 20KB. Unlike Windows and linux, the
stack does not grow dynamically. If the stack
size is exceeded, the program fails. This ties
directly back to function call depth, but also
influences how much, and how, information
is passed between functions, which is a
consideration that must be considered when
the database system is designed. This is a key
differentiator between an embedded database
that was written for embedded systems, and
an embedded database that is merely capable
of running on embedded systems. Figure 1
illustrates the function call stack.
It should be obvious, but for an in-memory
database, DRAM is storage space. Any
memory that is used for anything other than
raw data limits the amount of raw data that
can be stored in any given amount of DRAM.
In addition to storing raw data, memory is
used for meta data (data about the data),
indexes and database internals.
Let's use some real numbers to Illustrate.
Suppose that in-memory database "A11
imposes 100% overhead on the raw data. That
means that 20MB of DRAM will be required to
store 10MB of raw data. In-memory database
"B" only imposes 30% overhead, so it only
requires 13MB to store the same 10MB of raw
data. In an embedded system like a portable
media player that only has 32MB of memory
Top of stack
r
Local Variables
Return Address
Func1 (Arg1, Arg2 .. . ) --<
ArgN
...
Argl
>-
Local Variables
Return Address
Func2 {Arg1 , Arg2 ... ) --<
ArgN
...
Arg t
'-
Call Stack
to begin with, that is a meaningful difference!
eXtremeDB is an example of an in-memory
database type "B" in this comparison. The
relationship of code, static data, stack and
heap is illustrated in Figure 2.
For its part, eXtremeDB employs several
techniques to minimize the overhead. The
first-and biggest-influencer is index types
and how indexes are organized. eXtremeDB
offers a wider variety of index types than other
database systems, but the most commonly
used are hash and b-tree indexes. By their
nature, hash indexes use less memory (and
are faster) than b-tree indexes. By far, the
most common type of index is the b-tree
index. To understand the disadvantages of a
b-tree you need to have at least a high-level
understanding of their organization.
A I-TREE INDEX
As shown in Figure 3, a b-tree is an upside-
down tree, with the "root" node at the top. Each
node has many slots where the number of slots
is a function of the size of the node (in bytes)
and the size of the "payload.u Simplistically,
number-of-slots = node size I payload. Each slot
contains (1) a pointer to a node with key values
that precede the key value in this slot, (2) this
key value, and (3) a pointer to the actual data
record that is being indexed.
As you can see in the illustration,
b-trees are normally partially empty (up
to 45% empty), so there's built-in space
inefficiency. The key value exists in the slot
so that database systems can implement an
optimization called a "covered query,n which
• Call Stack is a stack that contains
a collection of stack frames.
• A Stack Frame, also called
an activation record, contains
information about a function call.• When the program runs, the call stac k
contains at least one stack frame,
which is for the main function. A stack
frame is created whenever a function
is called.
• Arguments are inserted into a stack
frame from right to left.
• A Stack Point Register (register 1) is
used to mark t he current "top" of
the stack .
simply means that ifthe column(s) queries are
only the indexed column(s), then the query
results can be obtained by only scanning the
key. There is no need to follow the pointer to
the data record and the amount of logical I/0
is reduced by one-half. But this optimization
only makes sense for persistent databases,
because of the speed of storage media.
Following a pointer in memory to the
data record takes just nanoseconds, whereas
following a pointer to a track and sector on
a solid-state disk can be as low as l~s, and
generally on the order of 10 milliseconds for
a hard disk drive. The use of precious DRAM
to store redundant key values is unjustified
Heap
In-memory rl database lives
!
here
t
StackN
Data
Code
ci rcuitcellar. corn 'D
FIGURE 1
An illustration of tl1e Call Stack function
FIGURE Z
This shows the relationship of the
code, the static data, the stack and
the heap.
15877542
15877542
Servo control is just one area where microcontrollers
shine. In this article, see how these two Comell
students designed and built a ball-balancing platform
based on PIC32 MCU, using a resistive touchscreen
and servomotors attached to a gimbal mount. A PlO
control algorithm is used to balance the ball.
FIGURE2
W hile it may seem a simple task, balancing on one foot is no small feat. It requires a
constant cycle of observation
and adjustment. Getting an electronic device
to perform a similar task in just a few weeks
is not easy and takes quite a bit of tuning-
just as it takes us time to learn to balance as
children.
mgsin(O) mgsln(O) 5 (B) 5
8 a - --1- =--2- = ?IJsln .. 70
m+RT m+~m
Illustrated here is a free body diagram of an isolated direction of the ball on an angled plate, and an equation
of predicted motion.
In this article, we present a ball-balancing
platform that uses a touchscreen and a
Microchip PIC32 microcontroller (MCU) to
keep a steel ball bearing stable on its surface.
A proportional, integral, derivative (PID)
control algorithm and two serves are used.
This project was designed to inspire interest
in control theory and its applications, and to
motivate deeper thought about the physics at
play in this system. Our end result is shown
in Figure 1.
PHYSICAL ANALYSIS
A ball rolling on a perfectly flat plate is
technically metastable, since, if there are no
forces applied, the ball will remain static.
Of course, this assumption is terrible, and a
real ball sitting on a real plate is going to fall
off unless we do something about it. A ball
rolling on a tilted platform roughly follows a
linear relation between angle of the platform
and acceleration along the surface (Figure :Z).
The no-slip condition makes this linearizing
assumption possible, because we essentially
assume that each rolling direction is totally
independent.
In this analysis, m represents the mass
of the ball, I is the moment of inertia of a
rotating sphere, and a is the acceleration
of the ball parallel to the surface. At small
angles, sin (8)=8, so we show a linear relation
at the end between angle and acceleration.
We tilted the platform over a range of about
±15 degrees, or about ±0.3 radians, which
gives a maximum error of approximately
l.So/o due to the small angle approximation.
Given a relatively heavy, 1" steel ball, we
knew we needed servos that could hold their
position with the mass of the ball (0.07kg) at
the servo arm's maximum distance from the
pivot (Bcm). This meant we needed serves
that have about 0.56 kg-cm torque, which
translates to around Boz-in. The serves we
chose had a 4.8V stall torque of 9.4kg-cm
or over 125oz-in. Although we planned to
run on SV power and thought we might be
underestimating the maximum torque on
the motor, this was plenty strong. The main
trade-off is between strength and precision
of the motors. As it turns out, our serves
were extremely strong for this task, causing
a precision issue in the tuning stage.
MECHANICAL DESIGN
The main pieces of the platform were the
base plate, pedestal, top plate, serve and pivot
hinges, and the servo mounting brackets. By
securing the serves to the base plate, we
hoped that the structure was rigid enough to
handle rapid movement. When starting this
project, the biggest decision to make was
to first choose a resistive touchscreen. The
dimensions of that piece of hardware largely
determine the rest of the design, and it is
the most unique item on the supply list. Our
project used a medium-sized, rectangular, 7"
diagonal resistive touchscreen overlay from
Adafruit [1], and we cut our top plate to match
its dimensions (165mm x 105mm).
From here it makes sense to do a bit of
math to answer the following questions: How
far off the table does the plate need to be
to accommodate two serves and the table's
full range of motion? How powerful does each
serve have to be to accelerate the ball when
it is moving quickly toward the edge? A good
estimate can go a long way-even if it means
the design is tweaked at the end.
The resistive touchscreen sits on an acrylic
plate, which is mounted to a base using a
partially 3D-printed Cardan joint (Figure 3).
This allows the plate to pivot around its hinge
in two directions independently. Each direction
is controlled by a serve motor, which is
attached to the underside of the plate with a
ball socket connection.
We used 1/8" acrylic for all pieces, and
attached them with acrylic cement. In
our implementation, the platform had an
approximately 32-degree range of motion in
the short direction, and 36 degrees in the long
direction. Placing the pivot mechanism at the
center of the plate, while easy to build, did not
allow for rotations outside of this range. This
mechanism has the only 3D-printed part: a
cross-shaped connector that joins the top plate
and pedestal.
We first laser cut the acrylic and glued
together all the supports, noting the order of
operations for attaching the pivot mechanism.
The pedestal and cross piece were assembled
first, and the servo joint attachment points
(shown in red in Figure 3) were glued to
the top plate separately. Then the center
supports were attached to the top plate, while
simultaneously joining them to the cross piece.
The ball joint attachments to the serve motors
were then easy to attach to the top plate and
were snapped onto the servos mounted to the
bottom plate at their minimum or maximum
extent. To do this, we first zeroed the serves
and then set the angle of the platform to our
desired zero angle.
The success of this project was heavily
dependent on the care with which the
FIGURE3
CAD drawings of the acrylic pieces, fully assembled
ci rcuitcellar. corn 31
32. CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE4
Full schematic, including our attilched
hardware, of parts of the development
board [4] created by Sean Carrell for
ECE 4760 [5]
mechanical integration was performed. Tightly
fitting each joint to the servo motors, and
making sure the pivot point didn't wobble, both
yielded better performance in the final design.
ELECTRICAL DESIGN
The main electrical components include a
Microchip PIC32 MCU [2], two serve motors, the
resistive touchscreen and a serial connection to
a separate computer monitor for the tuning
step (see the schematic in Figure 4).
The touchscreen generates a voltage
proportional to the X (long dimension) and Y
(short dimension) position of an input touch.
Using Adafruit's touchscreen control chip to
receive data proved time consuming, but
there were several options for making the job
easier. The touchscreen uses four pinsto set
the voltage of strips of conductive material
that line the outer perimeter of the screen.
By holding a SV potential across the screen
in one direction, the voltage read by one of
the perpendicular pins makes the screen
330
essentially a potentiometer. The value read by
that pin changes based on where you press
on the screen. The fourth pin is left to float,
since it must be used for the other direction's
touch. By performing this process for one
direction and then the other, the position of a
point of pressure on the screen is located [3].
The serve control used a standard pulse-
width-modulated (PWM) signal. The Tower
Pro MG995 took a 50Hz pulse with an on
time between lms and 2.5ms. The serial
connection to a computer and monitor was
purely a convenience for tuning parameters.
This is highly recommended to make tuning
less time consuming.
By watching the acceleration of the ball at
maximum tilt, we estimated that we needed
at least a 1kHz sampling rate for an accurate
reading of the ball's position. Because we can
only measure the ball's position in one direction
at a time, this means that each direction must
be sampled at that 1kHz frequency. We then
update the servo position as fast as possible.
330 330
"' •33V a:
U4 9
VOD
GPBO GPAO
CPBl GPAl
GPB2 GPA2
GPBJ GPA3
GPB4 GPM
GPB5 GPAS
CP!l6 GPA6
GPB7 GPA7
SCK
l~ SI so
•cs
20 AO INTA
19
Al INTB
A2 10
' RESET vss
MCP23Sl7
l.JO
~
~
_L ~~n ••0
~ LED
ON::. CS
~
~
TFTCS
J l O
~
PECS
+JJV
PGD= RBO
PGC• RBl
1\da~ulr TFT LCD DosfJIIIY
PROGRAM STRUCTURE
The program structure runs on two threads
and one interrupt service routine (ISR), with
a few other helper functions. The meat of
the functionality is in the ISR, which runs at
2kHz and toggles between reading the X and
Y positions. After each read, the PWM signal
to the corresponding servo is also set. The
two scheduled threads are for writing output
to a screen or exchanging serial information
with our command structure. Both of them
can be implemented in many different ways,
depending on what is convenient. We used
code and explanations from Bruce Land's
MCU design class [5] to use Adam Dunkels'
Protothreads library [6] for the high-level
design of our code structure.
Our main () function sets up the analog-to-
digital converter (ADC) ports, output compare
units (for generating PWM signals), and sets
up our first read from the touchscreen, before
jumping into the infinite cycle of writing to/
reading from the screen and the serial port.
The ISR then handles cycling through the
actual control loop.
Two helper functions called rea dXp rep ()
and readYprep() set the ports that control
the touchscreen to their appropriate values
for a read in one direction versus another.
Following the touchscreen specifications, one
pin must be set to logic high, one to low and
one is set as an input, so that its value nfloats"
and does not affect the reading. The fourth
pin is then read by an ADC on the PIC32.
The PID controller is a feedback loop that
tries to minimize the error between the input
and a desired input. The "proportional" term
applies a correction that is linearly related to
the error. The "derivative" term is essentially
a damping term and serves to slow down
the signal when it is moving too quickly. This
means that oscillations around the zero-error
point caused by the proportional term will
be smoothed out over time. The "integral"
term simply corrects for steady-state error.
We did not need an integral term, since the
system was never settled enough to measure
a steady-state error for which to correct.
During one control cycle, the ISR first reads
the position of a touch, shifts by an offset value
we determined to be at the "edge" of our screen's
sensitive area, and then scales to convert to a
position in units of O.lmm. This step allowed
us to check that the positions were being read
correctly. The error is calculated by subtracting
the read position from our pre-set desired
position, and is low-pass filtered to make these
position reads less jittery. We used an exponential
filter to low pass the output, and found that even
after heavy filtering, the error did not lag enough
to matter, because the ball did not move fast
enough to make it inaccurate (Figure 5).
ci rcuitcellar. corn 33
Setpoint +
p,
p, = a p, _, + (1 - a)p ,
FIGURES
The P!D control loop with filtered raw position data from the touchscreen
ABOUT THE AUTHOR
Samuel Feibel is a graduate student pu rsuing a M.Eng. in Mechanical and
Aerospace Engineering at Cornell University. Email: o
With the right tools
designing a microprocessor can DP. ~~~
Okay, maybe not easy, but certainly less complicated . Monte
Dalrymple has taken his yea rs of experience designing embedded
architecture and microprocessors and compiled his knowledge into
one comprehensive guide to
processor design in the real
world.
Monte demonstrates how Verllog
hardware description language
(HDL) enables you to depict,
simulate, and synthesize an
electronic design so you can
reduce your workload and
increase productlviry.
34 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE6
A QR link to a demonstration video of our device's capabilities. The video is also posted on Circuit Cellar's,
article materials webpage.
This filtering was done to desensitize
the system, given our very coarse servo
positioning {discussed in the Results section}
and slow update speed. The servo signal
was running at 50Hz, but the update in the
ISR took place at 2kHz. Because of that, the
position data needed to be slowed down so
that the servos updated with the most recent
accurate data over the last update period.
To calculate the derivative term, we stored
five values of the error-the four previous
values of the error, and the current error. Of
the different ways to calculate the derivative,
we opted for subtracting the most recent error
from the oldest, multiplying by derivative gain
and adding that to the output signal.
After uploading this version of the
program, dragging a finger across the screen
causes a reaction in the motors, which should
not go outside the ranges set. If this is not
the case, fixing the safety parameters before
putting the ball on the platform is a good
idea. Watching your delicate device-or more
harrowingly, HEARING your device break itself
due to an overzealous servo-is not a required
step and should be avoided.
For detailed article references and additional resources go to:
w.circuitcellar.com/artide-material
References [1] through [7) as marked in the article can be found there.
RESOURCES
RESULTS
Tuning the parameters takes a while, so
once you get to this step go ahead and settle
in. We achieved some starting values for each
direction independently by attaching a thin
railing to the platform, which constrained the
ball to a single direction of linear motion. The
derivative coefficient and the proportional
coefficient, along with a parameter that
changes the strength of the low-pass filter
on our error calculations, was performed
through a serial connection to a PC. After
getting the X direction tuned to a reasonable
level, we tuned Y, and then combined them by
removing the railing constraints.
Our video demonstrating the device in
action can be accessed by scanning the QR
code in Figure 6. With our best tuning on our
best run, we were able to balance the ball
for about 44 seconds. In about 24 seconds,
each servo performed around 46 direction
changes, matching the observed orbit around
the setpoint. Visually, it was balancing better
than a human could if constrained to a pivot
point.
During those runs where stability was not
ideal, a few issues could account for the lack
of steadiness:
• Minor looseness in the joints could couple
the X and Y directions of motion, throwing
off the algorithm.
• The servos mapto rotations, and don't
linearly map to the angle of the platform,
especially at high angles.
• TheY-dimension of the board was about 2/3
as large as the X-dimension, and therefore
had a harder time stabilizing the ball.
• The servos would only react to a change in
PWM on time of around 0.06ms to O.OBms.
Since servos like ours have unpredictable
behavior outside the range of about 1ms to
2.Sms of on time, this means we effectively
had about 25 or so positions over 180
degrees. This was further clamped to
about 10 distinct positions with which the
PID algorithm could work. Buying precise
servos that can react to smaller changes
in PWM signal would make this platform
much more effective.
CONCLUSION
This project was fun to make, impressed
our peers, and taught us a lot. It has an
exciting amount of movement, involves
interesting dynamics, and has great potential
for improvement. While the PID control setup
was adequate for getting the results we
expected, the dynamics of a ball on a plate
has been explored in more detail by similar
groups of students employing more complex
control algorithms [7]. G
Huge opportunities exist today for implementing systems that build Smart
Cities. From controlling energy waste to Smart Lighting and traffic control,
loT technologies including sensors, AI platforms, cloud services analog ICs
and wireless connectivity products all have roles to play in Smart Cities.
I n some ways, Smart Cities can be thought of as the ultimate form of the lnternet-of-Things (loT) at work. While loT implementations in factories and agriculture
can be fairly large scale, Smart Cities are inherently
large-scale deployments often involving diverse public and
private networks and stakeholders. Sub-segments of the
Smart City include traffic control, public security, waste
management, Smart lighting and more.
Serving the needs of Smart City system developers, a
wide range of technologies have emerged over the past
12 months, all useful for various large and small elements
of Smart City networked systems. These range from box-
level AI solutions and sophisticated loT cloud services, to
chip-level solutions for implementing LoRa wireless edge
nodes and battery-powered loT devices. Meanwhile, new
concerns related to COVID-19 have increased the urgency
for implementing many kinds of Smart City applications.
SMART ENTRANCE COUNTER
There's no doubt that the COVID-19 pandemic has created
needs for special kinds of Smart City solutions. Governmental
regulations all over the world have driven an urgent need
for solutions to secure social distancing in public buildings in
order to support slowing down the spread of COVID-19. With
that in mind, lnfineon Technologies developed a system that
counts people while entering and leaving buildings or rooms
and ensures social distancing at the same time. The Smart
Entrance Counter solution is a miniaturized, discrete radar
board (20mm x 15mm) that accurately and anonymously
counts people with one single 60GHz radar sensor and
integrated software (Figure 1). A traffic light system informs
whether an entry is allowed or not.
lnfineon Technologies says its Smart Entrance Counter
solution is a closed system. On one hand, it prevents
overcrowding, on the other hand it enables businesses to
keep their operations running. And most importantly, due
to the use of radar technology, personal data are 100%
protected. The system counts a person, but does not know
who it is, says the company.
Infineon expects volumes for this kind of solution
to amount to 90 million units globally. Infineon's Smart
Entrance Counter solution with XENSIV 60GHz radar sensor
is contactless and can easily be installed on the side or
ceiling of an entrance or exit. It can be implemented in all
kinds of building types, such as public buildings, retail and
grocery stores, restaurants, schools or corporate spaces-
for example, cafes, offices and the like.
SECURE CONTACTLESS TRANSACTIONS
Large-scale contactless payment capability was already
a key technology for Smart City applications, in mass
transportation, for example. But new requirements for social
36 CIRCUIT CELLAR • OCTOBER 2020 #363
Radar 1/0 board
Radar FF board
•) b) (Reference Hardware Platform}
FIGURE 1
Infineon's Smart Entrance Counter solution (a) is a miniatl.Jrized, discrete radar board (b) (20 mm x 15 mm) that accurately and anonymously counts people with one single 60GHz
radar sensor and integrated software.
FIGURE2
distancing have amplified these demands.
And the worldwide impact of COVID-19 makes
contact-free transactions a necessity. Serving
such needs, in June NXP Semiconductors
announced its new MIFARE DESFire EV3 IC,
a chip that provides advanced security and
seamless integration of mobile services for a
new era of security and connectivity in smart
city services (Figure 2).
As the third evolution of NXP's proven
contactless MIFARE DESFire portfolio, the
latest IC is backward compatible and offers
enhanced performance with a greater
operating distance and improved transaction
speed. In combination with its advanced
security features, the new IC delivers faster,
more secure transactions that are truly
The MIFARE DESFire EV3 IC chip enables secure transactions that are truly contactless, such as paying fur
parking, accessing offices or campuses and using other essential city services-all touch-free.
contactless, such as paying for parking,
accessing offices or campuses and using
other essential city services-all touch-free.
NXP's MIFARE product portfolio is used
in Smart City installations worldwide. The
new MIFARE DESFire EV3 IC builds upon
the portfolio's heritage of powering mass
transit ticketing. An extensive set of security
features in the MIFARE DESFire EV3 IC provide
more ways to protect data and help ensure
privacy. The IC hardware and software are
certified to Common Criteria EAL 5+, and the
IC supports a broad choice of open crypto
algorithms. A card-generated MAC helps to
securely authenticate transactions, and a
new Transaction Timer feature helps mitigate
man-in-the-middle attacks so it's harder for
an attacker to interfere with the transaction.
Meanwhile, the MIFARE DESFire EV3's new
Secure Unique NFC (SUN) messaging feature
offers a more secure method for maintaining
data confidentiality and integrity. Each time a
card, phone or ticket is tapped with the SUN
featured enabled, a tap-unique authentication
message and crypto-secure URL are generated
that can be sent to a server for verification,
which makes taps unclonable.
Support for MIFARE DESFire EV3 will be
integrated into NXP's MIFARE 2GO cloud
service, which manages digitized MIFARE
product-based credentials and helps
streamline mobile integration via NXP's
ecosystem. With this, Smart City services
can be seamlessly deployed to NFC-enabled
smartphones, wearables and other mobile
devices.
For simplified deployment, each MIFARE
DESFire EV3 IC is pre-configured with keys
to enable delegated application management,
which supports seamless, over-the-air
updates to already deployed smart cards using
NFC-enabled smartphones. In addition, NXP's
upcoming MIFARE Plus EV2 IC will provide a
drop-in replacement for upgrading existing
MIFARE Plus and MIFARE Classic product-
based installations for higher security.
loT PASSENGER COUNTING
Mass transit passenger counting had
already been a popular emerging technology.
But, as with so many other things, the COVID-19
era brings the importance of this capability to
the forefront. Eurotech's passenger counters,
already installed on urban and intercity bus
lines, allow accurate real-time passenger
monitoring, remotely and onsite.
Eurotech's technology was selected by
Thales as a supplier of embedded hardware and
loT software for the CAVE project »Automatic
Counting of Passengers" in some of the Grand
Paris Express' metro lines. In additionto
using the power-over-Ethernet (PoE) version
of Eurotech's DynaPCN passenger counter, the
solution is based on ESF (Everyware Software
Framework) for the onboard software for data
collection and remote configuration, and EC
(Everyware Cloud) for the ground software to
enable Societe du Grand Paris to securely access
passenger counting information and to use this
data internally or by sharing it externally.
The DynaPCN 10-20 is a compact, low
power, autonomous device based on non-
contact stereoscopic v1s1on technology
(Figure 3). It has been specifically designed
for passenger counting above the doorways in
buses and trains. It can also be used to count
people as they enter or leave buildings or
any area with restricted access. Stereoscopic
cameras capture images of the area below
the device. Thanks to the integrated high
luminosity infrared LED indicators, it can
operate in any type of lighting condition.
The extended temperature range capabilities
allow integrators to use the device in a wide
range of climatic conditions.
The DynaPCN 10-20 analyzes the height,
shape and direction of any object passing the
field of view. If the object is recognized as
a person entering or leaving, the incoming
and outgoing counters are incremented
accordingly, along with time and date
information. Data transfer is made via an
Ethernet interface. The onboard insulated
®
digital I/0 interfaces can be used to directly
communicate with intelligent doors or flow
control systems, guaranteeing optimal
functionality at all times. For example, it can
stop counting when the doors are closed.
LoRa FOR CONNECTIVITY
Because of the inherent spread-out nature
of Smart City network implementations,
LoRa has emerged as a popular wireless
connectivity technology for these applications.
Over the past couple years, the release of LoRa
(long range) chip solutions have accelerated
as technology providers race to keep pace
with demands. loT networks based on the
LoRaWAN specification have been deployed in
100 countries. for more on loRa as a solution
for Smart Cities, see the sidebar "LoRoWAN:
A foundational Network for Municipal loT
Solutions" on p.41.
In an example of a recent LoRa device,
in August STMicroelectronics (ST) added a
QFN48 package to its STM32WLE5 wireless
system-on-Chip (SoC) portfolio. The
STM32WLES combines ST's STM32l4 ultra-
low-power microcontoller (MCU) technology
and Semtech SX126x sub-GHz radio IP
optimized to meet local radio-equipment
regulations worldwide (Figure 4). The chip's
single-silicon-die integration helps save
bill-of-materials (BOM) costs and simplifies
system designs. ST targets the device for use
in connected, smart devices for applications
in metering, city management, agriculture,
retail, logistics, smart buildings and
environmental management.
The STM32WLES's new 7mm x 7mm QFN48
package option makes it suited to a simplified
two-layer board design that further eases
manufacturing and reduces BOM costs. The
STM32WLES supports multiple RF-modulation
ci rcuitcellar. corn D
FIGURE 3
The DynaPCN 10-20 is a compact,
low power, autonomous device based
on non-contact stereoscopic vision
technology. It has been specifically
designed for passenger counting
above the doorways in buses and
trains.
38 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE4
schemes including LoRa spread-spectrum
modulation as well as the (G)FSK, (G)MSK
and BPSK used by various sub-gigahertz
long-range protocols including proprietary
protocols. Users have flexibility to apply their
desired protocol stack, whether created in-
house, sourced externally or chosen from
off-the-shelf software such as the LoRaWAN
and wM Bus (wireless M-Bus) stacks that are
available from ST and authorized partners.
ST has engineered the integrated RF stage
to address global markets while improving
performance and easing manufacture. Features
include dual low-power (14dBm) and high-power
(22dBm) transmitter modes with highly linear
performance from 150MHz to 960MHz, spanning
the sub-lGHz unlicensed frequency range,
which ensures technical compatibility with RF
regulations in all world markets. Sensitivity
down to -148dBm helps to maximize RF range.
Only a single crystal is needed to synchronize
the high-speed external (HSE) clock and the
radio, delivering a further savings in BOM.
The new QFN48 package extends the
STM32WLE5 portfolio, which also includes
devices in a Smm x Smm BGA73. Three different
flash-memory density options are available per
package, offering a choice of 64KB, 128KB or
256KB, and all devices feature a high proportion
of user-assignable GPIOs. All feature ST's ultra-
low-power MCU technologies, including dynamic
voltage scaling and proprietary adaptive real-
time ART Accelerator that allows zero-wait
execution from flash.
LoRa INFRASTRUCTURE
In order for loRa wireless connectivity to
be deployed on a large scale, cities need to
The STM32WLES l.oRa SoC combines ST's STM32L4 ultra-low-power MQJ technology and Semtech SX126x
sub-gigahertz radio IP optimized to meet local radio-equipment regulations worldwide.
put LoRa infrastructure technology into place.
Feeding such needs, Semtech announced
a collaboration with Nesten, a developer of
specialized blockchain and IoT-based solutions
for optimized communications networks. The
effort supports the continued roll out of the
Nesten's LoRa-based node platform.
Following the successful 2019 deployment
of its first-generation G1 wireless node based
on Semtech's LoRa devices and the LoRaWAN
protocol, Nesten has increased the integration
of its LoRa-based wireless infrastructure in
several key markets throughout the US and
abroad, and has begun mass production of
its node platform to empower individual loT
management.
Nesten's G1 node is a wireless gateway
enabling loRa, Wi-Fi, GNSS and Bluetooth-
based data communication in real time.
Nesten recently announced the deployment
of more than 270 Gl nodes throughout the
Dallas metropolitan area, with additional
loRa-based infrastructure deployed across
major markets in the US, including Houston,
Georgia, California, the New York, New Jersey
and Washington, D.C. suburbs, as well as select
markets in Canada, Mexico and South Korea.
Nesten's consumer-based deployment
model enables end users to deploy their own
flexible LoRa-based applications built on the
Gl node, and operate and maintain their own
IoT network without the associated costs
traditionally found with telecom carriers.
leveraging the end user and blockchain as the
cornerstone of each LoRa-based deployment,
Nesten is also able to provide extensive data
protection and privacy. Several loT use cases
currently utilize Nesten's open-source LoRa-
based infrastructure. These applications exist
within a wide variety of vertical markets,
including smart parking, personal emergency
detection and pet tracking and geolocation,
home security and more.
LoRa EXPRESSWAY APPLICATION
In an example of LoRa technology in
action, in August Semtech announced that
Korea Expressway Corp. (KEC) has built a
network based on Semtech's LoRa devices
and the LoRaWAN protocol for its expressways
as the first stage in its ongoing four-year IoT
deployment plan in the country (Figure 5).
Beginning in 2019, KEC deployed 78 loRa-
based gateways over 306km of expressway.
Woojoo Telecom, a systems integrator and SK
Telesys, a loRa-based gateway manufacturer
and network server provider, were selected
as operators for this project, conducting
communication tests on roads and in tunnels
to establish the high-quality loT network.
Currently, the network offers many strategic
functions including parking space and trash
bin fill monitoring at rest areas, and real-
time condition tracking for shock-absorbing
barriers and guardrails.
In the coming years, KEC plans to expand
the LoRa-based network's applications to
include landslip detectors,road-freezing
sensors, electronic displays, fire extinguishers
in tunnel and expressway lights. By continuing
to migrate applications from legacy 3G/LTE
connectivity to LoRaWAN, KEC expects to reduce
operating cost by up to $2 million per year. LoRa
devices and LoRaWAN networks cover hundreds
of uses cases essential to city and often
countrywide infrastructure, says Semtech.
These deployments increase efficiency and cost
savings for those government entities providing
public infrastructure such as nationwide
expressways, and LoRa devices represent an
ideal technology and connectivity backbone.
CELLULAR loT PLATFORM
Implementation loT over existing cellular
infrastructure is a popular option for Smart
City system developers. To smooth the
way, in July Cloud of Things announced
a collaboration with Monogoto, a cellular
provider implementing cellular connectivity
alongside secure private LTE networks. The
two firms rolled out a global offering to
smart product manufacturers that reduces
complexity and risk, and speeds time to
market with advanced services supporting
secure edge-cloud deployments.
The Cloud of Things' DeviceTone loT Suite,
which includes its patented CloudSwitch
technology, has been integrated with
Monogoto's global cellular connectivity
platform using the Monogoto loT SIM
(Figure 6). This makes it simple to spin up
and scale connected systems, including
automatically and securely registering end-
points to the network, whether those end-
points are fixed or mobile, on land or at sea,
are indoors or outdoors and include single or
multiple sensors.
This means that Smart City system
developers can take full advantage of a
real-time operating system using a single
network with security embedded merged
with a single platform based on Microsoft
Azure's worldwide infrastructure that can
connect to any cloud. The combination of the
two platforms is enhanced with APis, which
means smart product/utility companies and
solution providers can benefit from a unified,
customized provisioning, management and
maintenance environment.
Monogoto offers global coverage in all
major markets, including their innovative
ucellular suitcase" and the ability to roam
into private networks like CBRS in the US for
service in remote places. With its multiple
cellular profile container, the Monogoto
Secured loT SIM has a globally redundant
footprint in more than 170 countries and 2G,
3G, 4G and LTE CAT-Ml connectivity federating
more than 550 cellular networks. Supporting
standard UlCC (triple form factor), eUICC and
iUICC, the Monogoto loT SIM card guarantees
compatibility to any loT device/use case.
The first joint offering from the two
companies is an end-to-end prototyping
package, which includes the DeviceTone
Genie, a ready-to-run device launched in
June, and made available on the Microsoft
Azure loT marketplace, and Monogoto's kit,
which includes zero code service creation for
rapid flow formation and global loT cellular
connectivity. Designed specifically for the
connected field service market, the DeviceTone
Genie Starter Kit that comes with a full featured
loT environment and with a Monogoto SIM and
complementary support services.
GPS: A CRITICAL ASSET
Because Smart City networks are deployed
on large scales, many of their applications
depend on GPS location and timing to ensure
ongoing operations. This can include power
utilities, financial services, mobile networks,
ci rcuitcellar. corn 39
FIGURE 5
Korea Expressway Corp. built a
network based on Semtech's LoRa
devices and the LoRaWAN protocol for
its expressways as the first stage in
its ongoing four-year loT deployment
plan in the country.
40 CIRCUIT CELLAR • OCTOBER 2020 #363
Assets
FIGURE6
• oevtc.lone
cen
~Iona
Gate .. ay
Designed specifical~ for the connected
field service market, the DeviceTone
Genie Starter Kit comes with a full
featured loT environment.
FIGURE 7
• Device Tone M~~ag~ BJs nwss Appl cat•ons
transportation and more. As a result, GPS
has become a critical asset in Smart City
implementations. To protect that asset, in
June Microchip Technology announced the
release of a major software update for its
BlueSky GNSS Firewall product, providing
a higher level of resiliency against GPS
vulnerabilities for systems dependent on GPS
signal reception.
Microchip's BlueSky GNSS Firewall
Software Release 2.0 performs real-time
analysis to detect jamming and spoofing
for protecting reception of the GPS signal
and hardening response and recovery to
avoid signal disruption (Figure 7). BlueSky
GNSS Firewall Software Release 2.0 includes
charting and advanced threshold settings of
Global Navigation Satellite System (GNSS}
observables such as satellites-in-view,
carrier-to-noise, position dispersion, phase
time deviation and radio frequency (RF)
power level to simplify system turn-up and
deployment.
Microchip's BlueSky GNSS Firewall Software Release 2.0 performs real-time analysis to detect jamming and
• spoofing far protecting neception of the GPS signal and hardening response and necovery to avoid signal
disruption.
BlueSky GNSS Firewall Software Release 2.0
includes improvements developed by Microchip
as a result of participation in an industry live-
sky testing event hosted by the US Department
of Homeland Security (OHS} Science and
Technology Directorate and open to all providers.
Microchip's participation in the OHS-hosted
GPS Testing for Critical Infrastructure (GET-
0} events, with scenarios including spoofed
signals, has helped the company to identify new
solutions to prevent signal disruptions. The Blue
Sky GNSS Firewall Software Release 2.0 release
improvements are based on the result of the
20191ive-sky testing and other input.
Microchip's BlueSky GNSS Firewall
Software Release 2.0 is provided as part of
a subscription service and is installed on the
BlueSky GNSS Firewall device. When connected
to Microchip's TimePictra management
software, critical infrastructure operators
also can monitor and analyze GNSS signals in
cities, across geographic regions, throughout
,a country and even globally.
BUCK-BOOST DC-DC CONVERTER
Smart metering is key subsegment of
Smart Cities. An ability run battery-operated
smart metering devices is vital in today's
applications where data-collection via IoT
is the only practical option. That means
devices that can operate for at least 10 years
without changing batteries. Along these
lines, in September Texas Instruments (TI}
rolled out what it claims is the industry's
first DC-DC buck-boost converter to combine
programmable input current limit and
integrated dynamic voltage scaling to extend
battery life by at least 50%. The TPS63900
maintains the industry's lowest quiescent
current (IQ}, 75 nA, with 92% efficiency at
l01JA and delivers up to three times more
output current than competing devices, says
TI (Figure 8).
It can be challenging for engineers to
design for low IQ while providing enough
output current to send signals between
connected smart grid applications and a
network via commonly used radio-frequency
standards, such as narrowband IoT (NB-IoT},
Bluetooth Low Energy (BLE} and long-range
and wM-Bus. The TPS63900 helps engineers
conserve energy in wirelessly connected
applications that run on batteries.
The TPS63900 integrates dynamic voltage
scaling to deliver power while keeping the
system at the minimum voltage required
to operate efficiently, maximizing battery
ci rcuitcellar. corn 41
life and reducing required maintenance
for industrial applications. This feature
enables design engineers to optimize power
architectures for ultra-low-power sensors
and wireless connectivity ICs, supporting
applications that can operate for at least 10
years using the primary battery. For example,
the buck-boost converter can be paired with
TI's MSP430FR2155 in security sensors or
wireless loTsensors to monitor the vibration
of water pumps for predictive maintenance
and help drive down costs. The TPS63900
is now available in a 2.5mm x 2.5mm wafer
small outline no-lead (WSON) package.
Extend battery life by 50% with the
industry's lowest 10 buck-boost converter
FIGURES
AI SYSTEM FOR SECURITY
Security is another area of Smart City
development where technology can make
a difference, and specifically technology
combining AI and loT. Exemplifying this trend,
in July IEI Integration introduced the FLEX
AloT Dev Kit equipped with 9th Generation LGA
1151 Intel Core/Xeon processor, Intel Q370/
C246 chipset and DDR4 memory (Figure 9).
The FLEX AloT Dev. Kit is specifically designed
for edge learning inference computation and
features modularized, rich interconnectivity.
Various input/output interfaces are provided
for engineers to integrate cameras, sensors
and motion control equipment to fast respond
to accidental event.
The FLEX AloT Dev. Kit features rich 1/0
and two PCie slots (xB) to support add-ons
like accelerator cards (Mustang-F100-A10
and Mustang-V100-MX8) or PoE cards (IPCIE-
4POE) to enhance performance. The Mustang-
F100-A10 is a PCie-based accelerator card
using the programmable Intel Arria 10 FPGA
that provides the performance and versatility
of FPGA acceleration. The Mustang-V100-MX8
is a PCie-based accelerator card using an
Intel Movidius VPU that drives the demanding
workloads of modern computer vision and AI
applications.
The TPS63900 maintains the industry's
lowest quiescent current (IQ), 75nA,
with 92% efficiency at lO>JA. It
helps engineers conserve energy in
wi relessly connected applications that
run on batteries.
The FLEX AloT Dev Kit's Mustang
accelerator card can be used for analyzing
multiple streams of video data and handling
LoRoWAN: A Foundational Network for Municipal loT Solutions
Like many industries and organizations, municipalities
have the opportunity to transform their operations and
service delivery by making smart technology investments
and building successful partnerships. The process of
becoming a usmart City" is supported by the evolution of
Internet of Things (loT) products and services which has
become a global market with significant activity in most
countries and regions.
As municipalities explore opportunities to deliver city-
wide loT services, they are in a unique position to partner
with first-movers in their region to deploy and manage
smart city solutions on a common and open network
architecture. Partnering with water utilities, for example,
provides municipalities with a unique opportunity to create
a shared network infrastructure capable of supporting a
wide range of commercial and citizen-facing applications.
LoRaWAN networks designed for water metering are
among the most capable. They are high-density, built
with abundant capacity and secure. With a carrier-grade
LoRaWAN network in place to support Advanced Metering
Infrastructure (AMI) deployments, municipalities and
utilities can partner to rapidly deploy and expand their loT
initiatives. Easy LoRaWAN gateway deployment and cloud-
based network management allow for multi-service utilities
(water, gas, electric) to deploy service and safety applications
at a low cost and in a collaborative fashion. Beyond utility
metering and service monitoring, municipalities can rapidly
deploy LoRaWAN solutions for waste management, smart
parking, environmental monitoring, asset tracking, pest
management, public safety and more.
Additionally, municipal leaders should consider that
short-term measures taken in response to global crises
often lead to changes that last for decades, making today's
technology decisions as important as ever. The COVID-19
crisis has made access to reliable, real-time environmental
data an absolute necessity. Contactless data collection
not only supports a wide variety of business reentry
initiatives, but it will be a key component of driving long
term operational efficiencies, improving service delivery,
implementing sustainable practices and ultimately
achieving a higher quality of life for citizens. ,....---....,..--......
- Contributed by Senet, www.senetco.com
42 CIRCUIT CELLAR • OCTOBER 2020 #363
b)
FIGURE9
FLEX AioT Dev Kit (a) equipped with 9th Generation LGA 1151 Intel Core/)(eon
pnocessor, Intel Q370/C246 chipset and DDR4 memory. The FLEX AioT Dev. Kit is
specifically designed for edge learning infenence computation (b).
RESOURCES
Texas Instruments I
real-time tasks such as age, gender and face
identification. The data collected can be used
in precision marketing, VIP customer service
and customer flow analysis to further provide
relevant product information through digital
signage display to improve product sales and
inventory control.
In addition to face identification, the
solution speeds up the characteristic
recognitions of vehicles such as license plates,
vehicle models and colors. It can be applied
in services like traffic steering analysis, illegal
parking/helmet detection and trajectory
tracking. Furthermore, vehicle license plate
analysis can be deployed on highways for
electronic toll collection, and can provide
enhanced security by establishing a database
of suspicious vehicles.
MORE AI AND SMART CITIES
late last year, Integrated Device
Technology (IDT), a subsidiary of Renesas
AI Inference Sy$lem
Electronics, announced a partnership with
industrial AI specialist ONE Tech to provide an
end-to-end, integrated loT and edge analytics
solution aimed at optimizing the performance
and use of city assets.
The joint loT with Edge AI platform
combines lOT's BLE and 6loWPAN wireless
interconnectivity devices, sensors and MRAM
non-volatile memory data storage with
ONE Tech's loT Platform and Micro Al. ONE
Tech's platform and AI deliver performance
optimization, security and analytics for
connected devices and assets (Figure 10).
The combination results in an end-to-end loT
ecosystem-from node-to-edge-to-cloud-
that is well suited for a variety of Smart City
applications, including connected community,
water and waste management, and energy
and asset management.
According to IDT, the loT with Edge
AI platform is a good alternative for loT
developers who do not want to develop
their own cloud platform, nor want to use
other major cloud platform solutions. Such
development requires expertise in configuring
wire less modules, sensors and other connected
devices. The platform is designed as a ready-
to-go solution that configures and provisions
sensor and wireless products, allowing loT
developers to easily scale and customize the
platform to the unique requirements of their
applications and devices.
Securing connected assets and optimizing
their performance are the most critical aspects
of managing Smart City environments, says
ONE Tech. By avoiding unexpected asset
downtime, increasing the productivity of
field teams and protecting all data, cities can
maximize their return on investment for all
...
J-
their public service projects while redirecting
any savings to other critical initiatives.
Using the loT with Edge AI service, users
can activate and manage any IDT/Renesas
device. It lets you define workflows for
automating business processes and create
real-time event notifications. The platform
V sllngS1ot
....... L Y
NOT YOUR
AVERAGE SLINGSHOT
c 20 (J 7 0
• Sin fti"CJkO
enables you to store big data and apply AI/
machine learning (ML) to perform advanced
analytics and gain deeper insights. You can
monitor real-time location and performance
for all your loT connected assets and
orchestrate an end-to-end digital experience
for your Smart City loT deployment. G
ci rcuitcellar. corn 43
FIGURE 10
The joint loT with Edge fJJ. platform
delivers performance optimization,
security and analytics for connected
devices and assets. The combination
results in anend-to-end loT
ecosystem-from node-to-edge-to-
cloud-that is well suited for a variety
of Smart City applications .
44 ORQIIT CELLAR • OCTOBER 2020 #363
Raspberry Pi Roundup
A Bounty of HATs and Clones
The MCC 1n is 1 bio-dllnnel, high-speed DAQ HAT for making SOJnd and vibralian
meiiSUI'8Tienls fhm lEPE sensors like aa:eleramet!rs and microphones. Up ID ~ MCC HATs
a111 be stadced onto one Raspberry PI.
T he popularity of the Raspberry Pi product line of open-spec SBCs is truly astounding. In surveys
of LinuxGizmos's readers, we've
found that year after year Raspberry Pi
SBCs are the most popular open-spec SBCs.
(LinuxGizmos.com is Circuit Cellar's sister
website). Raspberry Pi's targeted audience
has traditionally been DIY builders, makers,
electronics hobbyists and the like. But the
open-spec nature of Raspberry Pi has led to
huge interest among professional engineers
for two reasons.
First, board vendors have been able to
develop clones of Raspberry Pi SBCs, that
either match their functionality or simply
offer the same connector scheme. Second, the
emergence of Raspberry Pi add-on boards,
called HATs, has resulted in the development
of a wide variety of add-on functions that
professional engineers need for all kinds
of applications. HAT stands for "hardware
attached on top," a hardware specification
for add-on modules for the Raspberry Pi
model B+ SBC. HATs have several advantages
compared to older add-on modules for the
Raspberry Pi, such as no soldering required.
In other words, HATs can be plugged right
onto the Raspberry Pi's connector.
With all that in mind, the real story about
Raspberry Pi can arguably said to revolve
around HAT products, rather than the SBCs
themselves. Every month, new HAT products
have emerged targeting an impressively wide
set of functions and application needs. In fact,
such new products are so frequent, that you'll
notice that many of the products covered in
this article were released as recently as July
and August.
MACHINE CONDITIONING HAT
Exemplifying these trends, the latest
Raspberry Pi offering from Measurement
Computing is its MCC 172 IEPE Measurement
HAT for Raspberry Pi released in May. Well
suited for machine condition monitoring and
edge computing applications, the MCC 172 is a
two-channel, high-speed DAQ HAT for making
sound and vibration measurements from IEPE
sensors like accelerometers and microphones
(Figure 1). It features two, simultaneous,
24 bit analog inputs, with sample rates up to
51.2KS/s per channel.
Up to eight MCC HATs can be stacked
onto one Raspberry Pi. MCC offers a variety
of DAQ HATs that enable users to configure
multifunction, Pi-based solutions with analog
input, output and digital I/0. The open-
source MCC DAQ HAT Library of commands
in C/C++ and Python allows users to develop
applications on Linux. The library is available
to download from GitHub. Comprehensive
API and hardware documentation are also
provided.
The MCC 172 header plugs into the 40-pin
general purpose I/0 (GPIO) connector on a user-
supplied Raspberry Pi SBC. The MCC 172 was
tested for use with all Raspberry Pi models with
the 40-pin GPIO connector. Multiple MCC 172
HATs can be synchronized to a single sampling
clock. The clock is programmable for sampling
rates between 51.2KS/s to 200 samples/s.
HAT configuration parameters are stored
in an on-board EEPROM that allows the
Raspberry Pi to automatically set up the GPIO
pins when the HAT is connected. The MCC 172
is powered with SV provided by the Raspberry
Pi through the GPIO header connector. The
trigger input (terminal TRIG) is used to delay
an input scan until a specified condition is met
at the trigger input.
AUDIO AMPLIFIER HAT
While Raspberry Pi is aimed at hobbyists
and nmakers,n the rich variety of HATs
available has attracted professional
embedded system developers that want to
take advantage of what's available. Some
such HATs include products that are aimed at
users and makers. In an example along those
lines, in May Infineon Technologies released
what it claims is the world's first fully self-
contained Raspberry Pi audio amplifier HAT
board (Figure Z).
The board (KIT_ 40W_AMP_HAT_ZW) offers
high definition audio at boom box power levels
in a small form factor. The Infineon proprietary
multilevel technology ensures minimum size
and consumption, state of the art power
efficiency and HD audio quality for Raspberry
Pi users and makers. Infineon markets the
product for systems such as active speakers
with wireless music streaming.
The board is compatible with Raspberry
Pi Zero W and Raspberry Pi 3 and 4 SBCs.
It leverages the MERUS multilevel class D
amplification enabled by the MERUS MA12070P
amplifier, which allows for filter-free amplifier
design that does not need to use a filter-coil at
the output filter. This significantly reduces the
BOM cost and enables PCB area reduction. The
board furthermore scores high output power
in small form factor up to 40W instantaneous
peak power at 4Q. The solution offers best-
in-class efficiency and playback time up to 20
hours with a 6700mA-hour power bank. There
is no need for additional power supplies, only
a single 5V/2.5A USB power supply is required
for both the Raspberry Pi and the HAT.
For a quick and easy audio system setup,
the board is compatible with the main Linux
distributions such as Raspbian, Volumio,
moOde Audio or JustboomPiayer. Dual-channel
bridge-tied load (BTL) or single-channel
parallel bridge-tied load (PBTL) configurations
for Multi room, TWS, or subwoofer applications
are also possible.
FIGURE 2
ci rcuitcellar. corn 45
The KIT_40W_AMP_HAT_ZW board is a fully self-contained Raspberry Pi audio amplifier HAT board. The
board is compatible with Raspberry Pi Zero Wand Raspberry Pi 3 and 4.
FIGURE 3
The Indoor Air Quality HAT for Raspberry Pi features an on-board calibrated Renesas ZMOD4410 sensor that
measures the concentrations of total volatile organic compounds (TVOCs) from parts-per-billion to parts-
per-million and measures estimate carbon dioxide (eC02) levels.
46 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE4
pHAT FOR GNSS
Once again illustrating the diverse
ecosystem of Raspberry Pi add-on boards
available, in July SparkFun launched ZED-F9R
GPS pHAT, a high precision, sensor fusion
GPS board with impressive configuration
options. It embeds U-blox's Automotive
Dead Reckoning (ADR) technology. SparkFun
says the ZED-F9R module provides a highly
accurate and continuous position by fusing
a 3D IMU sensor, wheel ticks, a vehicle
dynamics model, correction data and GNSS
measurements. Sparkfun follows its pHAT (for
partial HAT) approach, which doesn't support
all the specs of the official Raspberry Pi HAT.
The ZED-F9R module is a 184-channel
U-blox F9 engine GNSS receiver, meaning it can
receive signals from the GPS, GLONASS, Galileo
and BeiDou constellations with approximately
0.2-meter accuracy. Such accuracy can be
achieved with an RTK navigation solution
when used with a correction source. Note that
the ZED-F9R can only operate as a rover, so
you will need to connect to a base station.
The module supports concurrent reception of
four GNSS systems. The combination of GNSS
and integrated 3D sensor measurements
on the ZED-F9R provide accurate, real-time
positioning rates of up to 30Hz.
Compared to other GPS modules, this pHAT
maximizes position accuracy in dense cities or
covered areas, says the company. Even under
poor signal conditions, continuous positioning
is provided in urban environments and is also
available during complete signal loss (such
as short tunnels and parking garages). The
ZED-F9R is a solution for autonomous robotic
The Cl'i-A150WR is a Raspberry Pi-based industrial panel PC with a 15" touch-panel display. Leveraging the
compact Raspberry Pi 3 SBC, the ComfilePi Cl'i-AlSOWR inherits the Raspberry Pi 3's 1.2GHz 64 bit quad-core Arm Cortex-A53 processor, a Broadcom VideoCore IV GPU and 1GB of RAM.
applications that require accurate positioning
under challenging conditions.
The U-blox receiver supports a few serial
protocols. By default, SparkFun chose to use
the Raspberry Pi's serial UART to communicate
with the module. With pre-soldered headers,
no soldering is required to stack the pHAT
on a Raspberry Pi, NVIDIA Jetson Nano,
Google Coral or any SBC with the 2x20 pin
connector header. The board breaks out a few
0.1"-spaced pins from the U-blox receiver.
A Qwiic connector is also added in case you
need to connect a Qwiic-enabled device.
AIR QUALITY SENSOR HAT
Some Raspberry Pi HAT manufacturers
have been keen to leverage the technologies
of sensor vendors. In an example along those
lines, in August, Avnet launched a Renesas-
sensor-based Indoor Air Quality HAT for
Raspberry Pi called the AES-RHSEN-ZM44-G
(Figure 3). The HAT features an on-board
calibrated Renesas ZMOD4410 sensor that
measures the concentrations of total volatile
organic compounds (TVOCs) from parts-per-
billion to parts-per-million and measures
estimate carbon dioxide (eC02) levels. These
are important indicators for monitoring indoor
air quality. All sensors are electrically and
chemically (gas) tested with lab calibration
data stored in each ZMOD4410 sensor's built-
in nonvolatile memory.
In addition to the ZMOD4410 sensor, the
HAT incorporates a Renesas HS3001 high-
precision relative humidity and temperature
sensor, along with software-controlled status
LEDs. Connection points are also available
to measure the ZMOD4410 active current
consumption, which is useful when integrating
the sensor and its software into products
powered by extended life batteries.
Potential applications for the board
range from air/health monitoring systems,
smart home appliances, smart thermostats,
smart speakers and smart fans to smoke
alarms, vacuum cleaners, garage openers,
security systems, HVAC controls, air purifiers
and building automation. The ZMOD4410
indoor air quality platform is available in
four software configurations providing
various sensor behaviors targeting unique
applications indoors.
Avnet provides a pre-compiled test
application that runs on the Raspberry Pi
operation system and can measure TVOC
and eC02 out of the box. The application
is built with Renesas' proprietary licensed
algorithms. For production purposes,
customers may obtain the algorithms directly
from Renesas under terms of their software
license agreement.
PANEL PC FOR RASPBERRY Pi
In July, Comfile introduced the ComfilePi
CPi-AlSOWR, a Raspberry Pi-based industrial
panel PC with a 15" touch-panel display.
Leveraging the compact Raspberry Pi3
SBC, the ComfilePi CPi-A150WR inherits the
Raspberry Pi 3's 1.2GHz 64 bit quad-core Arm
Cortex-A53 processor, a Broadcom VideoCore
IV GPU and 1GB of RAM (Figure 4). The new,
larger version has the same capabilities
as its predecessors with smaller screen
sizes: the 7" CPi-A070WR and the 10.2" CPi-
A102WR. All models in the series now support
AdvancedHMI software, based on the .NET
framework, which uses the popular Visual
Studio design environment. AdvancedHMI
enables the creation of HMis that are not
possible with other off-the-shelf packages. It
creates a true, fast executable for the Linux-
based ComfilePi.
The CPi-A150WR's display is a 24-bit calor
LCD with a resistive touchscreen, and the
controller itself provides 22x ESD-protected
GPIO lines, 3x USB 2.0 host ports, lx RJ-45
Ethernet port, lx 12C port, lx RS-485 port, a
1x RS-232C port and a battery-backed RTC.
It also features stereo audio output as well
as a piezo buzzer. Wi-Fi is also possible using
an external USB dangle. This 15" ComfilePi
requires a 12-24VDC 21W power input. The
CPi-AlSOWR is housed in a flame-retardant
ABS enclosure with an IP65 water resistant
front panel, and is specified for an operating
temperature range of oac to 70°C.
While Raspberry Pi SBCs typically run the
Linux operating system, the ComfilePi can
be programmed in almost any language,
including C, C++, Java, JavaFX, Javascript,
python, C#, vb.net and even emerging
languages such as Rust, D and Nim, as well
as .Net Core 2.0 applications. (Android and
Windows 10 loT are not supported.) Due to
the built-in Broadcomm VideoCore IV GPU,
the ComfilePi can even render real-time
3D graphics. CODESYS can be used on the
ComfilePi by installing one or more of the
CODESYS Raspberry Pi Control Modules.
CODESYS is a development environment
for programming controller applications
according to the international industrial
standard IEC 61131-3. Made in South Korea
by Comfile Technology, ComfilePi products are
available now from the distributor Saelig.
1/0 CARDS FOR RPi
For its part, Sequent Microsystems makes
a variety of Raspberry Pi-compatible I/0
boards serving diverse applications. In July,
the company Kickstarted a stackable HAT
called the Mega-RTD. Resistance Temperature
Detector (RTD) sensors, which are used for
highly precise temperature measurements
in industrial and laboratory systems, can
be found on embedded systems. Sequent
Microsystems won Kickstarter funding for a
Mega-RTD HAT that can be stacked to provide
the Raspberry Pi with up to 64 RTD channels.
Shipments are due in October.
Sequent's next Raspberry Pi offering,
listed on its website now as "coming soon,"
is a Raspberry Pi stackable card for industrial
automation under the product code MEGA-IND
(Figure 5). The board will be the company's
second-generation industrial automation
card, and is designed to bring to Raspberry
Pi all the necessary inputs and outputs to
implement complex industrial automation
projects, says Sequent.
The MEGA-IND features four optically
isolated digital inputs with status LEDs, four
OV - 10V or 0 to :!:lOV analog inputs and four
optically isolated 4-20mA inputs. You also
get four optically isolated open drain 24V/4A
outputs, four 0-lOV analog outputs and four
4-20mA analog outputs. The card provides
TVS protection on all inputs.
Other features of the MEGA-IND include
RS485 and CAN ports, 24VDC power supply,
on-board hardware watchdog and on-board
resettable fuse. The board provides a real
time clock with battery backup, pluggable
connectors, support for eight-level stacking
with all mounting hardware included. Command
line and Python driver support is provided.
PICO-ITX WITH RPi EXPANSION
Some embedded board vendors have
taken advantage of Raspberry Pi's open
specifications to create their own SBCs that
FIGURE 5
ci rcuitcellar. corn 47
This Raspberry Pi st.ackable card for industTial automation, called the MEGA-IND, is designed to bring to
Raspberry Pi all the necessary inputs and outputs to implement complex industrial automation projects.
48 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE 6
The Uno-220 system is an loT gateway designed to be powered by a bring-your-own Raspberry Pi 4 Model B
SBC. The Uno-220 exposes all the ports on the RPi 4 and adds a custom HAT add-on with serial and GPIO
connectivity.
RESOURCES
Advantech I www.advantech.com
Avnet I www.avnet. com
Hilscher I www.hilscher.com
include Raspberry Pi expansion support. That
opens the door to, for example, more rugged
SBC offerings that can work with the same
HATs as Raspberry Pi SBCs. Along exactly
those lines, in August ICP (Industrial Computer
Products) Germany released an i.MX8M-
based Pico-ITX SBC that it's positioning as an
industrial replacement for a Raspberry Pi SBC.
The 100mm x 72mm board serves up a
l.SGHz NXP i.MXBM in either quad- or dual-
core versions. Memory options include 1GB,
2GB or 4GB LPDDR4 SDRAM with 1600MHz
clock rate. There's a standard Mini-PCie
with PCie and USB signal. A Raspberry Pi-
compatible 40-pin header with GPIO signal is
available as an expansion slot along with an
API library.
In the basic version, ND108T comes with
HDMI 2.0with 4K resolution, GbE, 2x USB 3.0,
lx USB 2.0, lx RS-232/422/485 and audio line-
out and mic-in. A USB 2.0 OTG and a UART are
available for programming and debugging.
ICP Germany I www. icp-deutschland.de
Infineon Technologies I www. infineon.com
Measurement Computing I www.mccdaq.com
Renesas Electronics I www.renesas.com
Saelig I www.saelig.com
Sequent Microsystems I www.sequentmicrosyst ems.com
Sparkfun I www.sparkfun.com
Trenz Electronic I www. trenz-electronic.de
For mass storage you get an eMMC with 8GB,
16GB or 32GB storage and a microSD slot.
The basic version can be upgraded if
required, says ICP. Dual GbE or other display
connectors like LVDS or Display Port are
optional. The ND108T operates from a 12V
power supply in a temperature range of 0 to
60°C and complies with the CE/FCC Class B
standard. Operating system support includes
Board Support Packages (BSPs) for Yocto
Sumo and Android 9 Pie, both with Linux
Kernel 4.14.98.
BOX-LEVEL RPi SYSTEM
Support for Raspberry Pi appears to
have even infiltrated the box-level embedded
system realm. As reported by Circuit
Cellar's sister website LinuxGizmos, in July,
Advantech launched what appears to be its
first Raspberry Pi-compatible system. The
$90, lOOmm x 70mm x 33mm Uno-220 loT
gateway is designed to be powered by a bring-
your-own Raspberry Pi 4 Model 8 (Figure 6).
The Uno-220 exposes all the ports on the RPi 4
and adds a custom HAT add-on with serial
and GPIO connectivity. The system ships with
an 8GB microSD card that is preconfigured
with a Raspberry Pi OS based AdvRaspbian
stack. AdvRaspbian is said to offer plug-and-
play installation with the Raspberry Pi 4. The
source code is also available on GitHub.
External access is provided for the new
RS-232/485 port with auto direction control
and a terminal block interface. There are
also 4x GPIOs and inside the box is a real-
time clock with battery installed on the HAT.
TPM 2.0 is available on request. Standard
options are wall- and stand mounts, while
DIN-rail mounting is optional. The system
ships with all necessary screws to integrate
the Raspberry Pi.
The aluminum-built loT gateway is
protected per IP40 specs, supports 0 to soac
temperatures, and provides 10-95% RH at
40°(, non-condensing humidity resistance.
The enclosure's improved heat dissipation and
electrostatic discharge protection provides
the optimum protection for Raspberry Pi
SBCs, according to Advantech.
FPGA-BASED RPi ZERO CLONE
As discussed earlier, the open-spec nature
of Raspberry Pi makes it ripe for board
developers to design clones of the SBCs. Along
just those lines, in August Trenz Electronic
launched its open-spec ZynqBerryZero, a
pseudo-clone of the Raspberry PI Zero SBC
with a Zynq-7010 Arm/FPGA SaC, a microSD
slot, dual micro-USB, mini-HDMI, CSI-2 and
40-pin GPIO (Figure 7).
In 2017, Trenz Electronic rolled out its
ZynqBerry SBC from, which combines a Xilinx
Zynq-7010 FPGA SaC with a Raspberry Pi. Now,
this new ZynqBerryZero (TE0727) SBC takes a
similar approach, but this time imitating the
Raspberry Pi Zero. The 65mm x 30mm SBC
offers a 40-pin GPIO header that can load
Raspberry Pi HATs that support the Zero.
The ZynqBerryZero trades out the Zero's
lGHz, Armll-based Broadcom BCM2836 for
the Zynq-7010, which combines dual 667MHz
Cortex-A9 cores with an FPGA with 28K logic
cells, compared to 85K for the Zynq-7020. The
SBC comes with 512MB DDR3L DRAM, 16MB
flash and a microSD slot. The SBC's coastline
ports are limited to a mini-HDMI Type-C port,
dual micro-USB 2.0 ports, an OTG port and a
port for JTAG/UART debugging and SV power
input. The 0 to 70°( tolerant board is also
equipped with a 40-pin header with 26x GPIOs
and a MIPI-CSI-2 camera connector.
loT GATEWAY FOR RPi
loT gateways are yet another area that
has embraced the Raspberry Pi phenomenon.
With that in mind, in July Hilscher released its
Raspberry Pi based netPI Real-Time Ethernet
gateway. The netPI series is based on an
industrial-ready, customized Raspberry Pi 3
design made to run any custom applications in
edge automation (Figure 8). The model RTE 3
comes with Hilscher's multiprotocol netX SoC
additionally implementing all popular Industrial
Ethernet networks. With their powerful RPi 3
1.2GHz quad-core Arm CPU, the platforms are
ready-made for any demanding Cloud, Industry
4.0 and Industrial loT (lion application.
The model netPI RTE 3 includes two extra
Industrial Ethernet ports extra to connect to
systems such as PROFINET, EtherNet/IP and
others, as supported by netX. An expansion
slot at the unit's bottom accepts extension
modules made for sensor/actuator level
communications such as RFID, digital 1/0s,
others or your own custom boards.
To meet EMC standards EN 55011 and
IEC 61000, netPI is housed in a robust metal
chassis and uses two additional PCB layers
compared to a standard Raspberry Pi 3 SBC.
The radio antenna extends beyond the chassis
for improved wireless coverage. A hardware
Real-Time Clock with a supercapacitor
as backup power source is supported. A
nonvolatile auxiliary ferroelectric memory
(FeRAM) guarantees high endurance for data
to be rewritten billions of times (Model RTE 3).
The netPI hosts an AppArmor-secured Yocto
Linux build. By design, the system software
complies with the IEC 62443 cybersecurity
standard for automation and control systems.
User access is granted via web browsers over
https-secured connections. The device boots
secure and allows system updates with Hilscher
integrity-checked software only. G
ci rcuitcellar. corn 49
FIGURE 7
The ZynqBerryZero is a pseudo-clone of the Raspberry PI Zero SBC with a Zynq-7010 Arm/FPGA SoC, a
microSD slot, dual micro-USB, mini-HDMI, CSI 2 and 40-pin GPIO.
iiii
.. 11
FJGURE8
--.. --•••• iiii
D
a ... ~
docker
The netPI Real-Time Ethernet gateway features an industrial-ready, customized Raspberry Pi 3 design made
to run any custom applications in edge automation. The model RTE 3 comes with Hilscher's multiprotocol
netX SoC additionally implementing all popular Industrial Ethemet networks.
By Jeff Child,
Editor-in-Chief
Gone are the days when box-level embedded computers, also llntNIII
as Embedded PCs, were stridly custom-built offerings. Today, several
vendors offer extensive produd lines of embedded PC of all
and configurations, and for diverse applications including i
system monitoring, energy system control and ······~-
For its system that enables bats and wind turbines to coexist, Fleximaus chose the KBox A-150-APL
embedded PC from Kontron. The KBox A-150-APL embeds an Intel Pentium Quad Core N4200 processor.
F or many years, the mid- to high-end of embedded computing revolved around single-board computers
{SBCs). But a decade or so ago, a
new class of computing solution emerged-the
notion of an enclosed, integrated computing
system to which system integrators could
link their interfaces. Many such systems
used to be common as custom-built units,
but vendors shifted to offering them as off-
the-shelf products. These systems are called
a number of names including industrial
PCs, rugged stand-alone box systems and
embedded PCs. These systems are attractive
to system developers that want a high-level of
integration to start with-so that don't have
to deal with making different SBCs and 1/0
boards work together, for example.
Attempting to keep this Datasheet
roundup focused was a challenge because
box-level embedded computing has grown
into a broad category of products. With that
in mind, the representative products included
in this article's product gallery is restricted to
embedded PCs in the literal sense of systems
with PC-architecture computing (lntel or
AMD processing) and Windows OS support.
The gallery also excludes box-level systems
that are marketed as application-specific
systems-aimed at vehicles, digital signage,
railway systems, vision system and soforth.
It gets murky because many of the systems in
this article can and are used in transportation,
for example, so there is that kind of overlap.
An example of an embedded PC application
is a system developed by Fleximaus that
allows bats and wind turbines to coexist
{Figure 1). The Fleximaus solution is based on
intelligent software that is able to evaluate
the environmental conditions detected by rain
and temperature sensors and use this data to
effectively control the wind farms in order to
drastically reduce the dangers for hunting
bats. An essential technical component of the
solution is an industrial PC with integrated
soft PLC. For the embedded PC, Fleximaus
chose the KBox A-150-APL from Kontron.
According to Fleximaus, the KBox A-150-APL
was selected because of its fanless, rugged
design, which guarantees an extended service
life and high system availability. Other factors
in the selection included KBox's compact
design, its wide range of interfaces and its
expansion options. The KBox A-150-APL
embeds an Intel Pentium Quad Core N4200
processor. G
Fanless System Embeds 8th
Gen Coffee Lake
The BOXER-6641 from Aaeon
offers a range of processors from the
Bth Generation Intel Core and Xeon
processor family (formerly Coffee
Lake), from Celeron G4900T and
Pentium G5400T up to Xeon E-2124G
(up to 71W). The system provides up to
32GB of ECC or non-ECC ODR4 2666MHz
RAM and support for two hard drives.
• i3/i5/i7/i9 processor for A1 model
(max. TOP up to 65W)
• ... or i3/i5/i7/i9/Xeon processor for
A2 model (max. TOP up to 71W)
• DOR4 ECC or Non-ECC SODIMM, Up
to 64GB
• Intel GbE LAN x 4 (i211 x3 + i219 x1)
• Intel AMT (A2model)
• HDMI x 2 dual display
• USB 3.2 gen 1 x 8 (A2 model)
• BIOS selectable RS-232/422/485 x6
• Wide range DC 10V to 35V input
DATASHEET URLS:
AAEON
www.aaeon.com
System Blends CPU and GPU
Computing
AOLINK Technology's Matrix series
MVP-5100-MXM is an integrated fanless
embedded computer featuring Intel
Core i7/i5/i3 processors and embedded
GPU for industrial AI applications. The
system includes a comprehensive I/0
set to collect sensor measurements and
allow data-driven actions to be taken in
a timely manner.
• 9th Gen Intel Core i7/15/i3 LGA
processor
• Dual SOOIMMs sockets for up to
32GB DOR4
• Up to 4x additional OP 1.4 from
MXM, 2x OP++, DVI, VGA, 3x GbE,
3x COM, TPM2.0
• 3x USB 3.1 Gen 1, 3x USB 2.0
• 2x 2.5" SATA, M.2 2280
• Front accessible I/0 and adaptive
Function Module 2.0 options
• Slots for Mini PCie, M.2 3042,
2x USIM
• Embedded GP/GPU computing
options built-in
ADLINK Technology
www.adlinktech.com
AAEON http://data-us.aaeon.com/DOWNLOAD/2014%20datasheet/Systems/BOXER-6641.pdf
ci rcuitcellar. corn 51
Embedded Computer Features
lU Height
EPC-T4286 from Advantech is an
embedded computer designed for self-
service applications. As the newest
member of Advantech's EPC-T series,
this embedded computer features a
highly-functional small lU-high form-
factor design. Powered by a 9th Gen.
Intel CPU platform, EPC-T4286 combines
high computing performance with
diverse 1/0 ports, making it well suited
for applications in self-service kiosk
terminals.
• Intel Core i CPU
• Thin compact design with 44.2mm
in height
• Thin barebones system with multi-10
ports
• Suited for environments with OC-in
design
• Easy and installation for additional
peripherals
• 6x COMports, 6x USB ports,
3x LAN ports,
• 1x 2.5" shock-resistant drive bay
• Waii/VESA/Rack mounting kits
Advantech
www.advantech.com
ADllNK Technology www.adlinktech.com/Products/Download.ashx?type=MDownload&isDatasheet=yes&file=l815%5cMVP-5100-MXM_Series-20200304.pdf
Advantech https:/ /advdownload.blob.core.windows.net/productfi le/PIS/EPC-T4286/file/EPC-T4286-Series-System_DS(OB1020)20200903164229.pdf
52. CIRCUIT CELLAR • OCTOBER 2020 #363
Embedded PCs
Apollo Lake Fanless Box
Targets Industrial loT
LYNX-6110 from American Portwell
Technology is a compact, fanless and
cable-less PC adapting a low power
Intel Apollo Lake processor. Developed
to meet heavy industrial standards,
the rugged design enables it to work
in harsh environment. Providing
basic I/0 interfaces in a palm-
sized box, the system is suitable for
industrial automation, smart factory,
edge computing and IIoT gateway
applications.
• Intel Celeron N3350, 2 cores,
1.1GHz/2.4GHz, 6W TOP
• 4GB onboard LPDDR4, 2400 MT/s,
non-ECC; up to 8GB (optional)
• 32GB onboard eMMC 5.0 flash;
up to 256GB (optional)
• Expansion 1x M.2 Key E 2230 for
wireless module
• Display 1x DP v1.4 4096 x 2160 at
60Hz
• USB 2x USB 3.0
• Ethernet 2x 10/100/1000 GbE
• Power input 12-30VDC (+/- 20%)
• Operation temperature 0°( to 50°(
American Portwell Technology
www.portwell.com
DATASHEET URlS:
Coffee Lake System Offers
Flexible 1/0 Design
Axiomtek's eBOX640-521-FL is
powered by the 9th/8th generation Intel
Core i7/i5/i3 and Celeron processor with
the Intel H310 chipset (Coffee Lake).
This embedded system features a wide
choice of front-accessible I/0 interfaces
for easy cabling and maintenance. It
also has a flexible I/0 window for ease of
customization for versatile applications
and customer requests.
• LGA1151 socket 9th/8th gen Intel
Core i7/i5/i3
• ... and Celeron processor (Coffee
Lake)
• Supports 2x COM, 6x USB and 8
channels of digital I/0
• Two 2.5" SATA drive bay
• M.2 Key E 2230 for Wi-Fi
• Front I/0 connectivity design
• 12/19 to 24 VDC power input via
DC-Jack
• Flexible I/0 window supported
Axiomtek
https://us.axlomtek.com
American Portwell Technology ....ww.portwell.com/pdf/iot/LYNX-6110.pdf
Axiomtek https://us.axiomtek.com/Download/Spec/en-US/ebox640-521-fl.pdf
!base Technology ....ww.ibase.com.tw/englishfProductDetaii/EmbeddedComputingj/lSB200-918
Fanless Box Sports AMD
Ryzen ¥1000/RlOOOs
The ASB200-918 series from lbase
Technology is based on the IB918
3.5" form factor SBC supporting AMD
Ryzen SoCs (V1605B/V1202B/R1606G/
R1505G). The fanless ASB200-918 runs
two simultaneous HDMI 2.0a displays
at Ultra HD 4K resolution (3840 x 2160)
with a frame rate of 60 fps. Measuring
240mm x 162mm x 42mm, it is
equipped with rugged components.
• AMD Ryzen Embedded V1000/R1000
on board
• 2x DDR4 50-DIMM, Max. 32GB,
supports ECC
• Supports 2x M.2 sockets (E-Key/
M-Key, NVMe)
• 2x HDMI (2.0a), 2x Intel Gbit LAN
• 4x COMports, external GPIO
• 4x USB3.1, 1x USB2.0
• 12V (-10%) to 24V (+10%) DC-in
• Operating temperature 0°( to 45°(
Ibase Technology
www.ibase.com.tw
Embedded PC Serves Up
9th Gen Core Processors
Kontron's KBox B-202-CFl offers
high performance with maximum
expandability and low noise level
(maximum 34 dB(A)). The embedded
Box-PC with Intel Core 9th generation
processors, with up to eight processor
cores, provides a performance boost
with constant power dissipation. This
enables the KBox B-202-CFl to handled
computationally complex processes and
large amounts of data.
• Up to 9th Gen Intel Core i7/i5/i3
• Raid functionality with up to
4 storage devices
• 2x PCie expansion slots for graphics
or network cards
• low noise design
• Removable 2.5" SSD
• EN55032 Class B certified
• Operating temperature 0°C to 45°C
• Size: 190mm x 120mm x 190 mm
DATASHEET URLS:
Kontron
www.kontron.com
Apollo Lake Industrial PC is
LYE Certified
lanner's lEC-7242 is an industrial
environment gateway IPC driven by Intel
Apollo lake CPU, is CE, FCC and PTCRB
certified for LTE or Wi-Fi. It is designed
for IoT/IIoT edge, wireless security
and multi-site management solution
deployment in commercial, enterprise
and public sector applications. Power
consumption ranges between 5.4W to
13.5W.
• lntel Apollo lake CPU
• FCC/CE/PTCRB certification for LTE
or Wi-Fi
• 2x GbE RJ45, 1x RS232/422/485
COMport
• 2x USB 3.0, 1x DisplayPort, 1x HDMI
• 1x M.2 3042 B+M Key socket with
duaiSIM
• 1x Mini-PCiesocket with dual SIM
• Onboard lPDDR4, max 8GB and
onboard 64GB eMMC
• TPM support
Lanner
www.lannerlnc.com
Kontmn www.kontron.com/products/systems/embedded-box-pcjkbox-b-series{kbox-b-202-cfl.html
l.anner www.lannerinc.com/products{i ntelligent-edge-appliances/embedded-platform/ lec-7242
Onlogic https://'iJ:iltic.onlogic.com/resources/manuals/Onlogic-Helix-Pmduct-Manuai-Vl.pdf
ci rcuitcellar. corn 53
Comet Lake System Targets
Industrial Edge
The Helix 500 from Onlogic brings
desktop processing performance into
a fanless, silent mini-PC. Powered by
Intel Comet Lake Core processing,
Helix 500 can accommodate up to
64GB of RAM, has room for dual SSDs
(including NVMe options) and features
available VPU accelerators, including
Intel Movidius and Google Coral.
• Intel Comet lake Core i3/i5/i7/i9
processors
• Intel Q470 chipset; Intel UHD
Graphics 630
• Up to 64GB DDR4 50-DIMM
(non-ECC)
• 6x USB 3.1 Gen 2 ports,
2x USB 3.1 Gen 1 ports
• 2x Gbit lAN ports, 3x DisplayPorts
• lx 12V to 24V, 4-pin DC jack
• 2x M.2 2280 slots (NVME PCie x1/
SATA)
• Operating temperature: 0 to 50°C
• Size: 154mm x SO.Bmm x 210 mm
On Logic
www.onlogic.com
54 CIRCUIT CELLAR • OCTOBER 2020 #363
Embedded PCs
... ·- ..
-· "• ", · o ~HHH•
I 1 • .
Fanless Computers Blend GPU
and lntel Gen 10 CPU
Sintrones' ABOX-5210G Edge AI GPU
Computing is powered by Intel Gen 10th
10 Cores Xeon, i9 CPU with 10x GbE
with Nvidia GeForce GTX GPU. It can
provide high computing performance
on graphic processing by harnessing
the power of its GPU. The fanless box
computers feature dual hot swappable
SATA storage RAID 0,1,5.
• Intel Gen 10 Cores Xeon W-1290TE/
i9-10900TE
• Nvidia Geforce up to GTX 1660 GPU
• Supports 1408 CUDA Cores
• Bx GPI, 4x GPO and
3x RS-232/422/485
• 1x M.2 B key, 1x M.2 A-E key
• 2x Mini PCie expansion slots
• Dual hot swappable SATA storage
RAID 0,1,5
• Operating temperature.:
-40°C to 70°C
• 10x Gbit Ethernet RJ45
DATASHEET URLS:
Sintrones
Industrial PC Boasts
Six: Gbit Ethernet LANs
The Pl-50030 from WIN Enterprises
is a fanless, high-performance
networking system based on the Intel
7th Gen Core Processor. With six Gbit
Ethernet LANs and 4x USB 3.0 and 2x
USB 2.0 ports, it is well suited for small
call centers that demand quiet, but
high performance. Network expansion
is through PCie interface modules, M.2
and Mini PCie technology.
• Intel 7th gen Core processor
• DDR4 SODIMM up to 32GB
• Support for three independent
displays
• Rugged and fanless embedded
system
• 4x PoE + 2x LAN, Sx COM, 4x USB
3.0, 2x USB 2.0, 1x M.2x NVMe slots,
16-bit DIO
• lx PCie X16 or lx PCI, 2x Mini PCie
• Quiet fanless operation
• Wi-Fi antenna
Sintrones IMNW .si ,:rones. cor"' f datasheels/ ABOX-52 lOG. pdf
WIN Enterprises IMNW. w i n-ent. com/i mag es/sto •i es/down load/catasheets/M B-50030_ v2_DS. pdf
WIN SYSTEMS https ://resources. wi nsystems. eo m/ da:asr eets/sys-i t:x-n-3900-ds. pdf
Embedded Box: PC Offers
Wide Temp Range
WINSYSTEMS' SYS-ITX-N-3900 is
an industrial embedded computer
based on the Intel Atom E3900 Apollo
Lake processor family. It uses less
than 12W for fanless applications
and performs reliably in industrial
operating temperatures ranging from
-200 to +600C. It includes a SODIMM
socket supporting up to 8GB of DDR3
system memory and internal mounting
support for one 2.5" SATA HDD/SSD.
• Intel Apollo Lake E3950/E3940
processor
• 2x 10/100/1000 Mbps Ethernet ports
• DisplayPort and VGA outputs for
dual displays
• Up to 8GB DDR3-LV RAM
• 2x USB 3.0, 1x serial port,
audio output
• lx MiniPCie Socket with
mSATA support
• lx M.2 Socket, with E key, type 2230
• 1x SATA 3.0 ports and lx Micro SD
for storage
• Operating temperature:
-20°C to +60°C
WIN SYSTEMS
ms.co
56 CIRCUIT CELLAR • OCTOBER 2020 #363
Embedded in Thin Slices
By
BobJapenga
FIGURE 1
R ecently I was in a meeting with 12 young professionals. We met over Zoom, and some of us gathered 30
minutes before the meeting began
in order to share what's happening in our
lives. One of the young men was excited about
working on a Raspberry Pi loRa concentrator
{gateway). His company makes sensors and I
was excited to see that his company is now
getting into loRa sensors.
That's what we've been discussing in the
past six articles. This month we wrap up our
not-so-deep-dive into loRa. We are going to
look at building a prototype loRa device for
The MQSparl<. development kit comes with four Grove sensors for measuring temperature, sound, distance/
speed and orientation.
the MachineQ network using a development
kit and the example software. For testing,
we will be using the off-the-shelf MachineQ
loRaWAN gateway. As I did with building a
device and gateway for The Things Network
{TTN), I want to emphasize the prototype
nature of what I did. That's because I don't
want to mislead you into thinking: "Wow!
That part is all done and all I need to do is
concentrate on my specific application."
Au contraire. Using this hardware and
software will get you going for a proof-
of-concept prototype, but it is a long way
from a certified, ready-to-build-and-deploy
product-especially in terms of the software.
We all have used example software that was
little more than 10% of the finished product-
all-the-while hoping that we could use that
example software and be done with it.
In addition, I am a little concerned about
the robustness of the off-the-shelf gateway
I was using from MachineQ. Two days ago,
I disconnected the Ethernet cable from the
gateway at my router and put the cable
into a different port. The gateway stopped
connecting for 36 hours until I powered it
down. I was already told there were problems
with Wi-Fi in this area. This does not bode
well for 24/7 unattended operation.
REMOTE RESET WOES
As a side note, we experienced this several
years ago with an off-the-shelf cellular modem.
We were in the midst of a feeding frenzy in
Ontario when solar energy suppliers were
knocking on doors asking homeowners if they
could rent their roofs to install solar panels.
Canada was recognizing that it needed to supply
more electrical energy than its infrastructure
could provide, but did not want to invest in
the fossil fuel infrastructure [1]. The provincial
government was paying an outrageous amount
for homeowners to put electricity onto the grid
using photovoltaics {$0.802/k.W-hour! [2]). I
pay just over $0.09/k.W-hour for fossil fuel
generated electricity.
Many companies were tripping over each
other to get solar panels on every possible
roof as fast as possible. We rushed out a
modification of a design of a solar power
energy monitor for one of our clients that
used an off-the-shelf cellular modem powered
by USB. Once a few were in the field, we found
that some modems would stop communicating
and require a reset. We quickly installed a
fix to allow us to remotely power-cycle the
modem. Ever since then something equivalent
to this has been part of virtually all of our
designs that incorporate complex (software)
off-the-shelf systems. Basically, we don't trust
suppliers to create robust devices. You just
cannot send technicians to the field to reset
thousands of devices. So, if you are using
anyone's off-the-shelf gateway in a place that
cannot be easily reset, consider providing the
ability to remotely reset it or power cycle it.
Getting back on track, this month we will
look at the hardware and the software 1 used to
put together one LoRa node on an off-the-shelf
LoRaWAN gateway on the MachineQ network.
THE HARDWARE
The LoRa device: For the LoRa device,
MachineQ offers two development kits: The
MQSpark is the simplest and comes with four
Grove sensors for measuring temperature,
sound, distance/speed and orientation
(Figure 1). There are literally hundreds of
Grove sensors [3] for you to experiment
with. Robotics,motion, environmental and
proximity sensors are available to rapidly
prototype your new design. The device plugs
into a USB port for power and communications.
It uses the Arduino IDE for development.
All that said, I chose to use the other
offering: the STMicroelectronics (ST) LoRa
Development kit, which is for those who
want to design their own sensor and require
more advanced software and hardware.
This kit consists of two boards. The main
board (B-L072Z-LRWAN1) and the X-NUCLE0-
1KS01A2 daughterboard (Figure Z).
Main board: Also known as the Discovery
kit for LoRaWAN, Sigfox and LPWAN
protocols, this main board contains a Murata
CMWX1ZZABZ-091 module (Figure 3). This
module contains an ST Arm Cortex MO+ Core
with 192KB of flash, 20KB of RAM and 20KB of
Serial EEPROM; a Semtech SX1276 LoRa radio;
and variety of I/0 (ADCs, DACs, USB, serial
ports, discrete I/0, 7 LEDs, two pushbuttons
and more). There is a battery holder on board
for 3 AAA batteries. However, as shipped, the
battery is not connected. You have to cut a
jumper to connect the battery. Unfortunately,
you then forfeit the ability to use the USB
for loading, debugging and monitoring the
software. Ouch! Very unfriendly for real
development. I decided to buy a USB battery
charger for a phone and use that for my range
testing. I was impressed by the supported
development toolchains: Kell, IAR Embedded
Workbench for Arm, GCC-based IDE's like
Eclipse, and Arm embed. I used the Keil IDE,
ci rcuitcellar. corn S1
FIGURE2
The ST LoRa Development kit that
I uS€d consists of two boards. The
main board (B-L072Z-LRWAN1)
(bottom) and the X-NUQEO-IKS01A2
daughterboard (top).
U'l.WII'
IIAA1'
"" ac:
STM32L''' U'·Tiol
use
CIPIOoi!IW
FIGURE 3
Murata CMWXlZZABZ-091 module
T-s-o OliUoNI
MCO
I!IOOTII
15877542
15877542
Centuries before the science of color temperature was understood, blacksmiths
already knew how to read the temperature of a heated piece of metal by its
color emissions. In this article, leff es the math and science behind
color temperature. He then details his project that uses a color-lighHo-digital
sensor to measure the color temperature of a light source.
11 w hite assnow,U 0 white chocolate," 0 White
wedding dress,u "white lightning"
and "white diamondsu are common
descriptions of items in our world that
include the descriptor "white." You can probably think of many
others. Some of these describe a whitish hue, while others
don't connote a color at all. The most truthful might be 0 White
hot." While today we might use this to describe someone that
is udrop-dead gorgeous, u according to Merriam Webster, this
was first used as meaning "being at or radiating white heat.n
If you've ever sat by a campfire or gazed at a candle, you have
experienced heat through radiation and colors associated with
the flame.
Before we can discuss temperature and color, we need to
begin with the "black-body radiato~ [1]. This is a theoretical
object that can absorb all radiation that falls upon it. Radiation
is the emission or transmission of energy in the form of
waves (or particles) through some medium. This includes:
electromagnetic radiation, such as radio waves, microwaves,
infrared, visible light, ultraviolet, x-rays and gamma radiation
(y). At absolute zero-the coldest temperature possible-no
heat is generated in a black body. Absolute zero is -273.15°C
(Celsius) or -459.67°F (Fahrenheit). Science often uses the K
(Kelvin) temperature scale to make more sense.
K = °C + 273.27
so absolute zero = OK
... and freezing = 273.16K
As a black-body radiator's temperature rises, it gains
energy and will emit radiation beginning at the low end
of the electromagnetic spectrum. Figure 1 is a good
illustration comparing radiation type and temperature for the
electromagnetic spectrum [2]. We experience this emission as
color once its wavelength enters the visible spectrum: 400nm-
700nm. A blacksmith heats a piece of steel in his forge to
affect its malleability. While it's not a perfect black body, the
physical properties of the metal change with temperature,
and he can estimate its temperature by its color emission
alone (Figure :Z) [3].
We can therefore define the color temperature of a light
source in terms of the absolute temperature of a black-
body radiator or "chromaticity." Chromaticity is the quality
of color, independent its brightness or luminescence.
Chromaticity consists of two independent parameters, often
specified as hue (h) and as colorfulness (s). Colorfulness is
alternatively called saturation or chroma. A color space
Penetrates EarUfs
Aunosphere?
y --.-. ·. --
Radrabon Jypc Radio MicrOONave Infrared Visible u ltraviolet x -ray Gamma ray
1tr 10, 10 .. 0.5• 10 ... 10 8 10 10 10 17 V\lavelenylh (m,
A pproXJmate Scale
~· 11~ -P AC ~ of wavelength }) ~I Buildrngs Hun-.ans Bu ne rftre s Needle Pomt Prorozoans Mol ecules AlOrns Aromlc Nuclei
Frequency (Hz)
~mperaiUre of
ObJeCts at whrch
thrs radrauo n rs the
most rmense
wavelengdr emnted
chromaticity diagram (Figure 3) defines all
visible calor based on these parameters [4].
Note: Temperature calor has been indicated
within the calor space. Green and violet fall
outside the black body path or Planckian
locus (see physicist Max Planck), with green
(secondary) being a combination of primary
yellow and blue, and violet (secondary) being
a combination of primary red and blue.
ADDI11VE I. SUBTRACTIVE COLOR
This has to do with the source of the
calor. If the source is projected, the three
wavelengths used are RGB (red, green, blue)
and are additive. If the source is reflected,
then the pigments used are CMY {cyan,
magenta, yellow) and are subtractive. Note:
Many of us were taught early on that the three
primary colors were RYB (red, yellow, blue).
Figure 4 shows the computational effects of
each system.
These are the hues of chromaticity. The
other aspect of chromaticity-colorfulness,
saturation or chroma-has to do with its
intensity. If our brains receive equal signal
strengths from all three types of cones (calor
photoreceptors) in our eyes, then we would
perceive white light. If these cone outputs
were reduced from maximum to minimum,
the resultant perception would be a fade to
black. Likewise, if some other mix of cone
outputs were perceived as, say, green, and
these outputs were reduced to minimum
while remaining in the same proportions, the
perception would be a fade to gray.
10000 ,000K
-1o.ooo,ooo •c
the expected colors. However, if the source
were lacking some frequency, the resultant
perception would be skewed. The missing
frequency cannot be reflected, and so the
result will be lacking. We have two options for
a light source-the sun or an artificial source.
You've most likely noticed the temperature
calor is the opposite of the way we think of
temperature and the visible calor spectrum
(as red = hot and blue = cold). With calor
temperature, red is of a lower temperature
and therefore cooler than blue. The sun's
effective temperature, defined by the total
radiative power per square unit, is about
5,800K. During sunrise, the tangential angle
of light passes through more atmosphere,
scattering the shorter-wavelength blue light
from our view. As the path becomes a more
FIGURE2
ci rcuitcellar. corn 61
FIGURE 1
Shown here is the frequency/
wavelength /color temperature of the
electromagnetic spectrum of energy
[2]. Note those areas of protection by
our atmosphere.
We assume that a (white) source
illuminating a subject is perfect. A perfect
white source would give the expected result.
The subject under observation would absorb/
reflect the wavelengths, and we would perceive
A blacksmith uses tlle col or emissions given off by a heated metal to estimate its temperature [3]. This is
key to being able to rorm and temper it.
62 CIRCUIT CELLAR • OCTOBER 2020 #363
0.9
0.8
0.70.6
500
0.5
y
0.4
0.3
0.2
0.1
FIGURE 3
direct angle, this scattering can be seen off-
axis as blue skies.
Figure 5 shows how the source calor
temperature can vary between the sun
and artificial lights. The calor temperature
value of a light source refers only to the
visual appearance of the source. It does not
necessarily describe the effect this source
0.3 0.4
X
0.5 0.6 0.7 0.8
The OE (International Commission on Illumination) 1931 color chromaticity diagram was the first to
demonstrate the link between wavelengths in the electromagnetic visible spectrum, and physiologically
perceived colors of human col or vision. Note the plot of chromaticities of black-body light sources of various
temperatures [4].
FIGURE 4
will have on photographs or digital images.
The calor temperature does not take into
consideration the spectral distribution of a
visible light source, and is not a reliable means
of selecting suitable filters or creating look-
up tables for calor balance corrections. While
different light sources may be described as
having the same calor temperature, without
proper white balance, spectral output cannot
determine the correct adjustments for calor
temperature balance. So, let's look at one
possible sensor that will allow us to get a feel
for the spectral content of light exposed to it.
TCS3472
The TCS3472 is one of many sensors
manufactured by ams, a global leader in the
design and manufacture of advanced sensor
solutions. It consists of three sets of four
filtered sensors protected by an IR filter.
Three of the four filtered sensors have calor
filter RGB. Sensor values and control registers
are available via an FC interface.
The amount of light falling on each set
of silicon photodiodes is measured by an
integrating analog-to-digital converter (ADC),
one for each calor. All ADCs operate in parallel,
so all ADCs use the same integration time. The
device covers a wide signal range. For low-
level signals, higher programmable gains and
longer integration times can be used. At the
other extreme, higher-level signals will require
lower gains and shorter integration times.
The integration time period is chosen as
a multiple of 2.4ms. A saturated device will
present a count of 1,024 for each period. So,
you want to make sure the total count (for any
sensor) I number of periods is less than 1,024.
This is an analog saturation check. A sensor's
total value is held in a byte register pair, and
therefore is limited to a maximum of 65,535.
It is possible to have no analog saturation,
but choose a high number of integration
periods, where the total count is greater than
65,535. This is a digital saturation check. You
would need to adjust gain and/or number of
integration periods to keep the results high
On the right is the RYB (red, yellow,
blue) plot of colors we learned to mix
with crayons in kindergarten. The
pigments limit/filter any light reflected
to our eyes. On the left is the RGB
(red, green, blue) plot of a monitor
reproducing calor through the additive
process of I ight sources. In the center
the CMYK (cyan, magenta, yellow,
black) plot shows how a printer mixes
inks in a process similar to crayons.
While equal parts of CMY equal K
(black), it's a waste of colored inks to
make black, so when black is needed,
a separate black ink is used.
RGB (Additive) CMYK (Subtractive) RYB (Subtractive)
enough to provide good resolution, without
going into analog or digital saturation.
The register set for the TCS3472 is
presented in Figure 6. You'll note that the
COMMAND register is not really a physical
register, but rather a pointer used to access
registers OxOO-OxlB and alternately clear an
interrupt. Besides pointer data, the COMMAND
byte also enables/disables the auto increment
of the pointer register function.
The device has an interrupt output
that can be triggered by a clear channel
conversion count that is less than or greater
than minimum and maximum values you
program into registers Ox04/5and Ox06/7. This
interrupt can be further limited by requiring
a number of consecutive out-of-range counts
from 1 to 60, programmed into register OxOC.
The status of a conversion is found in register
Ox13. Channel counts follow in registers Ox14-
0x1B. The only interrupt that can be generated
is the out-of-bounds interrupt, and it is not
used in this project. Note that the external
LED is controlled via this interrupt output, and
it can be enabled and disabled via the AIEN bit
in the ENABLE register (OxOO).
You must set a number of registers to control
the operation of the TCS3472. There are timing
and amplification areas of configuration. First
is the general timing of the device. Assuming
the device has been enabled (AEN, WEN, POW),
it will continuously idle and sample the sensors.
The idle or wait time is set by the wCycl es or
WTIME. Each cycle adds 2.4ms to the operation.
The cycle values are two's complement values
(inverts all bits and adds 1). Therefore, to set
the minimum wCycl es equal to 1 {2.4ms),
OxFF must be written to the WTIME register
(Ox03). The CONFIGURATION register (OxOD)
holds the WLONG bit that, when enabled, will
multiply the WTIME by 12. The maximum
WTIME will be approximately 7 seconds. This
allows the device to remain in idle condition
for a large percentage of time, lowering the
average current of an active device by a factor
of 5. However, device current is only 0.3mA to
begin with.
The integration time has a similar register
(ATIME Ox02). You set the integration time
in periods of 2.4ms. If you wanted to set the
integration time to 50ms, you would use an
aCy cl e count of 50ms /2.4ms = 20.8 (or 21
periods). The two's complement of 21 (Ox15)
is 235 (OxEB). There is no multiplier for the
integration time. However, you can adjust the
gain of the sensor amplifiers, which is similar
to a multiplier, without actually adding any
more time to the conversion.
You can see that if all the timing registers
are set to maximum, one sample period would
be WTIME = OxOO (614ms), WLONG = 1 (times
12) 614ms x 12 = 7.4 seconds, plus ATIME =
8,000 K
6,500 K
5,500 K
4,500 K
3,000 K
2,000 K
FIGURE 5
Outdoor
source
Snow, water
b lue sky
Large shadows
blue sky
Average day
light, central
latitudes
Noon sunlight
Average day light,
Northern Hemisphere
Early morning
late af te rnoon,
and evening
sunlight
Indoor
source
Xenon
flash
ci rcuitcellar. corn 63
Blue bulb
f lash cube
Fluorescent
"Warm w hite"
tubes
dear flash
bulbs
Photofloods
Photo lamps
Household
150/200W
60/40W
25W
Candle light
This chart shows how the sun (outdoor source of light) and various types of artificial lights 0ndoors) produce
calor temperatures from a reddish (relaxing) tint to an bluish (intense) tint. In their art, photographers use
these subtle tints of white light to produce an emotion.
AllORESS RoalVII<AME 11/W MGIITEA fUNCllOfl RU ff VALUE
~ w .....,_........,_ c.oo
IWXI £NAIIlE 1\W
.,_ ___
c.oo
a.Dt ... ..._ - AGIIC- ,.,. IIIG3 W'llloiE 1\W '~'~"'- IW'f - ALn MY a..._ ..... _ .... byto IWXI 111111 Al. Ill MY a...-to.r-1'111•""" c.oo
OIIDII ~ A.W Clool -. ...,_ ..... 01100
011111 Qffi4 A.W cao.. ............. -N11..,.. IWXI
o.oc: PEAS MY
~--··
0.00
Qd) oor.m MY ~ 111100
01111' CONTROl MY OllfWU 01100
01112 tO R _., tO
01113 STATW R o.--.. c.oo
Oat• COAT N.. R a---- 111100 111115 COATAH R aoor .... ...,_ ClliOO
01111 IIDIITN.. R -- ..... -~ IWXI
01117 -TAH A --¥1¥0 IWXI
!loll OQAW_ " a.--~t.,w Odl Olllt OOATAH R a.-- ...... 0.00
0111A IIOATN.. R
__ .,....,.,..
IWXI
01118 BOATAH A
__ l'oil;ll..,..
c.oo
FIGURE 6
These are the PC registers of the TCS3472x. Note: the first data byte of a write wi 11 be a COMMAND byte,
which sets the pointer to a register of interest. Additional data bytes are stored beginning at the pointer. A
read will produce data,also beginning from that pointer.
64 CIRCUIT CELLAR • OCTOBER 2020 #363
OxOO (614ms) 7.4 seconds + 0.614 seconds = 8.014 seconds.
Reading the resultant registers prior to this time would
provide the data for the previous sample only.
USING THE SENSOR
Since the TSC3472 is an I2C device, it can be easily
interfaced using a 3.3V Arduino (or a SV Arduino with some
level shifting on the I2C pins). I'll begin this project with an
Arduino MEGA. A library for the TCS3472 is available, but I
won't use it for this project. Instead I'll break it all down into
visible function calls.
Let's begin with reading all of the registers. To do this
we'll need to write a command to the device. As we discussed
previously, the COMMAND byte sets up the pointer to the
register we want to communicate with (either to read from
or to write to). It also instructs the device whether or not
11 This example code is in the public domain.
String SignOn = "TCS3472 Probe 5/20/2020";
#include <Wire.h>
byte I2CADDRESS = Ox29;
#define RB OxOO
11 repeat same address
#define AI Ox20
11 auto increment address
//define SF Ox60 //special function
byte TYPE = AI;
byte REGISTER= 0;
int REGISTERVALUE = 0;
const i nt REGISTERCOUNT = OxlC;
i nt CHARACTER;
unsigned int BYTEARRAY[ 255 ];
const unsigned long I 2CCLOCK = 400000;
11-----------------------------------------
// setup()
1/-----------------------------------------
void setup()
{
Wi re.be gin();
11 join i2c bus (addres s opt ional for
ma ster)
Wi re.set Clock(I2CCLOCK);
Serial.begin(ll52 00 ) ;
I I start serial f or output
Se r i a l . p r i n t l n (S i g nOn ) ;
}
//-----------------------------------------
// loop()
/1-----------------------------------------
voi d loop ( )
{
}
r eadi2CCl:
di splayAll Regi sters( );
/ /-----------------------------------------
// readi2C ()
/1-----------------------------------------
void r eadi 2C( )
{
AODR = 0;
ifCwrit ei 2C ( 0))
{
I..ISTlNG 1
(continued}
The basic Arduino code needed to read all the registers in the TSC3472x
to increase this pointer automatically after each register
access. Using a COMMAND value of OxAO will set the pointer
to register OxOO and enable auto increment. Since the device
uses registers Ox00-0x1B, we will need to read Ox1C (28)
registers values. Listing 1 shows the basic Arduino code
needed to read all of the registers in the TSC3472x.
In Listing 1 we've collected 28 registers, and they are in
8 YTE ARRAY[ J. Displaying these requires the majority of
programming, and will therefore not be listed here. However,
Ustlng 2 shows a typical display of the output from this function.
There are actually two phases for each register. The first gives
raw register info, register name and hex value found there. The
second breaks this down-where necessary-indicating any
special bit significance.
A check of the value in the ID register (Ox12) tells me the
values are good. This device is actually a TSC34725 (a version
(Listing 1 continued)
int o = 0;
if (Wire . request From( I 2CADD RESS ,
REGISTERCOUNT)) // re quest bytes fr om
slave device
{
while ( Wi r e.available())
11 slave may send less t han req uested
{
int c = Wi re.rea d() ;
11 receive a by te as ch ar acter
BYTEARRAY [ o] = c;
}
else
{
o++ ;
Se r i a l • p r i n t l n C "Nobody There ! " ) ;
}
// -----------------------------------------
// writei 2C(int c )
1/ -----------------------------------------
bool ean writei 2C(by t e c)
{
byte COMMAN D = OxBO I TYPE I ADDR;
bool ean q = f al se ;
Wi re.beg i nTransmiss ionC I 2CADD RESSl ;
11 t ransmit to dev i ce
Wire.write(C OMMAN D) ; // sends one byte
wh i le( c)
{
c-- ;
I/
Wi re.write CBYTEARRAY[REGI ST ER + c ] );
send s one byte
}
ifCWire.endTr ansmi ssion()
11 st op tran smitti ng
{
q = t rue ;
}
return q;
== 0)
that uses an I2CAddress of Ox29 and runs
off 3.3V). Note that some registers are not
used (or at least have not been defined).
With the displayAllRegisters() function
working, we can expand this program by
adding a menu to allow us to choose alternate
functions.
The next function that will be useful is to
change a register's contents. Only the first
registers OxOO-OxOD are R/W (read/write}
registers. Six of these are byte oriented, and
four are word oriented. A sub menu will allow
you choose which of these you want to change.
----Change Register----
0 - OxOO Enable
1 - Ox01 Integration Time
2 - Ox03 Wait Time
3 - Ox04/5 Low Threshold
4 - Ox06/7 High Threshold
5 - OxOC Persistence
6 - OxOD Configuration
7 - OxOF Control
Menu selection?
When a choice is made here, you get to
enter a value for the byte or word register
pairs. REGISTER and REGISTERVALUE
variables are used to update a single register
in the TSC3472x.
The Main menu below gives you total
control ofthe device at your fingertips. We can
stop, start and compare conversions to find
the optimum settings for any light condition.
----TC53472 Probe----
1 - Read and display all I2C registers
2 - Change an I2C register
3 - Get a raw sample
4 - Toggle external LED
5- +Gain
6-- Gain
7 - + Integrate Time
8 - - Integrate Time
9 - Sample and auto adjust
Menu selection?
Note that while complete control of all
registers is available, the main menu has
shortcuts that allow adjustments of the
two main parameters that you will want to
change. The Gain sensor and its Integration
Time can be altered directly via single-keys
commands. I added a command to toggle the
on-board LED light source that can be used
for reflective measurements. Command 3
retrieves a sensor sample using the present
configuration. The final Command, 9, makes
fine tuning and sampling automatic.
AUTOMAGICAL
To make the magic happen, we need to
make changes continuously to the Gain and
Integration Time, and look for that point
just before the system reaches saturation.
Previous discussion showed both analog and
digital saturation. It was identified that if the
Integration Time exceeded a count of 63 (63 x
2.4ms = 151.2ms), unsaturated sample could
occur up to the maximum counts of 65,535.
For Integration Times less than 64 counts, the
maximum counts allowed were substantially
less. Using these rules, we can determine if
saturation occurs for a conversion.
OxO - Enable States value= Oxlb
Interrupt is Enabled
Wait is Enabled
Sensor is Enabled
Power is Enabled
Oxl - Integration Time value Oxec
Integration Time = 48.00ms
Ox2 - not implemented = Ox34
Ox3 - Wait Time value= Ox9
Wait Time = 592.80ms
ci rcuitcellar. corn 65
Ox4 - Clear Interrupt low t hres hol d value CLSB) = OxO
Ox5 - Clear Interrupt low t hres hol d value (MSB ) = Oxd e
Clear channel low threshold= 56 832
Ox6 - Clear Interrupt high t hr eshold value CLSB) OxO
Ox7 - Cl ear Interrupt high t hreshold va lue CMSB) = OxO
Clear channel high threshold = 0
Ox8 - not i mpl emented OxO
Ox9 - not impl emented = OxO
Oxa - not i mplemented = OxO
Oxb - not impl emented = OxO
Oxc - Interrupt Persist ence Fil ter value = OxO
Consecuti ve additional Max/Mi n th r esholds = 0 time s
Oxd - CON FIGU RATION valu e = Ox2
Wait multipli er= 12
Oxe - not i mplement ed = OxO
Oxf - CONTROL value = Ox3
Gain = 60
OxlO - not i mplemen t ed OxO
Ox11 - not impl emented = Ox1
Ox1 2 - I D value= Ox 44
TCS347 2115
Oxl3 - STATUS value = Ox11
Interrupt is Set
Sampl e i s Valid
Ox14 - Cl ear Data value CLSB) = Ox69
Ox15 - Clear Data value CMS B) = Oxc
Cl ear channel raw dat a = 3177
Ox16 - Red Data value CLSB) = Oxee
Ox17 - Red Data value CMSB ) = Ox 5
Red c hannel raw da t a = 1518
Ox1 8 - Green Data value CLSB) = Ox2
Oxl9 - Green Data value CMS B) = Ox5
Green channel raw dat a = 1282
Ox la - Blue Data value Cl SB) = Ox2 a
Ox lb - Blue Dat a value CMSB ) = Ox4
Blue c hannel raw data = 1066
I..IS'TlNG 2
The output of the display.AI/Registers() function, which includes a bneakdownof the register bit status. Note:
All numbers are in hexadecimal and pneceded by Ox.
66 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE7
Shown here is tne resultant display
(SSD1306) for a sample oftne mom ing
sky prior to the sun breaking the
horizon. There is very little light 0-ux),
with a reddish color temperature of
approximately 4,3821<.
Since we want to determine the point
just before saturation occurs, my algorithm
begins with minimum Integration Time and
maximum Gain. If saturation occurs, then we
must turn the Gain down a notch, since the
Integration Time is already at its minimum.
Gain has four steps-60, 16, 4 and 1. Once
we have a conversion with no saturation,
the Gain is now valid, and we can ramp up
the Integration Time until saturation again
occurs.
The Integration Time has 256 steps 1-256
cycles (where 0=256). It could take a few
seconds to try all possible steps. As each
step increases the Integration Time, the
conversion time also increases. While you
could shorten the potential number of steps
by using a different algorithm, I will keep this
as simple as possible and just increase by a
single step until saturation occurs, and then
back off 1 step (count). We should now be
at the maximum Gain and Integration Time
without going into saturation.
LUX a. COLOR TEMPERATURE
lux and calor temperature calculations can
be performed on any unsaturated conversion.
ABOUT THE AUTHOR
Jeff Bachiochi (pronounced BAH-key-AH-key)
has been writing for Circuit Cellar since 1988.
His background includes product design and
manufacturing. You can reach him at:
j eff.bachiochi @imaginethatnow.com or at :
www.imaginethatnow.com.
Additional materials from the author are available at:
www.ci rcu itcellar.com/a rticle-materials
References [1] and [3] as marked in the article can be found there.
RESOURCES
Adafrui t I www.adafruit.com
ams I www.ams.com
Espressif Systems I www.espressif.com
Heltec Au tomation I https://heltec.org
PacTec Enclosures I www.pactecenclosures.com
The previous configurations changes have been
done to optimize the conversion values for the
best possible accuracy when calculating the
lux (intensity) and calor temperature (surface
temperature in Kelvin). The intensity of light
hitting the sensors (RGBC) can be translated
into a value that closely matches the human
eye, by totaling the adjusted red, green and
blue conversions and applying a device factor.
You can see that as long as the color outputs
stay in proportion to one another, the lux has
virtually no effect on the Color Temperature,
which is essentially a ratio of blue to red
values.
So far, we've needed a PC connected to the
TSC3472x to get a conversion. Heltec makes
a DIP-style Arduino with an integrated 4x20
graphic display for around $10 that is based on
the Espressif Systems ESP8266. The ESP8266
has Wi-Fi, which we won't be using here, but
otherwise it is perfect for this project, as you
will quickly see. I did use Adafruit's support
for its SSD1306 display, because Heltec's
library doesn't have good text support. No
special changes to the Arduino program are
necessary, beyond that of the display support.
However, I want to make this simple and the
menus will have to go. Well ... not really.
I want to use two functions in conjunction
with the display. I want the user to be able
to start an automatic conversion, and also
have control over the LED. To do this, I need a
couple of push buttons and a way to convert the
button push into a simulated menu selection.
This was done in the getUserlnput()
routine that collects keyboard input.
Normally, execution is waiting here for you to
enter characters (menu choice). I added two
d i g it a l Re ad () tests-one for each button.
A button press (grounded input) forces exit
of the get User Input() routine, returning
the character "4" (Toggle external LED) or "9"
(Sample and auto adjust). Other than how
these buttons produce virtual keyboard input,
nothing else changes.
Although the display is graphic in nature,
you have control over every pixel on the
screen. I am using it as a four-line-by-20
character display. Sign-on messages are
produced on the first two lines, and the second
two lines are used to show the progress of
the conversion process. This should end up
with a display as shown in Figure 7 when
the conversion is complete. To produce text
characters, the library routine is responsible
for providing the character glyph (picture) of
each character, as well as where to place the
character within the display's screen.
The SSD1306 uses separate display
and buffer spaces. This allows the user to
completely draw a screen in the buffer space
before transferring it to the display space.
Updates therefore look instantaneous. The buffer remains
intact, and you may continue to add to it or clear it in
preparation for new text (or graphics).
PORTABLE
Up to this point we've received power from the USB port,
while attached to the PC. We added buttons to make it a
stand-alone device, but we must do something about power!
The Heltec device not only has a battery input, but also-
because everything works on 3.3V-a single cellli-lon battery
is a perfect mate. The Heltec Wi-Fi Kit 8 also has a Li-lon
battery charger built in to truly make all of this work with 11no
strings (or wires) attached."
I mounted the Wi-Fi Kit 8 in a PacTec enclosure (Figure 8).
I wanted to be able to aim the sensor independently from
the display, and found an itty-bitty book light that looked
like it would work well. The four-wire sensor cable had to be
replaced with a couple of pieces of flat cable that I zipped
down to two conductors wide. These could be fed through
the sensor arm quite nicely, without any pinching to the
wires.
To test this rig out, I got up before sunrise to make an
early morning reading before the sun broke the horizon. Look
back at Figure 7 for this sample. You'll note the Lux value
is less than 1 and the calor temperature is 4,382K. This is
just what I would suspect for sunrise. A clear, mid-day sky
produced a high calor temperature of 5,732K. You get a good
sense of the many shades of white while driving at night. The
range in calor temperature for various styles of headlights is
3,000K to more than 12,000K!
University of l(~
CINCINNATI IONLINE
ci rcuitcellar. corn 67
FIGURES
I used one of the enclosure boxes from PacTec that I already had. Although it was
a little large, once I added buttons and the Li-Ion battery (which fit nicely in the gv
battery box), it was fine.
Picking out a perfect shade of white is a nightmare come
to life. Pure white? Off white? Simply white? Benjamin Moore
has more than 35 shades of white! The shade of white (or
other calor) you apply to your walls will greatly influence the
way you feel in that room.
Remember to wash your hands! Too much to do, too
little time. e
W elcome back to "The Darker Side." As electronics designers, we all know what a wire is
and how it works, right? If we
connect a wire from A to B, a current can flow
between these two points. If we then disconnect
the wire from B, no current can flow. The wire
becomes useless because one of its ends is
open.
True? Well, not always. If you don't know
why, then keep reading because this will
be my topic this month. More precisely, my
goal is to explain what a stub filter is, and
how to build one. I will also show you that
you may inadvertently make such a filter, for
example with an improper printed-circuit
design. This may jeopardize the performance
of your project, at least if you are using high
frequencies or fast digital circuits.
Finally, and as usual, I will not use math
to convey these principles, but rather words
and small experiments. So, the good news
is that this article should be easy to read.
The downside is that my explanations will
approximate. Anyway, I hope that you will
catch theimportant points. I will provide
some resources for further reading, if you
want to dig more deeply into the subject.
SINE+SINE = 0
Let's start with a very simple mental
experiment (Figure 1). Assume that you have
a sine-shaped signal propagating on a wire.
Such a signal has a given wavelength, usually
noted as A. (the Greek letter, "lambda"). This
wavelength is the propagation speed of the
signal along the wire, divided by the frequency
of the signal. On a wire, or more exactly on
a so-called transmission line comprising the
wire and the accompanying current return
path, the propagation speed will be close to
the speed of light in free space, c, which is
300,000,000m/s.
Now, imagine that we delay this signal by
half the wavelength. We get the same sine
signal, but with an opposite phase. What
happens if we then sum the original signal
and its copy delayed by A./2? Naturally, they
will cancel out, and the result will be zero-a
null signal.
I'm sure you've followed me up to this point,
right? So, you will also easily understand that,
rather than delaying by 'A./2, we would get the
same result if we delayed the signal twice-
each time by 'A/4. Now look at Figure 2 for an
easy way to do it. The signal is coming from
the left, and is virtually split into two parts.
Half of it continues to the output on the right,
whereas the other half goes into a wire that
introduces a A./4 delay. Assume that there is
a reflector at the end of this wire. The signal
will then be reflected back on the same wire,
will be shifted again by A./4 on its way back,
and will be merged with the original signal. As
in my example above, this adds the signal and
a copy shifted by half a wavelength, and we
should get zero.
You may wonder how to actually make
such a signal reflector, but long-time readers
will remember an article I wrote several years
ago called nTime Domain Reflectometryn
(Circuit Cellar 225, April 2009). When a
signal propagates on a transmission line and
encounters an impedance mismatch, part of
it is reflected back to the source because it
can't go anywhere else. And, ifthe impedance
mismatch is 100%, then the full signal is
reflected back. There are two easy ways to
make a perfect impedance mismatch: An
open circuit (infinite impedance) or a short
circuit (OQ impedance). The difference is the
phase of the reflected signal-an open circuit
reflects without any phase change, whereas a
short circuit inverts the phase.
Let's summarize. Figure 2 seems to show
that if we have a transmission line and add a
wire connected to nowhere (open circuited),
we may cancel the signal if its length is
equivalent to a quarter of the wavelength. Is
it for real? You bet it is! Such a short wire to
nowhere-or more precisely, a transmission
line with open end-even has a name. It is
called a nstub.u
QUCS TO THE RESCUE
Why not start to check if it is working
using simulation software? Here, I propose to
use QUCS (Quite Universal Circuit Simulator),
a very good, free and open-source circuit
simulation software. Don't hesitate to
down load it and reproduce the example shown
in Figure 3. It will take you no more than half
an hour. QUCS can do plenty of things, but
in particular, it can model transmission lines
and run so-called S-parameter simulations.
I selected a signal source, P1, from the
tool box, connected it to two SOQ transmission
lines in series, and plugged the other end
to another source, P2 (Figure 3). This may
seem awkward, but for an S-parameter
simulation, all ports should be connected to
signal sources. The system then simulates
the propagation paths from one source to the
other. For example, the propagation from P1
to P2 is noted 521, or 5[2,1] in QUCS' syntax.
Finally, I added a 37.5mm, open-ended
transmission line as illustrated, making a
T-shaped circuit. I then gently asked QUCS to
calculate 521 with a signal frequency ranging
from 100MHz to 8GHz, and to plot it with a
decibel scale, thanks to a short equation that
converts volt ratios to dBs.
The resulting graph is depicted on the
bottom of Figure 3. What do we see? For
low frequencies, the transmission is OdB,
which means no loss. Not a surprise, since
even a wire with an open stub does transmit
electricity. However, what happens at a
frequency of 2GHz? The transmission is close
to 0 (-40dB, which means that only 10-40/10 =
1/10,000 of the power is transmitted). Why is
this happening at 2GHz? Simply because the
ci rcuitcellar. corn 69
SUM = O
FJGURE 1
The sum of two sine signals cancel out if one is shifted by half a wavelength.
A/4
FJGURE 2
Reflector
(in phase)
A/4
---.. } suM ~ o
A shift of half a wavelengtn can be made with a quarter wavelength stub, ended by a perfect reflector.
• • - --• - --I ~ .1--- -
+ • --.... --
FJGURE 3
""""" P1 IJnol
- Z~OIIM
Zo600Mt L•IOO,.,
---11011 . .......,
P2 -z~a..
........
Here is a QUCS simulation of an open stub (line 3, 37.5mm long). The response shows a null in the
transmission close to 2GHz.
70 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE 4
open stub is 37.5mm long, and that 37.5mm
is a quarter of the wavelength for 2GHz1 !..=
c/f = 300,000,000 m/s I 2,000,000,000Hz =
0.15m, divided by 4, or 37.5mm. A word of
caution here: QUCS assumes by default that
the propagation speed is c. On a real cable it
will be a little lower, maybe 80% or 90% of c,
but you get the idea.
So, such an open stub in fact makes a
band-reject filter. It passes the signals, except
close to 2GHz where the attenuation is very
high. If you look again at Figure 3, you will
see that there is something interesting when
Reflector
(phase inverted) 'A.
)\/2
(\j\_;
. . . . .
. . . .
CXX)
. . . . . .
A null can also be achieved with a phase-inverting reflector like a short circuit, but this time with a half-
wavelength stub.
~·: @ .,_ -• • I - --• - -I «; ;... - --• • ._ __ ....
il --
FIGURE 5
l!9!!!!!!'n ':'
~~
dBS21 odiiC Sfl.lll
d8S 11001115{1, IJ)
""""""" P1 U.1
,._, z·~a.
Z•~Oin l•IClO ...
A QUCS simulation of a short-circuited stub. See the zero transmission at OHz as expected.
••
the frequency continues to increase. There
are other frequencies where the attenuation
is very high, precisely at 6GHz, 10GHz and
every 4GHz thereafter (although not shown in
the Figure 3 graph). I'm sure you will easily
discover why.
Here's the trick:
3 X 2 X f../4 = f.. + 2 X 'A./4 ...
Up to now, I have used open-circuited
stubs, which are reflecting the signal in
phase. In contrast, what would be the effect
of a short-circuited stub? Well, nearly the
same, but with a twist. A short-circuited stub
introduces a 180-degree phase shift to the
reflected signal. A cancellation of the signal
is still possible, but this time with a 'A./2 long
stub rather than 'A./4 (Figure 4). Two times
'A./2 is 'A. so the propagation back and forth
is in phase, and the short-circuited reflector
inverts the phase. Therefore, the sum is zero
again .
I modified the QUCS simulation to show
you what happens with a short-circuited stub.
Figure 5 is exactly the same design as the
one we previously discussed, but now with
a short to ground at the end of the 37.5mm
stub. The first null is no longer at 2GHz but at
4GHz, because half the wavelength is 37.5mm
at this frequency, as expected. The signal is
now canceled at 4GHz, 8GHz and so forth. The
simulation also shows you an important point.
With a short-circuited stub, there is also a zero
transmission at a frequency of OHz, meaning
for DC signals. That's clear if you look again
at the design. The stub is a short circuit, so
no DC current can flow because it is short-
circuited to ground.
TO THE LAB
Simulations are nice, but wouldn't it be
preferable to see an actual experiment? With
that in mind, I went to my company's labs
and switched on our Keysight Technologies
N5230A vector network analyzer. This nice test
instrumentis, in fact, doing exactly the same
as the QUCS simulation described earlier. It
injects a signal of varying frequency into a
device under test, and plots its transmission
and reflections on a graph. For a quick
demonstration, I simply interconnected two of
its ports with a short coaxial cable, and added
a SMA T adapter, ended with a 3cm SMA/SMA
adapter, to simulate a 37mm open transmission
line (Figure 6). I pressed some buttons, and
voila! The result is shown in Figure 7. Very
dose to the simulation isn't it? Cool, so that's
actually real! Here the first null was measured
at a frequency of 2.0GHz, and the second at
6.16GHz. This is not exactly 6GHz as expected,
probably due to some parasitics somewhere.
OK, I must admit that I am a bit lucky to
have such expensive test equipment on hand.
So, I wanted to find a way for you to reproduce
the same experiment with equipment you will
have on your bench, or that you could buy
for reasonable prices on eBay. And this is
indeed easy! The key is to get far down in
frequency. Going to lower frequency means
longer wavelengths, and therefore longer
cables as stubs.
What wou Id you need to do the experiment?
First, you will need a long length of coaxial
cable to make a long open-ended stub. The
longer the better. I found a lOm long cable
on my bench, so it should cut frequencies of
wavelength close to 40m ('M4 = lOm), which
means f = cf'A. =7.5MHz, or, more exactly,
around 6MHz. That's because the propagation
speed in the cable is not the speed of light,
but rather 80% of it. Next, you need a signal
generator able to go up to 6MHz. If you don't
have one, building one is a nice exercise!
Finally, you will need a way to measure the
transmitted signal, and the easiest way is
to use an oscilloscope. It could be a very
cheap one, because lOMHz of bandwidth is
enough. On my side, I used a Keysight 33521A
generator and a Keysight DSO-X 3024A
oscilloscope, but they are truly both overkill
for this job.
Now, switch on the equipment, start with
a frequency of OHz and slowly increase the
frequency. Take a piece of paper and plot the
transmitted power versus frequency, and you
will find a null at 6MHz! The plot can be done
manually or, if you are lucky, by switching
the frequency generator to sweep mode as I
did. This allows you to get the plot directly
on the oscilloscope, if you trigger it carefully.
Looking again at Figure 8, the scope shows
the envelope of the transmitted signal from 0
to 20MHz. Two nulls are clearly visible, close
to 6MHz and 3X6 = 18MHz, as expected.
PRINTED CIRCUIT BOARDS
I talked about the effects of open-
circuited wires or coaxial cables, but the same
phenomenon exists for any kind oftransmission
line. In particular, it will happen if you design
a PCB and leave a short copper trace open-
ended. This might or might not be an issue, as
we will see in a minute, because it all depends
on the signal frequency and trace length.
Another simulation may be welcome here.
Rather than using QUCS again, I switched to
another and a bit more complex tool: Sonnet.
This software is neither open source nor
free, but a free, limited Sonnet Lite version
is available from Sonnet Software's website.
Unlike QUCS, Sonnet is not a circuit simulator,
but rather an actual electromagnetic
simulator. It uses a so-called planar or 2.50
ci rcuitcellar. corn 71
FIGURE 6
This open-drcuited SMA T adapter implements a short open stub.
FIGURE 7
Here is the actJ.Jal measurement of an open stub on a vector network analyzer.
FIGURE8
The same experiment can be done using far simpler equipment, here at 6MHz using a lOm-long coaxial
cable as a stub.
72 CIRCUIT CELLAR • OCTOBER 2020 #363
0
... _
\(\(
.. 0 _.. <>-
·5 -- .. - I g · 10
I ~ · 15 - • I ID I • ·20 ~ ..
I I
I dB I
·25
-30
0 2 3 4 s e • • 10
~r-(OIU) ........... ___
FIGURE 9
Sonnet Lite can simulate PCB
structl.lres like this open-circuit.
20mm stub, showing a first
transmission null at 1.82SGHz.
TOPB ..
il
fR~
GND
Cl u or .lrdg mou~• to roadoot dolavalue;
FIGURE 10
model. The design to be simulated must be
modeled as parallel dielectric layers, with
metal structures between each layer. This is
more limited than a full 3D simulator, but far
faster in terms of calculations. This is good
enough for PCB simulations.
The example I made with Sonnet Lite is
shown in Figure 9. On the far left you can see
the layer structure- a 1.6mm FR4 substrate
and air on top of it, with a full ground plane on
the bottom layer. I then drew two rectangular
copper traces on the top side of the PCB-one
from port 1 to port 2, and one open-ended
stub. The traces are 3mm wide, which is a
good width for a SO.Q transmission line on a
[l .m
"
An analysis of the current through each copper trace allows us tn visualize the cancellation of the waves at
the junction point at a precise frequency.
1.6mm thick FR4 PCB. (See my previous article
on the subject: "Microstrip Techniques,"
Circuit Cellar 223, February 2009.) The length
of the open-ended trace is 22mm.
I then ran the simulation, and a couple
of minutes later, I got the nice plot shown in
Figure B. Very close to the theory again! Here
the first null is at 1.825GHz. Since the open
trace is 22mm long, we would expect a null
for a wavelength of BBmm, so a frequency of
3.4GHz. However, the propagation speed on
a FR4 substrate is far lower than the speed
of light. The ratio is, in fact, the square root
of the so-called effective dielectric constant
of the trace. With such a trace on FR4, this
ratio is close to 1.8, and this explains why a
22mm trace is equivalent to a quarter wave
at 1.825GHz.
The Sonnet simulation also shows that the
other nulls, higher in frequency, are lower
and lower in terms of attenuation. This effect
is dearly visible in the graph in Figure 9, and
is due to the losses in the substrate, well
simulated by the tool. Finally, such a simulator
can represent the currents on the traces at
any frequency, using a calor grading scheme.
What's happening at the null frequency of
1.825GHz is shown in Figure 10. This figure is
helpful for understanding that the incoming
and reflected signals are canceling out at the
junction point, with a quarter wavelength
exactly equal to the trace length.
Once again, don't hesitate to download
Sonnet Lite, and try to reproduce this example
for yourself. You will learn a lot, even though
you will probably need to spend time learning
the software through the available tutorials.
MURPHY, UNFORTUNATELY
Stubs, intentionally designed using open-
or short-circuited transmission lines, are
actually used to build radio-frequency filters,
and now you know how. Several stubs, well
designed and with proper separation between
them, can be used together to implement
far more complex responses than the basic
examples I've illustrated. This may bring us a
little too far for this article.
That said, I would like to share with you that
you may also build stub filters unintentionally.
How? Imagine that you design a kind of
2.4GHz transmitter-maybe Bluetooth-using
an IC and some passive components around
it. You must design two variants of your
product, using two different kind of antennas.
Say one is ended with a SMA connector, and
the other is a dipole ended with a differential
flex cable. Maybe you would design a PCB like
the one illustrated in Figure 11a. Warning-
this is not an actual design, just an illustration
for this article. Here the transmitter circuit
is supposed to be on the lower left, and the
antenna trace goes simultaneously to the
SMA connector, Jl, and to some components
feeding the flex cable connector, 12. That's
clever, because, depending on the need, you
will solder either Jl or 12 and its passive
components, so you will have only one PCB
and two versions. Right?
Wrong! This would be a very, very bad
idea, and I'm sure you nowknow why.
Imagine that you populate only the connector,
ll, and leave J2 and the small accompanying
passive unpopulated. OK, but the trace going
from Jl to the pads planned for R7 and R9
FIGURE 11
will be an open-ended trace. It will therefore
act as a stub, and will cancel out signals with
frequencies for which its length is a quarter
ofthe wavelength. And, do you know what will
happen? Murphy's Law states that everything
that can go wrong will go wrong. So, for sure,
the frequency that will be canceled will be
exactly the frequency you want to use. And
your design will simply not work-all because
of a short open-circuited trace.
What would be a good solution? Simply
avoiding any open-circuited stub on any high
frequency line. Figure 11b shows a possible
way. Here I added two OQ resistors, RlO and
Rll. These two components are positioned
exactly at the Y junction between the two
intended paths. Of course, only one of them
will be populated. Therefore, there will be
no open-circuit line at all, and no Murphy-
related risk. For the lowest possible risk, it is
indeed a good practice to share a single pad
between the two components, RlO and Rll,
as illustrated, thus avoiding even a lmm stub.
WRAPPING UP
Here we are. As always, I have only covered
the basics, and with simplified explanations.
Stubs can be used to make any kind of filters or
impedance-matching networks, especially at
high frequencies. Stubs can also be the source
of serious headaches for the incautious PCB
designer. So, knowing what they are about is
crucial. This is true not only for high-frequency
(Left) A wrongly designed 2.4GHz transmitter PCB. (Right) A greatly improved version, avoiding stubs on the RF trace
ci rcuitcellar. corn 73
74 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE 12
This HP532A frequency meter is actually an adjustable short-circuit stub.
ABOUT THE AUTHOR
Robert Lacoste lives in France, between Paris and
Versailles. He has 30 years of experience in RF
systems, analog designs, and high speed
electronics. Robert has won prizes in more than 15
international design contests. In 2003 he started a
consulting company, ALOOM, to share his passion
for innovative mixed-signal designs. Robert's
bimonthly Darker Side column has been published
in Circuit Cellar since 2007. You can reach him at
rlacoste@alciom.com.
For detailed article references and additional resources go to:
www.circuitcellar.com/article-materials
RESOURCES
Keysight Technologies I www.keysight.com
Sonnet Software I www.sonnetsoftware.com
designs, but also for high-speed electronics.
A fast, digital signal with nanoseconds-
long transitions should be treated with
the same care as a radio-frequency signal
in the gigahertz range. Put simply, a PC
motherboard with its multi-Gbps PCI express
links will never work with uncontrolled stubs
or bad PCB routing! And even if you are not
designing PC motherboards, I'm sure that you
encounter fast digital transmissions often.
For example, USB is replacing RS-232 links in
many systems-and the frequency range is
not exactly the same.
To close, I can't resistthe pleasure of showing
you an old test instrument that is actually
based on a stub-like structure (Figure 1Z). It
is a Hewlett Packard HP 532A frequency meter
from the 1960s, borrowed from my colleague
YannickAvelino. (Hewlett Packard later became
Agilent and then Keysight). How does such a
frequency meter work? At the bottom of the
device, there is a transmission line. Here it is
made with a waveguide, but this is the same
as a wire transmission. The transmission line
is ended by a diode detector, clearly visible on
the right side.
On top of this transmission line, there is
a vertical tube, which is an adjustable cavity.
This cavity is the waveguide equivalent
of a short-circuited stub. Its length can
be adjusted, thanks to a precision helix
associated with a calibrated dial. The use
is then straightforward. The user injects a
signal of unknown frequency and turns the
knob, while looking at the power measured
by the diode detector. At a given position,
the signal on the detector will be drastically
attenuated. At that precise point, the cavity
length corresponds to half a wavelength, and
the dial directly indicates the corresponding
frequency-up to 26GHz! Who said that
microwaves have to be complicated?
I hope that you liked this small introduction
to stubs. I encourage you to read the articles
on Circuit Cellar's article materials webpage.
More importantly, I urge you to play with
stubs, using either simulators or actual
experiments. Don't be afraid. It will be fun,
and you will learn a lot! e
Module Speeds Medical Ventilator Designs
Trinamic Motion Control, now part of Maxim Integrated, has announced the
TMC4671+TMC6100-TOSV-REF design board, a BLOC serve driver capable of 12V to
36V with up to 6A RMS to accommodate medical ventilator and respiratory system
design. The reference design shows engineers how to build medical ventilators
using readily available components, bypassing the longer lead times of traditional
components. To shorten design cycles, the open-source module features a session
border controller connector in Raspberry Pi style and space for a pressure sensor
add-on board.
The reference design board includes a Hall sensor interface and connectors
for an optional pressure sensor add-on board. As a result, important pressure
data can be directly visualized on a Raspberry Pi with touch screen using the free
firmware developed by Trinamic for the reference design board.
Thanks to the embedded TMC4671 serve controller IC, the module generates a
pulse-width modulation (PWM} frequency and a current controller clock of 100kHz
independent of the microcontroller. The complete TMC4671+TMC6100-TOSV-REF
reference board is available now through Trinamic's distribution channels. All
hardware, firmware and software are open source under the MIT license.
Trinamic Motion Control 1 www.trinamic.com
Automotive Grade Step-Down DC-DC Converters
c·rrcuitcellar.com 75
PRODUO NEWS
Dialog Semiconductor has announced the DA913X-A product family, a new line of highly efficient, high-current, automotive-
grade, step-down DC-DC (Buck} converters. The highly integrated DA913X-A devices require fewer external components than
competing solutions, enabling a low system BoM cost and a reduced
solution footprint. The devices operate at efficiency levels above 90%,
reducing the thermal design challenges for powering high-current
rails in a wide range of automotive systems, including infotainment,
navigation, telemetry and Advanced Driver Assistance Systems
(ADAS).
The DA913X-A family is comprised of three devices configured
as single- or dual-output buck converters. The DA9130-A operates
as a single-channel, dual-phase buck converter, delivering up to a
lOA output current. The DA9131-A integrates two single-phase buck
converters, each delivering up to SA output current. The DA9132-A
also integrates two single-phase buck converters, each delivering up
to 3A output current. The DA9130X-A devices are AEC-QlOO Grade 2
qualified and are available in a 3.3mm x 4.8mm a 24-pin FC-QFN
wettable flank package. Industrial/commercial grade versions are
also available.
Dialog Semiconductor 1 www.dialog-semiconductor.com
Buck Boost DC-DC Converters Deliver 300W
TDK has announced the addition of 12.5A 300W rated models to the i7C
non-isolated DC-DC converter series. With an input range of 9 to 53Vdc, the
output can be adjusted from 5 to 28V. The i7C topology enables a seamless
transition from buck (voltage reduction} to boost (voltage increase}
operation. The series is well suited for generating additional high-power
outputs, from existing 12, 24, 36 or 48V system voltages.
Efficiencies of up to 96% minimize power losses, allowing the product
to operate and deliver high useable power in demanding thermal
environments,says TDK. Under light load conditions, the i7C's control
techniques significantly reduce power dissipation. All models are certified
IEC/UL/EN 62368-1, 60950-1 and carry the CE mark for the Low Voltage and
RoHS Directives.
TDK-Lambda I www.us.lambda.tdk.com
76 CIRCUIT CELLAR • OCTOBER 2020 #363
PRODUO NEWS
Software for STM32 MCU Condition Monitoring
STMicroelectronics (ST) has released a free STM32
software function pack that lets users quickly build, train
and deploy intelligent edge devices for industrial condition
monitoring using a microcontroller Discovery kit. Developed in
conjunction with machine-learning expert and ST Authorized
Partner Cartesiam, the FP-AI-NANOEDG1 software pack
contains all the necessary drivers, middleware, documentation
and sample code to capture sensor data, integrate and run
Cartesiam's NanoEdge libraries.
Users without specialist AI skills can quickly create
and export custom machine-learning libraries for their
applications using Cartesiam's NanoEdge AI Studio tool
running on a Windows 10 or Ubuntu PC. The function pack
simplifies complete prototyping and validation free of charge
on STM32 development boards, before deploying on customer
hardware where standard Cartesiam fees apply.
The FP-AI-NANOEOG1 function pack is available now at
www.st.com. The STM32l562E-DK Discovery kit contains
an STM32L562QEI6QU ultra-low-power microcontroller, an
iNEMO 30 accelerometer and 30 gyroscope, as well as two
MEMS microphones, a 240x240 calor TFT-LCO module and
on-board STLINK-V3E debugger/programmer. The budgetary
price for the Discovery kit is $76.00, and it is available from
www.st.com or distributors.
STMicroelectronlcs I www.st.com
• l::, .1./::•m~~ • .. ,.,
... -·
<:> " : .. . . . • • . .. r:~ e :o~ .. ~- . _:.•: ·!- -. •
FP-AI-NANOEDG 1
to learn and monitor equipment health
MCU Solution Targets Micromobility Designs
Renesas Electronics has introduced what it calls its 48V
Mobility Winning Combination Solution that helps engineers
accelerate the development of e-scooters, e-bikes, UPS and
Renesas Reference Design for Electric
Mobility Solutions
energy storage systems. This reference design uses a modular
approach in both hardware and software to showcase core
and optional functional blocks that can be adopted for many
24V-48V micromobility applications such as lawn mowers,
electric carts, robot cleaners, power tools, power banks and
more.
It also uses 15 Renesas ICs, including three key devices:
the ISL94216 16-cell battery front end (BFE), robust HIP2211
100V MOSFET drivers, and RX23T 32-bit microcontroller (MCU)
for motor control. The 48V mobility winning combination
solution is powered from a 25A-hour Li-ion battery that drives
a 1600W inverter to attain speeds up to 5,000rpm.
The ISL9421616-cell BFE is available now in a 64-lead QFN
package from Renesas' worldwide distributors, and is priced
at $2.99 USD in 1,000-unit quantities.
Renesas Electronics 1 www.renesas.com
Low Power Dual-Core MCU Serves Up BLE 5.2
Maxim Integrated Products has announced the MAX32666,
an ultra-low-power dual Arm Cortex-M4 MCU with floating-
point unit (FPU) and Bluetooth Low Energy 5.2 (BLE 5.2).
Its battery life is extended by combining robust memory,
security, communications, power management and processing
functions traditionally performed by multiple MCUs into a
single device, says Maxim.
This dual Cortex-M4F MCU provides efficient computation
of complex functions, operating at up to 96MHz. To replace
the need for a separate PMIC, the MAX32666 features an
integrated single-inductor, multiple-output (SIMO) regulator,
which extends the life for small-sized battery applications. The
MCU offers BLE 5.2, supports up to 2Mbps of data throughput
and long range (125kbps and 500kbps) and offers transceiver
output power of +4.5dBm programmable down to -95dBm.
The MAX32666GWPBT+ is available at Maxim Integrated's
website for $5.22 (1000-up, FOB USA); also available from
authorized distributors The MAX32666EVKIT# is available at
Maxim Integrated's website for $157.50.
Maxim Integrated I www.maximintegrated.com
The Directory of
PRO & SERVICES
Advertisers must furnish digital files that meet our specifications (circuitcellar.com/mediakit).
All text and other elements MUST fit within a 2" x 3" format.
E-mail adcopy@circuitcellar.com with your file.
circui tcellar.com 17
For current rates, deadlines, and more information contact
Hugh Heinsohn at 757-525-3677 or Hugh@circuitcellar.com.
,.
~~ Technofogic
" Systems
ter
TS-7250-V2
1 GHz ARM Computer with
Customizable FPGA-Driven
PC/1 04 Connector
and Several Interfaces
at Industrial Temp
ADuC841
M icrocontroller
Design Manual
0
12c Bus
Adapters
CE
USB I Ethe rne t I RS-232
Free
Visual Studio, Lab VIEW & ASCII AP!s
Win, OSX & Linux Drivers
Msg & EEPROM Program Apps
Sw itch Selectab le Options
Voltage Sense (O.Sv to Sv)
Power Source l OOmA (3.3v or Sv)
Pull-Ups (Enable/Disable)
0 /R V lt & ESD P t et'
shop-mcc-us.com
78 CIRCUIT CELlAR • OCTOBER 2020 #363
Answer 1- The total power dissipation is specified as
lmW, and the supply voltage is 1.5V. This means that
the total current consumption of both paths (base and
collector) can only be 666.7~-JA.
The "forced W' is specified as 10, which means that
10x the base current flows through the collector. This
means that Ib must be 60.61JA and le must be 606.11-JA.
Since Vc:E(satJ is 0.2V, the collector current must
produce a voltage drop of 1.5V- 0.2V = 1.3V across Re-
Therefore, Re: must be 1.3V I 606.11-JA = 2,145Q.
Similarly, since V8E is 0.2V, the base current must
produce a voltage drop of 1.5V - 0.7V = O.BV across
Re+ R8• Therefore, the total resistance must be O.BV I
60.61JA = 13.2 kQ, and the value of RB must be 13200
- 2145 = 11055 n.
The closest standard E96 values are 2.15kQ and
11.0kQ, respectively. Using E12 values of 2.2kQ and
12kQ yields currents of 5911JA and 56.31-JA, for a forced
~of 10.5.
Answer 3- The simplest way to have an arbitrary
number of inputs is to add both a transistor and its base
resistor for each additional input. All of the transistors
would share the same load (collector) resistor.
Answer 2- Yes, you could build a 2-input NOR gate
with just one more resistor.
Clearly, there would be no problem when both inputs
are high or both inputs are low. However, the situation
where one input is high and one input is low presents
a problem.
Just like with the inverter, the high input drives about
611JA into the base of the transistor, which sits at about
0.7V. However, with the other input low (at 0.2V), the
other base resistor steals about {0.7V - 0.2V) I 11 kQ =
451JA away, leaving only about 161JA for the transistor.
Now the transistor must have a minimum P of 6061JA I
161JA = 38 in order to remain saturated.
However, you could not add a third input this way.
A single high input would not be enough to turn the
transistor on.
Answer 4- Each additional input connected to the
output of the gate draws more current through Re, but
this current must be shared N ways, so the current
available to each input drops.
Table 1 shows that even with up to 8 loads, the input
current to each gate only drops by about half, requiring
a minimum P of about 20. ..... ,..... .... ..... .... Input
1 6lj.IA 6lj.IA
2 105j.IA 52j.IA
4 163j.IA 41j.IA
ci rcuitcellar. corn 79
The Future of Modular Edge Processing
Three Real-World Intelligent
Infrastructure Applications
ystems designed for edge
applications need to be highly
flexible. This requires scalable
processing power, which can be
provided most efficiently with computer-
on-modules (COMs). Here, we three
real-world applications-ranging from LoRa
gateways for smart cities to energy grid
servers and video surveillance servers, all
with optional Al-demonstrate the benefits
of this modular approach.
Low-power wide-areanetwork
(LPWAN) technology LoRa is deployed in
many different application areas. Smart
cities build networks on the basis of this
technology to connect smart distributed
devices-for example distributed parking
spaces as well as central multi-story car
parks. Such different parking scenarios are
one example why LoRa gateways need to be
highly adaptable.
LoRa GATEWAYS
Flexible loRa gateway configurations are
also required because they can connect any
LoRa sensor as this wireless protocol needs
no physical connector. This means that loRa
gateways can be used anywhere to cater for
any additional application based on various
mixes of loRa devices. Smart cities can
therefore also use loRa parking gateways
to track their free-floating mobility offers
and to integrate charging infrastructures
into parking guidance systems and so on.
However, extending the tasks of smart city
gateways leads to the need to integrate
scalability for future demands to improve
investment security.
The LoRa FlexGate FGW264 Gateway from
the French company Expemb for example
offers this scalability with COMs (Figure 1).
By using COM modules for the edge processor
demands, the new gateway enables a flexible
hardware and software setup to meet
any LoRa based loT technical challenge-
including artificial intelligence (AI).
The platform supports up to eight LoRa
channels simultaneously to communicate
with several thousand connected objects.
It can further host not only one but two
generations of high-performance and low-
power Intel Atom processors. Such high
scalability beyond dedicated processor
sockets has become possible by utilizing
COMs on the basis of the vendor
independent Qseven specification.
Towards the cloud, the LoRa gateway
offers connectivity with 1 Gbit Ethernet
and 3G/4G.
SMART CHARGING
INFRASTRUCTURE
Edge systems requiring more hybrid
local connectivity will need more 1/0
flexibility. But even in such scenarios, the
modular approach is a great fit for edge
computers as we can see in China's recent
edge layer deployments. China is currently
deploying an edge layer for a distributed
management system for smart grids in
cooperation with Tencent's Energy loT
Partner (Figure Z). Such an edge server
design in a smart city infrastructure context
is quite interesting, as e-mobility has a
bright future. E-mobility requires charging
infrastructures that must be fueled by
regenerative energies to improve the
ecological footprint.
Regenerative energy is generated in
local micro grids or distributed virtual grids;
and those grids need smart edge devices,
capable to manage the decentralized
processes in real-time. Once the Chinese
edge layer service is fully available, it
will support thousands of power devices,
• 2!!:3!
'": 11 rr: 1 J ~- .. -. . . ..
)·:.;~~'-· . . , f • I ·u
.... ( .; '. . . j ' ..... . ,.,. ., ·- -· -
• •·.. l .... . r p
j , • : •
Dan Demers,
congatec
FIGURE 1
The LoRaWAN FlexGate FG264
Gateway from Expemb is designed
with Qseven ffiMs.
80 CIRCUIT CELlAR • OCTOBER 2020 #363
, ~ --
FIGURE2
The first loT edge router designs in China's edge layer for smart grids are based
on congatec Server-on-Modules with Intel Xeon DlSxx processors. Alternative
configurations are based on the Intel AIDm Oxxx processors.
FIGURE3
The Christmann microserver family for rack systems is scalable with both COM
Express Type 6 and COM Express Type 7 Server-on-Modules as well as standardized
GPGPU cards and FPGA modules.
hundreds of power protocols and online editing of common
standard protocols as well as dynamic completion of common
standard device types. Such a comprehensive ecosystem could
be highly interesting for many worldwide deployments.
For the adaptive hardware of the new class of edge devices,
the edge server designers have chosen a flexible system design
based on COM Express Type 7 modules. These modules offer
server-grade performance and functionality on a standardized
form factor. First systems are based on modules with Intel
Xeon D1Sxx processors with up to 16 cores and 32 threads.
Alternative configurations are based on the Intel Atom C3xxx
processors. Featuring up to 16 cores, those processors are the
ideal fit for all installations that have to handle smaller package
sizes in parallel while consuming as little energy as 25W TOP.
SITUATIONAL AWARENESS
In rack server designs, standardized COMs can drastically
cut the long-term investment costs for infrastructure servers
used in connected smart city applications such as video
surveillance systems that are being equipped with AI to
improve situational awareness and public safety. For such
microserver installations at the infrastructure edges, vendors
such as Christmann also rely on Server-on-Modules based on
the vendor-independent COM Express Type 7 as well as the new
COM-HPC standard (Figure 3).
What speaks in their favor is not just the flexibility to adapt to
recent AI needs but also the long term perspective: The second
generation-required after three to five years as technology
enhancements evolve rapidly-is expected to cost only about
50% of the initial investment, as a simple replacement of the
processor modules will be all that's required in the majority
of cases.
To open up the potentia Is of significantly reduced TCO, such
rackmount servers can be flexibly equipped with up to 27 CPU
microservers with x86 or Arm architecture. In addition, also
standardized modular options for parallel processing in the
form of GPGPU cards and FPGA modules are possible, which
are physically implemented on a COM Express Basic footprint.
The modular concept makes the Christmann RECS Box 4.0
server family extremely scalable.
MODULARITY AT THE SG EDGE
These three examples illustrate the tremendous benefits of
designing edge gateways and edge servers on the basis of
Computer-on-Modules and Server-on-Modules. For large-scale
applications, even the fusion of modules with dedicated carrier
boards is a common strategy. So why not follow a similar
approach for large-scale applications such as SG edge servers
or for consumer-grade e-mobility vehicles, implementing first
a COM &. carrier design for R&D and later a full custom design
by COM and carrier fusion? Embedded computer vendors such
as congatec are ready to support such a paradigm change
from proprietary designs towards closed-loop engineering
with open modular platforms. e
RESOURCES
congatec I www.congatec.com
Dan Demers holds a B.B.S degree in International Business from Grand
Valley State University, Grand Rapids, Michigan and an M.B.A. from
Ashford University, Clinton, Iowa. Mr. Demers has over 22 years of
experience in embedded computing having worked with Fortune SOD
companies in the Industrial, Medical, and Communications markets.