circuit-cellar-363-2020
circuit-cellar-363-2020
2 CIRCUIT CELLAR • OCTOBER 2020 1363
Ll S INOUil•Y
SOURCEBOOK OniiM "-llllt .._...........,, circuitcellar.com/ac00101t
Renew I Change Address/E-mail 1 Check Status
CUSTOMER SERVICE
1!-tu•: customerservlce4Pclrcuitcellar.ccm
All Electronics Corp. 77 Phone: 434.533.0246
Mlolt Circuit Cellar, PO Box 417, Chase City, VA 23924
CCS, Inc. 77
Postmaster: Send addross changos to
congatec, Inc. 25 OmJit Cellar, PO Box 417, Chase Oty, VA 23924
drcuitx:ellar.ccm/SIJbscription
Micro Computer Control Corp. 77
ADVERTISING
IAR Systems, Inc. C3
Contact: Hugh Heinsohn
Newhaven Display International, Inc. 11 Phone: 757-525-3677
Fu: 888-980-1303
Contact Hugh Heinsohn Entire contents copyright 11:) 2020 by KCK Media Corp.
([email protected], Phone: 757-525-3677, Fax: 888-980-1303) All rights reserved. Circuit Cellar Is a registered trademark
of KCK Media Corp. Reproduction of this publication In
to reserve space in the next issue of Circuit Cellar. whole or in part without written consent from
KCK Media Corp. Is prohibited.
THE TEAM
DISCLAIMER
PRESIDENT EDITOR-IN-CHIEF ADVERTISING COORDINATOR
KCK Media Corp. makes no warranties and assumes no
KC Prescott Jeff Child Nathaniel Black responsibility or liability of any kind for errors In these
programs or schematics or for the consequences of any such
CONTROLLER SENIOR ASSOCIATE EDITOR ADVERTISING SALES REP. errors printed in Circuit Cellar®. Furthermore, because of
Chuck Fellows Shannon Becker Hugh Heinsohn possible variation in the quality and condition of materials and
workmanship at r!!ader-os~mbled projects, KCK Media Corp.
TECHNICAL COPY EDITOR PROJECT EDITORS disdaims any responsibility for the sofe and proper function
FOUNDER
of reader-assembled projects bas~ upon or from plans,
Steve Ciarcia Carol Bower Ken Davidson descriptions, or irlormation published in Circuit Cellar®.
David Tweed
GRAPHICS The irlormation provided in Circuit Celar® by KCK Media
Grace Chen 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
COLUMNISTS the devices described herein under the relevant patent or
other intellectual property law of the reader's jurisdiction.
Jeff Bachiochi (From the Bench), Bob Japenga (Embedded in Thin Slices), The reader assumes any risk of Infringement liabifity fu r
Robert Lacoste (The Darker Side}, Brian Millier (Picking Up Mixed Signals), constructing or operating such devices.
and Colin O'Fiynn (Embedded Systems Essentials} © KCK Media Corp. 2020 Printed In the United States
circuitcellar.com 3
DATASHEET
50 Embedded PCs
Integrated Solutions
By Jeff Child
14 Design
Device
a Wireless Tracking
18 AController
Review: VS Plus Drone Flight
Hands-On Evaluation
By Raul Alvarez-Torrico
SPECIAL FEATURE
TECHNOLOGY SPOTLIGHT
44 Raspberry Pi Roundup
A Bounty of HATs and Clones
By Jeff Child
~ @editor_cc .:31
' a•
@cirtuitcellar 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
transients with a time constant of longer than
a few tens of milliseconds.
ADC NOISE
If we are interested in measuring the noise
suited to the task. Let's see why. In probing a on the power rail, the displayed noise will
power rail with an oscilloscope, you probably include that introduced by the oscilloscope's
want to do one or more of three things: (1) analog-to-digital converter (ADC), your chosen
look at the level of ripple and noise on the rail; attenuation path and the input probe. There
(2) chase fast spikes or switching artifacts or is not much you can do about the ADC noise
(3) look at load transients such as over- or (except buy a more expensive oscilloscope),
under-shoots, settling times and so forth. but the attenuation path and probe noise are
These are all usually millivolt-level signals things we can control. With most oscilloscopes,
riding on top of the DC rails, with periods the lowest noise is achieved when you switch
ranging from nanoseconds to seconds. in the SOn input termination. This is not
You might try to use a standard passive practical with power rail measurements, since
probe with your oscilloscope switched to son would impose a significant load on the
DC coupling, and rely on the vertical offset power supply, and the SOQ input is usually only
controls to center the waveform on screen. rated to :!::SV to limit the power dissipation in
Unfortunately, you will find that at millivolt- the termination resistor.
per-division resolution, you are limited to just A dedicated power rail probe is designed
a volt or two of offset range, so you may not to overcome these limitations. It presents a
even be able to get a 3.3V rail on the screen, relatively high-impedance load to the power
let alone a 12V rail. rail, and provides a means to inject a DC offset
If you flick the AC-coupling switch, you to the signal, so the DC coupling can be used
will be able to get the trace on the screen with high vertical sensitivity. It should have a
with millivolt resolution, but you will have very wide bandwidth, from DC to at least the
just introduced a high-pass filter with a -3dB oscilloscope's bandwidth, be compatible with
cut-off at a few tens of Hertz. You therefore the son input and should introduce as little
will not be able to make much sense of load additional noise as possible.
ci rcuitcellar. corn 7
The commercial units I could find seemed frequency path. I started the design with the
to be specific to each manufacturer's low-frequency path. This can be an ordinary
proprietary active probe interface, and were summing amplifier followed by an inverting
integrated into the oscilloscope's on-screen stage to restore the polarity of the output
user interface. I wanted to see what would signal, as shown in the schematic (Figure 1).
be involved in rolling my own version of a This circuit pretty much designs itself,
power rail probe, so I did a quick survey of because we know the input impedance must
the available units to come up with a basic be 50kQ, and the feedback resistor R2 must
specification for mine. be the same for a gain of -1. If we assume a
split SV supply (±2.SV), then we can choose
1. It should be able to null out DC offsets of R2 to be SkQ for a gain of -10, giving an offset
±20V, and be safe to connect to ±60V. range of ±25V, which is nicely in line with
2. A DC input impedance of SOkQ seems to be our specification. Since we are connecting
the de-facto standard. R2 directly to the wiper of the potentiometer,
3. I aimed for an attenuation of 1:1.2 or the input impedance we will see on the
better, and flat to <ldB over the range DC offset summing input will only be SkQ at the
to lGHz. extremes of the potentiometer.
4. It should accommodate an active signal In the middle, the impedance will be SkQ
range of ±lV, and be designed to operate plus the two "halves" of the potentiometer
into a SOQ load. resistance in parallel, reducing the gain from
5. I set myself an ambitious target of the probe -10 to something less than that. For the SkQ
contributing no more than 10% additional pot I used, the gain of the offset branch is
noise beyond a typical oscilloscope's noise reduced to -8 at the center point. This means
floor. we will have slightly increased sensitivity at
lower offset voltages. This is by no means
DESIGN a bad thing, and the alternative of adding a
This design turned out to be an interesting buffer between the pot and R2 is not desirable,
exercise in low-noise design, and included a because it will add more noise to the circuit.
little bit of AC circuit analysis into the bargain. I Because we are adding a high level of
think it might be interesting to walk through the offset on purpose in this circuit, for once we
highlights of the design process step by step. do not have to be too concerned about the
I did not think a low-noise active circuit input offset voltages or bias currents of the
with a bandwidth in the gigahertz range was op amps we will select. This also means we do
a practical proposition. Instead, I looked at not need to add resistors in the non-inverting
splitting the probe into two parallel signal inputs of the op amps, and can connect them
paths-an active, low-frequency path that directly to our circuit ground. Similarly, for
deals with the DC offset, and a passive, high- the inverting amplifier, we just select R4 = RS
Jl J2
Cl
R6
In 10 Ou1 SW IA
~ C5:1
l OOn
RI l PI
V• • OV•
V-
50k
V• - 81
c~
J-82 47~
R3
Oft>«
....~ .,..._...,.--.~vv......._.~
10V -::::-
·~
u R7 DP.t r-
2
10, 10 DAV99V :
GND
I
~
I
I
I
L .
V- I
Re LEDl
V<
J-a•
OUl
I ~
200 .... SWl8 c1: eel
1P2
I 0 \J..
47~ lOOn+
lOV -:;-
FIGURE 1
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
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 of the Series Parallel
network at resonance.
ci rcuitcellar. corn 9
•m• n-- - - - - -
-
lnsumt Ouo1e
CIJ.!.fii
-
Pr~ee ts as low as 10 PCBs for only 5 USD
10 CIRCUIT CELLAR • OCTOBER 2020 #363
~~
.. ~
•T::." ..,
l!l.. . ~
12. CIRCUIT CELLAR • OCTOBER 2020 #363
D
es1gmng portable trackers In selecting an antenna, you will need to
means facing some unique consider the ground plane requirements and
challenges, including selecting proximity loading of lossy bodies (such as
the right antenna solution. By the human extremities), to be sure that the
their very nature, it is difficult to design for design allows enough space for the antenna to
Global Navigation Satellite System (GNSS) radiate effectively. You may want to consider
frequency bands. Particularly in small devices, the different forms of antenna as well, which
where a whole host of issues can arise during could be a flexible printed circuit, ceramic or
development. Here, we consider the factors an FR4 surface mount chip antenna.
that make a successful design for a tracking
device. ANTENNA DIRECTIONALITY
Portable trackers need to be small enough The antenna within a portable device needs
to be easily carried around and are often to be as omni-directional as possible, so that
used in applications where they are attached it can send and receive signals from anywhere
to another item, or they may be used as a in its environment (Figure 2). This might pose
portable or wearable device for a living being a difficulty because it means that the RF
such as a pet, a child or an adult person. design will need to mitigate interference that
This means that the design needs to be neat could affect the antenna from any direction.
and discrete, because the whole idea of the Choosing the right antenna and arranging
tracker is to provide an inobtrusive way to the components correctly within the device
monitor location. This means that the device becomes particularly important. We have
is likely to be small, and the antenna that sometimes seen trackers where the RF
drives it should also be small (Figure 1). If the functionality has been compromised by the
antenna is to be embedded into the PCB, its operating environment, so it is important
location needs to be planned right from the to design the RF circuity correctly and carry
very earliest stages of product design. out tests to be sure how the final device will
There are plenty of antenna options perform.
available, including choices of network: LTE, Portable trackers are generally small, so
Bluetooth, WLAN and so on, and the satellite the space on the PCB will be limited and the
options of GPS, GNSS which can pinpoint the antenna may be placed very close to other
location for navigation, mapping, gee-tracking components. Components such as batteries
and fitness trackers. For a design example and power regulators are known for creating
using a Bluetooth radio, see the sidebar "Design electrical noise, which could interfere with the
Example: Smart Bike Lock" on p.17. antenna signal. Some antennas are designed
ci rcuitcellar. corn 15
noise to impact the performance of the device. but it does limit their usefulness for trackers,
In small tracker designs, a surface-mounted wearables, handheld and other devices that
antenna will have a smaller footprint, and will require an antenna with low directivity to
usually outperform a ceramic patch at a lower perform well for a quick time-to-first-fix.
cost (Figure 3). There are many satellite frequencies
Ceramic patch antennas need line of sight within GNSS and many devices support
to the sky, which means they need to be multiple systems, but it becomes difficult
pointed upward wherever possible. Most cars to achieve sufficient performance across
and drones operate parallel to the horizon so varying wavelengths with small ceramic patch
this may not be an issue in those use cases, antennas. If the device is smaller than 25mm2,
ceramic patches will only effectively operate
FIGURE3
on narrow frequency bands. In contrast, a
The Sinica SMD (surface mount device) surface mount antenna can work effectively
antenna fur 1559-1609 MHz measures on wide frequency bands. This may not pose
7.0mm x S.Bmm x 0.4mm. It is a low- a design issue. If the device is to operate
prufi le antenna with the performance parallel to the horizon, on a single frequency,
of a ceramic patch. a small ceramic patch antenna may provide
sufficient performance.
,_-
•' • 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 I received the VS Plus flight controller and the
the VS Plus drone flight controller NEO V2 GNSS module from CUAV Tech for free,
and the NEO V2 Global Navigation to test and evaluate. This review reflects my
Satellite System (GNSS) module- personal experiences and opinions about these
both manufactured and distributed by CUAV products, in the context of the type of drone
Tech. The VS Plus flight controller is promoted applications I normally do as part of my day
by its manufacturer as an advanced drone job: advising undergraduate college students
flight controller aimed at academic research with drone autonomous flight projects.
and commercial applications. It is based on
the Pixhawk FMUvS open hardware design TECHNICAL SPECIFICATIONS
standard, and is modular, consisting of a core CUAV Tech is a Chinese company working
plus a separate carrier board. It is compatible since 2012 in research and development,
with PX4 and ArduPilot firmware, supporting production and salesofunmanned autonomous
a number of vehicle types and configurations. vehicle (UAV) applications and system modules,
The accompanying NEO V2 GNSS module such as flight controllers, digital radio link
can concurrently process signals from GPS, systems and global positioning devices. One
Galileo, GLONASS and BeiDou global satellite of their most recent products is the VS Plus
positioning systems, and includes a digital flight controller, designed in collaboration
compass. with the PX4 autopilot team. CUAV Tech is
In this review, I begin by describing a "silver member" of Dronecode-the non-
the flight controller and GNSS module's profit organization governed by the linux
specifications and functionality in detail. Next, Foundation that oversees the development
I some introductory concepts about of four open-source projects in the PX4
Hardware-in-the-Loop (HITL) simulation, ecosystem: PX4 autopilot, MAVlink, MAVSDK
to put in context some HITL tests I carried and QGroundControl.
out with the VS Plus. I also flight log The VS Plus is based on the Pixhawk
analysis review as a tool to assess aircraft FMUvS (Flight Management Unit vS) open
performance. Finally, I the results of hardware design standard, and uses Pixhawk
some field flight tests I made with the VS Plus standard pinouts to interface with external
and the NEO V2 GNSS module, both installed devices. It comes out of the box pre-installed
in a test quadrotor. with PX4 firmware, but is also compatible
ci rcuitcellar. corn 19
with ArduPilot firmware. Figure 1 shows the flight controller cores announced by CUAV
VS Plus core module (in silver) attached to its Tech in May, 2020.
carrier board (in black). The detachable core The NEO V2 GNSS module has a U-blox
contains the flight controller's main hardware MBN, 72-channel GNSS receiver and an
components (microcontrollers (MCUs) and iSentek IST8310 digital compass (Figure 4).
onboard sensors), and the separate carrier The MBN sub-module is a dual-mode parallel
board contains the interfacing connectors to GNSS receiver than can concurrently process
external devices. signals from GPS/Galileo and GLONASS
That modularity gives you the choice of
-
either using the core with one of the of-the-shelf FJGURE 1
carrier boards from CUAV Tech, or designing a VS Plus core and standard carrier
custom one. CUAV Tech made available an open boand
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 VS Plus Core
and a 3D gyroscope. Additionally, it has a
Bosch Sensortec BM1055, which also contains Main FMU Processor: STM32F765
a 3D accelerometer and 3D gyroscope. An 32 Bit Arm• Cortex•· M7, 216MHz, 2MB FLASH, 512KB RAM
iSentek Technology IST8310 3D compass and
10 Processor: STM32Fl00
a MEAS Switzerland MS5611 atmospheric
32 Bit Arm• Cortex•· M3, 24MHz, 8KB SRAM
pressure sensor (altimeter) complete the set
of onboard sensors (the MSS611 is sold by On-board sensors:
TE Connectivity). The flight controller reads 3 x Accei/Gyro: ICM-20689, ICM-20602, BM lOSS
the multi-channel sensor data in real time, 1 x Magnetometer: IST8310
and switches to a redundant sensor whenever 1 x Barometer: MS5611
there's a failure in the previous one, thus Interlaces:
improving safety and reliability. 8·14 PWM outputs (6 rrom 10. 8 from FMU)
Figure 2 summarizes the hardware 3 dedicated PWM/Capture Inputs on FMU
specifications for the VS Plus flight controller. Dedicated R/C Input for CPPM
Additional key characteristics worth Dedicated R/C input for PPM and S.Bus
mentioning are: a secondary input/output Analog / PWM RSSI input
processor (the STMicroelectronics STM32F100 S.Bus servo output
MCU); two battery monitoring systems; 5 general purpose serial ports
support for high-accuracy, centimeter-level, 4 12C ports
Real-Time-Kinematic (RTK) positioning, 4SPI buses
with the use of corresponding modules and 2 CAN buses with serial ESC
support for LTE telemetry and video links- 2 battery monitoring inputs
which provide a much wider coverage area
than conventional ones. Power System:
The core module has a built-in damping Power: 4.3-5.4V
system that separates the sensors from the U5B Input. 4.75-s.25 V
main board and provides high-performance Servo Rail Input: Q-36 V
shock absorption. This reduces signal noise Welcht and Dime nsions:
in the sensors due to mechanical vibration, Weight: 90g
making unnecessary the use of external anti- Dimensions: 85.5"42•33 mm
vibration systems (Figure 3). The VS Plus fully
adheres to the PX4 official standard, to ensure Other Characteristics:
compatibility and interoperability with other Operating temperature: - 20- 80 •c
hardware and software products in the PX4
ecosystem. Available VS Plus carrier boards FJGURE2
are also fully compatible with the new X7 VS Plus summary of specifications
ZO CIRCUIT CELLAR • OCTOBER 2020 #363
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
FIGURE4
the PX4 flight stack is run typically on the same
NEO V2 GNSS receiver and compass
module
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
FIGURES
VS Plus Hffi simulation running
ci rcuitcellar. corn 21
a real drone until it is absolutely necessary. flying the simulated drone with the real radio
This is particularly helpful when you integrate control system connected to the hardware
other technologies-such as computer vision flight controller, and it worked well.
and cloud data connections-to your drone In my previous article [1], I discussed
application, and you need to do indoor tests the installation procedure of the PX4 SITL
simultaneously with your autonomous flight simulation environment for developing
code. autonomous flight applications with
I tested the VS Plus in HITL simulation by the MAVSDK-Python library. The same
running some MAVSDK-Python autonomous environment works for HITL simulation.
flight code examples I had on hand. For If you are interested in autonomous flight
example, it ran well with the write_my_initials. application development, check that article
py program example from my previous article for a quick introduction to the subject. Once
uwriting MAVSDK/PX4 Drone Applications" you have the simulation environment correctly
(Circuit Cellar 361, August 2020) [1]. Figure 5 installed, the procedure for running an HITL
shows a screen capture of the HITL simulation simulation is as easy as for SITL when using
running. As I sometimes do with new drone the jMAVSim simulator.
builds, I also made a couple of HITL tests It is somewhat more involved for HITL with
--·
I•
--- .. -. .._.._
---·
-..---·---
_____,..
__, ..
_....,. ..... --
x:M---
~
l : ~~"";""---
P-lt'""' l
1:- ....,.
_.J ~
-·- --
FIGURE6
Plot examples from a flight log review
22 CIRCUIT CELLAR • OCTOBER 2020 #363
an interesting issue with this power module. instantly. Of course, in reality, the battery
After take-off of the quadrotor, the "low- wasn't getting discharged that fast, otherwise
battery" warning was being triggered in my external LiPo alarm would have been
QGroundControl less than a minute into flight, triggered as well. It was just that, for some
even though the batteries were fully charged. reason, the flight controller was apparently
Looking at QGroundControl's GUI, I noticed getting erroneous readings from the current
the "battery voltage" indicator was dropping and voltage sensors in the power module.
from 12.6V to 10V in just 3-4 seconds, and I got rid of the adapter cable and did a flight
the "remaining-battery" indicator fell from test again. The flight time improved to around
90% to 10% in just 8-10 seconds, making 4-6 minutes, before the warning signal sounded
QGroundControl emit audible "low-battery" again. It then appeared that the cause for the
warnings. I tested the quadrotor with three early warnings was that the voltage and current
different batteries, which I knew were fine sensors in the HV_PM power module were not
because I had used them previously with working well with the 35 batteries. I was also
other quadrotors of similar configuration told that, apparently for a 35 LiPo battery, a
without any issues-and got the same results. current of around 15A was normally expected
Additionally, I had an external LiPo battery for the kind of quadrotor configuration I
alarm connected, which never got triggered had, instead of the 22A I was getting in the
by the apparent low-voltage condition. I was flight logs. From past logs from other similar
flying with PX4 firmware, but I also changed quadrotors, I found that currents between 13A
to ArduPilot to check if the issue was specific to 15A were typical.
to PX4. I got the same instant "low-battery" It was suggested that I try using a LiPo
warnings with ArduPilot as well. battery with more cells, so I did tests with
45 batteries; the drone flew well but with a
USER GROUP HELP bit of oscillation. Perhaps it would have been
The CUAV Tech user group channel at PX4's fixed by tweaking the default PID calibration,
Slack workspace helped greatly to determine but I didn't go that route. I always tend to use
the cause of the issue. The first hint I was 35 batteries with quadrotors of this size and
given was that perhaps the power cable configuration, anyway.
connecting the battery to the power module Instead, I replaced the HV_PM power module
was too long. And it was-around 15cm in with a regular 25-85 Pixhawk 1 power module,
length-because of an adapter I was using to and the flight time increased easily up to 8-10
connect my T-connector batteries to the XT60 minutes with the default battery configuration
connector in the HV_PM power module. From in the flight controller. This default configuration
my own flight logs, it also was brought to my causes the flight controller to do conservative
attention that apparently, the power cable estimates of the remaining battery power and
length was causing a considerable voltage available flight time. So, after tweaking these
drop, which in turn was causing more current battery parameters a bit, the flight time rose a
to be sourced from the battery. little more.
Referring to the gray curve in Figure 8, In retrospect, perhaps the HV_PM module
you'll notice that the current sourced when could work well with higher-voltage batteries,
the quadrotor is hovering is around 22A on but I didn't test it with more than 45 ones.
average-with a peak as high as 52A! And I had never previously encountered any issue
the measured battery voltage (the dark- like this before, and it took me some days to
blue curve) drops from 12V to lOV almost understand what was happening. As you know,
I ~
\ here in the same fonmat that it's in
10 the PX4 cloud application. But some
V
= /
.......
~ ....... V -- l notes about the axis units are needed .
The Y axis displays both units of
0 Voltage M and Current (A) . The Xaxis
2:10 2:15 2:20 2:25 2:30 2:35 2:40 shows time in Minures: Seconds.
Z4 CIRCUIT CELLAR • OCTOBER 2020 #363
FIGURE 1
Top of stack An illustration of tl1e Call Stack function
r
Local Variables • Ca ll Stack is a stack that contains
a collection of stack frames.
to begin with, that is a meaningful difference! simply means that ifthe column(s) queries are
eXtremeDB is an example of an in-memory only the indexed column(s), then the query
database type "B" in this comparison. The results can be obtained by only scanning the
relationship of code, static data, stack and key. There is no need to follow the pointer to
heap is illustrated in Figure 2. the data record and the amount of logical I/0
For its part, eXtremeDB employs several is reduced by one-half. But this optimization
techniques to minimize the overhead. The only makes sense for persistent databases,
first-and biggest-influencer is index types because of the speed of storage media.
and how indexes are organized. eXtremeDB Following a pointer in memory to the
offers a wider variety of index types than other data record takes just nanoseconds, whereas
database systems, but the most commonly following a pointer to a track and sector on
used are hash and b-tree indexes. By their a solid-state disk can be as low as l~s, and
nature, hash indexes use less memory (and generally on the order of 10 milliseconds for
are faster) than b-tree indexes. By far, the a hard disk drive. The use of precious DRAM
most common type of index is the b-tree to store redundant key values is unjustified
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
Heap rl In-memory
database lives
here
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
t
StackN
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
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 FIGURE Z
inefficiency. The key value exists in the slot Code This shows the relationship of the
code, the static data, the stack and
so that database systems can implement an
the heap.
optimization called a "covered query,n which
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.
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.
mgsin(O) mgsln(O) 5 (B) 5 Of course, this assumption is terrible, and a
a - - -1 - =-- 2- = ?IJsln .. 708 real ball sitting on a real plate is going to fall
m+RT m+~m
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
FIGURE2 assume that each rolling direction is totally
Illustrated here is a free body diagram of an isolated direction of the ball on an angled plate, and an equation independent.
of predicted motion. In this analysis, m represents the mass
ci rcuitcellar. corn 31
mechanical integration was performed. Tightly essentially a potentiometer. The value read by
fitting each joint to the servo motors, and that pin changes based on where you press
making sure the pivot point didn't wobble, both on the screen. The fourth pin is left to float,
yielded better performance in the final design. since it must be used for the other direction's
touch. By performing this process for one
ELECTRICAL DESIGN direction and then the other, the position of a
The main electrical components include a point of pressure on the screen is located [3].
Microchip PIC32 MCU [2], two serve motors, the The serve control used a standard pulse-
resistive touchscreen and a serial connection to width-modulated (PWM) signal. The Tower
a separate computer monitor for the tuning Pro MG995 took a 50Hz pulse with an on
step (see the schematic in Figure 4). time between lms and 2.5ms. The serial
The touchscreen generates a voltage connection to a computer and monitor was
proportional to the X (long dimension) and Y purely a convenience for tuning parameters.
(short dimension) position of an input touch. This is highly recommended to make tuning
Using Adafruit's touchscreen control chip to less time consuming.
receive data proved time consuming, but By watching the acceleration of the ball at
there were several options for making the job maximum tilt, we estimated that we needed
easier. The touchscreen uses four pins to set at least a 1kHz sampling rate for an accurate
the voltage of strips of conductive material reading of the ball's position. Because we can
that line the outer perimeter of the screen. only measure the ball's position in one direction
By holding a SV potential across the screen at a time, this means that each direction must
in one direction, the voltage read by one of be sampled at that 1kHz frequency. We then
the perpendicular pins makes the screen update the servo position as fast as possible.
"'a: •33V
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
~ ON::. CS
PGD= RBO
~ PGC• RBl
~
TFTCS
JlO
~
~
PECS
_L ~~n ••0
~ LED
FIGURE4 +JJV
Full schematic, including our attilched
hardware, of parts of the development
board [4] created by Sean Carrell for
ECE 4760 [5]
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 Setpoint +
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 p,
with our command structure. Both of them
p, = a p, _, + (1 - a)p ,
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 FIGURES
design of our code structure. The P!D control loop with filtered raw position data from the touchscreen
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/ ABOUT THE AUTHOR
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
Samuel Feibel is a graduate student pu rsuing a M.Eng. in Mechanical and
the touchscreen to their appropriate values Aerospace Engineering at Cornell University. Email: o
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
With the right tools
applies a correction that is linearly related to designing a microprocessor can DP. ~~~
the error. The "derivative" term is essentially
a damping term and serves to slow down Okay, maybe not easy, but certainly less complicated . Monte
the signal when it is moving too quickly. This Dalrymple has taken his yea rs of experience designing embedded
means that oscillations around the zero-error architecture and microprocessors and compiled his knowledge into
point caused by the proportional term will one comprehensive guide to
be smoothed out over time. The "integral" processor design in the real
term simply corrects for steady-state error. world.
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 Monte demonstrates how Verllog
the position of a touch, shifts by an offset value hardware description language
we determined to be at the "edge" of our screen's (HDL) enables y ou to depict,
sensitive area, and then scales to convert to a
simulate, and synthesize an
position in units of O.lmm. This step allowed
us to check that the positions were being read electronic design so you can
correctly. The error is calculated by subtracting reduce your workload and
the read position from our pre-set desired increase productlviry.
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).
34 CIRCUIT CELLAR • OCTOBER 2020 #363
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
FIGURE6
A QR link to a demonstration video of our device's capabilities. The video is also posted on Circuit Cellar's,
changes, matching the observed orbit around
article materials webpage. the setpoint. Visually, it was balancing better
than a human could if constrained to a pivot
This filtering was done to desensitize point.
the system, given our very coarse servo During those runs where stability was not
positioning {discussed in the Results section} ideal, a few issues could account for the lack
and slow update speed. The servo signal of steadiness:
was running at 50Hz, but the update in the
ISR took place at 2kHz. Because of that, the • Minor looseness in the joints could couple
position data needed to be slowed down so the X and Y directions of motion, throwing
that the servos updated with the most recent off the algorithm.
accurate data over the last update period. • The servos map to rotations, and don't
To calculate the derivative term, we stored linearly map to the angle of the platform,
five values of the error-the four previous especially at high angles.
values of the error, and the current error. Of • TheY-dimension of the board was about 2/3
the different ways to calculate the derivative, as large as the X-dimension, and therefore
we opted for subtracting the most recent error had a harder time stabilizing the ball.
from the oldest, multiplying by derivative gain • The servos would only react to a change in
and adding that to the output signal. PWM on time of around 0.06ms to O.OBms.
After uploading this version of the Since servos like ours have unpredictable
program, dragging a finger across the screen behavior outside the range of about 1ms to
causes a reaction in the motors, which should 2.Sms of on time, this means we effectively
not go outside the ranges set. If this is not had about 25 or so positions over 180
the case, fixing the safety parameters before degrees. This was further clamped to
putting the ball on the platform is a good about 10 distinct positions with which the
idea. Watching your delicate device-or more PID algorithm could work. Buying precise
harrowingly, HEARING your device break itself servos that can react to smaller changes
due to an overzealous servo-is not a required in PWM signal would make this platform
step and should be avoided. much more effective.
I
n some ways, Smart Cities can be thought of as the and ensures social distancing at the same time. The Smart
ultimate form of the lnternet-of-Things (loT) at work. Entrance Counter solution is a miniaturized, discrete radar
While loT implementations in factories and agriculture board (20mm x 15mm) that accurately and anonymously
can be fairly large scale, Smart Cities are inherently counts people with one single 60GHz radar sensor and
large-scale deployments often involving diverse public and integrated software (Figure 1). A traffic light system informs
private networks and stakeholders. Sub-segments of the whether an entry is allowed or not.
Smart City include traffic control, public security, waste lnfineon Technologies says its Smart Entrance Counter
management, Smart lighting and more. solution is a closed system. On one hand, it prevents
Serving the needs of Smart City system developers, a overcrowding, on the other hand it enables businesses to
wide range of technologies have emerged over the past keep their operations running. And most importantly, due
12 months, all useful for various large and small elements to the use of radar technology, personal data are 100%
of Smart City networked systems. These range from box- protected. The system counts a person, but does not know
level AI solutions and sophisticated loT cloud services, to who it is, says the company.
chip-level solutions for implementing LoRa wireless edge Infineon expects volumes for this kind of solution
nodes and battery-powered loT devices. Meanwhile, new to amount to 90 million units globally. Infineon's Smart
concerns related to COVID-19 have increased the urgency Entrance Counter solution with XENSIV 60GHz radar sensor
for implementing many kinds of Smart City applications. is contactless and can easily be installed on the side or
ceiling of an entrance or exit. It can be implemented in all
SMART ENTRANCE COUNTER kinds of building types, such as public buildings, retail and
There's no doubt that the COVID-19 pandemic has created grocery stores, restaurants, schools or corporate spaces-
needs for special kinds of Smart City solutions. Governmental for example, cafes, offices and the like.
regulations all over the world have driven an urgent need
for solutions to secure social distancing in public buildings in SECURE CONTACTLESS TRANSACTIONS
order to support slowing down the spread of COVID-19. With Large-scale contactless payment capability was already
that in mind, lnfineon Technologies developed a system that a key technology for Smart City applications, in mass
counts people while entering and leaving buildings or rooms transportation, for example. But new requirements for social
36 CIRCUIT CELLAR • OCTOBER 2020 #363
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.
distancing have amplified these demands. contactless, such as paying for parking,
And the worldwide impact of COVID-19 makes accessing offices or campuses and using
contact-free transactions a necessity. Serving other essential city services-all touch-free.
such needs, in June NXP Semiconductors NXP's MIFARE product portfolio is used
announced its new MIFARE DESFire EV3 IC, in Smart City installations worldwide. The
a chip that provides advanced security and new MIFARE DESFire EV3 IC builds upon
seamless integration of mobile services for a the portfolio's heritage of powering mass
new era of security and connectivity in smart transit ticketing. An extensive set of security
city services (Figure 2). features in the MIFARE DESFire EV3 IC provide
As the third evolution of NXP's proven more ways to protect data and help ensure
contactless MIFARE DESFire portfolio, the privacy. The IC hardware and software are
latest IC is backward compatible and offers certified to Common Criteria EAL 5+, and the
enhanced performance with a greater IC supports a broad choice of open crypto
operating distance and improved transaction algorithms. A card-generated MAC helps to
speed. In combination with its advanced securely authenticate transactions, and a
security features, the new IC delivers faster, new Transaction Timer feature helps mitigate
more secure transactions that are truly 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
FIGURE2 can be seamlessly deployed to NFC-enabled
The MIFARE DESFire EV3 IC chip enables secure transactions that are truly contactless, such as paying fur smartphones, wearables and other mobile
parking, accessing offices or campuses and using other essential city services-all touch-free. devices.
ci rcuitcellar. corn D
schemes including LoRa spread-spectrum put LoRa infrastructure technology into place.
modulation as well as the (G)FSK, (G)MSK Feeding such needs, Semtech announced
and BPSK used by various sub-gigahertz a collaboration with Nesten, a developer of
long-range protocols including proprietary specialized blockchain and IoT-based solutions
protocols. Users have flexibility to apply their for optimized communications networks. The
desired protocol stack, whether created in- effort supports the continued roll out of the
house, sourced externally or chosen from Nesten's LoRa-based node platform.
off-the-shelf software such as the LoRaWAN Following the successful 2019 deployment
and wM Bus (wireless M-Bus) stacks that are of its first-generation G1 wireless node based
available from ST and authorized partners. on Semtech's LoRa devices and the LoRaWAN
ST has engineered the integrated RF stage protocol, Nesten has increased the integration
to address global markets while improving of its LoRa-based wireless infrastructure in
performance and easing manufacture. Features several key markets throughout the US and
include dual low-power (14dBm) and high-power abroad, and has begun mass production of
(22dBm) transmitter modes with highly linear its node platform to empower individual loT
performance from 150MHz to 960MHz, spanning management.
the sub-lGHz unlicensed frequency range, Nesten's G1 node is a wireless gateway
which ensures technical compatibility with RF enabling loRa, Wi-Fi, GNSS and Bluetooth-
regulations in all world markets. Sensitivity based data communication in real time.
down to -148dBm helps to maximize RF range. Nesten recently announced the deployment
Only a single crystal is needed to synchronize of more than 270 Gl nodes throughout the
the high-speed external (HSE) clock and the Dallas metropolitan area, with additional
radio, delivering a further savings in BOM. loRa-based infrastructure deployed across
The new QFN48 package extends the major markets in the US, including Houston,
STM32WLE5 portfolio, which also includes Georgia, California, the New York, New Jersey
devices in a Smm x Smm BGA73. Three different and Washington, D.C. suburbs, as well as select
flash-memory density options are available per markets in Canada, Mexico and South Korea.
package, offering a choice of 64KB, 128KB or Nesten's consumer-based deployment
256KB, and all devices feature a high proportion model enables end users to deploy their own
of user-assignable GPIOs. All feature ST's ultra- flexible LoRa-based applications built on the
low-power MCU technologies, including dynamic Gl node, and operate and maintain their own
voltage scaling and proprietary adaptive real- IoT network without the associated costs
time ART Accelerator that allows zero-wait traditionally found with telecom carriers.
execution from flash. leveraging the end user and blockchain as the
cornerstone of each LoRa-based deployment,
LoRa INFRASTRUCTURE Nesten is also able to provide extensive data
In order for loRa wireless connectivity to protection and privacy. Several loT use cases
be deployed on a large scale, cities need to 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.
b)
FIGURE9
FLEX AioT Dev Kit (a) equipped with 9th Generation LGA 1151 Intel Core/)(eon AI Inference Sy$lem
pnocessor, Intel Q370/C246 chipset and DDR4 memory. The FLEX AioT Dev. Kit is
specifically designed for edge learning infenence computation (b).
real-time tasks such as age, gender and face Electronics, announced a partnership with
identification. The data collected can be used industrial AI specialist ONE Tech to provide an
in precision marketing, VIP customer service end-to-end, integrated loT and edge analytics
and customer flow analysis to further provide solution aimed at optimizing the performance
relevant product information through digital and use of city assets.
signage display to improve product sales and The joint loT with Edge AI platform
inventory control. combines lOT's BLE and 6loWPAN wireless
In addition to face identification, the interconnectivity devices, sensors and MRAM
solution speeds up the characteristic non-volatile memory data storage with
recognitions of vehicles such as license plates, ONE Tech's loT Platform and Micro Al. ONE
vehicle models and colors. It can be applied Tech's platform and AI deliver performance
in services like traffic steering analysis, illegal optimization, security and analytics for
parking/helmet detection and trajectory connected devices and assets (Figure 10).
tracking. Furthermore, vehicle license plate The combination results in an end-to-end loT
analysis can be deployed on highways for ecosystem-from node-to-edge-to-cloud-
electronic toll collection, and can provide that is well suited for a variety of Smart City
enhanced security by establishing a database applications, including connected community,
of suspicious vehicles. water and waste management, and energy
and asset management.
MORE AI AND SMART CITIES According to IDT, the loT with Edge
late last year, Integrated Device AI platform is a good alternative for loT
Technology (IDT), a subsidiary of Renesas developers who do not want to develop
their own cloud platform, nor want to use
other major cloud platform solutions. Such
RESOURCES development requires expertise in configuring
wireless 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
Texas Instruments I maximize their return on investment for all
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
c 20 (J 7 0 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 .
... •
Sin fti"CJkO
J-
their public service projects while redirecting enables you to store big data and apply AI/
any savings to other critical initiatives. machine learning (ML) to perform advanced
Using the loT with Edge AI service, users analytics and gain deeper insights. You can
can activate and manage any IDT/Renesas monitor real-time location and performance
device. It lets you define workflows for for all your loT connected assets and
automating business processes and create orchestrate an end-to-end digital experience
real-time event notifications. The platform for your Smart City loT deployment. G
V sllngS1ot
....... L Y
NOT YOUR
AVERAGE SLINGSHOT
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.
onto one Raspberry Pi. MCC offers a variety is no need for additional power supplies, only
of DAQ HATs that enable users to configure a single 5V/2.5A USB power supply is required
multifunction, Pi-based solutions with analog for both the Raspberry Pi and the HAT.
input, output and digital I/0. The open- For a quick and easy audio system setup,
source MCC DAQ HAT Library of commands the board is compatible with the main Linux
in C/C++ and Python allows users to develop distributions such as Raspbian, Volumio,
applications on Linux. The library is available moOde Audio or JustboomPiayer. Dual-channel
to download from GitHub. Comprehensive bridge-tied load (BTL) or single-channel
API and hardware documentation are also parallel bridge-tied load (PBTL) configurations
provided. for Multi room, TWS, or subwoofer applications
The MCC 172 header plugs into the 40-pin are also possible.
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.
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.
By Jeff Child,
Editor-in-Chief
Fanless System Embeds 8th System Blends CPU and GPU Embedded Computer Features
Gen Coffee Lake Computing lU Height
The BOXER-6641 from Aaeon AOLINK Technology's Matrix series EPC-T4286 from Advantech is an
offers a range of processors from the MVP-5100-MXM is an integrated fanless embedded computer designed for self-
Bth Generation Intel Core and Xeon embedded computer featuring Intel service applications. As the newest
processor family (formerly Coffee Core i7/i5/i3 processors and embedded member of Advantech's EPC-T series,
Lake), from Celeron G4900T and GPU for industrial AI applications. The this embedded computer features a
Pentium G5400T up to Xeon E-2124G system includes a comprehensive I/0 highly-functional small lU-high form-
(up to 71W). The system provides up to set to collect sensor measurements and factor design. Powered by a 9th Gen.
32GB of ECC or non-ECC ODR4 2666MHz allow data-driven actions to be taken in Intel CPU platform, EPC-T4286 combines
RAM and support for two hard drives. a timely manner. high computing performance with
diverse 1/0 ports, making it well suited
• i3/i5/i7/i9 processor for A1 model • 9th Gen Intel Core i7/15/i3 LGA for applications in self-service kiosk
(max. TOP up to 65W) processor terminals.
• ... or i3/i5/i7/i9/Xeon processor for • Dual SOOIMMs sockets for up to
A2 model (max. TOP up to 71W) 32GB DOR4 • Intel Core i CPU
• DOR4 ECC or Non-ECC SODIMM, Up • Up to 4x additional OP 1.4 from • Thin compact design with 44.2mm
to 64GB MXM, 2x OP++, DVI, VGA, 3x GbE, in height
• Intel GbE LAN x 4 (i211 x3 + i219 x1) 3x COM, TPM2.0 • Thin barebones system with multi-10
• Intel AMT (A2model) • 3x USB 3.1 Gen 1, 3x USB 2.0 ports
• HDMI x 2 dual display • 2x 2.5" SATA, M.2 2280 • Suited for environments with OC-in
• USB 3.2 gen 1 x 8 (A2 model) • Front accessible I/0 and adaptive design
• BIOS selectable RS-232/422/485 x6 Function Module 2.0 options • Easy and installation for additional
• Wide range DC 10V to 35V input • Slots for Mini PCie, M.2 3042, peripherals
2x USIM • 6x COMports, 6x USB ports,
AAEON • Embedded GP/GPU computing 3x LAN ports,
www.aaeon.com options built-in • 1x 2.5" shock-resistant drive bay
• Waii/VESA/Rack mounting kits
ADLINK Technology
www.adlinktech.com Advantech
www.advantech.com
DATASHEET URLS:
AAEON http://data-us.aaeon.com/DOWNLOAD/2014%20datasheet/Systems/BOXER-6641.pdf
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/productfile/PIS/EPC-T4286/file/EPC-T4286-Series-System_DS(OB1020)20200903164229.pdf
52. CIRCUIT CELLAR • OCTOBER 2020 #363
Embedded PCs
Apollo Lake Fanless Box Coffee Lake System Offers Fanless Box Sports AMD
Targets Industrial loT Flexible 1/0 Design Ryzen ¥1000/RlOOOs
LYNX-6110 from American Portwell Axiomtek's eBOX640-521-FL is The ASB200-918 series from lbase
Technology is a compact, fanless and powered by the 9th/8th generation Intel Technology is based on the IB918
cable-less PC adapting a low power Core i7/i5/i3 and Celeron processor with 3.5" form factor SBC supporting AMD
Intel Apollo Lake processor. Developed the Intel H310 chipset (Coffee Lake). Ryzen SoCs (V1605B/V1202B/R1606G/
to meet heavy industrial standards, This embedded system features a wide R1505G). The fanless ASB200-918 runs
the rugged design enables it to work choice of front-accessible I/0 interfaces two simultaneous HDMI 2.0a displays
in harsh environment. Providing for easy cabling and maintenance. It at Ultra HD 4K resolution (3840 x 2160)
basic I/0 interfaces in a palm- also has a flexible I/0 window for ease of with a frame rate of 60 fps. Measuring
sized box, the system is suitable for customization for versatile applications 240mm x 162mm x 42mm, it is
industrial automation, smart factory, and customer requests. equipped with rugged components.
edge computing and IIoT gateway
applications. • LGA1151 socket 9th/8th gen Intel • AMD Ryzen Embedded V1000/R1000
Core i7/i5/i3 on board
• Intel Celeron N3350, 2 cores, • ... and Celeron processor (Coffee • 2x DDR4 50-DIMM, Max. 32GB,
1.1GHz/2.4GHz, 6W TOP Lake) supports ECC
• 4GB onboard LPDDR4, 2400 MT/s, • Supports 2x COM, 6x USB and 8 • Supports 2x M.2 sockets (E-Key/
non-ECC; up to 8GB (optional) channels of digital I/0 M-Key, NVMe)
• 32GB onboard eMMC 5.0 flash; • Two 2.5" SATA drive bay • 2x HDMI (2.0a), 2x Intel Gbit LAN
up to 256GB (optional) • M.2 Key E 2230 for Wi-Fi • 4x COMports, external GPIO
• Expansion 1x M.2 Key E 2230 for • Front I/0 connectivity design • 4x USB3.1, 1x USB2.0
wireless module • 12/19 to 24 VDC power input via • 12V (-10%) to 24V (+10%) DC-in
• Display 1x DP v1.4 4096 x 2160 at DC-Jack • Operating temperature 0°( to 45°(
60Hz • Flexible I/0 window supported
• USB 2x USB 3.0 Ibase Technology
• Ethernet 2x 10/100/1000 GbE Axiomtek www.ibase.com.tw
• Power input 12-30VDC (+/- 20%) https://us.axlomtek.com
• Operation temperature 0°( to 50°(
DATASHEET URlS:
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
ci rcuitcellar. corn 53
Kontron's KBox B-202-CFl offers lanner's lEC-7242 is an industrial The Helix 500 from Onlogic brings
high performance with maximum environment gateway IPC driven by Intel desktop processing performance into
expandability and low noise level Apollo lake CPU, is CE, FCC and PTCRB a fanless, silent mini-PC. Powered by
(maximum 34 dB(A)). The embedded certified for LTE or Wi-Fi. It is designed Intel Comet Lake Core processing,
Box-PC with Intel Core 9th generation for IoT/IIoT edge, wireless security Helix 500 can accommodate up to
processors, with up to eight processor and multi-site management solution 64GB of RAM, has room for dual SSDs
cores, provides a performance boost deployment in commercial, enterprise (including NVMe options) and features
with constant power dissipation. This and public sector applications. Power available VPU accelerators, including
enables the KBox B-202-CFl to handled consumption ranges between 5.4W to Intel Movidius and Google Coral.
computationally complex processes and 13.5W.
large amounts of data. • Intel Comet lake Core i3/i5/i7/i9
• lntel Apollo lake CPU processors
• Up to 9th Gen Intel Core i7/i5/i3 • FCC/CE/PTCRB certification for LTE • Intel Q470 chipset; Intel UHD
• Raid functionality with up to or Wi-Fi Graphics 630
4 storage devices • 2x GbE RJ45, 1x RS232/422/485 • Up to 64GB DDR4 50-DIMM
• 2x PCie expansion slots for graphics COMport (non-ECC)
or network cards • 2x USB 3.0, 1x DisplayPort, 1x HDMI • 6x USB 3.1 Gen 2 ports,
• low noise design • 1x M.2 3042 B+M Key socket with 2x USB 3.1 Gen 1 ports
• Removable 2.5" SSD duaiSIM • 2x Gbit lAN ports, 3x DisplayPorts
• EN55032 Class B certified • 1x Mini-PCie socket with dual SIM • lx 12V to 24V, 4-pin DC jack
• Operating temperature 0°C to 45°C • Onboard lPDDR4, max 8GB and • 2x M.2 2280 slots (NVME PCie x1/
• Size: 190mm x 120mm x 190 mm onboard 64GB eMMC SATA)
• TPM support • Operating temperature: 0 to 50°C
Kontron • Size: 154mm x SO.Bmm x 210 mm
www.kontron.com Lanner
www.lannerlnc.com On Logic
www.onlogic.com
DATASHEET URLS:
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
54 CIRCUIT CELLAR • OCTOBER 2020 #363
Embedded PCs
... ·--· ..
"• ", ·o ~HHH •
I 1 • .
Sintrones' ABOX-5210G Edge AI GPU The Pl-50030 from WIN Enterprises WINSYSTEMS' SYS-ITX-N-3900 is
Computing is powered by Intel Gen 10th is a fanless, high-performance an industrial embedded computer
10 Cores Xeon, i9 CPU with 10x GbE networking system based on the Intel based on the Intel Atom E3900 Apollo
with Nvidia GeForce GTX GPU. It can 7th Gen Core Processor. With six Gbit Lake processor family. It uses less
provide high computing performance Ethernet LANs and 4x USB 3.0 and 2x than 12W for fanless applications
on graphic processing by harnessing USB 2.0 ports, it is well suited for small and performs reliably in industrial
the power of its GPU. The fanless box call centers that demand quiet, but operating temperatures ranging from
computers feature dual hot swappable high performance. Network expansion -200 to +600C. It includes a SODIMM
SATA storage RAID 0,1,5. is through PCie interface modules, M.2 socket supporting up to 8GB of DDR3
and Mini PCie technology. system memory and internal mounting
• Intel Gen 10 Cores Xeon W-1290TE/ support for one 2.5" SATA HDD/SSD.
i9-10900TE • Intel 7th gen Core processor
• Nvidia Geforce up to GTX 1660 GPU • DDR4 SODIMM up to 32GB • Intel Apollo Lake E3950/E3940
• Supports 1408 CUDA Cores • Support for three independent processor
• Bx GPI, 4x GPO and displays • 2x 10/100/1000 Mbps Ethernet ports
3x RS-232/422/485 • Rugged and fanless embedded • DisplayPort and VGA outputs for
• 1x M.2 B key, 1x M.2 A-E key system dual displays
• 2x Mini PCie expansion slots • 4x PoE + 2x LAN, Sx COM, 4x USB • Up to 8GB DDR3-LV RAM
• Dual hot swappable SATA storage 3.0, 2x USB 2.0, 1x M.2x NVMe slots, • 2x USB 3.0, 1x serial port,
RAID 0,1,5 16-bit DIO audio output
• Operating temperature.: • lx PCie X16 or lx PCI, 2x Mini PCie • lx MiniPCie Socket with
-40°C to 70°C • Quiet fanless operation mSATA support
• 10x Gbit Ethernet RJ45 • Wi-Fi antenna • lx M.2 Socket, with E key, type 2230
• 1x SATA 3.0 ports and lx Micro SD
Sintrones for storage
• Operating temperature:
-20°C to +60°C
WIN SYSTEMS
ms.co
DATASHEET URLS:
Sintrones IMNW.si ,:rones.cor"' f datasheels/ABOX-52 lOG.pdf
WIN Enterprises IMNW. win-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
56 CIRCUIT CELLAR • OCTOBER 2020 #363
By
BobJapenga
R
ecently I was in a meeting with 12 the MachineQ network using a development
young professionals. We met over kit and the example software. For testing,
Zoom, and some of us gathered 30 we will be using the off-the-shelf MachineQ
minutes before the meeting began loRaWAN gateway. As I did with building a
in order to share what's happening in our device and gateway for The Things Network
lives. One of the young men was excited about {TTN), I want to emphasize the prototype
working on a Raspberry Pi loRa concentrator nature of what I did. That's because I don't
{gateway). His company makes sensors and I want to mislead you into thinking: "Wow!
was excited to see that his company is now That part is all done and all I need to do is
getting into loRa sensors. concentrate on my specific application."
That's what we've been discussing in the Au contraire. Using this hardware and
past six articles. This month we wrap up our software will get you going for a proof-
not-so-deep-dive into loRa. We are going to of-concept prototype, but it is a long way
look at building a prototype loRa device for 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.
MCO
s-o OliUoNI
Main board: Also known as the Discovery I!IOOTII
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 FIGURE 3
with 192KB of flash, 20KB of RAM and 20KB of Murata CMWXlZZABZ-091 module
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
w
sensor to measure the color temperature of a light source.
11 0 0
hite assnow,U white chocolate," White K = °C + 273.27
wedding dress,u "white lightning"
and "white diamondsu are common so absolute zero = OK
descriptions of items in our world that
include the descriptor "white." You can probably think of many ... and freezing = 273.16K
others. Some of these describe a whitish hue, while others
don't connote a color at all. The most truthful might be 0 White As a black-body radiator's temperature rises, it gains
hot." While today we might use this to describe someone that energy and will emit radiation beginning at the low end
is udrop-dead gorgeous,u according to Merriam Webster, this of the electromagnetic spectrum. Figure 1 is a good
was first used as meaning "being at or radiating white heat.n illustration comparing radiation type and temperature for the
If you've ever sat by a campfire or gazed at a candle, you have electromagnetic spectrum [2]. We experience this emission as
experienced heat through radiation and colors associated with color once its wavelength enters the visible spectrum: 400nm-
the flame. 700nm. A blacksmith heats a piece of steel in his forge to
Before we can discuss temperature and color, we need to affect its malleability. While it's not a perfect black body, the
begin with the "black-body radiato~ [1]. This is a theoretical physical properties of the metal change with temperature,
object that can absorb all radiation that falls upon it. Radiation and he can estimate its temperature by its color emission
is the emission or transmission of energy in the form of alone (Figure :Z) [3].
waves (or particles) through some medium. This includes: We can therefore define the color temperature of a light
electromagnetic radiation, such as radio waves, microwaves, source in terms of the absolute temperature of a black-
infrared, visible light, ultraviolet, x-rays and gamma radiation body radiator or "chromaticity." Chromaticity is the quality
(y). At absolute zero-the coldest temperature possible-no of color, independent its brightness or luminescence.
heat is generated in a black body. Absolute zero is -273.15°C Chromaticity consists of two independent parameters, often
(Celsius) or -459.67°F (Fahrenheit). Science often uses the K specified as hue (h) and as colorfulness (s). Colorfulness is
(Kelvin) temperature scale to make more sense. alternatively called saturation or chroma. A color space
ci rcuitcellar. corn 61
FIGURE 1
Penetrates EarUfs
Aunosphere?
y --.-. ·. -- Shown here is the frequency/
wavelength /color temperature of the
electromagnetic spectrum of energy
[2]. Note those areas of protection by
our atmosphere.
Radrabon Jypc Radio MicrOONave Infrared Visible u ltraviolet x -ray Gamma ray
10, 10 .. 0.5• 10 ... 8 10 10 17
V\lavelenylh (m, 1tr 10 10
A pproXJmate Scale
of wavelength
~·
Buildrngs
11~
}) ~I
Hun-.ans Bu ne rftre s
-P
Needle Pomt Pro rozoans
AC ~
Mol ecules AlOrns Aromlc N uclei
Frequency (Hz)
~mpe ra iU re of
ObJeCts at w hrch
thrs rad rauo n rs the
most rmense
waveleng dr emnted 10000 ,000K
-1o.ooo,ooo •c
chromaticity diagram (Figure 3) defines all the expected colors. However, if the source
visible calor based on these parameters [4]. were lacking some frequency, the resultant
Note: Temperature calor has been indicated perception would be skewed. The missing
within the calor space. Green and violet fall frequency cannot be reflected, and so the
outside the black body path or Planckian result will be lacking. We have two options for
locus (see physicist Max Planck), with green a light source-the sun or an artificial source.
(secondary) being a combination of primary You've most likely noticed the temperature
yellow and blue, and violet (secondary) being calor is the opposite of the way we think of
a combination of primary red and blue. temperature and the visible calor spectrum
(as red = hot and blue = cold). With calor
ADDI11VE I. SUBTRACTIVE COLOR temperature, red is of a lower temperature
This has to do with the source of the and therefore cooler than blue. The sun's
calor. If the source is projected, the three effective temperature, defined by the total
wavelengths used are RGB (red, green, blue) radiative power per square unit, is about
and are additive. If the source is reflected, 5,800K. During sunrise, the tangential angle
then the pigments used are CMY {cyan, of light passes through more atmosphere,
magenta, yellow) and are subtractive. Note: scattering the shorter-wavelength blue light
Many of us were taught early on that the three from our view. As the path becomes a more
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.
We assume that a (white) source
illuminating a subject is perfect. A perfect
white source would give the expected result. FIGURE2
The subject under observation would absorb/ A blacksmith uses tlle col or emissions given off by a heated metal to estimate its temperature [3]. This is
reflect the wavelengths, and we would perceive key to being able tororm and temper it.
62 CIRCUIT CELLAR • OCTOBER 2020 #363
direct angle, this scattering can be seen off- will have on photographs or digital images.
axis as blue skies. The calor temperature does not take into
Figure 5 shows how the source calor consideration the spectral distribution of a
temperature can vary between the sun visible light source, and is not a reliable means
and artificial lights. The calor temperature of selecting suitable filters or creating look-
value of a light source refers only to the up tables for calor balance corrections. While
visual appearance of the source. It does not different light sources may be described as
necessarily describe the effect this source 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
0.9 possible sensor that will allow us to get a feel
for the spectral content of light exposed to it.
0.8 TCS3472
The TCS3472 is one of many sensors
manufactured by ams, a global leader in the
0.7 design and manufacture of advanced sensor
solutions. It consists of three sets of four
filtered sensors protected by an IR filter.
0.6
Three of the four filtered sensors have calor
500 filter RGB. Sensor values and control registers
are available via an FC interface.
0.5
The amount of light falling on each set
y of silicon photodiodes is measured by an
integrating analog-to-digital converter (ADC),
0.4
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-
0.3
level signals, higher programmable gains and
longer integration times can be used. At the
0.2 other extreme, higher-level signals will require
lower gains and shorter integration times.
The integration time period is chosen as
0.1 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.
0.3 0.4 0.5 0.6 0.7 0.8 This is an analog saturation check. A sensor's
X 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,
FIGURE 3
The OE (International Commission on Illumination) 1931 color chromaticity diagram was the first to
but choose a high number of integration
demonstrate the link between wavelengths in the electromagnetic visible spectrum, and physiologically
periods, where the total count is greater than
perceived colors of human col or vision. Note the plot of chromaticities of black-body light sources of various 65,535. This is a digital saturation check. You
temperatures [4]. would need to adjust gain and/or number of
integration periods to keep the results high
FIGURE 4
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 Iight 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,
RGB (Additive) CMYK (Subtractive) RYB (Subtractive)
a separate black ink is used.
ci rcuitcellar. corn 63
___
calor temperatures from a reddish (relaxing) tint to an bluish (intense) tint. In their art, photographers use
holds the WLONG bit that, when enabled, will these subtle tints of white light to produce an emotion.
multiply the WTIME by 12. The maximum
WTIME will be approximately 7 seconds. This AllORESS RoalVII<AME
~
11/W
w .....,_........,_
.,_ MGIITEA fUNCllOfl RU ff VALUE
c.oo
-
allows the device to remain in idle condition c.oo
for a large percentage of time, lowering the
IWXI £NAIIlE
......_
1\W
,.,.
-
a.Dt AGIIC-
average current of an active device by a factor IIIG3 W'llloiE 1\W
'~'~"'-
a..._ ..... _ .... byto
IW'f
begin with.
111111 Al.Ill MY a...-to.r-1'111•""" c.oo
OIIDII ~ A.W Clool - . . . . , _ . . . . . 01100
The integration time has a similar register 011111
o.oc:
Qffi4 A.W cao.. ............. -N11..,.. IWXI
~--··
(ATIME Ox02). You set the integration time PEAS MY 0.00
Qd) oor.m MY ~ 111100
in periods of 2.4ms. If you wanted to set the 01111' CONTROl MY
_.,
OllfWU 01100
--a----
integration time to 50ms, you would use an 01112 tO R tO
aCy cl e count of 50ms /2.4ms = 20.8 (or 21 01113 STATW R o.--.. c.oo
Oat• COATN.. R 111100
periods). The two's complement of 21 (Ox15) 111115 COATAH R aoor .... ...,_ ClliOO
is 235 (OxEB). There is no multiplier for the 01111 IIDIITN.. R
.....-~ IWXI
__
integration time. However, you can adjust the 01117 -TAH A --¥1¥0 IWXI
!loll OQAW_
gain of the sensor amplifiers, which is similar
to a multiplier, without actually adding any
Olllt OOATAH "
R
a.--~t.,w
a.--.,....,.,..
......
Odl
0.00
0111A IIOATN.. R _ _ l'oil;ll..,.. IWXI
more time to the conversion. 01118 BOATAH A c.oo
You can see that if all the timing registers
FIGURE 6
are set to maximum, one sample period would These are the PC registers of the TCS3472x. Note: the first data byte of a write wi 11 be a COMMAND byte,
be WTIME = OxOO (614ms), WLONG = 1 (times which sets the pointer to a register of interest. Additional data bytes are stored beginning at the pointer. A
12) 614ms x 12 = 7.4 seconds, plus ATIME = 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. to increase this pointer automatically after each register
Reading the resultant registers prior to this time would access. Using a COMMAND value of OxAO will set the pointer
provide the data for the previous sample only. to register OxOO and enable auto increment. Since the device
uses registers Ox00-0x1B, we will need to read Ox1C (28)
USING THE SENSOR registers values. Listing 1 shows the basic Arduino code
Since the TSC3472 is an I2C device, it can be easily needed to read all of the registers in the TSC3472x.
interfaced using a 3.3V Arduino (or a SV Arduino with some In Listing 1 we've collected 28 registers, and they are in
level shifting on the I2C pins). I'll begin this project with an 8YTE ARRAY[ J. Displaying these requires the majority of
Arduino MEGA. A library for the TCS3472 is available, but I programming, and will therefore not be listed here. However,
won't use it for this project. Instead I'll break it all down into Ustlng 2 shows a typical display of the output from this function.
visible function calls. There are actually two phases for each register. The first gives
Let's begin with reading all of the registers. To do this raw register info, register name and hex value found there. The
we'll need to write a command to the device. As we discussed second breaks this down-where necessary-indicating any
previously, the COMMAND byte sets up the pointer to the special bit significance.
register we want to communicate with (either to read from A check of the value in the ID register (Ox12) tells me the
or to write to). It also instructs the device whether or not values are good. This device is actually a TSC34725 (a version
I..ISTlNG 1
The basic Arduino code needed to read all the registers in the TSC3472x
ci rcuitcellar. corn 65
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 FIGURES
down to two conductors wide. These could be fed through I used one of the enclosure boxes from PacTec that I already had. Although it was
the sensor arm quite nicely, without any pinching to the a little large, once I added buttons and the Li-Ion battery (which fit nicely in the gv
wires. battery box), it was fine.
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 Picking out a perfect shade of white is a nightmare come
is less than 1 and the calor temperature is 4,382K. This is to life. Pure white? Off white? Simply white? Benjamin Moore
just what I would suspect for sunrise. A clear, mid-day sky has more than 35 shades of white! The shade of white (or
produced a high calor temperature of 5,732K. You get a good other calor) you apply to your walls will greatly influence the
sense of the many shades of white while driving at night. The way you feel in that room.
range in calor temperature for various styles of headlights is Remember to wash your hands! Too much to do, too
3,000K to more than 12,000K! little time. e
University of l(~
CINCINNATI IONLINE
W
elcome back to "The Darker wavelength is the propagation speed of the
Side." As electronics designers, signal along the wire, divided by the frequency
we all know what a wire is of the signal. On a wire, or more exactly on
and how it works, right? If we a so-called transmission line comprising the
connect a wire from A to B, a current can flow wire and the accompanying current return
between these two points. If we then disconnect path, the propagation speed will be close to
the wire from B, no current can flow. The wire the speed of light in free space, c, which is
becomes useless because one of its ends is 300,000,000m/s.
open. Now, imagine that we delay this signal by
True? Well, not always. If you don't know half the wavelength. We get the same sine
why, then keep reading because this will signal, but with an opposite phase. What
be my topic this month. More precisely, my happens if we then sum the original signal
goal is to explain what a stub filter is, and and its copy delayed by A./2? Naturally, they
how to build one. I will also show you that will cancel out, and the result will be zero-a
you may inadvertently make such a filter, for null signal.
example with an improper printed-circuit I'm sure you've followed me up to this point,
design. This may jeopardize the performance right? So, you will also easily understand that,
of your project, at least if you are using high rather than delaying by 'A./2, we would get the
frequencies or fast digital circuits. same result if we delayed the signal twice-
Finally, and as usual, I will not use math each time by 'A/4. Now look at Figure 2 for an
to convey these principles, but rather words easy way to do it. The signal is coming from
and small experiments. So, the good news the left, and is virtually split into two parts.
is that this article should be easy to read. Half of it continues to the output on the right,
The downside is that my explanations will whereas the other half goes into a wire that
approximate. Anyway, I hope that you will introduces a A./4 delay. Assume that there is
catch the important points. I will provide a reflector at the end of this wire. The signal
some resources for further reading, if you will then be reflected back on the same wire,
want to dig more deeply into the subject. will be shifted again by A./4 on its way back,
and will be merged with the original signal. As
SINE+SINE =0
Let's start with a very simple mental
in my example above, this adds the signal and
a copy shifted by half a wavelength, and we
experiment (Figure 1). Assume that you have should get zero.
a sine-shaped signal propagating on a wire. You may wonder how to actually make
Such a signal has a given wavelength, usually such a signal reflector, but long-time readers
noted as A. (the Greek letter, "lambda"). This will remember an article I wrote several years
ci rcuitcellar. corn 69
- - -..} suM~o
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 FJGURE 2
lines in series, and plugged the other end A shift of half a wavelengtn can be made with a quarter wavelength stub, ended by a perfect reflector.
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
I
-- -•
~ .1-
P1
-
Zo600Mt
"""""
IJnol
Z~OIIM
L•IOO,.,
-
P2
z~a..
-- ....
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
........, ........
---11011
to 0 (-40dB, which means that only 10-40/10 = FJGURE 3
1/10,000 of the power is transmitted). Why is Here is a QUCS simulation of an open stub (line 3, 37.5mm long). The response shows a null in the
this happening at 2GHz? Simply because the transmission close to 2GHz.
70 CIRCUIT CELLAR • OCTOBER 2020 #363
open stub is 37.5mm long, and that 37.5mm the frequency continues to increase. There
is a quarter of the wavelength for 2GHz1 !..= are other frequencies where the attenuation
c/f = 300,000,000 m/s I 2,000,000,000Hz = is very high, precisely at 6GHz, 10GHz and
0.15m, divided by 4, or 37.5mm. A word of every 4GHz thereafter (although not shown in
caution here: QUCS assumes by default that the Figure 3 graph). I'm sure you will easily
the propagation speed is c. On a real cable it discover why.
will be a little lower, maybe 80% or 90% of c, Here's the trick:
but you get the idea.
So, such an open stub in fact makes a 3 X 2 X f../4 = f.. + 2 X 'A./4 ...
band-reject filter. It passes the signals, except
close to 2GHz where the attenuation is very Up to now, I have used open-circuited
high. If you look again at Figure 3, you will stubs, which are reflecting the signal in
see that there is something interesting when 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
Reflector introduces a 180-degree phase shift to the
(phase inverted) 'A. 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
(\j\_; '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
CXX)
.
.. again .
I modified the QUCS simulation to show
you what happens with a short-circuited stub.
)\/2 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-
FIGURE 4 circuited to ground.
A null can also be achieved with a phase-inverting reflector like a short circuit, but this time with a half-
wavelength stub. 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
.,_ instrument is, in fact, doing exactly the same
•
I -• --
as the QUCS simulation described earlier. It
injects a signal of varying frequency into a
- -• P1
,._,
"""""""
U.1
z·~a.
device under test, and plots its transmission
-•__--•
Z•~Oin l•IClO ... and reflections on a graph. For a quick
I «; ;... demonstration, I simply interconnected two of
its ports with a short coaxial cable, and added
l!9!!!!!!'n ':'
._ .... ~~ a SMA T adapter, ended with a 3cm SMA/SMA
dBS21 odiiCSfl.lll
--
il
d8S11001115{1,IJ) 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
FIGURE 5 6.16GHz. This is not exactly 6GHz as expected,
A QUCS simulation of a short-circuited stub. See the zero transmission at OHz as expected. probably due to some parasitics somewhere.
ci rcuitcellar. corn 71
..._ 0
.._..
---
0
\(\(
<>-
..
I
·5
~
g · 10
· 15 I
-~ ..• ID
I
I
I
•
IdB I
·20
·25
-30
0
I
2 3 4 s e • • 10
FIGURE 9 model. The design to be simulated must be 1.6mm thick FR4 PCB. (See my previous article
Sonnet Lite can simulate PCB modeled as parallel dielectric layers, with on the subject: "Microstrip Techniques,"
structl.lres like this open-circuit. metal structures between each layer. This is Circuit Cellar 223, February 2009.) The length
20mm stub, showing a first more limited than a full 3D simulator, but far of the open-ended trace is 22mm.
transmission null at 1.82SGHz. faster in terms of calculations. This is good I then ran the simulation, and a couple
enough for PCB simulations. of minutes later, I got the nice plot shown in
The example I made with Sonnet Lite is Figure B. Very close to the theory again! Here
shown in Figure 9. On the far left you can see the first null is at 1.825GHz. Since the open
the layer structure- a 1.6mm FR4 substrate trace is 22mm long, we would expect a null
and air on top of it, with a full ground plane on for a wavelength of BBmm, so a frequency of
the bottom layer. I then drew two rectangular 3.4GHz. However, the propagation speed on
copper traces on the top side of the PCB-one a FR4 substrate is far lower than the speed
from port 1 to port 2, and one open-ended of light. The ratio is, in fact, the square root
stub. The traces are 3mm wide, which is a of the so-called effective dielectric constant
good width for a SO.Q transmission line on a 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.
[l .m The Sonnet simulation also shows that the
other nulls, higher in frequency, are lower
TOPB ..
il
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
fR~
GND
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.
Cl u or .lrdg mou~• to roadoot dolavalue;
"
MURPHY, UNFORTUNATELY
FIGURE 10 Stubs, intentionally designed using open-
An analysis of the current through each copper trace allows us tn visualize the cancellation of the waves at or short-circuited transmission lines, are
the junction point at a precise frequency. actually used to build radio-frequency filters,
ci rcuitcellar. corn 73
and now you know how. Several stubs, well will be an open-ended trace. It will therefore
designed and with proper separation between act as a stub, and will cancel out signals with
them, can be used together to implement frequencies for which its length is a quarter
far more complex responses than the basic ofthe wavelength. And, do you know what will
examples I've illustrated. This may bring us a happen? Murphy's Law states that everything
little too far for this article. that can go wrong will go wrong. So, for sure,
That said, I would like to share with you that the frequency that will be canceled will be
you may also build stub filters unintentionally. exactly the frequency you want to use. And
How? Imagine that you design a kind of your design will simply not work-all because
2.4GHz transmitter-maybe Bluetooth-using of a short open-circuited trace.
an IC and some passive components around What would be a good solution? Simply
it. You must design two variants of your avoiding any open-circuited stub on any high
product, using two different kind of antennas. frequency line. Figure 11b shows a possible
Say one is ended with a SMA connector, and way. Here I added two OQ resistors, RlO and
the other is a dipole ended with a differential Rll. These two components are positioned
flex cable. Maybe you would design a PCB like exactly at the Y junction between the two
the one illustrated in Figure 11a. Warning- intended paths. Of course, only one of them
this is not an actual design, just an illustration will be populated. Therefore, there will be
for this article. Here the transmitter circuit no open-circuit line at all, and no Murphy-
is supposed to be on the lower left, and the related risk. For the lowest possible risk, it is
antenna trace goes simultaneously to the indeed a good practice to share a single pad
SMA connector, Jl, and to some components between the two components, RlO and Rll,
feeding the flex cable connector, 12. That's as illustrated, thus avoiding even a lmm stub.
clever, because, depending on the need, you
will solder either Jl or 12 and its passive WRAPPING UP
components, so you will have only one PCB Here we are. As always, I have only covered
and two versions. Right? the basics, and with simplified explanations.
Wrong! This would be a very, very bad Stubs can be used to make any kind of filters or
idea, and I'm sure you now know why. impedance-matching networks, especially at
Imagine that you populate only the connector, high frequencies. Stubs can also be the source
ll, and leave J2 and the small accompanying of serious headaches for the incautious PCB
passive unpopulated. OK, but the trace going designer. So, knowing what they are about is
from Jl to the pads planned for R7 and R9 crucial. This is true not only for high-frequency
FIGURE 11
(Left) A wrongly designed 2.4GHz transmitter PCB. (Right) A greatly improved version, avoiding stubs on the RF trace
74 CIRCUIT CELLAR • OCTOBER 2020 #363
RESOURCES
Keysight Technologies I www.keysight.com
Sonnet Software I www.sonnetsoftware.com
c·rrcuitcellar.com 75
PRODUO NEWS
TDK-Lambda I www.us.lambda.tdk.com
76 CIRCUIT CELLAR • OCTOBER 2020 #363
PRODUO NEWS
.
:
..
r:~
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
FP-AI-NANOEDG 1
iNEMO 30 accelerometer and 30 gyroscope, as well as two to learn and monitor equipment health
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 [email protected] with your file.
,. 12 c Bus
~~ Technofogic Adapters
" Systems
ter
0
CE
USB I Ethe rne t I RS-232
Free
Visual Studio, LabVIEW & ASCII AP!s
TS-7250-V2 Win, OSX & Linux Drivers
Msg & EEPROM Program Apps
1 GHz ARM Computer with
Sw itch Selectab le O ptions
Customizable FPGA-Driven Voltage Sense (O.Sv to Sv)
PC/1 04 Connector Power Source l OOmA (3.3v or Sv)
Pull-Ups (Enable/Disable)
and Several Interfaces 0 /R V lt & ESD P t et'
at Industrial Temp
shop-mcc-us.com
ADuC841
M icrocontroller
Design Manual
78 CIRCUIT CELlAR • OCTOBER 2020 #363
Answer 1- The total power dissipation is specified as Answer 2- Yes, you could build a 2-input NOR gate
lmW, and the supply voltage is 1.5V. This means that with just one more resistor.
the total current consumption of both paths (base and Clearly, there would be no problem when both inputs
collector) can only be 666.7~-JA. are high or both inputs are low. However, the situation
The "forced W' is specified as 10, which means that where one input is high and one input is low presents
10x the base current flows through the collector. This a problem.
means that Ib must be 60.61JA and le must be 606.11-JA. Just like with the inverter, the high input drives about
Since Vc:E(satJ is 0.2V, the collector current must 611JA into the base of the transistor, which sits at about
=
produce a voltage drop of 1.5V- 0.2V 1.3V across Re- 0.7V. However, with the other input low (at 0.2V), the
=
Therefore, Re: must be 1.3V I 606.11-JA 2,145Q. other base resistor steals about {0.7V - 0.2V) I 11 kQ =
Similarly, since V8E is 0.2V, the base current must 451JA away, leaving only about 161JA for the transistor.
produce a voltage drop of 1.5V - 0.7V = O.BV across Now the transistor must have a minimum P of 6061JA I
Re+ R8 • Therefore, the total resistance must be O.BV I 161JA = 38 in order to remain saturated.
60.61JA = 13.2 kQ, and the value of RB must be 13200 However, you could not add a third input this way.
- 2145 = 11055 n. A single high input would not be enough to turn the
The closest standard E96 values are 2.15kQ and transistor on.
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 Answer 4- Each additional input connected to the
number of inputs is to add both a transistor and its base output of the gate draws more current through Re, but
resistor for each additional input. All of the transistors this current must be shared N ways, so the current
would share the same load (collector) resistor. available to each input drops.
Table 1 shows that even with up to 8 loads, the input
.....
1
2
,..... ....
current to each gate only drops by about half, requiring
a minimum Pof about 20.
6lj.IA
105j.IA
. . . . . .... Input
6lj.IA
52j.IA
4 163j.IA 41j.IA
ci rcuitcellar. corn 79
•
j ,
(
•·..
• :
.,
.; '.
l
•
·-
. .
....
j
.
-· -
' . .. . .
rp
FIGURE 1
The LoRaWAN FlexGate FG264
Gateway from Expemb is designed
generations of high-performance and low- with Qseven ffiMs.
80 CIRCUIT CELlAR • OCTOBER 2020 #363