Elektor 07.08 2025
Elektor 07.08 2025
95
*
IN 1
CE 196
OBD2 Sensor
Dashboard
Real Vehicle Data on an Adaptable Display
FOCUS ON
IoT &
Sensors
membership!
www.elektormagazine.com/member
COLOPHON EDITORIAL
Jens Nickel
Volume 51, No. 538 International Editor-in-Chief, Elektor Magazine
July & August 2025
ISSN 1757-0875
Become a Member
This year, I visited the Sensor+Test fair in Nuremberg once again, and I was impressed by
www.elektormagazine.com/membership
many new developments, including sound intensity scanning and antenna arrays for tracking
Advertising & Sponsoring thousands of Bluetooth devices (see page 26).
Büsra Kas
Tel. +49 (0)241 95509178 In this edition, my colleague Jean-François Simon takes a closer look at a radar sensor you can
[email protected] use for presence detection and many other applications (page 50). Saad Imtiaz from our lab
www.elektormagazine.com/advertising reports on some of the best LiDAR sensors currently available (page 19). As you’ll see, there are
major differences in both specifications and cost. When I have time, I plan to buy one suitable
Copyright Notice
© Elektor International Media b.v. 2025
for beginners and run my own experiments with it. A kind of 3D map of audio equipment —
combined with sound direction measurements — could make for a fun, visionary project.
The circuits described in this magazine are Who knows? Maybe you’ll read about it in July 2026 (or 2027).
for domestic and educational use only. All
drawings, photographs, printed circuit board Our main cover projects — yes, we have two this time — are aimed at a different kind of
layouts, programmed integrated circuits, enthusiast: one who likes to solder and isn’t afraid to pick up a wrench (pages 6 and 14). For
digital data carriers, and article texts published
people like that, a faint smell of gasoline and a free Saturday are the foundation for happiness.
in our books and magazines (other than
third-party advertisements) are copyright
And I know we have plenty of them among our readers.
Elektor International Media b.v. and may not
be reproduced or transmitted in any form About 15 years ago, our “OBD2 Mini Simulator” was a big hit (https://elektormagazine.com/
or by any means, including photocopying, magazine/elektor-201006/19323). It even generated interest beyond our regular readership
scanning and recording, in whole or in part — if I remember correctly, even some German car websites picked it up.
without prior written permission from the
Publisher. Such written permission must also
I hope our two new OBD projects bring just as much joy to auto enthusiasts. As always, the
be obtained before any part of this publication
is stored in a retrieval system of any nature.
articles don’t just invite you to build them — they’re also an invitation to modify and extend
Patent protection may exist in respect of them to suit your own needs.
circuits, devices, components etc. described
in this magazine. The Publisher does not Whether you’re mapping with LiDAR or decoding engine diagnostic codes, I hope this issue
accept responsibility for failing to identify such gives you plenty to tinker with!
patent(s) or other protection. The Publisher
disclaims any responsibility for the safe and
proper function of reader-assembled projects
based upon or from schematics, descriptions
or information published in or in relation with
Elektor magazine.
Print
Senefelder Misset, Mercuriusstraat 35,
7006 RK Doetinchem, The Netherlands
Distribution
IPS Group, Carl-Zeiss-Straße 5
The Team
53340 Meckenheim, Germany
Phone: +49 2225 88010 International Editor-in-Chief: Jens Nickel | Content Director: C. J. Abate | International Editorial
Staff: Hans Adams, Asma Adhimi, Mahy Arafa, Roberto Armani, Jan Buiting, Rolf Gerstendorf (RG),
Ton Giesberts, Saad Imtiaz, Alina Neacsu, Dr. Thomas Scherer, Jean-Francois Simon, Clemens Valens,
PEFC Certified
Brian Tristam Williams | Regular Contributors: David Ashton, Stuart Cording, Tam Hanna, Ilse Joostens,
This product is from
sustainably managed
forests and controlled
Prof. Dr. Martin Ossmann, Alfred Rosenkränzer | Graphic Design & Prepress: Harmen Heida,
sources
Sylvia Sopamena, Patrick Wielders | Publisher: Erik Jansen | Technical Questions: [email protected]
PEFC/30-31-151 www.pefc.org
OBD2 Sensor
Dashboard
Old Dials Spark
a Quest for Real Data
6
Regulars Projects
3 Colophon 6 OBD2 Sensor Dashboard
Old Dials Spark a Quest for Real Data
48 Peculiar Parts
Solar Cells 14 OBD2: Rev Counter and Gear Shift Indicator
Retro, But Super Useful
56 From Life’s Experience
Paper Factory 28 Contact-Free E-Field Measurements (1)
A Vibrating Membrane for Assessing DC Voltages or
70 Err-lectronics
Static Electric Fields
Corrections, Updates, and Readers’ Letters
36 Wireless Mailbox Notifier
73 Starting Out in Electronics…
From Optical Sensors to Radar, Exploring a Few Options
…Concludes the Topic of Opamps
42 Elektor Mini-Wheelie
92 2025: An AI Odyssey
A Self-Balancing Robot
Mid-Year Review
82 Solar Charge Controller with MPPT (2)
The Circuit
19 LiDAR and Vision Sensors for Robotics 94 Raspberry Pi Standalone MIDI Synthesizer (3)
Making It Smarter and Adding a User Interface
50 Getting Started with a Modern Radar Sensor
Is Your Radar Accurate? 102 Meshtastic: A Demo Project
An Intelligent Mesh of LoRa Radios
66 Exploring Wireless Communication with the BeagleY-AI
110 Analog Audio Frequency Generator
76 A Powerful AI Code Assistant High-Quality Adjustable-Frequency Sine Wave Generator
Speed Up Your Development with Continue and
Visual Studio Code
FOCUS ON
V Bat Serial
a Modern A2
V Out
V In
D
Controller
Data
Radar Sensor
V In
I PV I In A
A1
PV V ISense =
Is Your Radar V PV
I Out x c
Charge
Load_On
Accurate?
Solar Charge En
V In T1
T2
Controller
In
I Out
Gate D1
I Sense
PWM Drive
50 82
+V = min
to
ab
Elek
NAL
ORIGI
la b
El
or
kt kt
e
or l
a b • Ele
It all began one early morning, sitting in my 2001 Toyota Land Cruiser,
waiting patiently as the engine warmed up. Watching the analog dials
slowly climb, I wondered: Why rely on vague needles for crucial parame-
ters like coolant temperature, battery voltage, or oil pressure (Figure 1)?
Wouldn’t precise numeric values directly from the vehicle’s ECU be far
more insightful? This simple thought sparked the idea of developing a
custom OBD2 dashboard, directly tapping into the vehicle’s real-time
sensor data via an ELM327 module and visualizing it clearly on an
ESP32-S3-based touch display.
Figure 2:
The block diagram.
However, another challenge emerged: the JC3248W535 ESP32-S3 without exposing UART (Figure 5). To overcome this limitation, the
board [1] I selected only supports Bluetooth Low Energy (BLE), while “Double PCB” variant of the ELM327 was selected [3], comprising
the ELM327 modules rely solely on standard Bluetooth. two stacked boards (Figure 6). Interestingly, at the time of planning
this article, we got another OBD project from one of our authors, and
While, I successfully tested Bluetooth connectivity using a standard it makes use of the same module for a gear-shift indicator system [4].
ESP32 module (which supports traditional Bluetooth). However, at
the end, I ultimately favored the JC3248W535 ESP32-S3 3.5-inch LCD In this module, the lower board contains a PIC microcontroller respon-
Development Board due to its aesthetic appearance, integrated capac- sible for OBD2 communication, while the upper board handles
itive touchscreen with a resolution of 480 × 320 pixels (Figure 4), Bluetooth functionality. Conveniently, these two boards communi-
built-in battery management circuitry, SD card and onboard speaker cate internally via UART, exposing RX, TX, and Ground pads. I soldered
support. The integrated built-in speaker opens possibilities for voice jumper wires directly to these UART pins, attaching a compact 4-pin
warning system reminiscent of aircraft alerts — such as “Fuel Low,” JST 1.25-mm connector at the other end (Figure 7). This connector
or “Engine Fire” and many more (though I sincerely hope no car ever seamlessly interfaces with the UART pins (IO17 for RX, IO18 for TX)
experiences that last one). on the JC3248W535 ESP32S3 development board (Figure 8). The
schematic digram is shown in Figure 9.
This compatibility mismatch prompted a decision to switch from a
Bluetooth wireless approach to a direct, stable UART connection. For secure dashboard mounting, a custom backplate was designed in
This change ensured reliable communication between the ESP32-S3 CAD equipped with a pivotable stand, attaching it with strong double-
and the ELM327 module. For those who prefer a wireless approach, a sided adhesive tape directly onto the vehicle’s dashboard (Figure 10).
suitable alternative smaller display called the “Cheap Yellow Display,” To withstand high cabin temperatures (often exceeding 55°C), PETG
compatible with classic Bluetooth, is available on Elektor’s store site [2]. filament was chosen for 3D printing the stand and backplate, as it offers
better heat resistance (approximately 85°C) compared to standard
Project Hardware Setup PLA, which softens around 55°C. While ABS filament would have been
Following the decision to shift to UART, I needed an ELM327 module even more resistant (up to 110°C), it requires specialized enclosures
variant with easily accessible serial pins. Most cost-effective ELM327 and ventilation systems due to its toxic printing fumes, making PETG
modules integrate Bluetooth and OBD2 processing into a single chip the practical material choice.
Figure 6: The PIC microcontroller-based “Double PCB” ELM327 Figure 7: UART jumper wire connections soldered onto the
module variant, featuring two stacked circuit boards. bluetooth PCB of the PIC-based ELM327 module.
sendOBDCommand("0105");
MOD1 MOD2 // Sending command for coolant temperature
ELM 327 Module JC3248W535
Development Board
250107-013
The vehicle’s ECU responds to the ELM327, which returns a raw
response string via UART, for example 41 05 7B. Here, 41 confirms a
Figure 9: Schematic diagram: connections between the ELM327 module successful response (mode 1), 05 specifies the requested PID (coolant
and the ESP32-S3 development board. temperature), and 7B represents the coolant temperature data.
response = cleanResponse(response);
// Cleans response, returns "41057B"
After parsing, the value (83 °C) is available for further use: check-engine warnings, and Battery Voltage to identify potential electri-
cal issues. Additionally, metrics such as Fuel Rate and Fuel Economy
Serial.printf("Coolant Temp: %.2f°C\n", value); encourage efficient driving habits, reminding me to keep my foot lighter
// Outputs: Coolant Temp: 83.00 °C on the gas. Parameters like Intake Manifold Temperature and Pressure,
Mass Airflow, and Engine Load were selected to provide insight into
This value is then displayed on the screen using graphical functions engine efficiency and performance.
defined in the firmware:
A personal favorite addition is the Uptime Timer, essentially a stopwatch
drawCoolantTemp(value); activated upon engine start, initially intended as a warm-up timer but
// Visually displays the coolant humorously useful for highlighting time wasted in traffic.
// temperature (83 °C) on the screen
The following snippet illustrates how an individual sensor card,
This process — sending commands, receiving and cleaning responses, such as Coolant Temperature, is drawn on the TFT display. The
parsing data using PID-specific formulas, and displaying parsed drawCoolantTemp function takes the coolant temperature value and
values — is consistently followed for each parameter requested from clearly presents it within a visually consistent card layout:
the vehicle’s ECU.
void drawCoolantTemp(int coolantTemp) {
User Interface Design int cardWidth = 147;
The parsed sensor values are continuously displayed using the graphical int cardHeight = 63;
capabilities provided by the Arduino_GFX library [8]. Real-time values int x = 17;
update dynamically on the TFT screen, offering the driver immediate int y = 45;
feedback on vehicle conditions, such as instantaneous fuel economy, // Draw card background
battery voltage, and engine parameters. gfx->fillRoundRect(x, y, cardWidth,
cardHeight, ROUND_EDGES, gfx->color565(0, 51, 102));
For the user interface, I took inspiration from various after market racing
dashboards available online, ultimately combining selected elements // Draw icon
into a unique, personalized layout. Initially, Figma Design [9] was used gfx->setFont(&FreeSans9pt7b);
(Figure 11) to precisely define and refine the visual concept before gfx->setTextColor(gfx->color565(0, 128, 255));
moving into actual code implementation. gfx->setCursor(x + 7, y + 18);
gfx->print("Coolant ( C)");
Each sensor reading is presented in a dedicated visual card, enhancing gfx->drawCircle(gfx->getCursorX() - 24,
readability and simplifying potential updates. The parameters chosen gfx->getCursorY() - 8, 2,
for display were guided by practical needs: Coolant Temperature for gfx->color565(0, 128, 255));
quick overheating detection, Oxygen Sensor Voltage due to frequent // Draw degree symbol
Although metrics like Transmission Temperature or Oil Pressure would Example: A response of 41 05 7B indicates:
have been beneficial, these are unsupported by my vehicle’s ECU.
However, integrating additional sensors into this project is straight- > 41 (0x40 + 0x01) confirms successful mode 01 response.
forward if supported by one’s vehicle. > 05 confirms the requested PID.
> 7B (hexadecimal) is the raw data value.
The fully realized user interface, actively displaying real-time sensor
data during driving, can be seen in Figure 12. To obtain meaningful information, the raw hexadecimal
response must be converted using a defined formula. For
Engine Coolant Temperature (PID 05), the formula is:
Formula/
PID Description Units
Conversion
05 Engine Coolant Temp. A - 40 °C
0C Engine RPM ((A × 256) + B) / 4 RPM
0D Vehicle Speed A km/h
11 Throttle Position (A × 100) / 255 %
10 Mass Air Flow (MAF) ((A × 256) + B) ÷ 100 g/s
To find out the PID requests along with their formulas, these
two internet resources were used [6][7].
Figure 12: Close-up view of the finalized user interface for the custom OBD2
sensor dashboard, displaying real-time sensor data.
Given that built-in batteries are impractical due to high cabin tempera-
Related Products
tures — particularly risky with LiPo batteries — the plan is to incor-
porate a Real-Time Clock (RTC) module. An RTC ensures accurate > ESP32 Development Board (Cheap Yellow Display)
timekeeping for reliable data logging and timestamping, essential www.elektor.com/20890
especially when combined with the intended GPS integration. This
addition would offer real-time speed data, accurate route tracking, and
> Dogan Ibrahim, Controller Area Network Projects
(E-book, Elektor)
comprehensive insights into driving performance and vehicle health. www.elektor.com/18219
WEB LINKS
[1] JC3248W535 ESP32-S3 Based Development Board, AliExpress: https://s.click.aliexpress.com/e/_mM4CGkP
[2] ESP32 Development Board (Cheap Yellow Display): https://www.elektor.com/20890
[3] ELM327 Module, AliExpress: https://s.click.aliexpress.com/e/_mrxPLWP
[4] Florian Schäffer, “OBD2: Retrofitting a Tachometer and Shift Light in your Car,” Elektor 7-8/2025:
https://www.elektormagazine.com/250005-01
[5] OBD2 Dashboard, GitHub: https://github.com/ElektorLabs/obd2-dashboard/
[6] OBD2 PIDs for Programmers, Total Car Diagnostics:
https://www.totalcardiagnostics.com/support/Knowledgebase/Article/View/104/0/obd2-pids-for-programmers-technical
[7] OBD2 PID Interactive Converter Tool, CSS Electronics:
https://www.csselectronics.com/pages/obd2-pid-table-on-board-diagnostics-j1979
[8] Arduino GFX library: https://docs.arduino.cc/libraries/gfx-library-for-arduino/
[9] Figma Design: http://www.figma.com
GET FREE
DOWNLOAD
Subscribe
Sub
ubscrib
ubscr
ubsscr
crib
cribe
ibee tod
to
toda
today
toda
oday
dayy a
day at elektor
elektormagazine.com/ezine-24
elektorm
elek tormag
torm
tor
orm
ormag
mag
agazine
aga
agazine
zine.c
zine
ine..com/
ine
ine.com/
ine.c om/ezine
om/ezine-24
ine-
ine-2
-24
24
If your car doesn’t have a rev counter or shift light and you think it The perfect time to shift is when your engine hits the RPM where it
might be useful, you can add it without even popping the hood. All makes peak power without the torque dropping off. For most gasoline
you need is a low-cost OBD2 diagnostic module and some electron- engines, that’s around 4,500 RPM while for diesels, it’s about 1,800 RPM.
ics to display the data. That’s also when the gear shift light comes on, if you have one.
Figure 2 shows the basic layout of a DIY RPM display with a gear shift The most reliable setup that I found can be built using a model that
light. This project uses a cheap ELM327 clone from China to handle consists of two circuit boards with a clearly separate (usually blue)
communication with your car. The great thing about these modules is Bluetooth module. Look closely at product photos when buying the
that they include not only the ELM chip (which grabs and formats the adapter and use the return option if what arrives doesn’t match. Some
data) but also all the circuitry needed to support various car commu- listings claim the dual-board design is a new innovation, but it isn’t.
nication protocols. To handle the logic and display output, the project Just keep in mind, even this version doesn’t support every protocol. It
uses an Arduino Pro Mini (the 3.3 V version works best with the generic can’t handle J1850 VPW, a rare and outdated standard mostly found
ELM clones). The Arduino reads the RPM data via UART and displays in old GM and Chrysler vehicles.
it on a simple four-digit numeric display. It also controls the shift light
LED according to the engine speed. Lastly, this project intentionally avoids any wireless communication
between the ELM and Arduino for good reason. Wireless connec-
Choosing the Right ELM Clone tions can be flaky in a car environment and introduce unnecessary
First, you’ll need an ELM327 interface. Since the demise of hassle. There’s also a potential security risk: a constantly active wireless
ELM Electronics, theres now not so much guilt in using one of the ELM device could, in theory, be a backdoor into your vehicle’s control
many knockoffs floating around. The easiest route is to buy a cheap network and may be exploited by ne’er-do-wells to unlock your car
prebuilt OBD2 interface and do a little hacking. The ELM chip was or cause other mischief.
originally designed for serial communication with a PC and had an
integrated CAN controller. That’s why all the clones still only support A Look Inside the ELM Clone
serial connections. That’s not really a big deal; there are plenty of Most ELM327 clone housings can be popped open pretty easily. Once
modules that can send serial data over USB, Bluetooth, or Wi-Fi. To inside, you’ll usually see a Bluetooth PCB module soldered in place, it’s
build the display setup, you can just tap into the ELM’s UART pins. USB typically connected at five points. You can desolder it without too much
versions are now rare and usually overpriced, so the simplest solution trouble, but be extra careful with the RxD and TxD pads, since they
is to opt for a Bluetooth OBD2 adapter. These come in small thumb- aren’t connected to pin headers (see the zoomed-in view in Figure 3).
sized housings that can be easily popped open. Remove the Bluetooth
module (which you won’t need for this project) and wire the ELM board To program your Arduino, you’ll need a USB-to-TTL adapter. Just hook
directly to the Arduino’s serial communication pins (see Figure 3). it up as shown in the schematic (Figure 2). In the Arduino IDE, select
Figure 3: The blue PCB with the Bluetooth Module is not needed
and can just be desoldered.
The second part of the question is a bit trickier. According to ISO standards, it’s the vehicle manufacturer’s responsibility to ensure that
continuous access to OBD2 does not impair the car’s functionality or drivability in any way.
In the early days of OBD2 port implementation, there were stories of control system crashes, causing the instrument cluster to switch to
disco mode with all displays flashing at random rates. The solution (as ever, where computers are involved) was to remove the diagnostic
device, turn the ignition off, and back on again. Continuous data monitoring via an external reader was problematic.
Stories of more serious malfunctions of the braking system or other horror scenarios, however, are nothing more than urban myths.
the usual settings for a Pro Mini: ATmega328, 3.3 V, and whatever doing this, but it can interfere with your vehicle’s control units, which
programmer you’re using. Make sure the Serial Monitor window is not may stay awake instead of going into sleep mode. Over time, this
open while uploading the code; otherwise, you may run into upload process can result in a drained battery.
errors.
If you want to know how your car responds in this situation, try measur-
This project uses a seven-segment LED display with a TM1637 control- ing the current draw directly at the battery. Use a DC clamp ammeter
ler. The display is available in different colours and works well both with the bonnet, doors, and windows all closed (don’t start the engine
at night and in bright sunlight. If you’d rather not use such a display, or touch the ignition key while testing!). After about two minutes, if
feel free to skip it or swap it for something else and tweak the code the current draw from the battery with the rev counter unit attached
accordingly. is the same as without it, there is nothing to worry about.
For the gear shift light LED indicator, go with something super bright, The best solution is to change the wiring to the OBD connector. Pin 16
such as 10,000 mcd. That’s plenty to catch your eye, even if it’s not provides a continuous 12 V supply. This can be replaced by a cable
mounted directly in your line of sight, just don’t stare straight into it. A carrying a switched supply so that the voltage drops to zero when the
reflective LED mount helps make it even more visible. As for the LED ignition is off. This mod will not affect how the socket is used in normal
series resistor, you’ll need to calculate the right value based on your operation when a garage technician connects diagnostic equipment
LED’s specs. Just make sure the current draw doesn’t go over 40 mA. to the socket, because it can only communicate with the ECU when
the vehicle ignition is on. In some older European VAG (Volkswagen/
Power to the Unit Audi) cars, a “Terminal X” supply is also available in the wiring harness
Powering electronics from a car’s electrical system always comes with and could alternatively be used to provide power to the socket. Termi-
its headaches. While we generally accept that cars run on “12 V,” that’s nal X only supplies 12 V after the engine starts running.
really just a nominal value. In reality, the voltage can go up to 14.4 V
when the engine is idling. During startup, you might even see huge If you prefer to use an extension adapter cable between the OBD socket
voltage spikes (hundreds of volts!) or dips below 5 V. Whilst driving, the and the rev counter unit, it is possible to swap the wire to pin 16 in the
voltage level tends to fluctuate, and has high levels of electrical noise. OBD extension cable with either of the alternative switched supplies
mentioned above. The rev counter unit will then be turned on and off
The designers of cloned ELM devices generally do not pay too much along with the ignition.
attention to mitigating the electrical noise issues. The unit needs to
be cheap, so every possible corner has been cut to save costs. Most The Program Code
of the designs use the AMS1117 type of voltage regulator to bring 12 V You can download the full program for this project from Elektor Labs [3].
down to 3.3 V. That particular regulator isn’t especially robust: it can Using the ELMduino.h library included in your Arduino sketch makes
only handle up to 15 V input and its “1 A” output rating is also more talking to the ELM327 module really simple. You just need a few function
wishful thinking than reality. On top of that, it has zero overvoltage calls, and you’re good to go. The same goes for the TM1637Display.h
protection, so if it fails, your whole circuit might fry from the applica- library used for outputting data to the 7-segment LED display. Both
tion of raw battery voltage. libraries are available via the Arduino IDE’s Library Manager and can
be installed in just a few clicks.
Another issue is that most OBD ports only supply constant power
(always-on 12 V), not switched power (on only when the ignition is on). The source code is well commented, making it easy to follow and
That means the ELM doesn’t actually know when the car turns back understand how everything works. At the start, there is a section for
on. Unless you unplug the unit after use, it will keep trying to initiate a customization. This is where you can set the target RPM for the shift
new diagnostics session over and over. It doesn’t draw much current light to trigger (default: 1850 RPM), and how long the LED should
Once the connection with the ELM is established, the sketch enters Questions or Comments?
a loop that continuously fetches the RPM data. It processes the data If you have any technical questions or comments regarding this
for display formatting, such as adding a separator or rounding the project please contact the author at [email protected] or the
last digit to zero so that the readout is more stable. (An ultra-precise Elektor editorial team ([email protected]).
RPM readout isn’t that useful for our purposes and just makes the
displayed values flicker.)
The most important part of the code checks whether the current RPM
has reached or exceeded the configured threshold. If it has, the gear
shift LED lights up and then turns off after a configurable delay period
elapses. The program locks out any further blinking until the RPM About the Author
drops back below the threshold, so you don’t get constant flashing Florian Schäffer has been working as an author of nonfiction books
while accelerating or cruising in the highest gear. and a freelance editor for over 30 years. His interests include
electronics and programming microcontrollers. Years ago, he got
The sketch also checks for communication errors during OBD polling. stuck into computer-based car diagnostics to fix his own car. Since
If something goes wrong, it attempts a quick reconnect of the ELM327 then, he has been exploring the possibilities of vehicle OBD and
to the OBD so the display keeps working without interruptions. If it even runs his own online shop.
detects a more persistent error (for example, when the car’s ignition is
turned off), it clears the display and waits for a longer interval before
trying again. This keeps the system from needlessly polling the OBD
when the ignition is turned off.
Related Products
Installation in Your Car
Housing all the components and making a neat installation can be a > Seeed Studio OBD-II CAN Bus Development Kit
little tricky. Your best bet is probably to design and 3D print your own www.elektor.com/20236
enclosure or use a commercial OBD plug and enclosure (Figure 4).
In this setup, the original blue ELM case was opened with a Dremel
> FNIRSI DMC-100 True RMS Smart Clamp
Multimeter (600 A)
and replaced with a custom OBD plug that also has a matching www.elektor.com/21114
housing [4].
Edited by Rolf Gerstendorf / Translated by Martin Cooke — 250005-01
WEB LINKS
[1] Saad Imtiaz, “OBD2 Sensor Dashboard,” Elektor 7-8/2025: http://www.elektormagazine.com/250107-01
[2] Chip on board, Wikipedia: https://en.wikipedia.org/wiki/Chip_on_board
[3] Download: https://www.elektormagazine.com/labs/elektor-articles-software-downloads
[4] Modular OBD-2 system: https://www.obd2-shop.eu/index.php/cPath/21_71/language/en
for Robotics
Source: Adobe Stock
By Saad Imtiaz (Elektor) In the rapidly evolving world of robotics, a machine’s ability to
perceive and understand its environment is critical to its success.
As sensing technologies continue to From autonomous vehicles navigating complex terrains to factory
evolve, they are quietly shaping how robots collaborating alongside humans, the fusion of advanced
sensors has enabled remarkable progress. Today, technologies like
robots perceive and interact with LiDAR, depth-sensing cameras, and AI-enabled vision systems are
their environment. This article looks no longer reserved for industrial giants — they are increasingly
into a range of LiDAR sensors, and accessible to engineers, students, and makers alike.
depth cameras that are commonly As part of this growing accessibility, a range of reliable sensors —
found across robotics projects — such as those from YDLIDAR [1], which is available via the Elektor
from research and education to more Store — have made it easier than ever to get started with robot-
ics projects or scale them up with more capable hardware. These
advanced applications. It also touches sensors are widely used in educational platforms and prototypes,
on software ecosystems, typical use offering a solid foundation for mapping, localization/navigation,
cases, and a few higher-end options that and obstacle detection.
hint at what’s possible as these tools This article offers an in-depth exploration of some of the most
become more widely adopted. popular and community-supported sensors available today,
comparing their performance, software ecosystems, and ideal
applications. Whether you’re building a mobile robot, a smart
surveillance system, or an autonomous drone, understanding
these technologies will help you select the right perception tools
to turn your vision into reality.
infrared light and measures the time it takes for the light to bounce where a camera or LiDAR might struggle. However, it might only
back from surfaces — this delay is used to calculate distance with tell “there’s an object at 150 m ahead in lane” but not detail its
high precision. Structured light, on the other hand, involves project- shape or type. Radars are also usually limited to planar scanning
ing a known infrared pattern — such as a grid or dot matrix — (automotive radars have a narrow vertical field).
onto the environment, and then using the deformation of this
pattern when viewed by the camera to calculate depth. This requires Best use cases for radar are in adverse visibility conditions or as
an integrated IR projector and is typically optimized for indoor a safety overlay for long-range obstacle detection (e.g., drones or
use. Depth cameras produce dense depth maps, enabling robots cars use radar to sense far-away obstacles or approaching objects
to understand not just what objects are, but exactly where they at high speed). In environments with lots of metal or reflections
are relative to the sensor. They are passive or semi-active systems (indoors, machinery), radar readings can be noisy. In short, radar
(depending on whether they project IR patterns) and often work adds robustness in weather and long-range speed sensing, comple-
best in controlled lighting conditions. menting cameras and LiDARs.
Depth cameras are ideal for indoor SLAM, gesture recognition, In practice, sensor fusion is key — many robots use all three:
object manipulation, and 3D scanning, providing a detailed spatial cameras (for understanding what objects are), LiDAR (for where
context at relatively low-cost and high resolution compared to objects are in 3D), and radar (for reliable detection in bad condi-
LiDAR. However, they can struggle outdoors under direct sunlight tions and velocity tracking). Each compensates for the others’
(especially structured-light sensors) or over very long distances, weaknesses.
and depth accuracy typically degrades beyond 5 to 10 m. Best-use
scenarios for depth cameras include building mobile robots for For example, an autonomous car might use a camera plus AI to
indoor navigation, interactive robots that recognize hand gestures, read a street sign, lidar to precisely map its surroundings in 3D,
warehouse automation for object picking, or AR/VR applications and radar to keep tracking a vehicle in heavy rain where the other
needing detailed room-scale mapping. sensors falter. Understanding these trade-offs helps in choosing
the right sensor mix for a given robotic application.
Radar
Radar uses radio waves (often in the microwave band, like 24 GHz or For a summary of how LiDAR, depth cameras, and radar differ in
77 GHz in automotive radar) and measures their reflections. Radar function and use, see the Technologies and Use Cases textbox.
can penetrate fog, rain, and dust far better than optical sensors –
weather has little effect on radar’s longer wavelengths. It’s also
an active sensor (emits its own signals), working in darkness and LiDAR Sensors (and a ToF Camera)
bright light alike. The trade-off is that radar has much lower spatial LiDAR sensors produce 2D or 3D point clouds that are commonly
resolution – it doesn’t create a detailed image, but rather detects used in robotics for SLAM, obstacle avoidance, and spatial naviga-
the position and velocity of objects (often outputting a sparse set tion. Depending on the model, these sensors output data via USB,
of detected targets or a coarse point cloud). UART, CAN, or Ethernet. High-resolution units typically require
processing on a PC or embedded system like an NVIDIA Jetson,
In robotics and vehicles, radar is fantastic for long-range detec- while lighter-weight models are often compatible with Raspberry
tion and speed measurement (Doppler returns give direct relative Pi boards and, in some cases, even microcontrollers — making
velocity of targets). For example, an autonomous car’s radar can them versatile for a range of robotics platforms. Below are some
detect another vehicle at more than 200 m even in heavy rain, LiDAR sensors widely used in such applications:
Field of View
Model Type Range (FoV) Points/s Applications Approx. Price
Velodyne VLP-16 3D LiDAR High-fidelity mapping,
Up to 100 m 360° H × 20° V ~600,000 ~$950–$1,500
(Puck Hi-Res) (16 channels) autonomous navigation
Slamtec 2D LiDAR Indoor SLAM, hobby
Up to 12 m 360° Up to 8,000 ~$99
RPLIDAR A1 (Triangulation) robots, education
Slamtec Outdoor SLAM,
2D LiDAR (ToF) Up to 40 m 360° Up to 9,200 ~$649
RPLIDAR S1 autonomous rovers
VSemi Sentinel Gesture tracking, depth
3D ToF Camera 0.1 m – 7.5 m 51° H × 20° V N/A ~$199
(3D ToF Camera) sensing, indoor robots
3D LiDAR Mobile robotics,
Livox MID-360 Up to 40 m 360° H N/A ~$1089
(Solid-State) warehouse navigation
3D LiDAR Dense mapping, SLAM,
RoboSense Airy Up to 30 m 360° H × 90° V 1.72 million ~$1,099
(Digital) drone navigation
3D LiDAR Rugged robotics,
RoboSense E1R Up to 75 m 120° H × 90° V 260,000 ~$999
(Solid-State) outdoor automation
Slamtec 2D LiDAR + Mapping, localization,
Up to 12 m 360° N/A ~$380
Slamkit & C1 SLAM Solution indoor AGV navigation
output over USB or Ethernet, making them easy to integrate. Most and temperature sensors. With support for ROS and SDKs in C++
are compatible with PCs, embedded platforms like the NVIDIA and Python, the ZED 2i is ideal for 3D mapping, autonomous naviga-
Jetson, and in some cases, even Raspberry Pi boards — though tion, and AR/VR applications.
microcontroller support is typically limited due to bandwidth
and processing constraints. Their robust software ecosystems, Orbbec Gemini 335Le
ROS compatibility, and active developer communities make them The Orbbec Gemini 335Le is a
especially well-suited for robotics applications. rugged, industrial-grade stereo
vision depth camera designed for Source: [13]
Intel RealSense D435 robotics in demanding environments [13]. It offers depth sensing
The Intel RealSense D435 is a versatile from 0.25 to 20 m, with optimal accuracy up to 6 m, and deliv-
active stereo depth camera equipped ers both depth and RGB streams at 1280×800 resolution using
with global shutter sensors, making global shutter sensors. With an IP67-rated enclosure, Power over
it suitable for capturing fast-moving Source: [10] Ethernet (PoE), and support for ROS1/ROS2 and NVIDIA Jetson, it’s
objects [10]. It offers a depth range of 0.3 m to 3 m and supports well-suited for mobile robots, automation, and outdoor robotic
resolutions up to 1280×720 at 30 fps. With a wide field of view (85° applications.
× 58°) and compatibility with ROS, it’s ideal for applications like
SLAM, obstacle avoidance, and robotic manipulation. See the Depth Sensing Cameras Comparison Chart textbox
for a technical and practical comparison of the most widely used
Intel RealSense D455 depth cameras in robotics.
Building upon the D435, the D455 extends the depth range up to
6 m and enhances accuracy by increasing the baseline between
the stereo sensors [11]. It maintains the same resolution and frame Why Some Sensors Cost More Than Others
rate capabilities, offering improved performance in outdoor and When browsing sensor options, you’ll notice huge price variations
long-range scenarios. The D455 is well-suited for mobile robotics – e.g., a hobby RGB-D camera might be $200, while a high-end 3D
and applications requiring precise depth perception over extended LiDAR can exceed $10,000+. Several factors drive the cost:
distances.
> Range and Power: Sensors designed to see farther (or in
Stereolabs ZED 2i tougher conditions) need more power and advanced compo-
The Stereolabs ZED 2i is a passive stereo camera that provides nents. A LiDAR that reaches 200 m uses more powerful lasers
high-resolution depth sensing up to 20 m [12]. It features a wide and sensitive detectors (often with cooling and precise timing
field of view (110°) and integrates an IMU, barometer, magnetometer, circuits), increasing cost. For instance, a basic indoor LIDAR
with 6 m range uses a low-power laser diode, whereas a 200 > Build Quality and Durability: Robotics sensors that are
m automotive LiDAR uses amplified laser pulses and APD meant for heavy use or harsh environments are built to
(avalanche photodiode) receiver arrays – clearly more expen- higher standards (ruggedized enclosures, waterproofing,
sive tech. Similarly, a depth camera like Microsoft’s Azure wide operating temperatures, shock/vibration resistance). For
Kinect (around $400) uses a sophisticated Time-of-Flight example, the Velodyne Puck is rated IP67 (waterproof) with
sensor to reach ~5 m with millimeter accuracy, whereas a $150 an aluminum housing and has undergone extensive testing
structured-light sensor only works to ~0.8 m reliably. — this drives up cost. Cheaper sensors might be just plastic
> Resolution (Channels / Pixels): Higher resolution means housings not meant for rain or long-term use. In industrial or
more sensing elements or more complex optics. In LiDARs, automotive settings, companies are willing to pay more for
the number of laser channels (beams) is a big cost factor — a sensors that reliably last tens of thousands of hours. Addition-
64-beam Velodyne has 64 individual laser diodes and detec- ally, manufacturing tolerances (for optics alignment, etc.)
tors, precision-mounted on a spinning assembly, which costs and calibration of each unit add to cost. High-end devices are
a lot more to manufacture than a single-beam RPLIDAR. Each often individually calibrated and tested.
additional channel also increases the data processing load
(needing beefier onboard processors or FPGAs). For cameras, In summary, you get what you pay for: budget sensors are fantas-
higher megapixel sensors or global shutter sensors cost more tic for hobby projects and early prototyping, but for applications
than low-res or rolling shutter ones. Depth cameras with needing long-range, precision, and reliability, the investment in a
higher resolution depth maps (e.g., 1024 × 1024 ToF arrays) higher-end sensor pays off in data quality. It’s often a balance – many
will be pricier than those with 640 × 480. robotics teams use a mix of high and low-cost sensors to meet their
> Processing and Intelligence: Some sensors bundle signif- needs without breaking the bank. For instance, a research robot
icant onboard processing which adds cost. An AI camera might use a $3000 LiDAR for mapping but a set of $50 sonar or IR
like the Luxonis OAK-D has the Myriad X VPU – essentially sensors as backup collision detectors at close range.
a mini computer – inside it. This adds to the price, but the
benefit is it offloads your main computer and simplifies Industrial-Grade Sensor Vendors to Know
software. High-end lidars often output processed point clouds Finally, it’s worth knowing the key players in the sensor industry,
in real-time, requiring built-in FPGA or ASIC processing. even if their products are beyond the needs of a small project. In
Cheaper sensors might output raw data for the user to process the LiDAR space, companies like Velodyne, Ouster, Hesai, and Livox
(shifting the cost to the user’s computing resources instead). are leading development. Velodyne (a pioneer since the DARPA
The inclusion of IMUs, onboard calibration modules, or Grand Challenge days) offers a range from the compact Puck to
sensor fusion (e.g., cameras with integrated depth processing the Alpha Prime (128 beams, long range). Ouster focuses on afford-
like the ZED) also raises price. able high-resolution digital lidars (with a single chip integrating
> Software Stack and Support: When you pay for a sensor, many lasers). Hesai produces high-performance LiDARs used in
especially industrial-grade ones, part of what you pay for is many self-driving car tests. Livox (affiliated with DJI) takes a novel
the robust software and support behind it. Industrial vendors approach to scanning to reduce cost. These vendors are pushing
(like Basler or Zivid for cameras, Velodyne for LiDAR) provide technology forward.
extensive SDKs, documentation, and customer support. They
ensure drivers are maintained for new OS versions, offer For depth and 3D cameras, industrial machine vision companies
calibration utilities, and have warranties. This “software assur- like Zivid and Basler are notable. Zivid’s cameras (e.g., Zivid Two) are
ance” cost is built into professional products. In contrast, a used in robotics picking systems for their high precision color 3D
$100 sensor from eBay might come with minimal documen- capture (accurate to 0.1 mm, but costing in the tens of thousands).
tation and no support, leaving you to reverse-engineer data or Basler’s blaze camera uses Time-of-Flight to produce metric 3D
rely on the community. data for logistics and factory automation, with the reliability
WEB LINKS
[1] YDLIDAR: https://www.ydlidar.com/
[2] Velodyne VLP-16, Ouster: https://ouster.com/products/hardware/vlp-16
[3] Slamtec RPLIDAR A1: https://www.slamtec.com/en/lidar/a1
[4] YDLIDAR TG15 Outdoor LiDAR: https://www.elektor.com/products/ydlidar-tg30-lidar-360-degree-laser-range-scanner-30-m
[5] Slamtec RPLIDAR S1, RobotShop: https://eu.robotshop.com/products/rplidar-s1-360-laser-scanner-40-m
[6] Sentinel 3D ToF Camera, VSemi: https://vsemi.io/products/sentinel
[7] Livox MID-360: https://www.livoxtech.com/mid-360
[8] RoboSense Airy: https://www.robosense.ai/en/rslidar/Airy
[9] RoboSense E1R: https://www.robosense.ai/en/rslidar/E1R
[10] Intel RealSense D435: https://www.intelrealsense.com/depth-camera-d435/
[11] Intel RealSense D455: https://www.intelrealsense.com/depth-camera-d455/
[12] StereoLabs ZED 2i: https://www.stereolabs.com/en-pk/store/products/zed-2i
[13] Orbbec Gemini 335Le: https://store.orbbec.com/products/gemini-335le
[14] Depth Sensor Visualizer, Tangram Vision: https://www.tangramvision.com/resources/depth-sensor-visualizer
Non-Contact Temperature
DC Motor Control Measurements
Motor control was, of course, a key Optris is specialized in industrial IR
topic at the PCIM. Toshiba showed a cameras and IR sensors, covering
nice demo based on the brushed DC applications as surveilling large
motor control chip TB67H453 with power facilities on one end to
current sensing. When slowing down the motor with your hands at the wheel, chip research on a microscopic
the higher current was shown at the LED ring. Current feedback can be used scale on the other end. The
for replacing position switches, cutting down the bill of materials and costs. German company has shown at
For easy evaluation of their motor control the Sensor+Test a lot of products
chips, Toshiba developed together with from their portfolio, for example
MikroElektronika a big set of Click boards. the thermosensor on the left, here
Find more about Toshiba at the PCIM at our measuring the surface temperature
Elektor TV Industry YouTube channel (see of an aluminium cube. A simple
textbox). “coating” — in that case an Edding
https://tinyurl.com/toshiba-motor-driver marker spot — does the trick!
https://optris.com/
PCIM in Video
Engineer and Journalist Stuart Cording
was also going around on the PCIM, as
always with the professional camera man
Michael “Mic” Klausner. Qoitech’s Otii
power analyzer was only one of the excit-
ing products they reported on. Check out
this video and a mashup of other company
video reports at our Elektor TV Industry
YouTube channel:
www.youtube.com/@ElektorIndustry
Weles Acoustics
As I am interested
in audio projects, Tracking Thousands of Devices
“sound maps” High-accuracy tracking with low-
always attract cost devices is a kind of holy grail of
my interest (see many IoT applications, like storage,
my report of traffic, and retail. The German start-
Sensor+Test up company Pelory uses an array of
2024 [3]). This antennas to track Bluetooth chips
system from (which are, for example, anyhow
Weles Acoustics is using a special sound integrated in smartphones) with an
probe to detect the sound pressure and accuracy of some centimeters. One
particle velocity at different positions and in antenna array can track thousands of devices at the same time,
different frequency ranges. The scan must and with more antennas, you can cover big halls and places.
be processed manually; the system detects According to the manufacturer, a German supermarket chain
the position of the probe with two LEDs, in is highly interested, but it could also be interesting for fairs and
order to draw maps of sound intensity. This events. Not only to see where the most successful booths are
is interesting for production machine and located, but also to navigate visitors to the exhibitor of their
automotive development, measurements choice. Especially in Nuremberg with a kind of labyrinthine
of sound protection and many more arrangement of halls, this could be indeed helpful!
applications. www.pelora.io
https://weles-acoustics.com/en/
250359-01
WEB LINKS
[1] Sensor+Test - The Measurement Fair: http://www.sensor-test.de
[2] PCIM Expo: https://pcim.mesago.com/nuernberg/en.html
[3] Jens Nickel, “Sensor+Test 2024 and PCIM 2024,” Elektor 7-8/2024 Bonus Edition: https://www.elektormagazine.com/iot-sensors
Contact-Free
E-Field Measurements (1)
which means that the current signal I(t) is a sine (cos) of frequency ν > Establishing coupling between drive actuator and sensitive
with an amplitude proportional to potential (difference) U and inversely membrane over 10 to 30 cm distance by a resonant air column.
proportional to the square of the distance d. The sensitivity depends The best (resonant) frequency is determined at start by a scan
on the product of the (effective) membrane area A, the vibration (Arduino program).
frequency ν and the (yet unknown) vibration amplitude a. > Using a two-channel phase synchronized detection employing
two 90° phase-shifted reference signals. From the two detector
Electrical field voltages, the amplitude and the phase angle of the membrane
An alternate view of the situation may start with a given electrical field current can be computed (Arduino program). The phase yields
at the surface of the membrane (e.g., resulting from some charged the sign of the applied field.
object in the vicinity). If the membrane moves a distance δx along the > To extract the sign (positive and negative polarity are associated
electrical field lines, its potential (voltage) should change by δU = E δx. with a 180° phase difference) and magnitude of the voltage of the
The voltage change in the capacitor C, however, is compensated by object under test in a calibration sequence, we observe the signal
a current flow in the shunt resistor R to ground. Again, the associated change upon charging the membrane with a known potential. This
charge is δQ = C δU = C E δx and since δx = a sin(2πν) leading to decouples the determination of the test object voltage from exact
a current: knowledge of the membrane distance and stray capacitance.
> Besides the phase sensitive detection using a frequency that is
different from multiples of 50 Hz, the diagram contains a 50 Hz
notch T-filter.
This may be compared to the previous result if we observe that
E = -U/d and C = ε A/d. Circuit Diagram
The circuit diagram of the electric field sensor is shown in Figure 1.
Note, however, that C is the “mutual” capacitance between membrane Here, its function is explained. From left to right, the functional blocks
and charged object plus free space; any extra capacitance added by include:
connecting cables and other circuit components has little or no influ-
ence on the signal, as long a Ctotal R ≪ 1/ν. > A coupling and protection network, including the shunt resistor
R1|R22 or R22 alone.
In the real world > A first amplification ×22 stage (U1) of the shunt resistor voltage.
For the present realization the membrane displacement is not that of a > A 50-Hz blocking T-filter network (R6, R7, R8, C3, C4, C5).
rigid vibration plate but rather that of a membrane with fixed boundary, > A second amplification ×22 stage (U2).
such that the displacement must be averaged over the area, yielding > Two synchronous switching stages (unity amplification ±1) with
an average that has a value of about 10% of the maximum central 90° phase difference (U3, U4 with Q1, Q2).
displacement amplitude. > Averaging RC combinations (R17, C6 and R18, C7) connected to
buffer amplifiers (U7A,B).
The amplitude (and the phase) of the displacement is frequency-de- > A four-channel (2 differences) 16 bit ADC-shield (based on
pendent, and for closer plate distances d depends on this distance ADS1115 by Texas Instruments) that reads the outputs of the
(as well as the exact resonance frequency). buffer amplifiers and communicates these via I2C to the Ardui-
no-programmed ATmega386 microcontroller.
The presented construction incorporates measures and strategies to > A chain of two D-flip-flops U5A, U5B that receive a frequency
cope with these difficulties to enable also quantitative results. Later, signal from the microcontroller (GPIO4) that is generated via the
the inferred membrane amplitudes were compared to results from a tone-command.
laser interferometer setup. > XOR logic and buffers (U8A, U8B) that create symmetric
90° shifted reference switching signal for the synchronous detec-
Challenges tor’s outputs U8A (Gf) and U8B (G1).
While the basic measuring task is clear and consists of simply deter- > Filtered and current limited (C1, R25) transistor switched
mining the amplitude of the induced current I(t), the practical reali- frequency output (at ¼ of the tone frequency) to drive a miniature
zation poses a number of challenges: loudspeaker (8 to 80 Ω) that is resonance coupled to the sensor
TLE2426xLP
V+
U10 Q3
20 7 21
R23
AVCC VCC AREF Frequency
COM 1 47k
RES Up
R29
SW2 23 14
C0 B0 BC547 R25
10k
24 15 V–
C1 U9 B1
470Ω
V– SW3A
V– 25 16
Reset C2 B2
Trigger out
U8C 26 17 Down
8 C3 B3
10 27 18 J5
9 =1 C4 B4 V– C1
28 19
C5 B5
V–
U8D U5 = 74HCT74 ATmega328p 1 2µ
12 2 13 Trigger out
11 U7 = TL272 D0 D7 /S R24 V–
13 =1 U8 = 4070 3
D1 D6
12 2
D Q
5
470Ω J4
4 11 U5A
D2 D5 V–
V– 5 6 3 6
D3 D4 CLK /Q
/R 10
GND X1 X2 GND
4 /S
8 9 10 22 12 9
Y1 D Q
LCD1
U5B
16 x 2
11 8
V– CLK /Q
C12 16MHz C13 /R
GND
SDA
SCL
+5V
13
1 2 3 4 22p 22p
V–
V– V+
V–
V+
G1
V+
OPA2182
R10 3
1
100k R17
5 3 V+
R9 U3 100k
2 1 14 8 14
100k U7A
4 2 U5 U7 U8
Q1 R31 7 4 7
U8A R11
1 R12
10k
3 100k C6 8
2 =1 100k
VDD
J113
1µ 4 2
V– AIN0 ALERT RDY V–
5 10
AIN1 SCL
V+ 6 U6 9
AIN2 SDA
G2 7 1
AIN3 ADDR
OPA2182 ADS1115IDGS R30 R28 R27
R14 GND
1 3
10k
10k
10k
100k R18 3
5 5
R15 U4 100k
2 7
100k U7B
4 6
Q2 V–
U8B R16
5 R13
4 100k C7
6 =1 100k
J113
1µ
V–
V–
V+ V+
OPA2182
OPA2182 1 3
Membrane C8 Monitor out
R21 3
1 5
J1 4k7 R7 R8 C9 R4 U2 J3
5 2
R19 2n2 U1 14k4 14k44 47k
2 4
C5 1µ
20M
SW1a 4 D3 D4
R5
R3 440n 1M
V-compensate D2 Yellow Yellow
D1 100k
J2 C3 C4
C2 V–
1N4148 1N4148
1n
R20 R1 R22 R2 220n R6 219n R26
220Ω
100k
7k22
4k7
1M
1M
V–
240279-006
Synchronous Detection
To detect the tiny currents from the sensor membrane movements
in the applied static electric field, we need a synchronous detection
scheme that only “tunes in” on signal components that are synchronous
with the driver excitation. Since, however, there is an unknown (and Figure 2: Amplifier frontend and sync-detection.
Figure 3: The complete design, with its main circuitry in the center; it includes: Amplifier (upper left), sync-detection (lower left), ADS1115 ADC, buffer
amplifiers, drive transistor (middle from above), ATmega328 (Arduino), dual flip-flop, XOR-gate(s) (right from above). The Arduino UNO board — with
ATmega chip removed — has been used as a programming interface and disconnected later on.
0.9V
A2
Clk 0.6V CLK /Q
A2 0.3V CLR
0.0V
-0.3V 240279-010
Out -0.6V
A3 -0.9V Figure 5: Flip-flop pair receiving the “tone” signal as input to A1. With the
-1.2V
0ms 5ms 10ms 15ms 20ms 25ms 30ms 35ms 40ms 45ms 50ms XOR gate A3 two 90 degree phase shifted sync-detector signals (U8A and
U8B outputs) are generated.
Figure 4: Signal sequence: “tone” frequency input (red), with U8A (black)
and U8B (green) outputs showing the sync detection signals. (Q3) drive for the speaker with only C1 to partially smooth the square
signal is foreseen.
starkly frequency dependent) phase-shift between the loudspeaker The JFETs switch the amplifier stages U3 and U4 from +1 to -1 amplifi-
excitation and the membrane vibration, the actual phase must be cation, depending on their gate voltage. Finally, the averaged (via R17/
adjusted or determined during the actual measurement. C6 and R18/C7) voltages U_outG1 and U_outG2 — buffered by U7A and
U7B — are digitized by ADC U6. From the digitized voltage values, the full
This is achieved by starting with an Arduino generated square wave signal amplitude and the phase are computed in the Arduino program.
four times the operation frequency f, which is divided down to 2f and The extracted phase further contains the E-field polarity information.
then further to f by two cascaded flip-flops. The first division ensures
a 2f signal that has a duty cycle of exactly 50%. Combining the 2f and With that, the signals at the outputs of the phase detector are illus-
f square waves (clk-A1 and clk-A2 in Figure 4) using an XOR gate trated in Figure 6. The traces shown are shifted for better visibility. To
(Figure 5) made with A1 and A2 (U5A and U5B in the schematic, respec- suppress the considerable noise in the input signal (CH1 = Monitor
tively) creates a further 1f square wave (out A3) with a 90° phase-shift. out) the averaging function was used for the oscilloscope acquisition,
thereby cleaning the signal in a way similar to that of the sync-de-
Feeding the clk A2 and clk A3 square waves to the gates G1 and G2 of tection stages, to extract “noise-free” DC-voltages representing the
the switching JFETs in the two synchronous detector stages around input vibration signal.
U3 and U4, yields averaged voltages U_outG1 and U_outG2 that are
proportional to the in-phase and the 90° phase-shifted detector signal The outputs of the sync-detector opamps are connected to 1 μF averag-
components. One of the square waves with frequency f (here clk-A2) ing capacitors by 100 kΩ resistors (low-pass filter). To achieve sub-mV
is used to drive the speaker (i.e., the membrane); since the acous- accuracy, the capacitor voltages are buffered by another pair of
tic coupling yields sufficient filtering, only a simplistic one transistor OPAx182 opamps, used as voltage followers.
Figure 6:
Phase detector outputs
CH2 and CH3 obtained
by multiplication of the
yellow CH1 signal, CH4
shows the reference
frequency. The
oscilloscope’s traces
are obtained using
averaging. The curves
are vertically shifted, for
a better visibility.
The final averaged voltages relate to the amplitude UR at the shunt Program
resistor via: The microcontroller is programmed using an Arduino environment
and is downloadable at the Elektor Labs page for this project [1].
Upon start or reset, the program starts with a frequency scan (400
to 750 Hz) to find the resonance point of the sensor tube used.
and To do this properly, a constant field must be applied. During that phase,
the display (top of Figure 7) shows the actual frequency together with
signal amplitude and phase.
with α ≃ 400 the amplification factor of the front end and ϕ the phase The switch SW3 (see circuit diagram) allows extending the scanning
angle. (up-ready-down) as long as one of the settings is kept. After the scan,
the resonance frequency will be applied and the present phase deter-
Operation and Measuring Sequence mined and stored. Then the display (Figure 7, bottom) will show the
At start/reset, first a frequency scan is initiated that determines the actual total voltage
resonance frequency. This requires the presence of a (reasonably)
constant applied field to the sensor membrane. As shown below, the
resonance somehow depends on the distance d between membrane
and object. and the phase angle ϕ. The second line shows the voltages after
“rotation” with the determined reference phase. I.e., if the phase has the
Thereby, the best frequency and the phase shift between drive and original value, the first voltage is equal to Ua and the second voltage
signal are determined and stored. The phase knowledge enables the should be close to zero. This enables to check the polarity of the field
determination of the sign of the applied field with respect to the refer- regarding the reference field, as well as potential resonance shifts.
ence at start.
Mechanics
Then measurement can be performed. The results are shown in terms As an easy-to-make makeshift sensor arrangement, a cardboard or
of displayed voltage and phase angle — settling after an averaging plastic (sewer tube) pipe can be used. The main setup is shown in
period of a few seconds. Figure 8. For my experiments I chose lengths between 20 to 30 cm, the
tube thickness was about 40 mm. At one side, a membrane consisting
To interpret the results as potential of the investigated object, a compen- of standard household Al-foil was glued across the opening (no tension
sating (enhancing) voltage can be applied to the membrane — as applied).
we’ll see later on — via a 20-MΩ resistor (still only a negligible signal
bypass!). The ratio of the measured values with and without compen-
sating voltage and the original value multiplied with the compensating
voltage yields an estimate of the object potential.
d
L
C
E
Drive D a E
C
g
Input Ux
2.2nF/
Figure 8: Sketch of the measuring setup. The vibrating membrane is 2KV 20 MW
connected to the input network (2.2 nF, 20 + 10 MΩ) via a 60 cm long Ucompensate
RG174 coax cable. The tube is above some distance from a grounded plane.
10 MW
A plane at elevated voltage Ux is at distance d from the membrane. The
maximum membrane amplitude a is of the order of 1…10 mm.
750
500
mV
250
Figure 10: Resonances of the “sewer pipe“ assembly: the black curve
Figure 9: Setup for some test measurements (distance dependence, offset represents the signal amplitude with the membrane at a distance of 2 mm,
voltage effect). The “sensor” with the vibrating membrane at the “right” end the green one at a distance of 10 mm. The red and blue curves represent
faces the Cu plate, charged at a potential up to 1000 V, connected via a the corresponding phases (1° = 1 mV). Note the artificial back-folding jumps
33 MΩ resistor. The “sensor” sits on a cardboard box to yield some distance when ±180 degrees are reached.
from the grounded steel plate. The Cu plate is isolated by a glass plate from
the steel ground. On the bottom right, the display shows the total average
voltage and the phase angle (1st line); the second line shows the voltages
obtained by “rotating” the sync detector voltages with the calibration 16 mm charged plate distance and 1000 V plate potential. Then the
standard phase angle; thus the first value contains the proper E-field sign
distance was varied and the resulting voltage Ua without and with
and the second value ideally should be zero.
applied (here 285 V) offset voltage Ub were registered.
The results are shown in Figure 11. In Figure 12 the ratio of resulting
At the other end, a miniature loudspeaker (8 to 80 Ω) was attached/glued. voltages without and with compensating offset voltage (applied to the
The Al-foil was connected to the amplifier input by a shielded RG174 cable membrane) are shown. The limiting value for d → 0 allows to infer the
with 40 cm length. A naive estimate of the basic λ/2 resonance of the Ux value of the object under investigation.
tube pipe then would yield 330 m/s/(0.4…0.6 m) = 550…850 Hz. Acous-
tic impedance effects of loudspeaker and membrane and coupling to Thus, the setup may be used to estimate the potential of an electro-
their resonance (may) cause further deviations. statically charged part. I tried a Styrofoam plate charged by rubbing
to some cloth. The ratio of Ua ≃ 200 mV and change by 285 V offset
For flexible experiments and tests, I used a steel ground plate which ∆Ua ≃ 6 mV yields an estimate of 285 V × 200/6 = 9.5 kV. One can
allowed to fix a potential plate (Cu printed circuit board material) as also monitor the slow decay of electrostatic charges. This may be a
well as the tube using a number of assembly brackets and small useful application of the setup to assess ESD risks.
NdB magnets. Figure 9 shows a photo of this assembly. The Ux poten-
tial parts were isolated from the steel by a glass plate. The steel plate Order of Magnitude of Effect and Membrane
was connected to ground. The coupling capacitances CE and Cg Amplitudes
determine the ratio between the displayed output voltage and Ux . With the values: shunt resistor Rs = 1 MΩ, first stage amplifier x420 (6
47.03 mV/701.82 mV = 0.922 damping of the 50 Hz T-filter at the used
Acoustic Resonance frequency of 520 Hz); synchronous detection x 1 and 2/π = 0.6366 we
The microcontroller program searches for the (optimal) resonance obtain a sensitivity such that 1 nA at input yields 0.2465 V at the DC
frequency of the actual setup. The general behavior of the response struc- output of the synchronous detector.
ture of the “tube” sensors (with applied voltage at the adjacent plane)
is displayed in Figure 10. At shorter distances between membrane and The capacitor membrane velocity v = dd/dt (assuming rigid plate
adjacent potential plane (d), the exact position of the main resonance movement) depends on the displacement amplitude a:
depends on this distance. Here it lies between 500 to 600 Hz.
v = 2π f a cos(2πft)
Results
To test the distance (d) dependence of the resulting voltage Ua exper- i.e., the velocity amplitude v0 = 2π f a; with an assumed estimated value
iments were carried out. Here I report the result obtained with the of 5 pF for C, a field E = 30 V/mm and measured U = 0.3 V we would
“sewer pipe sensor.” Initial resonance determination was initiated with get I0 = E C v0 = E C 2π f a ≅ 1 nA yielding a = I0/(E C 2π f) ≅ 2 μm.
150
Ua/mV
Ua/mV
100
50
0 0
0 20 40 60 80 0 20 40 60 80
d/mm d/mm
Figure 11: Measured voltage values as function of distance d at a plate Figure 12: Ratio of the measured Ua values without and with compensating
potential of 1000 V and a detector shunt resistor value of 100 kΩ. The red (externally) applied offset voltage. Ideally — without parasitic capacitive
curve is the value obtained with applied compensation voltage of 285 V. couplings - the value should enable the assessment of the Ux value of the
The change of phase (resonance) with Cu-plate distance is illustrated adjacent plate. The expected ratio would be Ux/Ux-Ucomp, here: 1000 V/
by the blue symbols. The lines are fits with expressions that somewhat (1000 V – 285 V) as indicated by the horizontal line. The influence of
deviate from the theoretical 1/d2 behavior due to influences of the parasitic stray capacitance in a larger distance is clearly visible in deviation of the
capacitance Cg. measured points from this value. Nevertheless, the offset method allows the
approximate assessment of Ux .
Since the real displacement of the membrane is not that of a rigid Questions or Comments?
plate but rather that of a membrane that is fixed at the boundaries, Do you have technical questions or comments about this article?
the effective displacement amounts only to 10 to 15% of the central Please contact the author at [email protected]
amplitude. Thus, we infer a maximum central membrane amplitude or the Elektor editorial team at [email protected].
up to 13 to 20 μm at resonance.
What’s Next
In the next installment of this article, I will describe the interferometric
Related Products
measurement of this amplitude — using a simple makeshift interfero-
metric setup. Stay Tuned! > Douglas Self, Small Signal Audio Design (4th Edition),
240279-01 Focal Press
www.elektor.com/18046
WEB LINK
[1] Elektor Labs page for this project: https://tinyurl.com/2t4wmw3w
b•
or la Elekt
kt
Ele
or
lab
ORIGIN
AL
Ele
b
kt
or
la
or
Wireless
la b
• Ele k t
Mailbox Notifier
From Optical Sensors to Radar, Exploring a Few Options
By Jean-François Simon (Elektor) Of course, this problem can easily be solved by purchas-
ing a ready-made system. Many options are available,
Are you eagerly waiting for a letter or a small from mechanical solutions to electronic ones. However,
parcel? Let’s see what sensors and RF modules building it yourself is an excellent opportunity to explore
different types of sensors and wireless systems while
we can use to build a simple mailbox notifier, enjoying the satisfaction of creating something unique!
and why infrared worked best in the end.
Design Objectives
The most obvious design goal for the project is of course
that it should be compatible with the particular type of
Unnecessary trips to check an empty mailbox can be mailbox I have, which is shown in Figure 1. The system
frustrating, especially in bad weather or for people in rural must operate entirely wirelessly, both for power and
areas where the mailbox might be far from the house. This communication, for ease of installation. Additionally, it
is particularly true for individuals with mobility challenges. should require minimal modification to the mailbox itself.
Additionally, in areas where mail theft is a concern, a Those modifications will have to be discreet, as I don’t
notifier can enhance security by alerting the user as soon want the letter carrier to be confronted with an eccentric
as the mail arrives, reducing the risk of tampering. device which could worry them or give them the impres-
sion of being spied on.
Figure 7: The best position for the sensor, at least for me.
by the PR100 produced a pulse output from the receiver. is present. 2: Both a letter and a package (or possibly
These pulses can then be counted by an Arduino or any junk mail). 3 or more: The sensor likely detected external
other similar device. movements near the mailbox! To reset the counter every
day, its power supply (an old phone charger) is plugged
Staying true to the “less is more” philosophy, I utilized a in a timer socket.
module I already had in stock, which you can easily find
on eBay or AliExpress. It’s a small red PCB equipped with Ultimately, the best position for the PIR sensor was
a 5-digit, 7-segment display and a Microchip PIC16F628A on the inner side of the front door, pointing toward
microcontroller, typically sold as a “Frequency Counter - the back of the mailbox (Figure 7). This configuration
Crystal Tester.” Heinz Winter, from the YouTube channel reliably detected envelopes slid through the slot without
TheHWcave, has made several excellent videos [10] about opening the door and had no trouble detecting motion
modifying this module, including a mode for counting when the door was opened to deposit a package, all
single pulses, even down to DC. You can find the expla- without detecting nearby pedestrians. Initially, I wanted
nation in the video and the source code on his GitHub to build a better, prettier receiver unit, but the cheap
repository [11]. I simply connected the open-drain output 7-segment LED counter blends right in with my living
of the EV1527 receiver to the counter’s pulse input and room now (Figure 8). In the end, I kept the rusty old
added a pull-up resistor (non-critical value, I used 2.6 kΩ). mailbox. Nothing is more permanent than a temporary
The receiver is just small enough to fit between pins of solution! However, these fancy radar sensors are intrigu-
the 7-segment display and was secured with a dab of ing though, I’ll have to keep experimenting and find a use
hot glue (Figure 6). for them in another project!
240715-01
Every day, the counter reading provides a clear indica-
tion of what happened. 0: No mail. 1: A letter or package
Questions or Comments?
Do you have questions or comments about this article?
Email the author at [email protected],
Figure 8: Yay, something or contact Elektor at [email protected].
has arrived!
WEB LINKS
[1] VCNL3040 sensor: https://www.vishay.com/docs/84917/vcnl3040.pdf
[2] VL53L sensor series: https://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html
[3] Stefano Lovati, “The HB100 Doppler Motion Sensor,” Elektor 7-8/2023: https://www.elektormagazine.com/230205-01
[4] XM125 Sensor at Sparkfun: https://www.sparkfun.com/products/24540
[5] Information on the RCWL-0516: https://github.com/jdesbonnet/RCWL-0516
[6] HC-12 RF module datasheet: https://www.elecrow.com/download/HC-12.pdf
[7] Video about the CDM324: https://www.youtube.com/watch?v=5vqSX40seqA
[8] EV1527 datasheet: https://www.sunrom.com/download/EV1527.pdf
[9] QA-R-011 receiver: https://qiachip.com/blogs/usermenu/light-control-module-specification-qa-r-010
[10] Video from TheHWcave about the pulse counter: https://www.youtube.com/watch?v=3imEpm_zztQ
[11] Source code for the counter: https://github.com/TheHWcave/PIC-freq.counter-modification/
CNC
ence
Excell
ag .de / en
MORE AT www.schaeffer-
r lab • Elekto
to
k
Ele
r la
b
O R IG IN A L
Ele
la b
kt
or r
la b to
• Ele k
Elektor
Mini-Wheelie
A Self-Balancing Robot
The Elektor Mini-Wheelie is an experimental self-balancing robot a virtual gamepad. The Dabble app is free and available for Android
platform designed for autonomous operation. Powered by an ESP32-S3 and Apple smartphones and tablets. Again, detailed instructions can
microcontroller, this robot is fully programmable using the Arduino be found at [1].
environment and open-source libraries. Its built-in wireless capabilities
enable remote control via Wi-Fi, Bluetooth, or ESP-NOW, as well as With the Dabble app, the Mini-Wheelie can move forward or backward,
communication with users or even other robots. An ultrasonic sensor is and it can turn left and right. However, it is important to understand
included for obstacle detection, while its colour display can showcase that this is not as easy as it sounds, and it requires some practice to
expressive faces — or, for the more practically minded, detailed debug make it move the way you want it to move.
messages.
How Does Self-Balancing Work?
The Elektor Mini-Wheelie comes as a kit of parts that you must assem- Basically, a self-balancing robot works like an inverted pendulum
ble yourself. Everything is included, even a screwdriver. After assem- (e.g., a rocket). To remain upright in an unstable equilibrium, it must
bling the robot, it must be programmed. It comes preloaded with a constantly measure its orientation in the vertical plane and correct
simple program that shows if the motors and display are working, but its attitude accordingly. The Mini-Wheelie is simpler than an inverted
that’s all it does. To make the robot balance, it must be programmed pendulum as it can only fall over forward or backward, not sideways.
with the Arduino sketch SBRobotDabble available at [1]. There, you
will also find detailed instructions on how to do this. When nothing is done, the robot will fall over. However, it has two
motorised wheels that allow to adjust the robot’s centre of gravity. If
The SBRobotDabble program needs a smartphone app called Dabble the robot starts tilting forward, it moves the wheels forward to bring
to work. With this app, the robot can be controlled over Bluetooth using its centre of gravity back over the wheels. If the robot tilts backward,
The tilt angle is sent to a PID (Proportional Integral Derivative, see In this state, the robot behaves similarly to a satellite in a geostation-
inset) controller algorithm that continuously determines how much the ary orbit — constantly “falling.” However, unlike a satellite that won’t
speed of the wheels must be adjusted for the robot to stay upright by crash into Earth because the orbit is wider than the planet’s diameter,
calculating the difference (the error) between the desired and actual the robot operates on a large flat surface. To prevent tipping over, it
tilt angle. relies on its motorized wheels and a sophisticated control algorithm
to maintain balance while moving. This is a delicate balance. If the
Moving Forward control algorithm can’t keep up, the robot will fall over; if it anticipates
A robot keeping balance and remaining upright is nice, but not very too much, the robot will stop moving or go the other way.
useful nor interesting. Allowing it to move around is what we want,
which implies some way to control it remotely. For this reason, the This is why the Mini-Wheelie is easier to control on a rough surface
Mini-Wheelie comes equipped with wireless capabilities in the shape of than on a smooth surface. A rough surface presents small obstacles
Wi-Fi and Bluetooth. This permits easy communication with a portable that keep the control algorithm active, but on a smooth surface it
device like a smartphone or tablet. An additional ultrasonic sensor can tends to run out of control. It needs noise and disturbances to work
be mounted to help with obstacle detection and navigation. well (Figure 2).
How do you make a self-balancing robot move forward or backward? Turning is like moving forward or backward, but with one wheel spinning
Easy, just manipulate its tilt angle, much like how you control movement faster than the other. This implies introducing an asymmetric tilt offset,
on a hoverboard or a Segway-style vehicle with your body (Figure 1). which doesn’t make things easier. Therefore, the Mini-Wheelie with its
By intentionally introducing an offset in the calculated tilt angle, the default software does not allow turning and moving at the same time.
robot will attempt to correct this imbalance, causing it to move in the However, turning while moving is possible simply by moving first and
direction of the tilt. then turning while it is still in motion.
Figure 1: The robot will move into its tilting direction. Figure 2: The Mini-Wheelie with its big tyres likes rough surfaces.
+3V3
VIN VSYS+
Q7 Q6
CN2 AO4407 AO4407
VSYS+
D S S D R3 R48 R47 R66
R20 R40
10k
10k
10k
NC
C22
100k
0Ω1
Charger in G G
1 8
100n VMOTOR IN+ U11 A1
2 7
IN– INA219 A0
3 6
C28 C6 R22 C62 C63 GND SDA
4 5
VS SCL
1k
1k
10µ 100n
Battery in
+3V3
+3V3
R23 R63
LED1 10µ 100n 10µ
1 40
10k
10k
GND GND
2 39 IO1/LCD_RST IO4/SCL
YELLOW 3V3 IO1
3 38 IO2/CMD IO5/SDA
EN IO2
R53 RESET IO4/SCL 4 37 TXD0/IO43 IO18/AIN2
C26 C36 IO4 TXD0
470Ω
IO5/SDA 5 36 RXD0/IO44
IO5 RXD0
IO6/INT 6 35 IO42/SCLK
100n 100n IO6 IO42
IO7/AIN1 7 U6 34 IO41/D0
IO7 IO41
IO15/HNSS0 8 ESP32-S3-WROOM-1 33 IO40/IRQ +3V3
IO15 IO40
IO16/CA1 9 32 IO39/SDA
IO16 IO39
+5V IO17/CA2 10 31 IO38/SCL
USB-NATIVE IO17 IO38
IO18/AIN2 11 30 R75 R18
1 IO18 IO37
GND IO8/ECHO 12 29
10k
10k
2 IO8 IO36 NC
VBUS 13 28
3 IO19 IO35
CC1 5k1 14 27
IO10
IO12
IO13
IO14
IO11
IO46
IO21
IO47
IO48
IO20 IO0
IO9
4
SBU2 R74 R64 IO3 IO45
5
D– 33Ω
15
16
17
18
19
20
21
IO14/HSCLK 22
IO21/LCD_RS 23
24
25
26
6
D+ 33Ω
USB-C 7
IO12/HMISO
IO13/HMOSI
IO45/PWMB
IO46/PWMA
IO47/CB2
IO3/TRIG
8
IO9/CB1
IO48/BL
D– C4 C20
10k
9
CC2 5k1
10 10µ 10µ
SBU1 R73
11
VBUS
12
GND Q2 Q5
Shield
+3V3
5k1
2 IO12/HMISO 2
VBUS
3 3
CC1 5k1 C42 C15 C41 C44 C45
4 IO48/BL 4
SBU2 R46
5 +3V3 IO15/HNSS0 5
D– 10µ 100n 10µ 100n 10µ
6 IO38/SCL 6
D+
USB-C 7 1 10 IO14/HSCLK 7
D+ UD+ U8 V3 R80
8 2 CH340K 9 TXD0/IO43 IO39/SDA 8
D– UD– RXD 0Ω
9 3 8 RXD0/IO44 IO21/LCD_RS 9
CC2 5k1 GND TXD 0Ω
10 4 7 IO1/LCD_RST 10
SBU1 R72 DTR# VCC R79
11 5 6 IO13/HMOSI 11
VBUS CTS# RTS#
12 IO40/IRQ 12
GND
Shield
C39 C40 LCD
100n 100n
240134-006
Figure 3: Schematic of the main board. The MPU6050 IMU module plugs onto J5.
J1
IO45/PWMB 1
VMA+
2
3 6 12 18 D3 D7 D9 D11 GND
3
NC VS VSS NC SA1
IO46/PWMA 8 14 4
ENABLEA ENABLEB SS34 SS34 SS34 SS34 SA2
5
+3V3 3V3
IO7/AIN1 7 4 6
INPUT1 OUT1 VMA–
IO18/AIN2 9
INPUT2 U2 OUT2
5
IO10/BIN1 13 L298P 16
INPUT3 OUT3 J4
IO11/BIN2 15 17 1
INPUT4 OUT4 VMB+
2
GND
2 19 3
SENSEA SENSEB SB1
R6 R2 4
GND GND GND GND D6 D8 D10 D12 SB2
5
0Ω1
0Ω1
1 10 11 20 +3V3 3V3
6
SS34 SS34 SS34 SS34 VMB–
IO16/CA1
IO17/CA2 +3V3
IO9/CB1
Ultrasonic
IO47/CB2 Transducer
J6
4
+3V3
IO3/TRIG 3 C1 C2
TRIG
IO8/ECHO 2
ECHO
1 10µ 100n
+3V3 GND
10k
10k
10k
10k
NC
1
DATA2
2
CS
IO2/CMD 3
DI
4
VDD C25
IO42/SCLK 5
SCLK SD
6 10µ
VSS
IO41/D0 7
DO
8
DATA1
D1 1 3 4 5 6 9
CDN
G1...4
+3V3
IMU (MPU6050)
J5
2 SMF05C
1
2
IO4/SCL 3
IO5/SDA 4 C10 C16
5
6 10µ 100n
7
IO6/INT 8
D4 D5
AMS1117/3V3
100n
1
BS L1 SS34 SS34 U4
5 6
IN LX
R1 10µH R26 3 2
U3 D2 C13
100k
10k
SY8201ABC
1
C3 C11 NC 22p C14 C19 C23 C29 C21 C5
4 3
EN FB
GND R28
4µ7 100n 10µ 100n 10µ 100n 10µ 10µ
25V 25V 2 16V
13k7
Note that the Mini-Wheelie software assumes that the upright (vertical) 1. Proportional (P): Responds to the current error, i.e. the difference
position is at 180° (originalSetpoint, line 160). Chances are that this between setpoint and process variable.
is slightly optimistic in reality due to mechanical tolerances. There- 2. Integral (I): Accounts for the accumulation of past errors to elimi-
fore, it is worth experimenting with this value to adapt it to your robot. nate steady-state offset.
3. Derivative (D): Predicts future error based on its rate of change,
Furthermore, there may also be some play in the motor shafts, which improving stability and response speed.
can introduce a slight jolt when the direction of rotation is reversed.
To make this abstract definition a bit more tangible, think of
Also, always bear in mind that humans tend to think they know better controlling the speed of a car. In this scenario the setpoint is the
and are cleverer than the system. Trying to be too clever or interfering desired speed, e.g. 100 km/h, while the process variable is the
too much with control algorithms often leads to sub-optimal results. measured speed as indicated by the speedometer of the car.
Suppose our objective is to keep the speed constant. There are
Features several ways to achieve this:
Besides a powerful IMU, the Mini-Wheelie has a few other features that
can be used to improve balancing and remote control. The complete 1. Adjust the pression of your foot on the accelerator pedal to keep
schematic of the main board is shown in Figure 3. The main board the value shown on the speedometer constant. In this case,
itself is shown in Figure 4. the speed v is directly related to the force F on the accelera-
tor. This is proportional control (P). The car responds quickly,
Hall-Effect Sensors but it is not so easy to maintain a super constant speed:
The two wheels are both equipped with two Hall-effect sensors that
allow detecting the spinning direction and speed of each wheel individ- v = k∙Faccelerator = P
ually. In the software, these inputs are labelled CA1 / CA2, and CB1 /
CB2. The sketch SBRobot_Motor_Compare uses them to calibrate the 2. Measure the distance travelled during a defined period, say
two motors. Refer to this sketch to see how to integrate these sensors five minutes. When the travelled distance per time period is
into your own program. They can provide information about the direc- constant, the average speed per time period is constant too.
tion the robot is moving in and if it is going straight or not. You can Note the word ‘average’. Distance d is the integral (I) of speed:
also use them to control or limit the speed.
d = v∙dt = I
Power Monitor
A power monitor lets you keep an eye on the state of the battery. A 3. To keep the speed of the car constant, it should not accelerate
fully charged battery behaves somewhat differently than a (partly) or decelerate. The acceleration must be zero. So, if you measure
discharged battery. This has an incidence on how efficient the motors the acceleration and try to keep it zero, the speed of the car
respond to changes in their control signals. The self-balancing algorithm will be constant. Acceleration a is the derivative (D) of speed:
and the PID controller can be made more performant by taking the
battery level and current consumption into account. The SBRobot- a = dv/dt = D
Dabble sketch shows how to read the power monitor (compile the
sketch with __VERBOSE__ enabled to activate its output on the serial By combining these three methods, the speed of the car can be
port, see around line 54). controlled very precisely and remain perfectly constant:
Here, PID is the signal that controls the accelerator of the car (e.g.,
the force you apply to the pedal). The hard part is finding the values
of the constants kp, ki and kd. Algorithms exist to do this in a more
or less theoretically-controlled way, but they can also be obtained
by experimenting when the system is non-critical and inexpensive,
like a small self-balancing robot. For the cooling system of a nuclear
power plant, you would probably first try with an algorithm. An
interesting tool to optimize PID parameters in (Arduino) code can
be found in this article [2].
Note that you don’t always need all three values to control a system.
P and PI controllers are common too, PD a bit less. ID controllers,
Figure 4: The ESP32-S3-based main board of the Mini-Wheelie is also an i.e., without P, do exist but are only used in rare cases.
excellent platform for other projects unrelated to robotics.
WEB LINKS
[1] This project on Elektor Labs: https://www.elektormagazine.com/labs/self-balancing-robot-with-maker-fabs
[2] Johannes Sturz, “PID Control Tool,” Elektor 5-6/2025: http://www.elektormagazine.com/240274-01
THE SERIES
Solar Cells
By David Ashton (Australia)
I have always found something magical about the idea of panels, as much as 40 to 50% for more expensive types.
solar cells being able to generate sometimes large quanti- When you consider that solar radiation is up to 1000 W
ties of electricity just using sunlight. For this, they depend per square meter, that’s a lot of power available.
on the photovoltaic effect. This was first noted by Edmond
Becquerel, who, in 1839, demonstrated the production of Solar cells may be monocrystalline or polycrystalline.
an electric current when two plates of gold or platinum Monocrystalline cells are made from a large bar of crystal-
in a solution were unevenly exposed to sunlight. line silicon cut into thin wafers, and are usually black,
whereas polycrystalline cells are made from fragments
In 1884, Charles Frits produced an experimental solar of silicon melted together, and are usually a blue color.
cell using a thin layer of selenium covered with a thin Monocrystalline cells are thought to be better and more
film of gold, but the efficiency was poor. efficient than polycrystalline cells, but the differences
are small and the quality of manufacturing probably has
Modern solar cells are based on semiconductor P-N more effect than the type used.
junctions, much like LEDs. In fact, an LED will generate
a voltage when exposed to light — I just got 1.46 V out Perovskite solar cells are another type of solar cell.
of a clear red LED with a powerful torch next to it. The Perovskites are a class of crystalline materials having
current would be very low, though. The polarity is the the same structure as calcium titanate, but include a host
opposite of what you’d normally use to illuminate an LED. of organic and inorganic compounds. Perovskite solar
cells are cheaper to produce, easier to make flexible,
General Features and exhibit better performance under low light condi-
Solar cells come in a wide variety of sizes, from a thumb- tions such as cloudy days. Some perovskites use lead
nail-sized cell in an ornamental solar garden light, up compounds, which has led to resistance to their use.
to the solar panels on my roof, which generate 440 W They have good efficiency, but some perovskites exhibit
each in full sunlight and are nearly 2 square meters in chemical instability, especially in the presence of moisture.
size. Ever larger wattages are available as the technology This has resulted in relatively limited acceptance, but
gets better, and efficiencies are up to 25% for average research is overcoming these problems.
Recent Applications
With the advent of very-low-power microcontrollers with About the Author
wireless features, small solar cells are seeing wide use in David Ashton was born in London, grew up in
remote environmental sensors, for example the outdoor Rhodesia (now Zimbabwe), lived and worked in
sensor units for weather stations (Figure 1). Teamed with Zimbabwe, and now lives in Australia. He has
lithium batteries, they can power many remote sensors been interested in electronics since he was “knee-high
for IoT and other applications. Solar garden lights and to a grasshopper.” Rhodesia was not the center of the
ornaments are now ubiquitous, and discarded ones electronics universe, so adapting, substituting, and
are a good source of small solar cells for the inquisitive scrounging components were skills he acquired early
hobbyist. (and still prides himself on). He has run an electronics
lab, but has worked mainly in telecommunications.
Larger solar installations, such as on house roofs or in
solar farms, are helping to speed the demise of fossil-fuel-
based power generation. Australia has one of the highest Questions or Comments?
rates of domestic solar power in the world, and large If you have technical questions or comments about
solar plants are being constructed everywhere. Battery this article, feel free to contact the Elektor editorial
storage to store some of the power and supply it at night team at [email protected].
is advancing rapidly and contributing to the uptake of
solar power. Figure 2 shows a large rooftop solar power
installation.
250146-01
Sensors are fascinating. Some time ago, while I was doing research to
build a mailbox mail indicator [1], I came across an interesting video
by Andreas Spiess [2] that, among other things, mentioned a very
powerful radar sensor, the A121 from the Swedish company Acconeer,
costing about €12. This strongly intrigued me and made me want to
give it a try! The manufacturer’s official development kit, the XE125, is Figure 1: The A121 is tiny, less than 6 mm square. The two 60 GHz
quite expensive (around €120), but fortunately, SparkFun also offers a antennas are visible.
development board based on the same sensor for $50. This is better,
and the price helps support a company that does a great job, with
their modules and documentation, of making electronics accessible to t elapsed between transmission and reception of the reflected signal
engineers of all levels. The fact that SparkFun and Elektor are business gives the measured distance d by the equation d = 1/2 * t * v, where v
partners did not influence my choice, and I am glad to have paid for is the propagation speed of the wave, which depends on the material.
this module with my own money. That said, let’s dive in! The A121 (Figure 1) is a Pulsed Coherent Radar, coherent meaning
that it is able to measure the phase of the received signal for even
Radar 101 more precise measurement.
While the general principle of a radar is to emit a radio signal toward
a target and analyze the reflected signal, there are different types. Hardware Overview
In continuous wave (CW) radar, like the HB100 previously featured The A121 [4] uses the 60 GHz band and offers a lot of features within a
in Elektor [3] or the similar CDM324, a constant frequency signal is very small form factor (5.2 x 5.5 x 0.8 mm). It is fully integrated, with the
transmitted and received simultaneously, allowing measurement of the baseband processor, RF front-end, and antenna in the same package,
target’s velocity through Doppler shift, but not its distance. Frequen- and a digital output via SPI. Internally, the A121 measures time differ-
cy-modulated continuous wave (FMCW) radar improves on this by ences with a resolution on the order of a picosecond, which provides
continuously varying the transmitted signal’s frequency over time. excellent distance resolution, on the order of 0.1 mm (!). The maximum
As the wave takes time to travel to and from the target, at any given range is about 20 m. This is a very complex component; explaining
instant the received signal is a different frequency than the transmit- it in detail would both be very hard, and go far beyond the scope of
ted signal. By measuring the difference between those frequencies, this article, but the manufacturer’s documentation (see [5] and [6]) is
the distance to the object can be computed. very good and abundant.
In contrast, Pulsed Radar transmit short bursts of signal at a single Acconeer suggests applications like distance measurement, proxim-
frequency and listens for echoes between pulses. Measuring the time ity or presence detection, measuring velocity, tracking objects, robot
All this is excellent, but on its own, this component is not very easy to A SparkFun Breakout Board
discover and experiment with, for two reasons: first, this tiny package Integrating a microcontroller into the module was a smart choice. This
is a 50-ball BGA, which is not so easy to solder. Second, using the way, Acconeer can offer downloadable firmware files that are already
advanced features requires a lot of data processing through software, compiled and ready to be flashed onto the STM32L431, making it much
which represents a significant amount of work for anyone just consid- easier to try out the sensor. SparkFun [8] makes things even more
ering trying out the component. To address this, Acconeer has a great convenient, with a PCB that includes the XM125, a CH340C USB-to-
solution. UART converter, a USB-C port, and the necessary voltage regulators,
as can be seen on Figure 3. Two Qwiic connectors allow the module
The XM125 Module to be linked via I2C to other SparkFun boards.
The Acconeer XM125 module [7] (Figure 2) makes it much easier
to explore the product. It is a small rectangular PCB measuring This breakout board is simply intended to make connections easier;
18.6 mm x 15 mm, containing: the A121 sensor, a 24-MHz crystal it does not include an additional microcontroller. SparkFun suggests
required for its operation, a few resistors and capacitors, and finally to use the provided binaries as-is for the STM32L431, and to develop
an STM32L431CBY6 microcontroller from STMicroelectronics. All your own application on an external microcontroller, for example an
components are mounted on the top side, allowing the module to be ESP32 on an extra board, communicating with the XM125 via I2C. For
soldered flat onto a Land Grid Array (LGA) footprint on your proto- more advanced users, or those familiar with STM32 products, it is also
type PCB, using hot air or a soldering iron. Of the 28 pins with a possible to do without an external microcontroller and to fully develop
1.27-mm pitch (more accessible than BGA for us mortals), only a few your project on the provided STM32L431.
are absolutely necessary; it would even be possible to solder wires
directly for prototyping without a PCB. Software
Acconeer offers many options in terms of software. For the XM125,
The module is compact enough to be directly integrated into commer- a Software Development Kit (SDK) is provided [6] and contains
cial products. It may function as a stand-alone unit, allowing customers source code and compiled files, directly transferable to the onboard
to build their applications on top of the Acconeer software. Alternatively, STM32L431, for many example applications (distance measurement,
it can be paired with an external microcontroller, communicating with speed, presence detection, etc.). For those planning to use the A121
the module using a register command protocol via a serial port or I2C. sensor in a fully custom project without the XM125 module, other SDKs
are also available in different variants (Keil, ARM-GCC, IAR, etc.) for
ARM Cortex M7, M4, M33, M0 platforms. A dedicated PDF guide is
available for each case.
In the terminal (of PyCharm or your system), install the Exploration Tool it is possible to directly download the latest firmware version under the
with the command python -m pip install --upgrade acconeer- Get Latest Binary tab. As of the time of writing, a bug seems to exist:
exptool[app] and, once all packages are installed, launch the GUI the firmware acconeer_xc120_exploration_server_a121-v1_10_0.bin
interface with the command python -m acconeer.exptool.app. downloaded via the Exploration Tool does not work properly. Although
The Exploration Tool also supports the predecessor of the A121, the flashing seems normal, trying to connect to the module afterward
A111. Click the left panel to open the A121 version. The main window results in a connection failure (Figure 6). Among other minor issues,
that opens is shown in Figure 4. the link provided by the Exploration Tool to create a Developer account
returns a 404 error. Use [10] instead.
Firmware Download
Just as each specific situation (distance, speed, presence measure- To work around the firmware bug, select the Browse tab and manually
ment, etc.) has its own optimized firmware available in binary format, select the firmware file from the ZIP you downloaded earlier. Choose
the Exploration Tool also needs a specific firmware, called the Explo- Serial, then the correct serial port (on Windows, you can check the port
ration Server. To start, create an account at [10]. Then download the number in the Device Manager when plugging in the module), then
Exploration Server firmware at [6] and unzip the ZIP file. XM125. Finally, click Flash and follow the on-screen instructions: press
the Boot button, then the Reset button while keeping Boot pressed,
The Exploration Tool contains four distinct sections: Stream, Flash, release Reset, and then release Boot. I recommend not doing this
Resource Calculator (RC), and Help. These are accessible through sequence too quickly; leave at least a third to half a second between
buttons on the left. First, open the Flash page (Figure 5). In principle, each press. Flashing should complete normally.
First Tests
Now, click on the Advanced Settings button (to the left of Connect in
the top bar) and type 115200 in the Baudrate field. Close Advanced
Settings and click Connect. Congratulations, your module is connected!
Figure 5: Preparing to flash firmware. Figure 6: I pulled my hair out over this error for quite a while.
To use the CP210x instead of the CH340, simply change the COM port
number in the Exploration Tool. In my case, the CP2102 worked properly,
Figure 9: Modifying the wiring to support other USB to UART converters. and the graphs now refresh continuously, between 2 and 20 times per
second depending on the application. Much better! Another module
based on the FT232RL by FTDI worked as well, but was slightly slower.
As you’re not supposed to use a different USB to UART converter, there
is no easy access to the primary TX, RX, CTS, and RTS signals; those A Solution Looking for a Problem
are directly routed from the XM125 to the CH340C. The DEBUG_TX The Presence Detector illustrates how the radar’s sensitivity to
and DEBUG_RX pins on the side of the module are connected to the micro-movements gives an advantage over other types of sensors.
second serial port of the XM125, which is used for debugging only. I tried sitting perfectly still a few meters away from the sensor: no
This required some adaptation (Figure 9). matter what, my tiny involuntary movements were detected by the
A121, and the Exploration Tool clearly indicated I was always present,
A small piece of perfboard was added to the sensor’s back side, and which is reassuring in case of an existential crisis. On the other hand,
a pin header was wired to the corresponding pins of the CH340 using the Passive Infrared (PIR) sensor placed at the same distance ignored
thin wire. If you attempt this, pins TX, RX, CTS, and RTS are pins 2, me after a few seconds if I stayed still. More interesting applications
3, 9, and 14 on the CH340C, respectively. You can also solder directly include remote vibration measurement of machines, or non-inva-
onto the XM125 pads on the front side. To disable the CH340C, its sively monitoring people’s breathing. I tried that (see Figure 10), but
VCC pin (pin 16) must be disconnected, either by cutting the trace there seems to be something wrong: During the test, I was calm and
Going Further
It is recommended to tinker with the various settings of the Explo-
ration Tool for yourself! Also have a look at the Resource Calculator
panel, which provides estimates (not measurements) of the module’s
power consumption based on the settings. Also check out SparkFun’s About the Author
Hookup Guide, which offers an Arduino library [14] that you can use Jean-Francois Simon (Engineer, Elektor) has a longstanding passion
on an external microcontroller of your choice, to help you communi- for electronics and enjoys topics as varied as circuit design, test and
cate with the XM125 in Presence and Distance modes, through I2C. I measurement, prototyping, playing with SDRs, and more. He likes
encourage reading Acconeer’s documentation for a detailed under- to create, modify and improve his tools and other systems. He has
standing, and for the brave, taking a look at the source files. To develop an engineering background and also enjoys mechanics, machin-
your own application, you can also install STM32CubeIDE and build ing, and all things technical. Follow him on X at x.com/JFS_Elektor.
upon the Acconeer SDK with the STM32L431.
WEB LINKS
[1] Jean-Francois Simon, “Wireless Mailbox Notifier,” Elektor 7-8/2025: http://www.elektormagazine.com/240715-01
[2] Andreas Spiess, “Which Radar Sensor Is Best?,” YouTube: https://www.youtube.com/watch?v=s-GzUTyIH9c
[3] Stefano Lovati, “The HB100 Doppler Motion Sensor”, Elektor 7-8/2023 : http://www.elektormagazine.com/230205-01
[4] The A121 Radar Sensor: https://www.acconeer.com/products/
[5] Acconeer Documentation (1/2): https://docs.acconeer.com/en/latest/index.html
[6] Acconeer Documentation (2/2) and SDK: https://developer.acconeer.com/home/a121-docs-software/xm125-xe125/
[7] XM125 Datasheet: https://developer.acconeer.com/download/xm125-datasheet/
[8] SparkFun XM125 Board: https://www.sparkfun.com/products/24540
[9] Acconeer Exploration Tool: https://github.com/acconeer/acconeer-python-exploration
[10] Create Developer Account: https://developer.acconeer.com/register/
[11] CH340C Datasheet, Version 3B: https://tinyurl.com/2a6nawzt
[12] SparkFun XM125 Hookup Guide: https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125
[13] Adafruit CP2105 Friend: https://www.adafruit.com/product/6065
[14] SparkFun XM125 Arduino Library, GitHub: https://github.com/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library
from replacing silicon in computer proces- in April 2024 was still being talked about Putting the Cart Before the
sors to extremely thin rollable television in superlatives as the company with the Horse
screens and even a real space elevator ambition to become the world’s largest Nowadays, it seems as if people in academia
(Figure 2). Now that the hype has died green battery manufacturer and to build a publish first and think later. The reasons for
down, more realistic commercial applica- dam against Chinese, Korean, and Ameri- publishing as much as possible are diverse,
tions have appeared on the market, includ- can battery dominance. Barely six months such as publication pressure (publish or
ing (bio)sensors and solutions for cooling later, the company’s trajectory resembled perish), employment, attracting students,
chips in smartphones. And how about roads more of an Icarus flight due to produc- subsidies, ego and prestige, creating hype,
covered with solar panels, printed solar tion problems combined with the choice obtaining immigration visas, etc. The list
panels on thin film, tubular solar panels for of “expensive cells” with NMC technology is long, and studies show that a signifi-
flat roofs [4], and solar panels that electro- (nickel-manganese-cobalt), a technology for cant proportion of published papers and
chemically generate hydrogen gas from lithium-ion cells that is considerably more doctoral theses are hardly ever cited or read,
water (Figure 3)? Unfortunately, none of expensive than LFP technology (LiFePO4 let alone applied, making them little more
these ideas came to fruition for technical or lithium iron phosphate). LFP was long than paper factories [9][10].
and/or economic reasons. Currently, Solhyd considered inferior, but China has never-
[5], a spin-off from KU Leuven, is working on theless succeeded in using this technology I am not advocating a Trump-style crack-
solar panels that extract water from the air to produce high-performance and cheaper down on the academic world, and not all
at night and generate hydrogen gas during cells for electric vehicles. research needs to be economically useful,
the day using electrical energy from sunlight but reforms to maintain real, lasting impact
through electrolysis. They have clearly Of course, things could always be worse, do seem sensible to me. No one benefits
learned from the mistakes of their prede- and I’m not going to claim that nuclear from research inflation and the creation of a
cessors, and the technology looks promising, energy is the best alternative to fossil fuels, scientific bubble. Moreover, it does no harm
so let’s keep our fingers crossed that they but closing all nuclear reactors and fully to think critically for oneself and realize that
succeed in commercializing these panels. committing to a hydrogen economy that scientists, researchers, and politicians are,
doesn’t yet exist, as Germany has done, was after all, just ordinary people.
On a larger scale, too, mistakes are a huge mistake in my opinion [7][8]. And Translated by Hans Adams — 250311-01
sometimes made. Take Northvolt [6] in I can see that hydrogen bubble bursting in
Skellefteå, Sweden, for example, which the not too distant future.
WEB LINKS
[1] Wikipedia: Schön scandal: https://en.wikipedia.org/wiki/Sch%C3%B6n_scandal
[2] Wikipedia: Golden rice: https://en.wikipedia.org/wiki/Golden_rice
[3] Mark Peplow, “Coming of age — Twenty years after the ballyhooed discovery of graphene, the atom-thin carbon sheets are
finding their footing,” Science, Oct 2024:
https://www.science.org/content/article/twenty-years-after-its-discovery-graphene-finally-living-hype
[4] Wikipedia: Solyndra: https://en.wikipedia.org/wiki/Solyndra
[5] The Solhyd project — Discover all about hydrogen panels: https://solhyd.eu/en/
[6] Anthony King, “Northvolt bankruptcy dents European battery industry ambitions,” ChemistryWorld, Nov 2024:
https://www.chemistryworld.com/news/northvolt-bankruptcy-dents-european-battery-industry-ambitions/4020603.article
[7] YouTube: Sabine Hossenfelder — Why I’m embarrassed to be German: https://www.youtube.com/watch?v=W1ZZ-Yni8Fg
[8] YouTube: Wise Guys — Deutsche Bahn: https://www.youtube.com/watch?v=wXjhszy2f9w
[9] Wikipedia: Why Most Published Research Findings Are False — John Ioannidis (2005):
https://en.wikipedia.org/wiki/Why_Most_Published_Research_Findings_Are_False
[10] YouTube: Sabine Hossenfelder — I was asked to keep this confidential: https://www.youtube.com/watch?v=shFUDPqVmTg
Cybersecurity
Tough Times for Hackers
By Gerhard Stelzer (Würth Elektronik eiSos) The deadline for implementation now runs until August 1, 2025.
After that, no wireless devices may be placed on the EU market
Cybersecurity is shifting into the focus unless they meet the cybersecurity requirements of the RED.
of European regulation. According
EN 18031 Standard Facilitates Implementation
to the EU Radio Equipment Directive, The EN 18031 standard translates the cybersecurity aspects of
by August 2025, products with radio the RED into specific testing procedures and was developed by
technology and internet access the CENELEC standards organization on behalf of the EU. In
October 2024, CENELEC submitted EN 18031 to the European
must protect networks and personal Commission for review. The standard was harmonized in
data as well as prevent fraud. The January 2025, meaning that new products no longer have to be
EN18031 standard is designed to assist certified by an accredited testing service provider (Figure 1). A
self-declaration of conformity is sufficient.
manufacturers in implementation.
Conformity Test, Using a Wi-Fi Module as an
Example
The EU Cyber Resilience Act (CRA) introduces entirely new cyber- The conformity test is illustrated here, taking the example of
security requirements for electronic devices. It was published in Würth Elektronik’s IoT Wi-Fi module Cordelia-I [1]. The Wi-Fi
the Official Journal of the EU in November 2024 and is therefore module is fully compliant with the RED, including the cyberse-
applicable law. However, no standards exist for it yet. A transitional curity extension 2022/30/EU from January 2022. The Cordelia-I
period is therefore expected to apply until December 2027, after module complies with IEEE 802.11 b/g/n, operates in the 2.4 GHz
which new products will have to comply with the CRA. band, and has the following features:
Until then, the Radio Equipment Directive (RED) is intended to > Zero-touch provisioning with QuarkLink [2] (more on this later)
enhance cybersecurity, at least for all wireless devices. To this end, > Secure UART-to-cloud bridge (transparent mode)
the EU amended the RED in 2022, supplementing Article 3(3), to > Small form factor: 19×27.5×4 mm3
define the following three sub-points: > Sleep mode <10 μA
> Intelligent antenna configuration (2-in-1 module)
> 3(3)(d) to ensure network protection > Output power +18 dBm peak (1DSSS)
> 3(3)(e) to safeguard personal data and privacy > Receiver sensitivity: –92 dBm (1 DSSS, 8% PER)
> 3(3)(f) to ensure protection against fraud > Industrial temperature range: -40°C up to +85°C
Figure 1: Whether a product’s conformity can be assessed in-house depends on the existence of a harmonized standard. Otherwise, certified service
providers (Notified Bodies) come into play. (Source: European Commission — RED Guide [4])
> Every interface to the outside world must be considered Secure Cloud Connection
vulnerable and secured accordingly. A range of standard To ensure a secure connection to the cloud, the device and the cloud
protocols can be used for authentication and encryption should perform mutual authentication, followed by exchanging
of communication interfaces. a session key, which is then used to encrypt the communication
> Secure storage areas are isolated execution environ- channel. This is usually done using the TLS protocol.
ments that provide hardware-based security for sensitive
data and code. They are designed to protect against attacks To establish a mutual TLS connection, the following cryptographic
that attempt to access or modify data in memory or steal elements must be present on the device and in the cloud. The assets
cryptographic keys. must also be properly aligned with each other.
These general measures to ensure cybersecurity have been imple- On the device side, these are:
mented in the Cordelia-I Wi-Fi module (Figure 3). The Wi-Fi radio
module includes the following security features: > Device ID: Unique device identity that is unchangeable and
tamper-proof.
> 10-byte non-manipulable unique device ID > Device key: This is a private key that is unique to each device
> Secure boot and must be kept secret.
> Secure storage with an encrypted file system for storing > Device certificate: This certificate contains the public key
certificates and other credentials associated with the device private key.
> Secure firmware over-the-air update > Root CA: This is the root CA (Certificate Authority) of the
> Secure socket — Transport Layer Security protocol TLSv1.2 cloud, which is used to authenticate the cloud endpoint.
> Secure Wi-Fi connection according to WPA3
> Hardware-accelerated crypto engine The process of storing these parameters on the end device is known
as “device provisioning”.
> List of the device IDs: A whitelist of device IDs that are
authorized to establish connections.
> Device certificates: Public keys corresponding to the device
IDs to enable device authentication.
Figure 3: The Cordelia-I Wi-Fi module from Würth Elektronik offers a wide The process of storing these parameters on the cloud endpoint is
range of features to ensure cybersecurity in IoT applications. known as “cloud onboarding.” These cryptographic values must
Figure 4: Enrolment to a cloud via zero-touch provisioning is handled by the QuarkLink IoT security platform from Crypto Quantique. Secure data exchange
then takes place directly between the IoT device and the cloud. (Source: Würth Elektronik)
WEB LINKS
[1] Cordelia-I Wi-Fi IoT radio module from Würth Elektronik: https://www.we-online.com/de/components/products/CORDELIA-I
[2] QuarkLink, Crypto Quantique: https://www.cryptoquantique.com/products/quarklink/
[3] Product Guide: Wireless Connectivity & Sensors from Würth Elektronik: https://www.we-online.com/de/components/products/wco
[4] European Commission: Guide to the Radio Equipment Directive 2012/53/EU: https://ec.europa.eu/docsroom/documents/33162
Siglent Presents
Next-Gen Multi-Channel
Oscilloscopes
High-Performance Solutions for Modern Power and
Embedded Systems
These offerings give engineers the flexibility to choose the right preventing issues such as data transmission errors in communica-
tool for their workflow, whether it’s in a hands-on R&D lab or a tion systems. As circuit complexity grows, so do the challenges of
fully automated validation setup. The goal is to provide powerful, power-up testing. The SDS5000X HD addresses this by capturing
scalable solutions that grow with the complexity of modern test the entire power-up process of all relevant signals in a single acqui-
environments. sition. This significantly reduces measurement time, improving
efficiency, and minimizing errors associated with repeated tests.
Advanced Performance for High Requirements For complex designs featuring up to eight power rails, this one-shot
The SDS5000X HD and SDS5000L series deliver the performance measurement capability is a powerful tool for reliable validation.
needed to tackle demanding measurement challenges (Figure 3).
With sampling rates of up to 5 GSamples/s, engineers can capture Accurate Measurements for SiC and GaN Power
fast signal transitions with high precision. Each channel supports Electronics
up to 500 Megapoints of memory (with all channels active), enabling With the introduction of Siglent’s latest 8-channel oscilloscopes
long-duration acquisitions at high resolution, which is ideal for and the new optically isolated differential probe series ODP6000B,
analyzing protocol sequences. In quarter-channel mode, memory a crucial gap in wide-bandgap (WBG) semiconductor testing
depth extends up to 2.5 Gigapoints per channel, supporting deep is now filled. The SDS5000X HD delivers picosecond-level rise
signal analysis over extended time spans. An effective number of bits time performance, enabling precise capture of the fast-switching
(ENOB) of up to 8.2 at 1 GHz ensures excellent dynamic range and behavior characteristic of silicon carbide (SiC) and gallium nitride
signal accuracy, even at full bandwidth. Combined with an impres- (GaN) devices. It provides detailed analysis of voltage and current
sively low noise floor of just 140 µVrms at 1 GHz, the new models offer transients during switching events, including overshoot, ringing, and
clear, detailed signal visibility, which is crucial for accurate debug- other dynamic effects. These capabilities help engineers optimize
ging in sensitive analog, power, and mixed-signal environments. circuit performance and ensure signal integrity in high-efficiency
power designs. Complementing these capabilities, the ODP6000B
Multi-Channel Application-Focused Analysis probes are available with bandwidths of 500 MHz and 1 GHz and
An 8-channel oscilloscope enables comprehensive three-phase feature an exceptional common-mode rejection ratio (CMRR) of
power analysis by allowing simultaneous connection to all voltage 160 dB at low frequencies, further enhancing the accuracy and
and current signals. This synchronized acquisition ensures accurate, noise immunity essential for advanced WBG device measurements.
real-time measurement of waveforms and key parameters across all
phases. Engineers can directly observe and compare phase relation- Elevating Efficiency, Accuracy, and Reliability
ships to detect imbalances and verify system performance. With With the launch of the SDS5000X HD and SDS5000L series, along
built-in FFT capabilities, the oscilloscope also supports detailed with the optically isolated ODP6000B probes, Siglent delivers a
harmonic analysis of three-phase systems. Optional application powerful and scalable measurement solution tailored to the
software further extends functionality by providing vector diagram demands of modern power electronics and complex embedded
visualization for motor diagnostics, power quality evaluation, ripple systems. The combination of high channel count, excellent signal
measurement, and overall system efficiency analysis. fidelity, deep memory, and versatile analysis capabilities enables
precise insights into demanding applications — from three-phase
Beyond power analysis, modern electronic systems increasingly rely power analysis and power-up sequence testing to high-speed
on multiple integrated chips and modules, whose initialization and characterization of wide-bandgap semiconductors. Whether in
operation must be carefully coordinated to avoid undefined states. the lab or integrated into automated test setups, Siglent provides
Power-up sequence testing verifies that signals from different circuit the tools to elevate efficiency, accuracy, and reliability in develop-
modules follow the correct timing, ensuring system stability and ment workflows.
250428-01
WEB LINK
[1] Siglent Technologies Germany GmbH: https://www.siglenteu.com/
New enhancements to the Bluetooth protocol, introduced parameter, which provided a reference
in version 6.0, are expected to spur engineers to develop power level one meter from the transmit-
ting device, to provide a Received Signal
improved device-positioning and location service Strength Indicator (RSSI). Because the
products. The most significant new feature is Bluetooth strength of the RF signal tails off inversely
Channel Sounding, which significantly enhances the proportional to the distance between the
two radio devices, it can be used to provide
precision of all previous Bluetooth distance-measuring a crude estimate of distance. This technique
techniques. is useful for locating objects in reasonable
proximity, but indicating the direction of
one object relative to another is quite a
The Bluetooth Special Interest Group (SIG) ing and location service products: The different matter.
continues to diversify the target applica- Bluetooth SIG forecasts a 22 percent CAGR
tions of the once consumer-focused short- to reach 563 million location services device In 2019, Bluetooth Direction Finding
range wireless technology. Originally shipments by 2028 [2]. [3] (adopted as part of the ratification
designed to wirelessly connect peripher- of Bluetooth v5.1) enhanced Bluetooth
als to host computers, Bluetooth® technol- Initial Support for Bluetooth device positioning and distance ranging.
ogy has become almost ubiquitous as the Distance-Ranging The technique enables applications to
go-to solution for power-frugal and reliable Theoretically, wireless connectivity can be calculate the direction of a received signal
wireless connectivity, with almost univer- used to locate lost objects. Think of those using phase measurements made by the
sal smartphone support for the tech hardly keys hiding in the depths of the sofa. If the Bluetooth Low Energy controller. Two
harmed its adoption either. keys are attached to a wireless tag, your methods were defined, angle of arrival
smartphone can quickly indicate where to (AoA) and angle of departure (AoD).
Bluetooth technology use has expanded start looking. In an industrial environment,
into healthcare, consumer, audio, indus- wireless mesh networks can help workers While Bluetooth Direction Finding works
trial, and numerous other applications. quickly locate goods on warehouse shelves. well, it requires extensive design experience
Despite impressive uptake — Bluetooth SIG But in practice, implementing such appli- to implement. Designs are complex and can
forecasts approximately 5.9 billion annual cations is incredibly tricky. Factors such as be expensive. As a result, the technology
device shipments during 2025 — success in multipath fading and interference from has been limited to high-end applications
some target applications has been under- other nearby 2.4 GHz transceivers spoil such as asset tracking high-value items,
whelming [1]. One area of note is device the signal integrity and undermine location rather than being widely adopted for more
positioning and location services. accuracy. day-to-day applications.
New enhancements to the Bluetooth The Bluetooth SIG has already made several New to Bluetooth 6.0
protocol, introduced in version 6.0, are attempts to add distance ranging and device The recent introduction of Bluetooth 6.0
expected to spur engineers to use the tech positioning support to its RF protocol. First brought several key improvements to the
to develop improved device-position- was an attempt to use the transmit (TX) protocol, including:
WEB LINKS
[1] “2024 Bluetooth® Market Update,” bluetooth.com, 2024: https://www.bluetooth.com/2024-market-update/
[2] “2024 Bluetooth® Market Update: Location Services,” bluetooth.com, 2024:
https://www.bluetooth.com/2024-market-update/#location-services
[3] Steven Keeping, “Bluetooth Heads in New Direction,” Mouser:
https://resources.mouser.com/explore-all/bluetooth-heads-in-new-direction
Exploring
Wireless
Communication
with BeagleY-AI
By Dogan Ibrahim (United Kingdom)
Editor’s Note. This article is an excerpt from The
In this article, we explore two hands-on projects BeagleY-AI Handbook. It was formatted and lightly
that demonstrate how devices can communicate edited to match ElektorMag’s conventions and page
layout. The author and editor are happy to help with
wirelessly. First, we’ll set up a TCP connection queries. Contact details are in the Questions or
between a BeagleY-AI board and an Android Comments? box.
smartphone to send text messages. Then, we’ll
explore controlling an LED connected to BeagleY- Three major features of BeagleY-AI are its Wi-Fi,
AI from a smartphone using UDP. These projects Bluetooth communication, and AI capabilities.
will give you a practical look at how wireless BeagleY-AI is equipped with a dual-band 2.4 GHz
IEEE802.11ax wireless LAN module and Bluetooth
communication works in everyday tech! Low Energy (BLE) 5.4. These built-in features mean
you won’t need any external network-based hardware
to communicate over the Internet. Network commu-
nication is handled using either UDP or TCP protocols.
In this article, we’ll guide you through two projects
that demonstrate how to use these protocols!
UDP Communication
Let’s break down the UDP communication process
Figure 1: between the server and client over a Wi-Fi link (this
UDP communication. process is illustrated in Figure 1):
Client
1. Create a UDP socket (and optionally bind).
2. Send a message to the server.
3. Wait until the response from the server is received.
4. Process the reply. Figure 2:
5. Go back to step 2, or close the socket. TCP communication.
TCP Communication
Let’s go over the steps for TCP communication between the Client node. Figure 3 illustrates the project block
the server and client over a Wi-Fi link (this process is diagram, showing how the BeagleY-AI and smartphone
illustrated in Figure 2): communicate over a Wi-Fi router.
yn = 'y'
while yn == 'y':
msg = input("Enter your message: ") # read a message
Figure 5: Configuring the TCP Client App on the
msg = msg + "\n" Smartphone.
client.send(msg.encode('utf-8')) # send the message
yn = input("Send more messages?: ")
yn = yn.lower()
> After connecting, you should see a connection
message on your BeagleY-AI screen and also the
print("\nClosing connection to client")
IP address of the remote Android smartphone.
sock.close()
Now, enter a message and press the Enter key.
In this example, the message “HELLO FROM
BEAGLEY-AI” is sent to the client (Figure 6).
Figure 7 shows the message displayed on the
If the firewall is running, you should disable it using smartphone.
the following command:
Project 2: Controlling an LED
beagle@beagle:~ $ sudo ufw disable Connected to BeagleY-AI from a
Smartphone Using UDP
There are many TCP apps available free of charge on In this project, an LED is connected to BeagleY-AI port
the Internet for smartphones. In this project, the TCP pin GPIO21 (pin 40) through a 470-Ω current-limiting
Client app by HARDCODED JOY S.R.L. is used on an resistor. The LED is controlled by sending On and Off
Android smartphone. This app is available free of commands from an Android smartphone. The aim
charge in the Play Store (see Figure 4). of this project is to show how an LED on BeagleY-AI
can be controlled from a smartphone by sending
The program is run as follows: commands using the UDP protocol over a Wi-Fi link.
In this setup, BeagleY-AI acts as the server, while the
> First, run the server program: smartphone serves as the client.
Figure 4:
Apps used in the project. Figure 7: Message displayed on the smartphone.
led = gpiod.find_line('GPIO21')
led.request(consumer='beagle', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
led.set_value(0)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("192.168.1.127", 1500)) # Bind to Zero 2 W IP,port
data = [' '] * 10
while data != b'X':
data, addr = sock.recvfrom(1024)
if data == b'ON': # ON command
led.set_value(1) # LED ON
elif data == b'OFF': # OFF command
led.set_value(0) # LED OFF
sock.close()
sleep(1)
The LED can easily be replaced with a relay, for
example, to control electrical appliances from a Figure 8: UDP app.
smartphone.
Err-lectronics
Corrections, Updates, and Readers’ Letters
Compiled by Jean-François Simon (Elektor)
Thank you for your email. We are sorry for this confusion
in the article, which was probably introduced when we
translated the article from Italian. In the Italian article,
it is written: “R19, R20: -” instead of “see text.” From the
photo, I can see that those two resistors were not used.
I would guess that they were from a previous revision
that the author did. The circuit should work fine without
R19 and R20.
_
Ideas or Feedback?
Got a bright idea or valuable feed
back
for Elektor? Reach out to us at
[email protected]. We’re eager to
hear from you!
_
250334-01
Starting Out in
Electronics…
…Concludes the Topic on Opamps
LC Filters
LC filter circuits have the great advantage of being able to manage
with a minimal number of semiconductors. This means that noise
and distortion can hardly cause any problems. The few equalizers
that are built with “real” coils are, therefore, arts for audiophiles. Figure 1: Equalizer with LC filters.
In the diagram in Figure 1, we have only drawn two filters, but this
diagram can, in principle, be expanded with any number of filter
sections. Resistors R1 and R2 are usually chosen to have the same
value (for example, 10 kΩ); the value of the (slide) potentiometer
is in the same order of magnitude.
As an example, we will calculate such an equalizer filter (if you like
The following formula can be used to calculate the resonance to calculate and build a complete third-band equalizer, it is best to
frequency: write a suitable computer program).
In this case, R1 represents the coil’s ohmic resistance (caused by Operational Amplifiers in Practice
capacitive losses — these are negligible in the LF range, so a value Except for SMD components, operational amplifiers are almost
between 100 kΩ and 1 MΩ can be chosen for R1). always assembled in DIL8 or DIL14 packages (Figure 4). DIL stands
for dual inline, which means that there is a row of connection pins
R2 stands for the wiring resistance of the coil: We can use 100 Ω on either side of the package.
for this (you can’t really use a smaller value for the opamp — a
value of 1 kΩ would be even better).
the IC’s power connections (Figure 6). If the circuit is to meet the
highest standards, you can use a parallel connection of an electro-
lytic capacitor of approximately 10 µF and a ceramic capacitor of
approximately 1 nF.
Translated by Hans Adams — 250271-01
Figure 5: Pin layout of (most) opamps. Editor’s note: This series of articles, “Starting Out in Electronics,” is
based on the book, Basiskurs Elektronik, by Michael Ebner, which
was published in German and Dutch by Elektor.
Single and dual opamps are enclosed in DIL8 packages, while quad
opamps are enclosed in DIL14 packages. The pinout of these ICs is
almost always as outlined in Figure 5. Questions or Comments?
Do you have technical questions or comments about his article?
With single opamps, pins 1, 5, and 8 are often used for frequency Send an email to Elektor at [email protected].
and offset compensation. More information about this can be found
in the opamps’ datasheets.
Power Supply
In the diagrams that we have shown in the last few installations,
Related Product
we have not included the power supply for the opamps, but that
does not mean that opamps do not require one. > B. Kainka, Basic Electronics for Beginners (Elektor, 2020)
Book: www.elektor.com/19212
To guarantee optimal functioning of the opamp, decoupling capac- Ebook: www.elektor.com/19213
itors of about 10 to 100 nF should be placed as close as possible to
Highlights
• MIL-STD & IEC interfaces
• Characteristic impedance 50 Ω
• High quality data transmission
©eiSos
By Koen Vervloesem (Belgium) Fortunately, recent years have seen the advent of smaller LLMs that
you can run on your own hardware, provided it’s powerful enough.
Large language models can accelerate your An NVIDIA GPU with at least 8-GB VRAM is recommended, as these
software development. In this tutorial, we GPUs are particularly suited for running LLMs at accelerated speeds.
In this article, I’ll set up an Ollama [5] server for local LLM operation
use the Continue extension for Visual Studio and show how to install and use the Continue [6] extension in Visual
Code and enjoy the advantages of an AI code Studio Code to instruct the LLM in the background to assist you in
assistant that autocompletes, rewrites, and various coding tasks.
Figure 1: Find code-related LLMs in Ollama’s model library. Figure 2: Install the Continue extension in Visual Studio Code.
You can also let Continue directly edit code within the code editor.
Specify Ollama’s Llama 3.1 model: Select the part of the code you want to modify, press Ctrl+I (Cmd+I on
macOS), and then instruct the model what you want to change. This
"models": [ is useful for refactoring, adopting a new approach, or adapting code
{ to a new API. For each changed block of code, Continue displays a
"title": "Llama 3.1 8B", diff with buttons to accept or reject the changes. You can also press
"provider": "ollama", Ctrl+I again for additional instructions until you’re satisfied with the
"model": "llama3.1:8b" model’s edits.
}
], The assistant can help fix errors, too. Running your code in Visual
Studio Code’s terminal and encountering an error? Pressing Ctrl+-
Alternatively, setting the model as AUTODETECT allows Continue to Shift+R (Cmd+Shift+R on macOS) lets Continue feed the question
query Ollama for all available models, letting you choose the model “I got the following error, can you please help explain how to fix it?”
for chat from a dropdown list. For code completion, specify the model followed by the actual error message from the terminal to the LLM.
as follows: The model then replies with a potential solution. Try its suggestion,
and if it doesn’t work, and you get an error again (the same or another
"tabAutocompleteModel": { one), just press Ctrl+Shift+R again to ask for help.
"title": "StarCoder 2 3B",
"provider": "ollama", Adding Context
"model": "starcoder2:3b" Until now, you’ve been using LLMs on selected parts of your code.
}, However, you can also add context by one of Continue’s built-in context
providers, which allow you to use the LLM more effectively. During
Finally, specify the model for text embeddings: any conversation with the LLM, type @code to reference specific
functions or classes from throughout your project, without having
"embeddingsProvider": { to select them. With @problems you can refer to the problems that
"provider": "ollama", Visual Studio Code shows for your currently opened code file, such
"model": "nomic-embed-text" as syntax errors.
},
Continue also indexes the codebase you’re working on, allowing it to
After this, save your changes. automatically pull in the most relevant context from throughout your
workspace when answering general questions. Just type @codebase
Regarding model selection, depending on your hardware it is possible followed by your question to provide this context. It’s best to start a
that the suggested models Llama 3.1 8B and StarCoder 2 3B can’t fit new session for this, which you can do by clicking on the + icon at
simultaneously. See the text box Fitting models in your GPU’s VRAM the top right of Continue’s sidebar.
for more information on that topic.
When the LLM answers your query with the @codebase context, it
Using Continue shows the context items it uses as “X context items”. If you click on
When you start developing in Visual Studio Code now, Continue it, a list of the precise files and lines unfolds that the LLM is using
operates in the background, enhancing your workflow. For instance, as context for its answer. In its answer, it also refers to the relevant
pressing the tab key while typing a line of code provides a suggestion files. This works well for general questions, like how to add a new
configuration option, how to implement a subclass using another this context, this should result in more relevant answers. However, the
subclass as an example, or how to add command-line parameters @open context provider isn’t enabled by default. You need to add the
using Python’s argparse module. You can also use @folder to ask following entry to Continue’s config.json file in the contextProviders
questions about a specific folder within your project, instead of using list:
the entire codebase as context.
{
If you’re developing a more than trivial program, you often have multiple "name": "open",
source files open in Visual Studio Code. You can refer to the contents "params": {}
of all your open files with @open. When asking your question within },
External Context
Continue can incorporate external sources into LLM context as well.
For instance, referencing a specific GitHub issue within LLM queries
is possible by typing @issue. Enable this context provider with the
following entry in Continue’s configuration file:
{
"name": "issue",
"params": {
"repos": [
{
"owner": "theengs",
"repo": "gateway"
}
],
"githubToken": "github_pat_xxx"
} Figure 4: Create a GitHub personal access token to give Continue access to
}, issues on your GitHub repositories.
Note that you need to explicitly specify the repositories you want Another command is /comment, which prompts the LLM to comment
to be able to refer to. It’s also recommended to include a GitHub the selected code. The /commit command generates a commit
personal access token [21] to avoid being rate-limited. When creating message from the current Git diff with changes in your code, and /
the access token on GitHub’s website, giving just read-only access cmd generates a shell command based on your instructions and pastes
to public repositories is enough (Figure 4). Copy the access token it into Visual Studio Code’s terminal. You only need to review and adapt
immediately and paste it in Continue’s configuration file because it’s the command and then press enter to execute it.
only visible once.
You can also create custom slash commands, using either TypeScript
Another useful context provider is @docs, which is enabled by default. code or LLM prompts. By default, Continue includes one custom
Continue pre-indexes a number of common documentation sites, most command using a prompt:
of them about web development technologies, but also the official
Python documentation and Rust documentation and the C# language "customCommands": [
reference. Just start typing @docs, choose the documentation site {
from the dropdown menu or type the name of the project, and then "name": "test",
after selecting the project ask your question with this documentation "prompt": "{{{ input }}}\n\nWrite a comprehensive
site as context. set of unit tests for the selected code. It should setup,
run tests that check for correctness including important
You can also add any documentation site by selecting Add Docs in edge cases, and teardown. Ensure that the tests are
the dropdown menu that appears after typing @docs. Just enter the complete and sophisticated. Give the tests just as chat
root URL of the documentation site and the name of the project. This output, don’t edit any file.",
is useful to add the documentation of the major libraries you’re using "description": "Write unit tests for highlighted code"
in your project, so the LLM is aware of it when asking questions. }
],
Built-In Commands
Continue also has some handy built-in slash commands [22]. Simply The {{{ input }}} is a placeholder for the selected code. Then
select a block of code, press Ctrl+L to start a session with the LLM, come two newlines (\n), followed by the prompt to the model. You
and enter /edit followed by instructions to edit the code. Continue can customize this to your liking. Then just select your code that you
shows the suggested changes in a side-by-side diff editor to accept want to be tested, press Ctrl+L and type /test. Refine the results
or reject individual changes. through follow-up questions if necessary.
WEB LINKS
[1] ChatGPT: https://openai.com/chatgpt/
[2] GitHub Copilot: https://github.com/features/copilot/
[3] Visual Studio Code: https://code.visualstudio.com
[4] GitHub Copilot extension: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
[5] Ollama: https://ollama.com
[6] Continue: https://www.continue.dev
[7] Ollama downloads: https://ollama.com/download
[8] AMD Radeon drivers: https://www.amd.com/en/support/download/drivers.html
[9] AMD ROCm: https://rocm.docs.amd.com
[10] CUDA drivers: https://developer.nvidia.com/cuda-downloads
[11] Mistral AI’s Codestral 22B: https://mistral.ai/news/codestral/
[12] Mistral AI Non-Production License: https://mistral.ai/news/mistral-ai-non-production-license-mnpl/
[13] DeepSeek AI’s DeepSeek Coder: https://deepseekcoder.github.io
[14] DeepSeek AI’s DeepSeek Coder V2: https://github.com/deepseek-ai/DeepSeek-Coder-V2
[15] Ollama’s model library: https://ollama.com/library
[16] Meta’s Llama 3.1: https://ai.meta.com/blog/meta-llama-3-1/
[17] BigCode’s StarCoder 2: https://github.com/bigcode-project/starcoder2
[18] Nomic’s Embed: https://www.nomic.ai/blog/posts/nomic-embed-text-v1
[19] Continue’s configuration documentation: https://docs.continue.dev/setup/configuration
[20] Continue’s built-in context providers: https://docs.continue.dev/customization/context-providers
[21] GitHub personal access token: https://tinyurl.com/bykfswr9
[22] Slash commands: https://docs.continue.dev/customization/slash-commands
Solar Charge
Controller
with MPPT (2)
The Circuit
By Roland Stiglmayr (Germany) The first part of this article series [1] covered the basics, advantages,
and functionality of an MPP tracker in a solar charge controller and
For the second article in this series, ended with a block diagram showing the design of an MPPT. In part 2,
we convert the block diagram of the the block diagram (Figure 1) is converted into a functioning circuit
(Figure 2). In addition, the functionality of the sub-circuits is explained
MPPT solar charge controller into a in detail.
functioning circuit. As always with
power electronics, the main focus is on The Internal Power Supply
Voltage VPV from the solar panel is fed via fuse F1 to suppressor
the currents within the circuit and their diode D2, which suppresses brief overvoltages. F1 trips in the event
implications for certain components. of very high fault currents caused by inductive coupling, and also
Calculations are required! makes it possible to disconnect the module from the solar panels.
12 bit D/A
V In
Supply Voltage A D HMI
En
V Bat
Serial
A2 D
V Out Data
V In
I PV I In V In Controller
A1
PV A
V PV V ISense =
I Out x c
Charge Load_On
V In
T1 T2
In En
I Out
Gate
PWM
Drive
Load
0V = max
I Sense D1
+V = min
Figure 1: V Out
Reminder: The block
diagram from the first 250109-007
12k
100k
100k
470k
330k
100k
C1 C33 C2 D8 C4 C6 R34 3
PV+ GND GND R10 LM4041IDBZ C30
1
10k
PV0 100n 100n 47µ
D3 2 2 220k T4 IC6A
8.0SMDJ51A SM40042µ2 2µ2
100n R16 2
100V 100V 63V 100V 100V
47k
R60 R5 LL4148 R53 R2 R7 R8 R13 R15
C3 C7 C9 C10 8 C35 C34
100k
10k
BC847
4k7
47k
47k
18k
82k
22k
IC6
12k
10k
R38
C16
C21
100n ARDUINO_NANO
10Ω
10k
12
16 15
1µ
1µ
VCC TX VIN
16 17 14 R36
2IN+ R19 R20 A_4V8 RX GND
15 C14 18 13 C20 47n R37 R35
8 2IN- 10k 150k RST RST D_4V8
C1 1µ 19
GND
MOD1 12
5V
4k7
4k7
10k
C31 R21 R58 D5
13 20 11
9 OC 10k D2 A7 10k LL4148
E1 21 10
1n 8 1 D3 A6
3 VOUTA VDD 22 9
IC4 CIN 7 2 R31 D4 RESET A5
D_4V8 R65 GND IC5 /CS 1k 23 8
TL494CDRD16-M 6 3 R32 D5 A4
1k2
14 VOUTB SCK 1k 24 7
12
13
14
15
16
17
18
19
20
11
VREF 5 4 R33 D6 A3
/LDAC SDI 1k 25 6
VOUT
IM1
VDD
VSS
SID
/CS
SA0
SOD
SCLK
/RST
11 C11 D7 A2
C2 4 R25 26 5 C18 47n
D8 A1
Figure 2: The complete circuit diagram of the MPPT solar charge controller.
MCP4822-E/SN 27 4 C17 47n
10n D9 A0
1k2
10 R26
E2 2 28 3 C15 1µ
1IN- 10k R23 D10 AREF DSP1
1 29 2
1IN+ 10k D11 3V3 DOGS104N-A
30 1 C19 47n
RT GND CT D12 D13
6 7 5 R62
NC/C2
NC/C1
NC/A2
NC/A1
R30 R29 R18 R27 R24 R55
C12 10k
10k
USB
3k9
10k
33k
10k
1k
10
9
2
1
1n
R61
V_BCK 100k
13V V_IN V_ACS V_IBCK R45
1k
R44 R57
C25 C27 C37 C26 V_LOAD
100k
4Ω7 T3 T5
100n 100µ 100µ 1µ
IPP024N08NF25 MVMFWS2D3P04
D 100V 63V 63V
D4 T1
DFLS1100 S D S D
R42
G D7 R49
3Ω3 8
D_4V8 1 16 R40 R50 F2
22k
INA VCCA G G
2 15 C23 IPP024N08NF25 S 1 VCC 470k
L5
10k
INB OUTA IP+@1
3 14 2 7 25A D6
VDD_1 IC10 VSSA 15µH IP+@2 VIOUT
4 13 100n BZV55-C12 R46
GND NC_2 6 5 4
5 12 D IC8 C32 C36 LL4148
X2 R56 R48 X3
GATE
CAT_D
ANO_S
8k2
ENA/DIS NC_1 T2
6 11 3 6
10k
DT VCCB R43 IP–@3 FLTR R51
100n 100n Bat+ Out+
6k8
7 10 G 4
ANB OUTB 3Ω3 IP–@4 1 T6
IC9 Bat0 Out0
6k8
8 9 GND VCAP
VDD_2 VSSB
IPP024N08NF25 S 5 LM74700
R64 R39 R41 R67 R68 R54 3 R47
C22 C24 C28 C29 EN LED1 LED2
MCP51561BADWR2G GND
100k
100k
BC847
22k
10k
10k
2k2
2k2
2
1µ 100n 1µ 270µ
35V red green
250109-022
IC8 = ACS711ELCTR-25AB-T
Technical Specifications
Input voltage 20…60 V
Input current (max.) 15 A
Output voltage 10…29 V
Charging current (max.) 20 A
Since uL only assumes two constant values (V_IN – V_BCK and -V_BCK),
Charging power (max.) 280 W the following applies:
Load current (max.) 25 A ∆iL = 1/L × uL × ∆t; uL = constant
Efficiency (230 W) >96%
When loading the choke, the following results:
Internal power consumption (low power) <8 mA
∆t = 1/f × (V_BCK / V_IN)
uL = V_IN – V_BCK
The output voltage of IC2 is cleaned of high-frequency interference The first curve shows the voltage curves, the second shows the current,
by L4 and is used to supply the analog section. The adjustable preci- I(L5), through storage choke L5 and load current I(Load). The super-
sion voltage source, IC3, generates the reference voltage of 3.3 V. imposed alternating current is the magnetizing current applied to C29.
Op-amp IC6B buffers this voltage and supplies it to the reference The third curve shows the current, I(V_IN), supplied by the solar panel,
voltage input AREF of the Arduino. Op-amp IC6A uses the reference the current flowing through the high-side FET, I(T1_DS), and current
voltage as the supply voltage, V_ACS, for current sensor IC8. To keep I(C27) flowing through one of the two decoupling capacitors, C27||C37.
the power consumption as low as possible, the controller switches off The comparison of the two curves clearly shows how an input current
this voltage via T4 when it is dark. Op-amp IC6, a TLV9002, is charac- of 4 A becomes an output current of 15 A. The fourth curve, which
terized by its high stability in unity gain operation and must not be uses a different time scale, shows the energy dissipated at the equiv-
replaced by an arbitrary type. alent series resistance (ESR) of C27 within the observation period of
7 ms. The power dissipation of the capacitor and the associated ripple
The High-Power Section current can be calculated from the energy.
In the block diagram, the function blocks PWM, Gate Driver, the two
MOSFETs in half-bridge configuration, and the storage choke with the Energy: ∆E = P × ∆t; P = ∆E/ ∆t
output capacitor form the high-power section of the MPP tracker. If Power: P = (E8ms – E1ms) / 7 ms = (64.4 mJ – 63.1 mJ) / 7 ms = 0.19 W
you add the control from A1 and A2, you can see a pure buck converter Current: Ieff = √(P/ESR) = √(0.19 W/17 mΩ) = 3.3 A
with synchronous rectification. Synchronous rectification means that
MOSFET T2 (Figure 2) takes over the role of the usual freewheeling If electrolytic capacitors were subjected to such high currents, they
diode. This is the only way to achieve an efficiency of over 95% at would explode in no time! Only high-quality aluminum polymer capac-
currents of 15 A and higher. To achieve this goal, the MOSFETs must itors can withstand currents of this magnitude.
have a very low RDSON and, to keep switching losses low, the semicon-
ductor capacities must be as small as possible. Only N-channel FETs Current sensor IC8 is connected in series with choke L5. The current
can meet these requirements. is measured by detecting the flux density generated by the current in
the sensor’s internal conductor. An integrated Hall sensor measures
Since the high-side FET requires a gate voltage that is higher than the magnetic field. The advantage of this principle is that there are
V_IN, the bootstrap circuit consisting of C23, D4, and R44 adds 13 V no losses. The sensor type used here is suitable for measuring ±25 A
to V_IN and makes it available to the gate driver. Several aspects with a sensitivity of 55 mV/1 A. Since the sensitivity depends on the
must be considered when dimensioning the storage choke: If a small supply voltage, it is supplied with the reference voltage.
inductance value is selected, the magnetization current increases and,
in turn, the ohmic losses decrease for the same component size. The What is still missing is the control of the MOSFETs by gate driver IC10.
magnetization current represents the ripple current of output capacitor In addition to generating the high gate currents of 7 to 9 A, it separates
C29 and therefore has a major influence on its load. A quick calcula- the different reference potentials of the input and output. For this
tion shows the range of the magnetization current. purpose, it is coupled inductively internally to achieve isolation between
all stages. Furthermore, the gate driver generates the complementary
Choke current in general: iL = 1/L × ∫uL × dt output signals required to control the high-side and low-side FETs.
To prevent the dreaded shoot-through, i.e., the simultaneous conduc- to the body diode’s polarity. Otherwise, the load would always be
tion of both FETs, it inserts a dead time when commutating the current connected to the battery via the body diode. As already mentioned
from one FET to the other. The dead time is adjusted with R39. The above, in the dark, the battery supplies the controller via diode D8,
microcontroller can disable the component by applying a low signal which is connected to the load output. If there is no input voltage and
to the ENA/DIS pin. the controller detects that the battery voltage is too low, the load is
disconnected, which leads to a complete shutdown of the system.
The above considerations apply to every step-down-regulator and can
therefore also be used very well for your own developments. The Control Circuit
The most complex part of the solar controller is the power converter’s
Battery and Load Management control circuit. It adjusts the PWM’s pulse width so that the output
To charge the battery, the microcontroller activates MOSFET T3 via current corresponds to a value specified by the controller, and the
IC9, which switches the output of the converter to the battery. It is maximum output voltage cannot exceed the battery’s end-of-charge
essential to disconnect the battery from the converter; otherwise the voltage.
converter will discharge the battery. Due to the polarity of body diode
T3, only an N-channel FET can be used here, but this requires an The setpoints for current and voltage are provided by the 12-bit D/A
increase in its gate voltage. IC9, a component originally designed converter, IC5. It has two outputs, an internal reference voltage of
for reverse polarity protection circuits, performs this task. In addition 2.048 V, and is controlled via an SPI interface.
to increasing the voltage, it monitors T3’s DS voltage and immedi-
ately switches off the FET if the source voltage falls below the drain IC4 contains two control amplifiers and the PWM generator. Figure 4
voltage. This reliably prevents reverse operation, which could cause shows a section of the internal circuit and the associated external
the converter to become a boost converter. circuitry. The outputs of the control amplifiers are connected to two
diodes in such a way that the higher signal always dominates. Since
The microcontroller continuously measures the battery voltage and the PWM generator reduces the pulse width as the voltage increases,
switches the battery to the load output when the voltage is sufficient. the actual values must necessarily act on the non-inverting inputs.
This is ensured by MOSFET T5, which must be a P-channel type due If the current or voltage rises above its setpoint value, the control
R24 R23
1IN+
V_BCK
R66
C2
R27
IC4 = TL494 PWM
E2
OUT
R18
2IN+ R39
V_IBCK
R22 R19 2
A_3.3V
R21
VOUTB
R20
Figure 4: The control 250109-018
amplifier’s output voltage also increases and, as a result, the pulse for the converter’s output voltage of the converter. The non-inverting
width is reduced. This causes the deviating value to fall back to the input of control amplifier 1 sums part of the converter voltage, V_BCK,
setpoint value. with VOUTA from the D/A converter. The value of the setpoint that
the D/A converter outputs is calculated as follows:
The signal from the current sensor, V_IBCK, which represents the
output current, is present at the non-inverting input of control ampli- V_BCK = IR24 × R24 + V1IN+
fier 2. Without current, the quiescent level of the sensor is half its IR24 = (V1IN+ - VOUTA) / (R25 + R65)
supply voltage, i.e., A_3V3 / 2. V_IBCK is: V_BCK = ((V1IN+ - VOUTA) × R24 / (R25 + R65)) + V1IN+
V_BCK = V1IN+ × (c + 1) – VOUTA × c
V_IBCK = I_BCK × SSense + (A_3V3 / 2); VOUTA = V1IN+ × ((c + 1) / c) – V_BCK / c
where SSense = (55 mV / 1000 mA) = 0.055 mV / 1 mA where c = R24 / (R25 + R65) = 13.75
VOUTA = V1IN+ × 1.07272 – V_BCK × 1 / 13.75
The setpoint of the output current, which is obtained from the refer- V1IN+ = V1IN- = A_3V3 × R27 / (R28 || R68 + R27)
ence voltage A_3V3 and VOUTB using a voltage divider consisting VOUTA = A_3V3 × 0.625 – V_BCK × 1 / 13.75
of R20||R21 and R22, is present at the inverting input. The base point DAC_A = VOUTA × 4096 / 2048 = VOUTA × 2
of the voltage divider is present at the VOUTB output of the D/A
converter, which controls the potential of this point in order to set the V_SetZ = A_3V3 × 0.625 × 1.07272 × 216 = A_3V3 × 43939
output current. The following applies: V_SetG = (1 / 13.75) × 216 = 4766
The storage choke, L5, must be insulated from the vias of the circuit board
using a heat-resistant film or a mica disc. The clips of the fuse holders
must be well tinned before soldering, to prevent cold solder joints.
Although the Arduino can be soldered directly onto the board by stick- About the Author
ing insulating film to its underside, it is better to provide a socket for Roland Stiglmayr studied information technology in the 1970s and
it. Either way, it should not be fitted until commissioning. The display has over 40 years of experience in research and development. His
is also mounted in a socket for better visibility. work has focused on the development of computer mainframes,
fiber optic-based data transmission systems, RRHs for mobile
The MOSFETs, T1, T2, and T3, must be cooled. Either place the module communications, and contactless energy transmission systems.
on a heat sink as shown in the title image and screw the transistors Today, he works as a consultant. He is particularly passionate about
onto this plate in an insulated manner, or mount the insulated MOSFETs sharing his knowledge.
on a heat sink with a thermal resistance of less than 3 K/W. T1 and T2
should not be fitted until commissioning.
Questions or Comments?
In Conclusion Do you have questions or comments about this article?
The solar charge controller is ideal for use with today’s standard solar Email the author at [email protected], or contact Elektor at
panels with 2×72 half cells. Another cost-effective option is to use four [email protected].
small panels with 36 cells each, connecting two in series and then
connecting the two series connections in parallel. This creates an ideal
arrangement in terms of shading [2]. In any case, the specifications
of the tracker must be observed.
Related Products
Due to its robustness and low price, a lead-acid battery [3] is the best > Waveshare Solar Power Management Module
choice for the battery. Lithium batteries can only be operated with an www.elektor.com/20488
additional battery management system that monitors voltage and current
and balances the cell voltage. It should be noted that the charging > Waveshare Solar Power Manager (C)
current should not be limited due to an unfavorable battery selection, as www.elektor.com/20490
otherwise the maximum available power will not be available to the load.
WEB LINKS
[1] Roland Stiglmayr, “Solar Charge Controller with MPPT,” Part 1, Elektor 5-6/2025: https://elektormagazine.com/250109-01
[2] Elektor Special: Solaranlagen und Photovoltaik [German]: https://elektor.de/20597
[3] Walter Ribbert, “Pimp My Car Battery Charger (Part 1),” Elektor Circuit Special 2024: https://elektormagazine.com/240040-01
[4] Download: https://www.elektormagazine.com/labs/solar-charge-controller-with-mpp-tracking
Ultrasonic
Obstacle Detector
A Simple Project to Help Those
with Impaired Vision
U2 GY-521
Motor Vibration
1 2
3 4
CD2
5 6
INT
VCC
GND
SCL
SDA
XDA
XCL
AD0
7 8
100n
9 10
U1 ARDUINO_NANO +5V
CN3 CD5
1 30
TX VIN
+5V 2 29
RX GND CD4 100n
3 28
RST RST
R1 4 27
+5V GND 5V 100n
5 26
D2 A7
10k
6 25
CN2 CD3 D3 A6
1 7 24 +5V
BLACK D4 RESET A5
2 8 23
RED D5 A4
3 100n 9 22
WHITE D6 A3
4 10 21 +5V
YELLOW D7 A2
R12 R9 11 20
Ultrasonic Sensor D8 A1
220Ω
220Ω
12 19
D9 A0
13 18
D10 AREF
14 17
Red DL1 Green D11 3V3 RA3
15 16
D12 D13 RA2
RA1
100k
USB 100k
JP3 JP1
100k
C1 C2 C3
+5V
100n 100n 100n
RA1 = Distance
R2
RA2 = PWM
RA3 = See text
R3 R4 R5 R6 R7 R8 R10
1k
150Ω
150Ω
150Ω
150Ω
150Ω
150Ω
100Ω
LED1 +5V
CN1
1
D VCC
T1 2 CD1
D–
3
G D+
4 100n
R11 GND
RFD14N05SM9A
S
100k
USB Mini
with these USB power banks is their tendency to shut down when
current draw is too low. To prevent this, the circuit uses a MOSFET (T1)
to periodically activate load resistors (R3 to R8) for a few milliseconds,
drawing a short current pulse to keep the power bank awake. LED1
gives a visual indication of these pulses. This approach is inspired
by the “USB Battery Interface” project published in Elektor [2]. The
potentiometer RA3 controls the interval to keep the USB battery from
switching off.
A bi-color LED (DL1) signals system status: green for normal operation,
red when an obstacle is detected. If desired, the LED can be disabled
with the JP3 jumper. On the PCB, I have added a footprint for an 8-pin
GY-521 module, using an MPU6050 accelerometer to be added in the
future to detect motion and automatically wake the system. In the end,
this feature hasn’t been used.
Practical Build
The PCB and the ultrasonic transducer fit in a translucent Hammond
enclosure, which was mounted under the seat of the walker, with the
sensor pointing forward. The control box, battery and cables are secured
under the seat (Figure 4) using zip-ties and small, custom-made sheet Figure 4: Mounting everything under the seat.
1
BLACK
(who was a particularly discern- RA1 = Angle min 2
RED
RA2 = Angle max CD2 LED1 3
ing user) pointed out that the 20° RA3 = Sweep time CD1 C2 WHITE
4
YELLOW
detection angle of the ultrasonic 100n ON 100n 100µ
To Nano Board
sensor was insufficient, especially +3V3 CN4
10V
SWCLK
GND
SWDIO
CD3 WHITE
RA1 4
A0 5V +5V YELLOW
could be used; I chose to mount RA2
A1 GND 100n Ultrasonic Sensor
the ultrasonic sensor on a bracket, RA3
A2 MOD1 3V3 +3V3
10k
and make it pivot using a small RC 10k
A3 Xiao A10 R1
3
CN3
A4 SAMD21 A9 10Ω ORANGE
servo (Figure 5). 10k
A5 A8
2
RED
C6 C1 C3 C4
1
A6 A7 BLACK
GND
CD4 C5
VIN
// Forward transition
for (int i = 0; i <= steps; i++) {
angle = angleStart + increment * i;
monServo.write(angle);
delay(20); // Wait 20 ms between each step
}
Hence, the sweep duration (in milliseconds) is divided by 20 to give About the Author
the number of steps needed. The angle the servo needs to move in Pascal Rondane’s hobby has been electronics since he was a
each step is the total sweep angle angleEnd - angleStart divided teenager, and he has owned every issue of Elektor since the beginning
by the number of steps. A for loop is used to go through all the angles, of the French edition in 1978. He trained as an electronics technician
step by step. Then a similar loop is called, counting in reverse, for a and worked for 20 years in a company that maintained Motorola radio
smooth sweep in the opposite direction, as can be seen in Listing 1. equipment, and repaired electronic boards for IBM France. He then
worked for 22 years in after-sales service and test bench design in a
The sweeping sensor made it easier to detect obstacles on the sides, major French group manufacturing road signs. He’s been retired for
and turned out to be a useful addition. I’d like to think of this article as a a year, which leaves him more time for his favorite hobby, as well as
small tribute to my late uncle, whose request started it all; I’m glad this allowing him to take part in the activities of the Association du Centre
project could help him regain a degree of independence. I hope this Historique de la Diffusion Radiophonique (ACHDR), dedicated to
will inspire you with other ideas to help take care of your loved ones! the safeguarding of the French audiovisual heritage.
Many thanks to Vincent, Bastian, and Cyril for their valuable help.
230653-01
Related Products
Questions or Comments?
Do you have technical questions or comments about this article? > Seeed Studio Grove Ultrasonic Distance Sensor
Feel free to contact the author at [email protected] or Elektor www.elektor.com/20027
at [email protected].
> Ultrasonic Radar Robot Kit
www.elektor.com/20941
WEB LINKS
[1] M5Stack Vibration Motor Unit: https://shop.m5stack.com/products/vibration-motor-unit
[2] Pascal Rondane, “USB Battery Interface,” Elektor Circuit Special 2024: https://www.elektormagazine.com/230652-01
[3] XIAO SAMD21 by Seeed Studio: https://tinyurl.com/yrtxyaza
[4] Downloads: https://www.elektormagazine.com/labs/elektor-articles-software-downloads
WEB LINKS
[1] Google: 2025 and the Next Chapter(s) of AI: https://tinyurl.com/google2025ai
[2] IBM: AI agents in 2025: Expectations vs. reality: https://tinyurl.com/ibmaiagents
[3] PwC: 2025 AI Business Predictions: https://www.pwc.com/us/en/tech-effect/ai-analytics/ai-predictions.html
[4] Microsoft: 6 AI trends you’ll see more of in 2025: https://tinyurl.com/ibm2025ai
[5] IEEE Spectrum: 12 Graphs That Explain the State of AI in 2025: https://spectrum.ieee.org/ai-index-2025
[6] MIT Sloan: Five Trends in AI and Data Science for 2025: https://tinyurl.com/sloan2025ai
[7] McKinsey: Superagency in the workplace: Empowering people to unlock AI’s full potential: https://tinyurl.com/mckinseywpai
Raspberry Pi
Standalone MIDI
Synthesizer (3)
Making It Smarter and Adding a User Interface
def generate_response(input_sequence):
# Set generation parameters
generator_options = generator_pb2.GeneratorOptions()
generator_options.args['temperature'].float_value = 1.0 # Higher = more random
generator_options.generate_sections.add(
start_time=0,
end_time=4.0 # Generate 4 seconds of music
)
def midi_callback():
global last_note_time
while True:
message = midi_in.get_message()
if message:
midi_msg, delta_time = message
Listing 2: style_transform.py
import rtmidi
import time
import random
import numpy as np
# MIDI setup
midi_in = rtmidi.MidiIn()
midi_out = rtmidi.MidiOut()
midi_in.open_port(0)
midi_out.open_port(1)
# Style definitions
STYLES = {
'jazz': {
'chord_extensions': [9, 11, 13], # 9th, 11th, 13th extensions
'swing_ratio': 0.67, # Swing feel
'velocity_variance': 15, # More dynamic expression
'scale': [0, 2, 3, 5, 7, 9, 10] # Dorian scale (for jazz feel)
},
'classical': {
'chord_extensions': [7], # Simpler harmonies
'swing_ratio': 0.5, # No swing
'velocity_variance': 10, # Moderate dynamics
'scale': [0, 2, 4, 5, 7, 9, 11] # Major scale
},
'electronic': {
'chord_extensions': [4, 7], # Power chords and octaves
'swing_ratio': 0.5, # Straight timing
'velocity_variance': 5, # Less dynamic variance
'scale': [0, 2, 4, 7, 9] # Pentatonic scale
}
}
# Current style
current_style = 'jazz'
# Note tracking
active_notes = {}
note_history = []
last_timestamp = time.time()
beat_interval = 0.5 # 120 BPM (in seconds)
def apply_style_to_note(note, velocity):
"""Apply the current style's characteristics to a MIDI note"""
style = STYLES[current_style]
def adjust_timing(timestamp):
"""Apply swing feel based on current style"""
style = STYLES[current_style]
global last_timestamp, beat_interval
return timestamp
def process_midi():
"""Process incoming MIDI messages and apply style transformations"""
while True:
msg = midi_in.get_message()
if msg:
message, timestamp = msg
command = message[0] & 0xF0
# Note on
if command == 0x90 and message[2] > 0:
note, velocity = message[1], message[2]
styled_note, styled_velocity = apply_style_to_note(note, velocity)
styled_time = adjust_timing(timestamp)
# Note off
continued on next page
time.sleep(0.001)
def cycle_style():
"""Change to the next available style"""
global current_style
styles = list(STYLES.keys())
current_index = styles.index(current_style)
next_index = (current_index + 1) % len(styles)
current_style = styles[next_index]
print(f"Style changed to: ")
# Set up a separate thread for button handling if using the Pirate Audio buttons
try:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON_A, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(BUTTON_B, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(BUTTON_X, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(BUTTON_Y, GPIO.IN, pull_up_down=GPIO.PUD_UP)
def button_callback(channel):
if channel == BUTTON_A:
cycle_style()
> Button A: Cycles through modes on the main screen, navigates Using crontab make this script executable and set it to run at startup.
up in menus, increases values when editing settings. Crontab (short for “cron table”) is a time-based job scheduler in Unix-like
> Button B: Opens settings menu on the main screen, navigates operating systems, including the Raspberry Pi’s Linux distribution. It
down in menus, decreases values when editing settings. allows users to schedule commands or scripts to run automatically
> Button X: Save functionality (saves presets), edits selected at specified times or intervals.
settings, confirms selections.
> Button Y: Load functionality (loads presets), navigates back, Use this line to enter crontab:
cancels editing.
chmod +x ~/start_midi_ai.sh crontab -e
Button A cycles through the available modes (FluidSynth, AI Melody,
Jazz Style, Classical, Electronic). The interface shows the current mode And then add this line to the crontab:
and status on the display.
@reboot /home/pi/start_midi_ai.sh &
Combining Everything with an Auto-Start Script
Let’s create a master script that will start our entire MIDI AI system at Finally, exit the nano editor by using Ctrl-X, Y, then Enter.
boot. Create a file called start_midi_ai.sh (Listing 3).
Listing 3: start_midi_ai.sh
#!/bin/bash
# Log startup
echo "MIDI AI System started at $(date)" >> /home/pi/midi_ai.log
1. Use TensorFlow Lite: Instead of the implementation in this project > Respond to our playing with generated melodies
— especially for lower-power devices — we could use TensorFlow > Transform our input into different musical styles
Lite, as it’s designed for edge devices. > Provide visual feedback on the Pirate Audio display
> Start automatically at boot
2. Quantize TensorFlow models: This reduces model size and speeds
up inference. As computing power on edge devices continues to improve, and as
AI models become more efficient, we’ll be able to run increasingly
# Add to your Python setup script sophisticated musical intelligence directly on edge devices such as the
converter = tf.lite.TFLiteConverter. Raspberry Pi. Future enhancements could include full band accompa-
from_saved_model(saved_model_dir) niment (perhaps even on an array of Raspberry Pis!), learning from your
converter.optimizations = [tf.lite.Optimize.DEFAULT] specific playing style, or even voice-controlled music generation.
quantized_tflite_model = converter.convert() 240714-C-01
oject
See the pr ere!
in action h
WEB LINKS
[1] Brian Tristam Williams, “Raspberry Pi Standalone MIDI Synthesizer (1),” Elektor 3-4/2025: https://elektormagazine.com/240714-01
[2] Brian Tristam Williams, “Raspberry Pi Standalone MIDI Synthesizer (2),” Elektor 5-6/2025:
https://elektormagazine.com/240714-B-01
[3] GitHub repository for these experiments: https://github.com/briantw/pi-midi
[4] Magenta Project: https://magenta.tensorflow.org/
[5] Magenta’s Melody RNN README.md — GitHub repository: https://tinyurl.com/melodyreadme
Meshtastic:
A Demo Project An Intelligent Mesh of LoRa Radios
Ever since Long Range (LoRa) radios hit the market, lots of IoT devices Whilst the ZigBee network is highly scalable, the LoRa network is not
are appearing in the market now and then. Besides LoRa, there is one lagging much behind. Besides, LoRa has a very long range, low-power
more standard which is already occupying the market segment with consumption, highly encrypted and is immune to electromagnetic
various applications, and that is ZigBee. Although ZigBee devices interferences.
are substantially costly, still they are in use due to their exceptionally
easy meshing capability. ZigBee radios can be placed in mesh config- Meshtastic Network
urations, where every ZigBee will be connected as a node with each Meshtastic [1] has brought an open-source software to create a LoRa
other (Figure 1), such that if one or more nodes fail, the network will mesh network. LoRa works great on Line of Sight (LOS). Therefore,
still be available. if one or two nodes can be placed at a strategically high place, then
all nodes will easily talk to each other. There are already many works
available on the Internet. Here, I just tried to create a practical working
network for readers, where sensor data, GPS position and triggering
alarms can be easily worked out.
The Project
To make a workable mesh network for testing, we need to build three or
more LoRa nodes, with an ESP32 board and a LoRa module (Figure 2),
or purchase ready-made ESP32 LoRa boards from the market, for
example the WiFi LoRa 32 [2] from Heltec (Figure 3). Furthermore,
at least one I2C sensor from the following list has to be procured:
> BME280
> BME680
Figure 1: A typical mesh network. (Source: Adobe Stock) > MCP9808
> INA260 webpage [3]. This tool will only work in Chrome or Edge browsers.
> INA219 However, the command line interface (CLI) method of uploading does
> SHTC3 not have this limitation.
> SHT31
> PMSA0031 The website with the Meshtastic flashing tool described above does
not provide flash facility for Heltec V1 or V2 boards. It starts working
Wiring Diagram with the Heltec V3 board upwards (and for higher level boards like
The wiring needed to link all the modules included in this project is T-Beam, T-Echo, T-Deck, etc.). The flash software firmware-heltec-v1-
shown in Figure 4. To flash an ESP32 board with Meshtastic software 2.2.12.092e6f2.bin available from [4] will flash the Heltec LoRa board,
(see also the textbox Compatible Boards), connect the board to your or the finished prototype of a ESP32 LoRa homemade board shown
computer’s USB port and then go to the Meshtastic online flasher in Figure 2.
ANT1
+3V3 +3V3 +3V3 +9V
1 38 HT7333A
3V3 GND VCC
2 37
EN/RST GPIO23 GND
3 36 PWR
GPIO36/SVP GPIO22 SCL
LORA-SX1278 4 35
GPIO39/SVN GPIO1/TX0 SDA
14 Radio Module 5 34
DIO5 GPIO34 GPIO3/RX0 CSB
13 6 33
DIO4 GPIO35 GPIO21 SDO
7 32
REST
SCLK
GPIO32 GND
MOSI
MISO
DIO0
DIO3
DIO2
DIO1
GND
GND
VCC
NSS
8 31 BME280
GPIO33 GPIO19
9 30
12 11 10 9 8 7 6 5 4 3 2 1 GPIO25 GPIO18
10 29
GPIO26 GPIO5
11 28
GPIO27 GPIO17
12 27
GPIO14 GPIO16
13 26
GPIO12 GPIO4
14 25
GND GPIO0
+3V3 15 24 +3V3 +3V3
GPIO13 GPIO2
16 23
GPIO9/SD2 GPIO15
17 22
GPIO10/SD3 GPIO8/SD1
18 21 1 2 3 4
GPIO11/SDCMD GPIO7/SD0
GND
SCL
SDA
GND
VCC
PPS
VCC
EN
RX
TX
19 20
5V GPIO6/SDCLK
PWR PPS
EN IO0
USB
PPS
230679-018
SSD1306
Figure 4: Schematic: A generic GPS sensor (see text) is added. The PPS (Pulse Per Second) output signal is routed to an LED.
Figure 5a and 5b: First steps to install the Meshtastic software on each ESP32 board.
Attaching Sensors
Only I2C sensors with the following addresses are allowed: 0x76, 0x77,
0x78, 0x18, 0x40, 0x41, 0x5D, 0x5C, 0x70, 0x44, 0x12, and 0x3C (fixed for
OLED). More sensors will hopefully be added in the future. To enable
detection, navigate to Radio Configuration → Detection Sensor →
Detection Sensor enabled.
You may provide a name for the sensor, such as BME or Temp_Ind. In
the same window, you can also designate a GPIO pin to monitor for
high or low signals. The detection will be monitored periodically every
900 s (default value) for high or low signals. Please note that this GPIO
pin status is entirely independent of the sensor value.
Role Configuration
In Radio Configuration → Device → Role, you can assign the role for
transmitting sensor values: Figure 7:
> SENSOR: Used for devices that gather and send sensor data. Screenshot of the
Optimized for low-power consumption and periodic data trans- Meshtastic app.
mission. These are strategically used for remote sensor data on The LoRa node at the
solar panels or battery power. top is up. The two at the
bottom are not up.
> CLIENT: Used for end-user devices that primarily consume and That’s why question
display data. These devices can also send commands but do not marks are appearing
relay messages within the network. against their names.
GPS Location
If the board has a GPS locator (Figure 9), it will deliver the location
automatically. Otherwise, in case GPS is not fitted, if the Android/
iOS device has location information turned on, it will provide its own
GPS location, which will be visible and used for that node in the app
window. The app has the facility to attach a separate GPS sensor, for
which you must manually set the GPIO pins for TX and RX in Radio
Configuration → Position. After setting the GPS sensor, the location
data (latitude and longitude) will come from the GPS sensor. Currently,
only u-blox and GLONASS sensors are supported. My old V.KEL-GPS
sensor also worked when connected. The PPS (pulse per second) is
connected to an LED, which can be disabled to preserve battery life.
Typical Use
Related Products
In a forest area, a LoRa mesh network can be used to monitor forest
fires, with each node tracking air temperature, wind velocity, and humid- > Claus Kühnel, Develop and Operate Your LoRaWAN IoT
ity in its zone. In an industrial setting, this technology is effective for Nodes (Elektor, 2022)
monitoring fire hazards. In a city, turning all vehicles into LoRa nodes www.elektor.com/20147
allows for monitoring vehicle speed and position. For a township or
> 0.96" OLED Display for Arduino (128x64)
housing complex, V53LOX laser sensors can be employed to monitor www.elektor.com/18004
WEB LINKS
[1] Meshtastic website: https://meshtastic.org/
[2] WiFi LoRa 32(V3), ESP32S3 + SX1262 LoRa Node, Heltec Automation: https://heltec.org/project/wifi-lora-32-v3/
[3] Meshtastic flasher: https://flasher.meshtastic.org
[4] Software download at Elektor Labs: https://tinyurl.com/2psrnvdp
[5] “ESP32 Serial Terminal” at Elektor Labs: https://tinyurl.com/95rak5up
www.elektor.com/20346 www.elektor.com/21167
www.elektor.com/21181 www.elektor.com/21177
www.elektor.com/21139 www.elektor.com/21144
www.elektor.com/21146 www.elektor.com/20802
Analog Audio
Frequency Generator
High-Quality Adjustable Frequency Sine Wave Generator
Coarse and fine frequency control potentiometers are mounted on implemented using the relay-controlled “Attenuator for Audio Signals”
the front panel. The signal amplitude control consisting of a rectifier, featured in the Elektor Circuit Special 2024 [3] or more simply with
filter, amplifier, reference voltage, control amplifier, and optocoupler a rotary switch. Attenuation step sizes of 6 or 10 dB would be ideal. If
has been borrowed from the “Analog 1 kHz Generator” circuit featured no additional attenuator is used, the corresponding connections are
in Elektor 7-8/2024 [2]. The output stage also comes from that circuit bridged using a 0-Ω resistor (R64).
but has been slightly modified here.
In the first version of the audio generator, I used an OPA1632 differen-
The output level is adjusted via a potentiometer. The three-position tial op-amp to generate differential output signals but it introduced too
selector switch sets the gain to 0, 6, or 12 dB (corresponding to x1, x2, much distortion. By the fifth iteration of the circuit (Version E), it was
and x4). An optional stepped attenuator can be placed between the replaced with a conventional dual op-amp. In theory, you could leave
amplifier’s output and the input to the final output stage. This can be this out entirely, but that would result in a single, unbalanced output.
C44 3n3
R47 R49
10k 10k
R39
+12V C45 10µ
100k 2
R46
5 1
R43 10k IC7A
Q5 2 7 3
R38 27k IC8B
1 6
100Ω IC8A
3 R41
D9
2N3904 R44 BAV199 C48 47p
47k
LED + JP4 LSP8 4k7
Opto Control C50
6
Voltage R42
7
100k 10µ IC7B R50
VR1 5
Amplitude R45 Q6 R48 2k2
– TL431 C47
4k7
10k
R37 R40 R51
5k1
1µ
470Ω
8k2
C46 10µ
2N3904
–12V
C2 100n 100n C8
K1 7 5 3 1 1 3 5 7 K3
9802-05-00
9802-05-00
D1 D3
R65
1N4148 1N4148
4k7
8 6 4 2 2 4 6 8
Q1 R19 R26 Q3
4k7 4k7
R23 R28
2N3904 2N3904
10k
10k
JP2
R31 1
C3 1n2 +5V +5V 1k 2 Range +5V 1n2 C11
R30 3
C4 33n 1k 4 33n C12
K2 7 5 3 1 1 3 5 7 K4
9802-05-00
9802-05-00
D2 D4
1N4148 1N4148
IC10
8 6 4 2 2 4 6 8
NSL-32SR3
C5 680p 680p C9
Q2 R20 R27 Q4
4k7 4k7
C6 15n 15n C10
R24 R29
2N3904 2N3904
10k
10k
R16
2k15
2
R13
1 6
IC2A 1k5 R21
3 7 2
IC2B NB R25
R11 5 R22 1
IC3A 220Ω
3
2k2
2k2
R15
4k22
R10 R9
R18B
Coarse
0Ω
5k R18A
NB
5k
R14
0Ω
R17B
Fine
500Ω R17A
500Ω
R5 R7
2k2
JP1 R8
R3 200Ω
2k87
150Ω
R4
2k87 R12
R2 2k87
2
510Ω R6
R Opto IC1A
1 6
2k87
3 7
IC1B
R1 5
100Ω
240463-006
Figure 2: The audio signal generator circuit diagram and some elements of the design are taken from my previous projects.
R33
47Ω
C33 C30 C21
The complete power supply design has also been borrowed from the
R32
22µ 220µ
100n
25V 47Ω previously mentioned notch filter design [1].
X2
D5
+12V B1
TR1
Details
IC4
7812
SK34 F1
Figure 2 shows the circuit diagram for the most recent Version E of
250mA
the design. The State Variable Filter is built around four op-amps: IC1B,
D6
C19 C17 C15 C13
L IC2A, IC2B, and IC3A. Just like the circuit used in the notch filter, the
N
SK34
22µ 100n 100n 2200µ PE frequency range can be switched between three bands using four
16V
X1
relays that control the frequency-determining parallel wired capacitors:
D7
C1||C2, C3||C4 and C5||C6 as well as C7||C8, C9||C10 and C11||C12.
C14
C20 C18 C16
In this design, the achievable frequency range extends from 175 to
22µ 2200µ
SK34 100n 100n
16V 5500 Hz. Two twin-ganged potentiometers mounted on the front panel
allow continuous control of the output signal frequency: R18 for coarse
7912
and R17 for fine adjustments. Feedback control used by the system is
–12V IC5
provided by IC1A, via an optocoupler (the variable resistance element
+12V of the optocoupler IC10 at JP1).
The sine wave output from IC3A drives the active rectifier around IC7,
C22 C24 C26 C28 C31 C34 C36 C38 C40 C42 which is part of the amplitude regulation circuit. Its output signal level
100n 100n 100n 100n 100n 100n 22µ 22µ 22µ 22µ is smoothed by R46 and C47 and fed to the input of IC8B which has a
8 8 8 8 8 8
IC1 IC2 IC3 IC7 IC8 IC9
fixed voltage gain of 2. The core regulation stage, built around IC8A,
4 4 4 4 4 4
compares this rectified and filtered output signal amplitude with the
C23 C25 C27 C29 C32 C35 C37 C39 C41 C43
reference voltage from VR1. The resulting voltage level defines the
100n 100n 100n 100n 100n 100n 22µ 22µ 22µ 22µ
current through the opto coupler’s LED via transistor Q5 which influ-
ences the value of its resistive element to control the gain of IC1 and
–12V
close the feedback loop. This section of the circuit is almost identical
to that used by the 1 kHz audio generator design [2].
3
R61 X3 To expand the amplitude control range, R3 (in parallel with the resistor
1
IC9A
2
220Ω
in optocoupler IC10) has been increased to 150 Ω, and R2 changed
R57 to 510 Ω. Resistor R37 has also been swapped for a 470 Ω to allow
3k3 4
R58 3 for a higher current through the optocoupler LED. Extra components
3k3
R59
2
1
— C50, Q6, and R65 — have been added to increase the smoothing
3k3
JP5 capacitor effect at low frequencies. There wasn’t enough space on
R53
5
6
7
R62 X4 the PCB to accommodate these components, so they were wired
220Ω R64 R56 IC9B 220Ω
IC3B
7
0Ω 220Ω
5 by hand.
6
R52
R55 R60
3k3 220Ω The amplitude of the output signal is continuously adjustable using
10k R63 R54 JP7 JP8 potentiometer R52 and is buffered by IC3B. If needed, a switch at JP6
can be fitted to provide additional amplification by a factor of 2 or 4
1k1
3k3
+12V
R35 (connect JP6 pin 2 to pin 1 for 6 dB or to pin 3 for 12 dB gain). The
3 2 1
JP6 additional gain will however result in increased output signal distor-
8k2
6dB
LED1
Gain
(input) and J8 (output). If an external attenuator is used, R64 (a 0-ohm
K6 LED2 resistor) must not be fitted.
LED R36
R34 Front For the differential output stage, I originally intended to use the OPA1632
3K3
8k2
The entire power supply design was taken from the notch filter [1]. Questions or Comments?
Its configuration is completely conventional and doesn’t really need Do you have questions or comments about this article? Email the
any explanation. author at [email protected] or contact the Elektor
editorial team at [email protected].
Figure 3 shows the populated PCB (this is still the first prototype
Version A) installed inside its case. The PCB layout files can be
downloaded in Eagle format from the Elektor Labs website [4]. Figure 4
shows the front panel labeling. The output stage gain switch is missing
from this version. The stepped attenuator option is also not included in
this first prototype. For calibration and setup, refer to the correspond- About the Author
ing section in the 1 kHz generator article [2]. Alfred Rosenkränzer worked for many years as a development
engineer, initially specializing in professional television technology.
Quality Components Are Key Since the late 1990s, he has been designing digital high-speed
The quality of the output signal doesn’t just depend on a well-de- and analogue circuits for IC testing. His special interests are in all
signed circuit — it’s crucial that high quality components are used, things audio.
especially when you are designing high-performance linear or audio
circuits. For this reason, all resistors used in the signal path are Mini
MELF 204 format, as they offer the same high-quality performance as
leaded metal film resistors. Thin-film resistors in the 1206 SMD format Related Products
can also be used. It is important to use COG-type capacitors in this
design. The performance of the entire circuit would be compromised > OWON SDS1102 2-ch Oscilloscope (100 MHz)
www.elektor.com/18782
if a single X7R-type capacitor were substituted for any of the COG
types. The high-performance OPA2210 opamp is used throughout the > Douglas Self, Small Signal Audio Design
circuit for processing audio signals. (4th Edition, Focal Press)
Translated by Martin Cooke — 240463-01 www.elektor.com/18046
WEB LINKS
[1] Alfred Rosenkränzer, “Audio Notch Filter with Adjustable Frequency,” Elektor 9-10/2024:
https://www.elektormagazine.com/magazine/elektor-354/63208
[2] Alfred Rosenkränzer, “Analogue 1 kHz generator,” Elektor 7-8/2024:
https://www.elektormagazine.com/magazine/elektor-346/62910
[3] Alfred Rosenkränzer, “Attenuators for Audio Signals,” Elektor Circuit Special 2024:
https://www.elektormagazine.com/magazine/elektor-350/63040
[4] Analogue Audio Generator, Elektor Labs: https://tinyurl.com/ysns2nut
673-100B-1003XT
340103211B
654-10-504637-008
A17251-09
11350
CB5347-000
RSPST070856