0% found this document useful (0 votes)
825 views48 pages

Elektor01 2025

Uploaded by

marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
825 views48 pages

Elektor01 2025

Uploaded by

marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

DECEMBER 2024 | ELEKTORMAGAZINE.

COM

D I G I TA L
534B
SI
NCE 1961
EDITION

Articles
Gue for Pros, Makers,
st-Ed and Students!
ited
Edition

Raspberry Pi AI Camera

50 A
I Ke y Terms
For Engi
neers
and Makers
AI for Product
Concept Design
A Tour of the World of
AI-Based Art Generators High-Performance
Edge AI
The New STM32N6

AI-Based Universal IR Remote Control A Personal AI Terminal Hailo AI Kit with Raspberry Pi 5
Gesture-Controlled with Raspberry Pi ChatGPT Gets a Voice Object Detection Made Easy
PE8000G
Revolutionary Edge AI performance
Robust and reliable Powerful dual GPU support
The PE8000G complies with the MIL-STD- Process multiple neural networks
810H standard and is therefore protected simultaneously thanks to the support of two
against extreme temperatures, vibrations 450-watt GPUs - seamlessly and in real time.
and voltage fluctuations - ideal for use in This allows you to complete even complex
harsh industrial environments. tasks efficiently and quickly.

Wide range of applications Flexible power supply

From AI-driven factory automation to With a DC input of 8-48V and integrated


intelligent video analytics, the PE8000G ignition control, the PE8000G is ideally
delivers the computing power and flexibility equipped for a wide range of industrial
you need. requirements.

Interested in our products?


COLOPHON EDITORIAL

Volume 50
Guest-Edited AI Digital Bonus Edition
ISSN 0932-5468 Bonus AI Projects and Articles
Elektor Magazine is published 8 times a year by Did you really think we were done delivering In “AI for Product Concept Design” we look at how
Elektor International Media b.v. AI-related content after we announced the 2024 AI has revolutionized image creation. Designers
PO Box 11, 6114 ZG Susteren, The Netherlands Guest-Edited AI edition of ElektorMag? No way! can transform sketches and ideas into photore-
Phone: +31 46 4389444 As regular Elektor readers know, we always have alistic renderings with just a well-crafted text
www.elektor.com | www.elektormagazine.com
new projects, tutorials, and background articles prompt. Dive into this exploration of AI-pow-
in the pipeline. With this Bonus edition, which ered design tools.
For all your questions
[email protected] we’ll unveil over the course of four weeks, we aim
to inspire you to design new AI-related solutions Curious about the history of AI in the pages of
Become a Member for weeks and months to come. Elektor? In this edition, we take you on a journey
www.elektormagazine.com/membership through Elektor’s archives, showcasing how
If you are looking for a project to start experi- artificial intelligence has evolved within the
Advertising & Sponsoring
menting with AI, the article, “AI-Based Universal electronics community. Dive into our editors’
Büsra Kas
IR Remote Control,” is a great place to start! With top recommendations from past editions of your
Tel. +49 (0)241 95509178
[email protected] the help of a Raspberry Pi 5, Google’s MediaPipe favorite magazine.
www.elektormagazine.com/advertising Studio platform, and a tiny plug-in interface
board, you can have a versatile gesture recog- And much more awaits you in this free Bonus
Copyright Notice nition system to control your TV or other devices edition!
© Elektor International Media b.v. 2024 operated through IR remote controls.
After you dive into this issue and start your
The circuits described in this magazine are
Can a modern build capture the spirit of Turing’s own AI-related projects, be sure to share your
for domestic and educational use only. All
drawings, photographs, printed circuit board original experiment? In “A Personal AI Terminal,” experiences on the Elektor Labs online platform:
layouts, programmed integrated circuits, discover how an ESP32 module, paired with a www.elektormagazine.com/labs. We look forward
digital data carriers, and article texts published TFT display and an I2S amplifier, becomes the to learning about your creations!
in our books and magazines (other than gateway to a 21st-century version of the Turing
third-party advertisements) are copyright Test, communicating directly with ChatGPT. C. J. Abate (Content Director, Elektor)
Elektor International Media b.v. and may not
be reproduced or transmitted in any form
or by any means, including photocopying,
scanning and recording, in whole or in part THIS EDITION
without prior written permission from the
Publisher. Such written permission must also
be obtained before any part of this publication
4 A Personal AI Terminal
is stored in a retrieval system of any nature. ChatGPT Gets a Voice
Patent protection may exist in respect of
circuits, devices, components etc. described 8 High-Performance Edge AI: The New STM32N6
in this magazine. The Publisher does not A Game-Changer in Performance and AI Capabilities
accept responsibility for failing to identify such
patent(s) or other protection. The Publisher
disclaims any responsibility for the safe and
12 Unlocking AI
proper function of reader-assembled projects 50 Key Terms for Engineers and Makers
based upon or from schematics, descriptions
or information published in or in relation with 16 Raspberry Pi AI Camera
Elektor magazine. Taking the Hassle out of the Edge
International Editor-in-Chief
Jens Nickel 22 Artificial Intelligence in Elektor

Content Director 26 Hailo AI Kit with Raspberry Pi 5


C. J. Abate

32 Infographics:
Publisher The Guest-Edited AI Edition 2024 of
Erik Jansen
Artificial Intelligence
ElektorMag is available at newsstands
and in the Elektor Store.
34 AI-Based IR Remote Control
www.elektor.com/ep-0534
Gesture-Controlled with MediaPipe
and Raspberry Pi

42 AI for Product Concept Design


A Tour of the World of AI-Based Art Generators

Bonus Guest-Edited AI Edition 3


PROJECT

A Personal
AI Terminal
ChatGPT Gets a Voice

By Somnath Bera (India) You may be surprised at the use of an old PS2 keyboard; the only reason
is that I was not successful at implementing a USB port for this purpose
Whether AI solutions such as ChatGPT can on the ESP32. In the limited time available, I opted for the simpler PS2
pass the Turing test is still up for debate. type of interface, which uses far fewer resources. A PS2 socket for the
keyboard can be sourced from several web-based electronic compo-
Back in the day, Turing imagined a human nent distributors. The PS2 keyboard pin assignments can be seen in
operator judging replies to questions sent the circuit diagram. No doubt there will be developers out there itching
and received using an electromechanical to upgrade the system to USB, and I welcome their input.

teletype machine. Here we build a 21st- The 3.5-inch TFT touch display used has a parallel interface rather
century version of Turing’s original than the alternative SPI version. This inevitably uses more interconnect
experimental concept, using an ESP32 with wires, but in this application, we have enough spare GPIOs and the
interface offers a significantly faster response time. The touch screen
a keyboard and TFT display to communicate features are not used in this application.
exclusively with ChatGPT via the Internet.
In addition, Google text-to-speech together A MAX98357A I2S amplifier (Figure 2)
module takes the digital audio I2S signal
with a tiny I2S amplifier module and speaker generated by the ESP32 and converts it
lets you listen in to the conversation. In our into analog audio. A built-in, 3-W class D
case, it’s obvious from the start that we are amplifier boosts the signal to achieve a
good level of sound. The gain input is
communicating with a machine — isn’t it? tied to ground, which produces maximum
volume from the amp. The class D amp Figure 2: The audio amp
output can drive a 4-Ω speaker. module converts I2S digital
audio to 3 W of audio.
There is no doubt that AI tools such as OpenAI’s ChatGPT and Google’s
Gemini can be real game changers in so many situations. I have used Don’t Lose the Key
ChatGPT to develop quite complex control solutions. I provide the ChatGPT was developed by OpenAI. It generates text-based responses
initial idea, and as I give more inputs, it refines the code, making it to prompts or questions entered by the user. Usually, it works through
better with each iteration. It can even convert Python code to Micro- a browser interface. The OpenAI API has been designed for use by
Python or an Arduino sketch. The key is to guide the process carefully developers and businesses so that they can integrate AI features into
to prevent it from straying too far off course. There are times when their own applications, software, or websites. It’s not just a chatbot
it does deviate and repeats the same mistakes, but I actually enjoy interface, but a flexible programming interface allowing businesses
finding these bugs and steering ChatGPT’s output to more closely to embed chatGPT’s capabilities into their products. Developers send
match my target outcome. data to the API programmatically and get responses back. To use the
OpenAI API, you will need a unique key, which is generated for your
Hardware account when you sign up. Go to the OpenAI website [1] and click
The heart of this build is Espressif’s ESP32 development module. Its on the Sign up button.
dual-core architecture has enough processing reserve to take care of
Wi-Fi communications, handling the serial input from a PS2 keyboard, Fill out the registration form with your email address, password, and
sending data to the 3.5-inch TFT display and outputting digital audio other required information. Once you have entered these, navigate to
data to the I2S module. The complete schematic for the ChatGPT your OpenAI account dashboard and click on the New Project button.
terminal is shown in Figure 1. Give your project a name and description (optional). In your project

4 www.elektormagazine.com
+5V

4
2 6
PS/2-keyboard
1 5
DATA 3 IRQ ESP32-DevKitC
1 38 MAX98357A
3V3 GND
3.5 TFT 2 37
EN/RST GPIO23 LRC
+5V Touch 3 36
GPIO36/SVP GPIO22 BCLK
Screen 4 35
GPIO39/SVN GPIO1/TX0 DIN –
1 21 5 34
GPIO34 GPIO3/RX0 GAIN +
2 22 6 33
GPIO35 GPIO21 SD
3 23 7 32
GPIO32 GND GND
4 24 8 31
GPIO33 GPIO19 +5V VIN
5 25 9 30
GPIO25 GPIO18
6 26 10 29
GPIO26 GPIO5
7 27 11 28
GPIO27 GPIO17
8 28 12 27
GPIO14 GPIO16
9 29 13 26
GPIO12 GPIO4
10 30 14 25
GND GPIO0
11 31 15 24
GPIO13 GPIO2
12 32 16 23
GPIO9/SD2 GPIO15
13 33 17 22
GPIO10/SD3 GPIO8/SD1 +5V
14 34 18 21
GPIO11/SDCMD GPIO7/SD0
15 35 19 20
5V GPIO6/SDCLK 7805
16 36 3 2
17 37 EN IO0
USB
18 38 +5V
19 39 1 7...9V
20 40
100µ
10V

230536-025

Figure 1: Schematic of the talking ChatGPT terminal.

settings, click on the API Keys tab. You’ll see a list of existing secret these credits, you will need to pay based on your usage. If you haven’t
keys (Figure 3). Click the Create new secret key button to generate a already set up a payment method for billing, it will be necessary to
new key. Make a copy of this generated API key and save it securely, do so. Read through OpenAI’s usage guidelines and terms of service.
as you won’t be able to retrieve it again for security reasons. You’ll need
this key to authenticate your applications with OpenAI’s services. On Text to Speech
their site there is also a developer’s quickstart tutorial which guides A Text to Speech (TTS) API is used to convert the textual response
you through the process of generating a response via the API using from OpenAI into a digital audio data stream. There are a couple of
the generated key to authorize your access. text-to-speech APIs we can use for this. OpenAI has its own TTS API
offering a number of different voice alternatives which sound quite
At the time of writing, OpenAI provides free credits when you first sign natural. To access this API, you use the same key you were allocated
up, which you can use to experiment with the API. After you use up all to use the OpenAI API.

Figure 3: The OpenAI page to register for the OpenAI API.

Bonus Guest-Edited AI Edition 5


For this project, we make use of the Google Cloud Text-to-Speech API. // setting a maximum size of 1KB
It offers a diverse range of voices in various languages and dialects. jsonPayload["model"] = "gpt-3.5-turbo";
Compared to OpenAI TTS the voices sound a little more mechanical. // model is gpt-3.5-turbo,
Long text strings make the ouput break up. This API is however free to // change if you have access to 4 or 4.5
use at the time of writing, whereas OpenAI TTS API incurs a charge. jsonPayload["temperature"] = 0.8;
// randomness of response, the higher
To start using the Google TTS, we first need to create the project on // the value, the higher the randomness
Google Cloud and enable the Google TTS API to get our API key. Text jsonPayload["max_tokens"] = 2000;
strings can now be posted to the API using an HTTP POST request // maximum words & punctuations
along with the key. The resulting I2S digital audio stream is then stored // limit to be generated by response
and played back to produce an analog audio signal via the MAX98357A.
3. Prepare the message (a nested array of messages), serialize to JSON
Software: Libraries format and send the request:
The Arduino sketch is included [2]. Check all the libraries referenced
in the header of the sketch listing to make sure they are installed in JsonArray messages = jsonPayload.
your environment, if not install them now using the Arduino IDE library createNestedArray("messages");
manager. Using the methods available in the Audio.h library, it was a //put in a nested format not random
simple job to produce the audio output to accompany the word output JsonObject userMessage = messages.createNestedObject();
written to the TFT display. It was only necessary to add a few lines userMessage["role"] = "user";
in the loop to generate the audio. Check it out in the Arduino sketch. userMessage["content"] = prompt1;
String payloadString;
#include <PS2Keyboard.h> serializeJson(jsonPayload, payloadString);
#include <WiFi.h>
#include <HTTPClient.h> 4. Send the request and receive the response:
#include <ArduinoJson.h>
#include <SPI.h> int httpResponseCode = http.POST(payloadString);
#include <TFT_eSPI.h> // Hardware-specific library //transfer to the open page
#include "Audio.h" //Audio header file if (httpResponseCode == HTTP_CODE_OK) {
String response = http.getString();
// GPIO connections to I2S board // if everything goes OK get the
#define I2S_DOUT 21 // reply = output and put in a string
#define I2S_BCLK 22 ...
#define I2S_LRC 23
5. The web page will generally include a jungle of spurious informa-
Audio audio; //audio instance creation tion (all in HTML code) which is not useful for our application and
can be stripped off. Here we normalize the response — remove the
The ArduinoJSON.h is used to parse the JSON-formatted response data tags JSON etc. so that it can read on the TFT display:
from the OpenAI API into a format that can be used by the Arduino code.
StaticJsonDocument<1024> jsonResponse;
Software: ChatGPT API request //parse the tags etc of the response string.
The process of interacting with the OpenAI API is contained in the deserializeJson(jsonResponse, response);
makeApiRequest(String prompt1) function: // and put in a simple stripped string & return
String assistantReply = jsonResponse
1. First, we set up an HTTP client: ["choices"][0]["message"]["content"].
as<String>();
HTTPClient http; // select the first part which contains our reply
http.setTimeout(24000); // 24 seconds timeout return assistantReply;
http.begin("https://api.openai.com/v1/chat/completions");
http.addHeader("Content-Type", "application/json"); Software: Setup and Loop
http.addHeader("Authorization", "Bearer " + In the setup function we are initialising the TFT, I2S board, connected
String(api_key)); to the Internet with our Wi-Fi credentials.

2. Next, prepare the payload which will be JSON formatted: void setup() {
delay(300);
StaticJsonDocument<1024> jsonPayload; …

6 www.elektormagazine.com
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); In every case, ChatGPT performed flawlessly, understood the context
//I2S board initialised perfectly and answered accurately, with the speaker delivering the
audio.setVolume(50); voice output loud and clear.

Inside the loop function, we sent questions to ChatGPT. When the To Wrap Up
session is complete we remain inside loop: All files associated with this project can be found at [2]. The Inter-
net and web browsers such as Google have totally revolutionized
String response = makeApiRequest(msg); our access to information and replaced those bulky encyclopedias
// sent to Chatgpt that used to line our bookshelves at home. Now we see the rise of AI
... software and machines based on ChatGPT API, TensorFlow Lite Micro,
if (l1>200) { Edge Impulse, OpenMV, TinyML which are poised to disrupt existing
response = response.substring(0, 200); business models and more traditional methods of problem-solving.
// truncate first 200 characters We live in interesting times.
} 230536-01
audio.connecttospeech(response.c_str(), "en");
//speak up the 200 characters

The Google TTS has a 200-character limit and will not output any text
beyond this limit. To work around this, the answer string is trimmed to
200 characters for Google TTS. This ensures that while the full answer
is displayed on the screen, only the first 200 characters are vocalized. About the Author
For longer answers, the screen scrolls, but this can be adjusted by Somnath Bera, a mechanical engineer from Jalpaiguri Govt. Engg.
making slight modifications to the sketch. College, India, worked as a General Manager at NTPC, the largest
power producer in the country. He has a profound passion for
Project Testing electronics, evidenced by his 60+ innovative projects on Elektor
The delays I’ve used inside the software loops are quite specific. You Labs, over 10 of which have been featured in ElektorMag. His
may adjust them, but I recommend starting with the default values used projects are often focused on problem-solving in areas like waste
in the code. Once you’re comfortable with the responses, feel free to and natural resource management. Somnath likes to use innovative
tweak them. I began with simple questions like “Who r u?” ChatGPT approaches and platforms like Arduino, Raspberry Pi, and ESP32
responded appropriately, displaying the introduction on the screen, coupled with various kinds of sensors and wireless systems to
while the speaker articulated it clearly. create efficient and cost-effective solutions.

I then tested the system using questions such as: “Write 5 sentences
about Elektor magazine” (Figure 4) and even asked it to write blink Questions or Comments?
sketches for Arduino UNO, ESP32, and Raspberry Pi Pico. If you have technical questions or comments about this article, feel
free to contact the author by email at [email protected] or
the Elektor editorial team at [email protected].

Related Product
> Espressif ESP32-DevKitC-32E
www.elektor.com/20518

WEB LINKS
[1] OpenAI website: https://platform.openai.com
[2] Elektor web page for this article (downloads):
Figure 4: Testing the system with prompts asking for blink sketches for https://www.elektormagazine.com/230536-01
Arduino UNO, ESP32, and Raspberry Pi Pico.

Bonus Guest-Edited AI Edition 7


FEATURE

High-Performance Edge AI:


The New STM32N6
A Game-Changer in Performance and AI Capabilities

Contributed by STMicroelectronics

The new STM32N6 is designed to meet the


STM32N6 — Features and Benefits
growing demands for high-performance > The embedded NPU (ST Neural-ART Accelera-
edge AI, enabling new use cases in computer tor) is the heart of the new STM32N6. It offers
vision, audio processing, and other advanced an impressive 600 GOPS at a very low-power
consumption. This NPU is a game-changer,
applications. It continues to elevate the enabling high-end AI performance (Figure 2)
standards for video and multimedia on an MCU with a small footprint, low power
applications, enhancing user experiences with consumption, and low costs.
> Powered by an Arm Cortex®-M55 core operating
its rich multimedia capabilities. at 800 MHz, the STM32N6 provides 1280 DMIPS
and 3360 CoreMark, marking the highest perfor-
The STM32 microcontrollers — based on Arm Cortex mance for an STM32 MCU to date. This makes it
CPUs from M0 to M7 — are well known in the electron- ideal for advanced vision and graphics applica-
ics community, as they are equipped with an abundant tions, supported by a Chrom-ART Accelerator,
set of peripherals and there is a vast ecosystem of NeoChrom Accelerator, H264 encoder, and JPEG
development boards, libraries and software tools for all encoder/decoder.
kind of applications. The new STM32N6 addresses the > The MCU includes 4.2 MB of embedded RAM,
needs for pre-processing data “on the edge”, with the supporting real-time data processing, multitask-
help of AI in form of a Neural Processing Unit (NPU). ing, and efficient execution without the need
It opens up new fields of applications for Arm Cortex for external memory in most cases. Addition-
M processors (Figure 1). ally, it offers a rich peripheral set, including dual

Figure 1: The Neural


Processing Unit (NPU) is
opening up new fields of
applications.

8 www.elektormagazine.com Partner Content


USB, Gbit Ethernet, I3C, and seven UART inter-
faces, ensuring versatile connectivity options for
various applications.
> A dedicated image signal processor (ISP) is
dimensioned for a 5 MP camera at 30 fps. Embed-
ded firmware for the Arm Cortex processor
allows auto white-balance and auto exposure.
A software tool permits fine-tuning of the ISP
(Figure 3).
> Fully integrated within the STM32 ecosystem, the
STM32N6 is supported by the ST Edge AI Suite,
including tools like STM32Cube.AI, an AI model 
zoo, various resources, and case studies. It is also
backed by numerous partners, including Edge Figure 2: The ST
Neural-ART Accelerator
Impulse, Nota.AI, and EmbedUR, providing a enables the execution
comprehensive development environment. of advanced AI
applications.
Comprehensive Software Ecosystem
STMicroelectronics is at the forefront of the edge AI 
movement, providing comprehensive solutions that
cater to the varying needs of engineers and developers Figure 3: A dedicated
image signal processor
across industries. Through its Edge AI Suite, ST offers (ISP) is dimensioned for
a wide range of software tools tailored to different user a 5 MP camera at 30 fps
profiles and expertise levels, along with a large collec- and can be fine-tuned via
tion of case studies to inspire developers. a software tool.

STM32Cube.AI and ST Edge AI Developer Cloud The STM32 Edge AI Contest


are designed for users who need great flexibility Want to use the capabilities of the new STM32N6 in a
and customization. These tools provide access to project of your own? Participate in the STM32 Edge AI
advanced resources for optimizing and deploying Contest powered by STMicroelectronics and Elektor!
custom models (Figure 4). If you are a professional engineer, maker or student,
apply for a free STM32N6 development board, and
ST also developed a comprehensive model zoo that develop your own AI application by the end of April
comes with additional resources like retraining scripts 2025. More information about the contest is available
and application code examples. This is a great starting at www.elektormagazine.com/stm32ai and in January/
point for developers who want to quickly implement February 2025 edition of Elektor.

Figure 4: STM32Cube.
AI and ST Edge AI
Developer Cloud are
designed for users who
need great flexibility. The
comprehensive model
zoo with application
code examples is a
great starting point for
developers who want
to quickly implement AI
solutions.

Partner Content Guest-Edited AI Edition 9



AI solutions without starting from scratch. The model Cost and Power Efficiency
Figure 5: STM32N6 zoo provides pre-trained models for various applica- By providing MPU-like AI user experience with a
comes with a set of code tions, such as object detection, image classification, smaller footprint, lower power consumption, and
examples to kick-start and audio scene recognition, which can be fine-tuned reduced costs, the STM32N6 allows developers to
your project.
to meet specific requirements. The retraining scripts create innovative AI-enabled applications without
and application code examples make it easier for the high expenses typically associated with MPU and
developers to adapt these models to their unique GPU solutions.
use cases, accelerating the development process and
reducing time-to-market (Figure 5). Enhanced Performance
The high-performance Arm Cortex®-M55 core,
It’s an STM32! combined with the embedded NPU and ample
Developers will benefit from the great ecosystem and RAM, ensures that developers can run complex AI
legacy of STM32 products to create their own design. algorithms and multimedia applications efficiently.
The STM32N6 offers a host of advantages for devel- This opens up new possibilities for creating cutting-
opers, opening up new possibilities and simplifying edge applications that stand out in the competitive
the development process: market. The STM32N6’s performance capabilities
enable developers to push the boundaries of what is
Seamless AI Integration possible with MCUs.
The STM32N6 is fully integrated into the STM32
Figure 6: The STM32N6
— which is also available ecosystem, making AI deployment straightforward. Rich Graphics
without the Neural Developers can leverage the ST Edge AI Suite, includ- The STM32N6 stands out as the most powerful STM32
Processing Unit — is ing tools like STM32Cube.AI, to optimize and deploy MCU in terms of graphics capabilities. It features the
the most powerful their neural network models with ease. This integra- Chrom-ART™ Accelerator for 2D graphics acceleration
STM32 MCU in terms of
tion reduces the complexity of AI development and and the NeoChrom™ Accelerator for 2.5D acceleration,
graphics capabilities.
accelerates time-to-market for new products. including advanced drawing, perspective correction,
 and texture mappings (Figure 6). Additionally, the
Chrom-GRC™ serves as a graphic resource cutter for
non-square displays. With 4.2 MB of integrated SRAM,
the STM32N6 provides ample memory to handle large
graphical assets and complex animations without the
need for external memory, ensuring faster and more
responsive user interfaces.

Comprehensive Development Environment


The STM32N6 is supported by a robust ecosys-
tem and numerous partners, providing developers
with a comprehensive development environment.
Leveraging the STM32Cube software suite, it offers

10 www.elektormagazine.com Partner Content


Figure 7: The STM32N6
is supported by a
robust ecosystem and
numerous partners.

a range of software tools for configuration, develop- wide range of applications, from audio processing to
ment, programming, and monitoring. For embed- computer vision. The STM32N6 empowers develop-
ded software, it includes packages, middleware, and ers to create smarter, more efficient, and more secure
driver support, complemented by RTOS options like devices that can operate at the edge.
FreeRTOS, Zephyr, and Eclipse ThreadX (Figure 7).
Developers can leverage the STM32N6 to create intel-
In the AI domain, developers have access to tools, ligent home automation systems that recognize
resources, case studies, and support from partners like and respond to various commands and situations,
Edge Impulse, Nota.AI, and EmbedUR. For graphics enhancing convenience and security. In healthcare,
development, the STM32N6 is supported by TouchGFX, this STM32 can be used to develop advanced medical
simplifying the creation of sophisticated graphical devices that monitor patient health in real-time,
user interfaces (GUIs). This extensive support network providing accurate diagnostics and timely alerts.
ensures that developers have the assistance they need For industrial automation, the STM32N6 enables
at every stage of the development process, enabling the design of robust systems that perform complex
the creation of visually stunning and highly respon- tasks with high precision and efficiency, improving
sive applications. productivity and safety. In the consumer electron-
ics space, this microcontroller allows for the innova-
Flexibility and Versatility tion of new gadgets that offer enhanced multimedia
With its rich peripheral set and extensive connectivity experiences, from high-definition video playback to
options, the STM32N6 offers developers the flexibility immersive gaming.
to design a wide range of applications. Whether it’s
computer vision, audio processing, or advanced multi- The STM32N6 is a testament to STMicroelectron-
media, the STM32N6 provides the necessary tools and ics’ commitment to innovation and excellence. By
capabilities to bring innovative ideas to life. Addition- redefining microcontroller performance and integrat-
ally, the STM32N6 will also be available in a version ing advanced AI capabilities, the STM32N6 empow-
without the NPU for applications requiring high-per- ers developers to create cutting-edge applications
formance computing, graphics, and multimedia but that stand out in the competitive market. With its
not demanding AI features. This versatility ensures seamless integration into the STM32 ecosystem and
that developers can choose the right configuration for support from numerous partners, the STM32N6 is
their specific needs, making the STM32N6 suitable for poised to revolutionize the world of microcontrollers
a variety of industries, including automotive, health- and embedded AI.
care, consumer electronics, and industrial automation.
For more information, visit www.st.com/stm32n6.
Exciting Possibilities for Developers 240676-01
The STM32N6 opens up new horizons for embedded AI
applications, offering unmatched edge AI performance
on an MCU. Its small footprint, lower power consump-
tion, and reduced costs make it an ideal choice for a

Partner Content Guest-Edited AI Edition 11


AI IN PRACTICE

Unlocking AI
50 Key Terms
for Engineers
and Makers
Artificial Intelligence (AI)
The simulation of human intelligence
in machines programmed to think,
learn, and solve problems. It’s a
broad field that encompasses a wide
By The Elektor Team
range of technologies and applica-
Activation Function tions, including simple algorithms,
AI is reshaping the world A function in neural networks that chatbots, neural networks, and
of electrical engineering determines the output of a neuron, complex self-driving cars.
and DIY projects. helping to introduce nonlinearity.
The choice of activation function
But which terms are can significantly impact the
Backpropagation
A neural network training method
essential to know? We network’s performance and learning
that adjusts weights by propagat-
asked AI (e.g., ChatGPT capabilities.
ing the error backward from the
and Gemini) — and the output layer to minimize the differ-
Algorithm ence between predicted and actual
answers might surprise A step-by-step computational outputs. It updates weights based
you! These terms provide procedure for solving a problem or on the error rate from previous
a solid foundation performing a task. Think of it as a iterations.
guide that outlines the specific steps
for understanding AI a computer or person should take to
concepts relevant to Bias
achieve a specific goal.
An adjustable parameter in machine
electrical engineering learning models that allows for shift-
and making. Artificial General ing the activation function, influenc-
Intelligence (AGI) ing model predictions. Bias is an
Hypothetical AI capable of under- important concept in machine learn-
standing, learning, and performing ing, as it can help to improve the
any intellectual task like a human. accuracy and flexibility of models.
While AGI remains a theoret- However, bias can introduce system-
ical concept, researchers are atic errors into a model’s predictions.
actively working on developing AI
systems that exhibit some of these
capabilities.

12 www.elektormagazine.com
Edge AI
Big Data AI computation and processing
Massive datasets that can be done locally on edge devices rather
analyzed computationally to reveal than centralized cloud servers.
patterns, trends, and associations. Data Mining This approach can reduce latency,
Big Data is commonly used in fields The process of discovering patterns enhance privacy, and minimize
like scientific research and IoT and extracting useful informa- bandwidth use, making it a smart
applications to make data-driven tion from large datasets. It involves solution for real-time applica-
decisions, predict outcomes, and methods such as classification, tions like autonomous vehicles and
optimize processes. clustering, and association rule learn- augmented reality.
ing to transform raw data into action-
able insights for decision-making. Epoch
Classification
A supervised learning task of assign- One complete cycle through the
ing input data to one of several Data Preprocessing full training dataset during machine
predefined categories or labels. The The steps taken to clean, transform, learning model training. Multiple
objective is to build a model that and prepare raw data for machine epochs are often required to ensure
accurately predicts the category of learning models. This includes that the model has learned the data’s
new, unseen data based on patterns handling missing values, normaliz- underlying patterns adequately.
learned from labeled training data. ing data, and encoding categorical
variables, which are crucial for ensur- Feature Engineering
ing accurate model performance.
Clustering The process of selecting, modify-
An unsupervised learning technique ing, or developing new features
that groups data points with similar Deep Learning to improve the performance of
features into clusters. Clustering is A subset of machine learning using machine learning models. Effective
used for data exploration, pattern neural networks with many layers to feature engineering can significantly
recognition, and identifying natural model complex data patterns. Deep enhance model accuracy and reduce
groupings within datasets. learning is particularly effective in overfitting.
handling large datasets with high-di-
mensional data, such as images, Feature Extraction
Convolutional Neural audio, and text.
Network (CNN) The process of transforming raw data
A deep learning model particularly into a format suitable for machine
effective for image and video recog- Dimensionality Reduction learning by identifying pertinent
nition tasks. CNNs use convolutional The process of reducing the number characteristics. This step reduces
layers to automatically learn spatial of random variables under consid- dimensionality and helps in focusing
hierarchies of features from input eration by obtaining a set of princi- on the most informative attributes for
images, making them well-suited for pal variables. This technique helps model building.
computer vision applications. improve model efficiency, reduce
computational costs, and avoid Generative Adversarial
overfitting in machine learning tasks. Network (GAN)
Cross-Validation
A technique for evaluating machine A class of machine learning frame-
learning models by partitioning data Dropout works where two neural networks
into training and validation sets. It A regularization technique for neural compete to generate realistic data
helps assess model performance networks that randomly ignores samples. GANs are often used to
and generalizability by reducing certain neurons during training to create high-quality synthetic images,
overfitting and ensuring that the prevent overfitting. By “dropping out” videos, and even text.
model works well on unseen data. nodes, dropout reduces reliance on
specific neurons, improving model
generalization on unseen data.
Data Augmentation
A technique that artificially expands
training data by generating variations
of existing data samples. Common
methods include rotation, scaling,
flipping, or adding noise to images,
which helps improve model robust-
ness and prevent overfitting.

Bonus Guest-Edited AI Edition 13


Meta-Learning
A technique in AI where models
learn how to learn, adapting quickly
to new tasks with minimal data.
K-Nearest Neighbors Meta-learning aims to improve
(KNN) learning efficiency and performance
A simple, instance-based learning across various tasks by lever0aging
algorithm used for classification and previous learning experiences.
regression by comparing new data
points to previously seen examples. Model Compression
It classifies based on the major- Techniques like pruning or quanti-
ity class of the nearest data points, zation that reduce the size and
making it easy to implement but complexity of machine learning
computationally intensive. models. Compression makes models
more efficient for deployment on
Gradient Descent Latent Space devices with limited or constrained
An optimization algorithm used to A hidden, low-dimensional space computational resources.
minimize the cost function by adjust- representing compressed features
ing model parameters. It iteratively learned by a neural network. Latent Natural Language
updates the weights in the direction space is used in techniques like Processing (NLP)
that reduces the error, helping the autoencoders for dimensionality A branch of AI focused on the inter-
model learn from the data. reduction and data generation. action between computers and
human language. NLP enables
Hyperparameter Tuning Logistic Regression machines to understand, interpret,
The process of optimizing the A statistical model used for binary and generate human language, facil-
settings of a machine learning model classification, predicting the proba- itating applications like translation,
to improve its performance. Hyper- bility of class membership. It uses a sentiment analysis, and chatbots.
parameters (e.g., learning rate or logistic function to map input values
number of layers) are manually to a probability, making it effec- Neural Network
adjusted to find the best model tive for distinguishing between two A computational model inspired
configuration. classes. by the human brain, consisting of
interconnected nodes (neurons).
Inference Loss Function Neural networks are the backbone
The process of using a trained A mathematical function used to of deep learning, capable of model-
machine learning model to make measure the error between predicted ing complex, non-linear relationships
predictions on new data. Inference and actual outputs in a machine in data.
is performed after a model has been learning model. The loss function
trained and deployed, and it is often guides the optimization process One-Hot Encoding
used in real-time decision-making to minimize errors during training, A data preprocessing technique that
applications. crucial for model accuracy. converts categorical variables into
a binary matrix. It enables machine
Internet of Things (IoT) Machine Learning (ML) learning models to interpret categor-
A network of interconnected A subset of AI involving algorithms ical data by representing each
devices capable of collecting and that learn patterns from data to category as a unique vector.
exchanging data using embedded make predictions or decisions.
sensors and software. IoT enables ML algorithms can be supervised, Overfitting
remote monitoring, automation, and unsupervised, or reinforced, depend- A modeling error in machine learning
data-driven insights across various ing on the nature of the data and the where the model learns noise instead
industries, from smart homes to task. of the actual pattern, performing
industrial systems. poorly on new data. Overfitting
occurs when a model is too complex
relative to the amount of training
data available.

14 www.elektormagazine.com
Parameter Optimization
The process of finding the best
model parameters to minimize the Unsupervised Learning
error during training. This involves Support Vector Machine A type of machine learning where
adjusting parameters like weights (SVM) models learn patterns from unlabeled
and biases to improve the model’s A supervised learning algorithm data without specific guidance.
accuracy and performance. used for classification and regression Unsupervised learning is used for
tasks, finding the optimal decision tasks like clustering, dimensionality
boundary. SVM aims to maximize the reduction, and anomaly detection.
Perceptron margin between different classes,
The simplest type of artificial neural
ensuring robust classification. Variational Autoencoder
network, consisting of a single layer
used for binary classification tasks. (VAE)
The perceptron model serves as Tensor A type of neural network used for
the building block for more complex A multidimensional array used to generating new data samples similar
neural network architectures. represent data in neural networks, to a given dataset. VAEs learn the
especially in deep learning. Tensors distribution of the input data and
provide a framework for manipu- generate new, similar data points,
Recurrent Neural Network lating large datasets across multi- useful in image synthesis and
(RNN) ple dimensions, facilitating efficient anomaly detection.
A type of neural network that retains
computations.
information through feedback loops,
suitable for sequential data. RNNs Weights
are widely used for tasks such as Transfer Learning Parameters in neural networks
language modeling, speech recogni- A technique where a pre-trained that are adjusted during training to
tion, and time series prediction. model is fine-tuned on a new, similar minimize the loss function. Weights
task to leverage existing knowl- determine the strength of connec-
edge. Transfer learning is especially tions between neurons, influencing
Regularization useful when training data is scarce or how input signals are transformed
Techniques to prevent overfitting by into output predictions.
computational resources are limited.
adding a penalty to model complex-
ity during training. Regularization
methods like L1 or L2 norms reduce Underfitting
overfitting and improve model gener- A modeling error where a machine 240535-01

alization on new data. learning model is too simple to


capture underlying patterns in the
data. Underfitting leads to poor
Reinforcement Learning performance on both training and
(RL) new data, necessitating a more
A type of machine learning where an
complex model.
agent learns to make decisions by
receiving rewards or penalties. RL is
widely used in robotics, game-play-
ing, and other decision-making
scenarios where learning from inter-
action is essential.

Supervised Learning
A type of machine learning where
models learn from labeled datasets
to make predictions or decisions. The
model is trained using input-output
pairs to map inputs to the correct
outputs, suitable for tasks like classi-
fication and regression.

Bonus Guest-Edited AI Edition 15


REVIEW

Raspberry Pi

AI Camera
Taking the Hassle Out of the Edge

Figure 1: The Raspberry Pi AI Camera (note that the Raspberry Pi is not included).

By Brian Tristam Williams (Elektor)


When my Raspberry Pi AI Camera finally arrived, the box revealed
At Embedded World 2024, I had the the camera module, two ribbon cables, and — surprisingly — a
chance to see the Raspberry Pi AI handy little plastic focus ring (Figure 1). In the past, adjusting
focus on Raspberry Pi cameras without autofocus meant twisting
Camera. It was unannounced at the the lens with your fingers, or worse, using needle-nosed pliers
time, but it was immediately of interest: (gently). Not anymore. This tiny, cheap piece of plastic made life
a camera with built-in AI capabilities, easier, even if the lack of autofocus meant you’d still have to fiddle
a bit to get it just right.
capable of handling object detection
and pose estimation. Fast-forward a few Under the Tiny Hood
months, and the camera has officially The Sony IMX500 intelligent vision sensor is at the heart of the
Raspberry Pi AI Camera, handling both high-resolution image
been released. I got my hands on one to capture and onboard AI processing. Supporting this powerhouse is
put it through its paces. the RP2040 microcontroller, which manages important peripheral

16 www.elektormagazine.com
tasks, including firmware management, communication, and
ensuring smooth operation between the camera module and the
Raspberry Pi.

The RP2040, the same chip used in the Raspberry Pi Pico, is respon-
sible for coordinating communication between the IMX500 and
the Raspberry Pi. While it doesn’t perform the AI inference, it plays
a key role in ensuring that the neural network models and camera
functions are loaded and operate correctly. Once the RP2040 sets
everything up, the IMX500 handles the AI processing.

By leveraging both the IMX500 for neural network tasks and the
RP2040 for control and management, the Raspberry Pi AI Camera
efficiently handles AI inference tasks, such as object detection and
pose estimation, all without heavily taxing the Raspberry Pi’s CPU.

Sony’s IMX500 is the world’s first intelligent vision sensor with edge
processing functionality, meaning it doesn’t require a round trip
to a server or external accelerator for AI tasks. Instead, all the AI
inference is done right on the sensor itself. This design eliminates
the need for external processors or high-performance chips, signifi-
cantly reducing the load on the Raspberry Pi’s CPU and allowing
for real-time AI-driven applications.

Key Features and Benefits of the IMX500


The IMX500 combines a 12.3-megapixel image sensor with a power-
ful digital signal processor (DSP) and dedicated on-chip SRAM to
perform high-speed AI tasks. This “one-chip solution” stacks the Figure 2: The Raspberry Pi AI Camera won’t even tax a Raspberry Pi Zero.
sensor and the AI processing hardware in a single unit, optimizing
the entire system for low-latency and low-power AI processing.
require image data to be sent to a host processor — whether it’s a
Here are some of the standout features of the IMX500: local CPU, an external AI accelerator, or even a cloud server. This
back-and-forth can introduce significant delays, not to mention
> 1/2.3" sensor: The IMX500 features a sensor size that increased bandwidth and power consumption.
supports resolutions up to 4,056 × 3,040 pixels, making it
capable of capturing high-quality images while running AI With the IMX500, this processing bottleneck is removed. The
models in real-time. sensor itself captures the raw image data, processes it using
> Optimized AI processing: The built-in AI accelerator elimi- pre-trained neural networks, and outputs the results as metadata.
nates the need for high-performance external processors or The Raspberry Pi — any model with a camera connector, from the
memory, making it a more cost-effective and reliable solution. Raspberry Pi Zero (Figure 2) to the Raspberry Pi 5 — receives both
This translates to lower hardware costs and improved power the image data and the AI results in parallel, allowing the system to
efficiency. perform tasks such as object detection and pose estimation without
> Low latency: By handling AI inference directly on the sensor, any additional hardware or complex processing on the Pi.
the IMX500 eliminates the need to send data to a server or
external AI accelerator. This significantly reduces latency and The IMX500’s ability to crop and scale images using its built-in
ensures that AI decisions are made almost instantaneously. region of interest (ROI) feature is another great benefit. This allows
> Privacy by design: The sensor can output only the processed the sensor to focus on specific areas of the image, ensuring that only
metadata, ensuring that the raw image data never leaves the the relevant portions are processed by the neural network, which
chip if privacy is a concern. This feature is particularly useful optimizes performance and speeds up AI inference, all without
in applications where privacy regulations are stringent, such using any of your host system’s CPU time.
as smart retail or smart city deployments.
Sony IMX500 Key Specifications
How the IMX500 Works The key specifications are pretty impressive for a camera that is
The key innovation of the IMX500 is its ability to handle AI infer- ostensibly used just for AI applications, which typically don’t require
ence directly on the sensor. Traditional vision systems typically super high resolutions:

Bonus Guest-Edited AI Edition 17


> Image size: 4,056 × 3,040 — that’s a little more than 4K UHD in
width, but its 4:3 aspect ratio means 40% more pixels in height.
> Pixel size: 1.55 μm, enabling the camera to capture detailed
images even in challenging lighting conditions.
> Frame rate: The camera supports up to 30 frames per second
(fps) at a binned resolution of 2,028 × 1,520 pixels and 10 fps at
its impressive full resolution, making it suitable for real-time
video applications. Figure 3: “No cameras available” persisted at first.
> Focal length: 4.74 mm, with a manual adjustable focus
ranging from 20 cm to infinity.
> Field of view: Horizontal 66° ±3°, Vertical 52.3° ±3°, providing > Smart factories: In industrial settings, the IMX500 can
a wide-angle view suitable for various applications. monitor production lines, detect anomalies, and ensure
> Operating temperature: 0°C to 50°C. worker safety by tracking movement within designated zones.
> Size: 25 × 24 × 11.9 mm, this is slightly larger than the
Raspberry Pi Camera Module 3, but still compact enough to fit All of this also bodes well for reducing system complexity and cost,
into many existing applications. while improving reliability and power efficiency.

AI-Driven Applications with the IMX500 Setting It Up


The onboard AI capabilities of the Sony IMX500 open up a wide So, time for me to get it up and running. As always with me, there
range of possibilities for vision-based applications. By perform- were some setup challenges.
ing AI inference at the edge, the IMX500 makes it possible to run
sophisticated machine learning models without needing additional Firstly, I the update/upgrade dance as recommended by the official
hardware accelerators such as the Hailo or Coral TPU. Some appli- documentation [1]:
cations include:
sudo apt update && sudo apt full-upgrade
> Object detection: Using the MobileNet SSD neural network,
the camera can detect objects in real-time, providing bound- Then I installed the IMX500 firmware...
ing boxes and confidence values for each detected object.
This makes it ideal for applications such as security systems, sudo apt install imx500-all
automated retail, or industrial monitoring.
> Pose estimation: With the PoseNet neural network, the ...and did the recommended reboot:
camera can track and estimate human poses in real-time. This
has applications in healthcare, fitness tracking, and robotics, sudo reboot
where understanding human motion is critical.
> Semantic image segmentation: By taking image classification That should have been it, and I should have been able to try some
to the pixel level, the IMX500 can classify individual pixels object detection using
in an image, allowing for advanced use cases such as smart
factory monitoring or smart city infrastructure. rpicam-hello -t 0s --post-process-file /usr/share/
> Privacy-preserving vision: Since the IMX500 can process rpi-camera-assets/imx500_mobilenet_ssd.json --viewfinder-
images on the sensor itself and output only the metadata, it’s width 1920 --viewfinder-height 1080 --framerate 30
a good fit for applications where privacy is critical. If you so
wish, it can analyze foot traffic or detect specific behaviors But instead, I got a “no cameras available” error (Figure 3). I tried
without ever transmitting raw image data. two different cameras, two different cables, and three different
Raspberry Pis (two 5s and a 4), and could not get the application
Industry Use Cases running. I checked the forums, did the googling, and all I got were
The IMX500 has already proven itself in various industries, enabling the generic “did you plug it in correctly?” troubleshooting steps.
a wide array of smart vision solutions: I had to step away, but gave it another go later on. This time, it
worked. I wish I could tell you how I solved the problem, but it
> Smart retail: In retail environments, the IMX500 can be used just came right on its own — just know that if you experience this,
to analyze customer behavior, detect products, and manage you’re not alone.
inventory in real-time, all while respecting customer privacy.
> Smart cities: Cities can leverage the camera’s ability to classify Once the camera was finally recognized, I needed to view the live
objects (such as vehicles or pedestrians) and detect danger- feed. While I’m not a huge fan of using GUIs on embedded systems,
ous situations in real-time, contributing to safer and more for live camera tasks they certainly have their charms. But still, I
efficient urban environments. didn’t want to hook up a mouse, keyboard, and monitor, so I used

18 www.elektormagazine.com
Figure 4: Some raspberries on a pie, or a “doughnut” according to the Figure 5: Ashton has the ability to transform between different mammal
trained model. species.

the still-in-beta Raspberry Pi Connect service [2], since SSH alone Speaking of children, since I wanted some action, I enlisted the help
wasn’t enough for this job. There were a few glitches, but again, of Chase and Ashton, two tykes who have more energy than I do.
it’s still in beta.
Then I tried some moving targets. Getting Ashton to play with a
With the camera working, and Raspberry Pi Connect running on football yielded a human (Figure 5, left), but it wouldn’t detect the
my Windows 11 laptop, I was able to go mobile and try the camera football, at least under those lighting conditions. I asked him to
out “in the wild.” Since AI cameras will likely be used in various crouch down and pick up the ball, but this instantly transformed
environments, I wanted to test mine outdoors in less controlled him into a “dog” (Figure 5, right).
lighting conditions.
Pose Estimation
Object Detection For pose estimation, the camera uses PoseNet, a neural network that
Using the aforementioned rpicam-hello command line, I tried labels key points on the body, identifying joints and limbs. Unlike
object detection. This identifies objects by providing bounding object detection, pose estimation requires additional post-process-
boxes and confidence values for each object detected. The process- ing on the Raspberry Pi to generate the final output. Once it was
ing happens directly on the camera, with no significant post-pro- running, we were able to overlay stick figures, both in good light-
cessing needed on the Raspberry Pi itself. Once the output tensor ing (Figure 6, left), and when it got a bit darker (Figure 6, center),
is generated, the system can draw bounding boxes and labels on but with high-speed tests, such as Chase sprinting past the lens,
the image. the camera sometimes lost track of the figures, even at one point
chasing Chase (Figure 6, right). It also struggled a bit with motion
I tried a variety of everyday objects, even attempting it to get it blur, so good lighting would be preferable for reliable results.
to recognize some raspberries. It told me I was likely looking at a
“teddy bear.” Then I tried a pie, and got nothing. So I put the raspber- Besides taking control of the lighting, you could also tweak the
ries on the pie (Figure 4), and lo and behold, I had a “doughnut.” brightness, exposure, and ISO settings from the same command
All fun and games, but the pie was enjoyed, and the children have line to maintain decent image quality. Your end application may
discovered that they now like raspberries. have to automate this if you can’t control the ambient lighting.

Figure 6: Chase needs to


slow down in the dark.

Bonus Guest-Edited AI Edition 19


Figure 9:
The Raspberry Pi
AI Camera was teased
with a 3D-printed
enclosure.

Figure 7: The Raspberry Pi Camera Module 3 and prior models fit into this
multi-camera test jig.

About the Author


Brian Tristam Williams has been fascinated with computers and
electronics since he got his first “microcomputer” at age 10. His
journey with Elektor Magazine began when he bought his first issue
at 16, and since then, he’s been following the world of electron-
ics and computers, constantly exploring and learning. He started
working at Elektor in 2010, and nowadays, he’s keen on keeping
up with the newest trends in tech, particularly focusing on artificial
intelligence and single-board computers such as the Raspberry Pi.
Figure 8: The Raspberry Pi AI Camera may not fit previous camera
enclosures.
Questions or Comments?
We’d love to hear about how you are using AI and how it has affected
Mechanical Compatibility you over the past two years. If you have questions or comments,
The AI Camera module is slightly larger than older Raspberry Pi email me at [email protected]. You can also catch me on
cameras, which means it’s not 100% compatible with all previous Elektor Engineering Insights each month on YouTube, and you can
enclosures. I found this out firsthand when I tried to fit the AI find me @briantw on X.
camera into a test jig I’d made for comparing multiple versions of
the Raspberry Pi Camera Module. While the Camera Module 3 fitted
fine (Figure 7), the Raspberry Pi AI Camera didn’t (Figure 8). The
third-party market will no doubt fill the gap, but you could always
Related Products
3D-print something, just as Raspberry Pi themselves did (Figure 9)
when showing the camera off prior to its official launch. > Raspberry Pi AI Camera
www.elektor.com/20953
Lots of Potential
So, now you have an AI Camera that neither taxes your CPU nor
> Raspberry Pi Zero 2 WH
www.elektor.com/20952
requires you to have, for example, a separate accelerator sitting
on your Raspberry Pi M.2 HAT+, hogging the bus that you might > Raspberry Pi 5 (4 GB RAM)
want to use for an SSD. www.elektor.com/20598

Despite the initial challenges, the camera showed real promise.


With object detection and pose estimation enabled, I’ve only
scratched the surface of what it can do. The AI processing power of
the Sony IMX500 makes this camera a great tool for makers, educa-
tors, and anyone wanting to experiment with AI at the edge. Visit our Raspberry Pi page
240635-01 for articles, projects, news, and
videos.
www.elektormagazine.com/
elektor-raspberry-pi

WEB LINKS
[1] Raspberry Pi Documentation: AI Camera: https://raspberrypi.com/documentation/accessories/ai-camera.html
[2] Raspberry Pi Connect remote control: https://www.raspberrypi.com/software/connect

20 www.elektormagazine.com
PROTEUS DESIGN
Driving SUITE
forward with Manual Routing

Push and Shove Routing


for dense layouts

Dedicated Differential Length Matching and


Pairs Routing mode Net Tuning Support

Visual DRC shows legal


paths for route placement

[email protected]
EDITOR’S PICKS

Artificial Intelligence
in Elektor
By The Elektor Content Team
Once science fiction, artificial intelligence (AI) is now a cornerstone of
Join us on a fascinating journey through modern technology. Elektor, a pioneer in electronics with articles dating
Elektor’s archives, showcasing how back to 1961, has been at the forefront of this evolution, exploring AI’s
potential since its nascent stages. Whether you manually flip through
artificial intelligence (AI) has evolved old editions of ElektorMag or use the beta version of our Elektor GPT [1],
within the electronics community. you will see that AI-related topics have been covered for decades.
From early experiments in machine From discussions of neural networks and fuzzy logic in the 1970s and
1980s to in-depth projects featuring today’s sophisticated AI-driven
learning to the integration of AI in solutions, our coverage has mirrored the swift advancement of AI
modern projects, discover how AI has tech. Here, our editors and engineers offer a selection of significant
influenced technology trends, inspired AI-related articles from our vast archives. Of course, not every article
is ostensibly about AI. But the concepts and ideas explored, such as
innovation, and shaped the future of pattern recognition, automation, and machine learning, have been
electronics design. Check out these integral to the development of AI tech.
editor’s picks.

What Is Cybernetics? (Elektor, June 1975)

Focus: Discusses cybernetic models simulating animal behavior, exploring concepts of learn-
ing, adaptability, and intelligence in artificial systems.

The ‘cybernetic beetle’ is the first of a series ship between the stimulus and the relevant
of articles in ‘Elektor’ on designs which are reaction, the more the behaviour of the model
on the one hand meant to be a game, but approaches that of the animal example and
which on the other hand should be regarded the more will an ingenious toy become a
as serious and sometimes scientific imita- scientific object. It was found to be extremely
tions of animal behaviour. These cybernet- difficult to imitate the behaviour of more highly
ics projects have an electronic ‘nerve system’ developed animals in a cybernetic model,
enabling them to react specifically to exter- because an electronic nerve system can only
nal acoustic, optical and tactile stimuli. Such perform a limited number of functions. Exper-
models can moreover be designed so that iments on a scientific basis therefore confine
the reaction is not only governed by the type themselves to certain aspects of behaviour
of stimulus, but also by the condition of the or to living models of a very simple nature.
model at the moment when the stimulus Continue reading: www.elektormagazine.com/
is applied. The more ‘natural’ the relation- magazine/elektor-197506/57395

22 www.elektormagazine.com
Computers and Chess: How the Monster Thinks (Elektor, January 1979)

Focus: Discusses the development of chess-playing computers and highlights key contribu-
tions in AI, particularly by Claude Shannon.

Decades ago, with the electronic computer still in its infancy and illustrating above all else the
First Law of Thermodynamics (‘Work is Heat’), the game of chess attracted the interest of a
number of researchers in the field of artificial intelligence. The first person to actually propose
how a computer might be programmed to play chess was the English Mathematician Claude
Shannon. In 1949 he presented a paper entitled ‘Programming a computer for playing chess’,
which was significant, both for the fact that it was the first paper expressly on this subject, and
more importantly since many of Shannon’s ideas are still employed in the strongest chess-play-
ing programs of today. Shannon’s interest in chess programming stemmed from his belief that
the game represented an ideal test of machine intelligence. Chess is clearly defined in terms
of legal operations (moves of the pieces) and ultimate goal (checkmate), whilst being neither
so simple as to be trivial nor too complex to be unsusceptible to analysis. Continue reading:
www.elektormagazine.com/magazine/elektor-197901/58282

Intelligence, Intentionality and Self Awareness


Artificial Intelligence (Elektor, May 1988) (Elektor, November 1989)

Focus: Discusses the evolution of artificial intelligence, from Focus: Discusses some of the problems in ascribing intelligence
its Charles Babbage and Alan Turing to its development as a to computers, and investigates intentionality, the origin of self
recognized field in 1956, while addressing the misconceptions awareness, and brain and machine translations
and myths surrounding machine intelligence
In his article “Artificial Intelligence,” M. Seymour provides an
Man is intelligent, but his intelligence is often thwarted (or interesting and informative account of some of the problems
worse) by his environment. That realization has given rise to met by computer designers in attempting to produce machines
a dream: that one day it may be possible to build a machine that exhibit artificial intelligence. The article discusses
that can think, that is, need not be programmed to perform its arguments for and against what constitutes artificial intel-
functions. Machine intelligence was first thought of by Charles ligence, including the existence or otherwise of intentional-
Babbage (1792-1871). Later, Alan Mathison Turing (1912-1954) ity (Searle, 1984). The present paper examines some of the
achieved immortality through the Turing Machine, which concepts from the point of view of a psychologist, who was a
purports to show that machines are mathematical objects, student at Manchester when Alan Turing was working on the
and his proof of the theorem that the set of mathematical theoretical aspects of information processing. The power of
tasks that is computable is exactly the same as the set that electronic devices has increased enormously since that time,
can be executed by the machine. He also formulated a theory but perhaps there has not been a similar growth in defin-
about what questions could in principle be answered by an ing the terminology used to describe computer activities and
intelligent machine. Artificial intelligence grew out of the work brain activities. At the simplest level there has been revival of
on digital computers during the Second World War and was anthropomorphism, a condemnatory appellation feared by
officially recognized as a branch of computing science in 1956. biologists accused of reading human characteristics into the
Since those early days, artificial intelligence has given rise to a behaviour pattern of lower animals. However, equally imprecise
number of myths, particularly, but not only, in the popular press. use of language is exemplified by phrases such as ‘comput-
However, claims of computers achieving this and that, without ers talking to each other’. This is largely a matter of economy
human intervention, always prove, on close examination, to be in the use of words, since it is easier to use concepts already
mere illusions of intelligence. These illusions are created by the in existence than to invent new ones, but there are dangers
fact that computers work so extremely fast. Continue reading: in over-extending the concepts to include things that are not
www.elektormagazine.com/magazine/elektor-198805/47340 justifiable. Continue reading: www.elektormagazine.com/
magazine/elektor-198911/47684

Bonus Guest-Edited AI Edition 23


Fuzzy Logic: An Introduction (Elektor, July 1992)

Focus: Introduces fuzzy logic as a flexible reasoning method suitable


for expert systems and human-like responses in AI Editors have used Elektor GPT (Archive
Assistant) to research content in past Elektor
Fuzzy logic is a kind of statistical reasoning, whose foundations can articles. What is it and what does it offer?
be said to have been laid in the 18th century by the British philoso-
pher Thomas Bayes. With this technique, large amounts of data can
be condensed into a much smaller set of variable rules than with rigid
logic. The result is an expert system that can process information faster, Drafts
and provide a more flexible, more human-like response than conven-
tional logic. The great German polymath, Gottfried Leibniz (1646-1716), Elektor GPT (Archive Assistant), the
dreamed about devising a way whereby a couple of philosophers could beta version of which went online in
discuss and settle any human argument once and for all by pure logic. April of 2024, is a tool designed to help
But he and many other thinkers after him have discovered that there users efficiently search and access
are many problems that cannot be solved by just logic. This realiza- Elektor magazine’s digital archives. It
tion gave rise to another way of attempting to solve problems: the use assists Elektor community members
of statistics. In statistical reasoning, probabilities express the idea of by quickly retrieving articles, projects,
’perhaps’. One method of statistical reasoning, whose foundations can and resources related to electronics,
be said to have been laid in the 18th century by the British philosopher
making research and project planning
Thomas Bayes, is called fuzzy logic. In fuzzy logic, there is not just ’true’
easier. Community members can use it
and ’false’, 1s and 0s, ’black’ and ’white’, but also all the various grades of
to find specific topics, locate past issues,
grey in between. Fuzzy logic can condense large amounts of data into a
much smaller set of variable rules than rigid logic. The result is an expert or explore articles relevant to their
system that can process information faster, and provide a more flexible, interests, saving time and effort while
more human-like response than conventional logic. Continue reading: navigating Elektor’s extensive content
www.elektormagazine.com/magazine/elektor-199207/32683 collection.

Enter a prompt for ChatGPT

Neural Networks in Control: Neurocomputers Are Here (Elektor, October 2001)

Focus: Discusses neurons, the possibilities of implementing the neurocomputer, modeling an artificial neural network (ANN), and training

Neurons are usually organised into well-de- each connection. The number of possi- was made until the advent of VLSI. Now,
fined structures, such as the brain, the ble connections is far greater than the with the enormous computing power of
spinal cord and the peripheral nerves. Each number of neurons present. We estimate even the smallest of bench-top comput-
neuron is a centre of information transfer that a human brain may contain as many as ers, we model ANNs mathematically. This
(Note: transfer, not storage). It can receive 1016 connections, an enormous resource for can be done in a system based on conven-
information as electrical signals from a memory and intelligent action... Given that tional microprocessors, as illustrated by the
number of other neurons in the network, the neural network of an animal is capable software described later. There are also
process this information, and pass it on of complex recognition and control actions, custom-designed processors used to build
to other neurons. In the human brain, for researchers have tried to build the artifi- true neurocomputers. These are designed
instance, a neuron connects to as many as cial equivalent, an artificial neural network to excel in the particular kinds of process-
10,000 other neurons. The extent to which or ANN. An ANN consists of neuron units ing that are needed to model ANNs, which
information is transferred from neuron to mimicking the action of animal neurons. is done most efficiently by using parallel
neuron depends on the number of physi- They have input, processing and output processing. Continue reading:
cal connections existing between the stages. The earliest electronic ANNs were www.elektormagazine.com/magazine/
neurons and the intensity (or strength) of based on valve circuitry, but little progress elektor-200110/17112

24 www.elektormagazine.com
Practical Neural Networks (Elektor, January 2003)

Focus: Covers neural networks, the birth and history of the ANN, and learning and training algorithms

Artificial Neural Networks (Neural Nets or just experiment with your own Neural Nets. A Neural
ANNs for short) are a popular form of Artificial Net is a network of connected processors. Each
Intelligence (AI). They are based on the operation individual processor is only capable of a very
of Brain Cells and many researchers think that simple mathematical task, but when many are
they are our best hope for achieving true intelli- connected together complex behaviour results.
gence in a machine. If you’re a fan of the TV series The drawing in Figure 1 shows a typical neural
“Star Trek,” you’ll know that Data is supposed to net. To understand the Neural Network let’s look
have a Neural Net brain, as is the robot in the at its inspiration - the brain. What a layman calls
“Terminator” films. Although these technologi- ‘Brain Cells’ are what a biologist would refer to
cal wonders are on the cutting edge of research as Neurons. These are the tiny living cells, which
in Computer Science, they are also well within make up our brain and nervous system. There
the grasp of the enthusiastic amateur. The aim are about 100 billion of them in a typical human.
of these articles is to introduce this fascinating Continue reading: www.elektormagazine.com/
topic in a practical way, which will allow you to magazine/elektor-200301/17413

Image Processing with the Nvidia Jetson Nano


(Elektor, September/October 2021)

Focus: Covers the Nvidia Jetson Nano, training with the Jetson Nano,
development via a web browser, and more

The Future of Machine Learning


No developer should ignore the potential of artificial intelligence (AI).
(Elektor, November/December 2020)
Tools like the Sipeed Maixduino and the Maxim MAX78000, which we
have already presented in Elektor, are suitable options for taking your first
Focus: Discusses embedded machine learning steps into the world of AI. The Nvidia Jetson Nano is a much more power-
and introduces TinyML, Edge Impulse, and TinyML ful hardware from the class of single board computers, equipped with a
projects quad-core ARM processor, 4 GB RAM and a GPU with 128 CUDA cores.
In this series of articles, I show you which applications are possible, for
Daniel Situnayake is a creative engineer who example, in the fields of image processing or robotics... The Nvidia Jetson
believes embedded machine learning (ML) is a Nano is a much more powerful piece of hardware from the single board
“once-in-a-generation technology.” Here he talks computer (SBC) class. Equipped with a quad-core ARM processor, 4 GB
about ML’s potential and introduces TinyML, as well RAM and a GPU with 128 CUDA cores, the Jetson Nano is a good platform
as a few ideal applications. We also touch on his for investigating AI and neural networks. Applications range from speech
experience as a developer at Google. Situnayake recognition to classifying objects in captured video images to full-blown
states: “There are four main constraints that make robot control. Continue reading:
an application ideal for TinyML. If an application www.elektormagazine.com/magazine/elektor-183/59829
has limited connectivity, low tolerance for latency, a
limited source of power, or a requirement for strong
privacy, TinyML can potentially help, by avoiding
the need to send data from the device. It’s worth
noting that only certain problems can be solved
by machine learning. They need to be problems Related Product
where a bit of fuzziness is OK, since ML can rarely
give absolute answers. It’s perfect for taking animal > Elektor Archive (USB Stick)
photos, where the occasional mistake is accept- www.elektor.com/20751
able, but it might not be reliable enough in some
safety-critical applications.” Continue reading:
www.elektormagazine.com/magazine/ WEB LINK
elektor-159/59100 [1] Elektor GPT (ChatGPT registration necessary):
https://tinyurl.com/Elektor-GPT
240572-01

Bonus Guest-Edited AI Edition 25


ELEKTOR BOOKS

Hailo AI Kit
with Raspberry Pi 5
By Dogan Ibrahim (United Kingdom)

For those of you familiar with the


Raspberry 5 but hesitant about Edge
Computing and relevant hardware,
Elektor’s book, Getting Started with
the Raspberry Pi 5 AI Kit, is a fantastic
stepping stone. Packed with examples
for a flying start to Raspberry 5-based
AI programming, the book has the
Elektor Raspberry Pi AI Kit as a solid
base for the hardware. To show the
potential of the book and kit jointly,
Figure 1: AI Kit disassembled.
here’s an excerpt demonstrating person
recognition in two ways with free AI
tools, plus a brief introduction to Hailo way, which can be used in many AI-based applications, such as
object recognition, automation, process control, security, robotics,
Software Components. medical and many more.

Features
Editor’s Note. This article is an excerpt from the Elektor book Getting > Contains a neural network inference accelerator capable of
Started with the Raspberry Pi AI Kit, which will be published by Elektor 13 TOPS
in 2024. It was formatted and lightly edited to match ElektorMag’s > Fully integrated into Raspberry Pi’s camera software stack
conventions and page layout. The author and editor are happy to help > Thermal pad pre-fitted between module and HAT+ spreads
with queries. Contact details are in the Questions or Comments? box. heat across components, improving performance
> Conforms to Raspberry Pi HAT+ specification

The Raspberry Pi 5 AI Kit (Figure 1) is a 13 TOPS (trillion of opera- Included


tions per second) neural network inference accelerator built around Each AI Kit comes with a pre-installed AI module, ribbon cable,
the Hailo-8L chip. The AI Kit includes the Raspberry Pi M.2 HAT+ GPIO header, and mounting hardware. In detail, included with
and a Hailo AI acceleration module for use with the Raspberry Pi 5. the kit are:
The module uses the M.2 2242 form factor, and comes pre-installed
in the M.2 HAT+, to which it connects through an M key edge > Hailo 8L accelerator with Neural Processing Unit (NPU)
connector. The M.2 HAT+ communicates between the AI module’s > Raspberry Pi M.2 HAT+
M.2 interface and the Raspberry Pi 5’s PCIe 2.0 interface. As a result, > Thermal pad pre-fitted between the module and the M.2 HAT+
the AI kit provides an accessible, cost-effective, and power-efficient > Mounting hardware kit (spacers, screws)

26 www.elektormagazine.com
> 16 mm GPIO stacking header To achieve optimal performance from the Hailo device, it is neces-
> 4 threaded spacers sary to set PCIe to Gen3. While using Gen2 is an option, it will result
> 8 screws in lower performance. The steps are:
> 1 knurled double-flanged drive attachment screw to secure
and support the M.2 peripheral pi@raspberrypi:~ $ sudo raspi-config

Hardware Installation Select option 6. Advanced Options, then select option A8 PCIe Speed.
Figure 2 shows the AI Kit with the Raspberry Pi 5. The AI kit must Choose Yes to enable PCIe Gen 3 mode. Click Finish to exit.
be installed on top of the Raspberry Pi 5 before it can be used. It is
recommended to use the AI Kit with the Raspberry Pi active Cooler. Reboot your Raspberry Pi 5:
Thus, if you have an Active Cooler, make sure that you install it
before installing the AI Kit. Also, it is recommended to install the pi@raspberrypi:~ $ sudo reboot
Raspberry Pi 5 camera (e.g., camera V3) before you install the AI Kit,
as this way it will be easier to connect the camera cable. Installing the Hailo AI Kit Software
Run the following command to install the Hailo AI Kit software
Installing the AI Kit Software on Raspberry Pi 5:
First of all, you should ensure that your Raspberry Pi 5 is installed
with the latest Bookworm operating system. pi@raspberrypi:~ $ sudo apt install hailo-all

Run the following commands to update the operating system to The above command installs the following dependencies:
latest version:
> Hailo kernel device driver and firmware
pi@raspberrypi:~ $ sudo apt update > HailoRT runtime software
pi@raspberrypi:~ $ sudo apt full-upgrade > Hailo Tappas core package
> The rpicam-apps Hailo post-processing software demo stages
Ensure that the Raspberry Pi 5 firmware is up to date:
Reboot your Raspberry Pi 5 for the above settings to take effect:
pi@raspberrypi:~ $ sudo rpi-eeprom-update
pi@raspberrypi:~ $ sudo reboot
If you see December 2023 or a later date, proceed to the next step.
If you see a date earlier than 6 December 2023, run the following Verifying the Software Installation
command to open the Raspberry Pi configuration tool: You should verify the software installation to make sure that all
the software components are in place and the AI kit can be recog-
pi@raspberrypi:~ $ sudo raspi-config nized by the Raspberry Pi 5. The steps are:

Under Advanced Options Bootloader Version, choose Latest. Then > Make sure the AI kit hardware is installed on your
exit raspi-config with Finish or the Escape key. Run the following Raspberry Pi 5 as described earlier
command: > Enter the following command:

pi@raspberrypi:~ $ sudo rpi-eeprom-update –a pi@raspberrypi:~ $ hailortcli fw-control identify

If everything is ok, you should see an output similar to Figure 3.


Note here that the software version is 4.17.

Figure 2: AI Kit assembled. Figure 3: Verifying the software installation.

Bonus Guest-Edited AI Edition 27


> Edit config.txt: sudo nano /boot/firmware/config.txt
> Change line: camera_auto_detect=1 to
camera_auto_detect=0
> Insert line: dtoverlay=imx708
> Type CntrlX followed by Y to save and exit

Re-enter the command rpicam-hello –t 10s to check the camera


operation again. At this point, you have verified that the AI Kit
hardware and software have been installed correctly, and your
camera is operating.

Running the Demo Programs


A number of demo programs are available with the AI Kit for the
Figure 4: Test TAPPAS Core installation (part of the display is shown). Raspberry Pi 5. The steps to install some of these demo programs
are:

> Clone the repository

git clone https://github.com/hailo-ai/hailo-rpi5-


examples.git

> Enter the repository directory:

cd hailo-rpi5-examples
Figure 5: Checking kernel logs (part of the display is shown).
> To run the examples, you should ensure your environment is
set up correctly. You can set it all up by sourcing the following
> You should also test for the TAPPAS Core installation by script. This script will set the required environment variables
running the following command: and activate Hailo virtual environment (if it doesn’t exist, it
will create it).
pi@raspberrypi:~ $ gst-inspect-1.0 hailotools
source setup_env.sh
If everything is ok, you should see something similar to Figure 4.
> Make sure you are in the virtual environment and run the
If hailo or hailotools are not found, try deleting the GStreamer following command. This may take some time, wait until it is
registry: finished.

pi@raspberrypi:~ $ rm ~/.cache/gstreamer-1.0/registry. pip install –r requirements.txt


aarch64.bin
> Resource download. This may take some time, wait until it is
> Additionally, you can run the following command to check finished:
the kernel logs:
./download_resources.sh
pi@raspberrypi:~ $ dmesg | grep –i hailo
This repository contains examples of basic pipelines for Hailo’s
Which should give an output similar to Figure 5. RPi5 platform. The examples demonstrate object detection,
human pose estimation, and instance segmentation. It is built
> Finally, you should check to make sure that the camera as templates to allow you to use these applications as a basis for
operates correctly. Enter the following command, which will your own projects.
show a camera preview for 10 seconds.
The hailo-rpi5-examples folder contains the folders and files shown
pi@raspberrypi:~ $ rpicam-hello –t 10s in Figure 6.

If you are using a V3 camera module with your Raspberry Pi 5, add The applications programs (detection, pose estimation, instance
the following lines to your config.txt file: segmentation) are in folder basic_pipelines as shown in Figure 7.

28 www.elektormagazine.com
or, enter the command:

v4l2-ctl –list-devices

You can test whether the USB camera is working by entering (Note
that it is lowercase L, not 1):
Figure 6: Examples folder contents.
ffplay –f v4l2 /dev/video0

If you get an error try another device (e.g. /dev/video2). In author’s


setup the USB camera was named as /dev/video8. Your USB camera
will probably have a different device name.

Figure 7: Applications programs. For example, to read images from the USB camera, the author used
the option –i /dev/video8. In the following example, a keyboard
is detected using a USB camera:

Detection Demo Example python basic_pipelines/detection.py -i /dev/video8


This example demonstrates object detection. It uses YOLOv6n model
as default. It supports also yolov8s and yolox_s_leaky models. It uses The output is shown in Figure 9 with the keyboard label displayed
Hailo’s NMS (Non-Maximum Suppression) layer as part of the HEF at the top left corner of the display.
file, so all detection networks which are compiled with NMS can
be used with the same code. To print the frame rate add the --print-fps flag. This will print
the frame rate to the terminal and to the video output window.
To run the example, use (make sure you are in Desktop GUI mode):

cd hailo-rpi5-examples
source setup_env.sh
python basic_pipelines/detection.py --input resources/
detection0.mp4

This application reads the detection0.mp4 movie file and detects


and indicates various items in the file. Figure 8 shows the output
of the program displayed on the Raspberry Pi monitor, where the
identified objects are shown with rectangles.

To close the application press Ctrl+C. For additional input options, Figure 8: Output of the program.
enter the following command:

python basic_pipelines/detection.py --help

For example, to read images from a Raspberry Pi 5 camera, enter


--input rpi. The following command will read the images from
the Raspberry Pi 5 camera:

python basic_pipelines/detection.py --input rpi

Also, to read images from a USB camera (webcam), enter --input


/dev/video0.

Note that the USB camera is not guaranteed to be /dev/video0.


You can check which video devices are available by entering the
command:

ls /dev/video* Figure 9: Detecting a keyboard.

Bonus Guest-Edited AI Edition 29


RaspberryPi 5
3V3 1 2 5V
GPIO2 3 4 5V
GPIO3 5 6 GND
GPIO4 7 8 GPIO14
GND 9 10 GPIO15
GPIO17 11 12 GPIO18
GPIO27 13 14 GND
GPIO22 15 16 GPIO23
SW 3V3 17 18 GPIO24
GPIO10 19 20 GND
GPIO9 21 22 GPIO25
GPIO11 23 24 GPIO8
Figure 10: Block diagram. R1 GND 25 26 GPIO7
GPIO0 27 28 GPIO1

10k
GPIO5 29 30 GND

Project — Detect Person Presence Using the AI GPIO6 31 32 GPIO12

Kit — LED Output When Person Detected


GPIO13 33 34 GND
GPIO19 35 36 GPIO16
Description: In this project, a person’s presence is detected, and GPIO26 37 38 GPIO20

an LED is turned ON when a person is detected. The program waits GND 39 40 GPIO21
R2
with the LED ON until the user presses a reset button to acknowl-

330Ω
edge the detection. At this time, the LED turns OFF and the detec-
tion process starts again. This is a simple but useful example. The LED1
LED can be replaced with a relay or a buzzer if required. Also, the
program can be modified to detect objects other than persons.

Block diagram: Figure 10 shows the project block diagram.


240562-002

Circuit diagram: The circuit diagram is shown in Figure 11. Figure 11: Circuit diagram.
The LED is connected to port pin 21 of Raspberry Pi 5 through a
330-Ω current limiting resistor. The pushbutton is connected to
port pin 20. The default state of the button is at logic 1 and goes to Object Detection Training
logic 0 when the button is pressed. AI-based object detection and training is a highly complex process
and requires good understanding and working knowledge of
Program listing: The Python program listing is shown in programming concepts, especially Python programming. Chapter
Listing 1. The program creates a subprogram and runs as a shell 11 of the book describes in detail how to carry out object detection
program. At the beginning of the program, the gpiozero library is training using an Ubuntu-based computer, where the output is
imported and Raspberry Pi 5 GPIO port 21 is assigned to led and loaded to a Raspberry Pi 5.
button is assigned to port 20. 240562-01

The rpicam-apps post-processing Hailo inference program is started


in a while loop and the output of this program is compared if it
contains the word person. i.e. If a person has been detected. If so, the
message Person detected is displayed on the Raspberry Pi 5 monitor,
and the shell program exits and the LED is turned ON. The program
then waits until the button is pressed. Pressing the button is like
an acknowledgement from the user. Pressing the button turns About the Author
OFF the LED. The program then waits for 15 seconds, and then the Prof. Dr. Dogan Ibrahim has a BSc degree in electronic engineering,
detection process resumes from the beginning. an MSc degree in automatic control engineering, and a PhD degree
in digital signal processing. Dogan has worked in many industrial
This program can easily be modified by replacing the LED with a organizations before he returned to academic life. Prof. Ibrahim
relay or a buzzer, and changing the waiting time to suit the required is the author of over 70 technical books and has published over
application. One possible application of this project is in security, 200 technical articles on microcontrollers, microprocessors, and
where it may be required to detect when a person is sensed in-front related fields. He is a Chartered electrical engineer and a Fellow
of the camera. Also, other objects can be detected and then required of the Institution of the Engineering Technology. He is a certified
actions can be taken. Arduino professional.

30 www.elektormagazine.com
Listing 1: Python program.
#-----------------------------------------------------------------
# DETECT PERSON AND TURN ON LED
# ---------------------------------------------------
#
# File : Detect.py
# Date : October, 2024
# Author: Dogan Ibrahim
#----------------------------------------------------------------
import os
import subprocess
from gpiozero import LED, Button
from time import sleep
led = LED(21) # LED port
button = Button(20) # Button port
led.off() # LED OFF
while(True):
p=subprocess.call("rpicam-hello -n -v 2 -t 0 \
--post-process-file /home/pi/rpicam-apps/assets/hailo_yolov8_inference.json\
--lores-width 640 --lores-height 640 2>&1 | grep -m 1 -c \
--line-buffered 'person'",shell=True)
print("Person detected...")
#
# At this point a person has been detected
#
led.on()
button.wait_for_press() # Wait for button press
led.off()
sleep(15)

Questions or Comments?
Do you have any questions or comments related to this article?
Email the author at [email protected] or Elektor at
[email protected].

Related Products
> Dogan Ibrahim, Getting Started with the Raspberry Pi
AI Kit (Elektor 2024)
www.elektor.com/21031

> Dogan Ibrahim, Getting Started with the Raspberry Pi


AI Kit (Elektor 2024, E-book)
www.elektor.com/21032

> Raspberry Pi AI Kit


www.elektor.com/20879

Bonus Guest-Edited AI Edition 31


Elektor infographic
Artificial Intelligence

AI’s Impact on Smart Building Energy Management


As artificial intelligence technology continues to advance, its AI could help decrease CO2 emissions by:
impact on energy consumption and carbon emissions in buildings
could be profound [1]. This research [2] explores how AI can

~40%
reduce energy costs and emissions, emphasizing the need for
further studies to quantify AI’s full potential. The study proposes
a systematic approach to evaluate AI’s impact, predicting

~90%
significant reductions in energy use and emissions by 2050.
compared to the
With AI technology and efficiency policies, CO2 emissions could BAU scenario.
be cut by around 40% by 2050 compared to maintaining the
current trajectory without any intervention (BAU). Implementing from the BAU scenario when
both AI and policy-driven efforts could lead to a 60% reduction. combined with energy efficiency
By further incorporating low-emission power generation, policies and low-emission power
emissions could be nearly eliminated by 2050, achieving savings generation (LEPG).
of up to 93–95% compared to current trends.

200

Provide accurate, up-to-date data


Energy use (million MMBTU)

150
on AI adoption and usage in the
top EU countries (by population).
Scenario
100 Frozen
BAU wo/AI Drafts
BAU w/AI
50 Policy wo/AI Here’s a summary of AI adoption
Policy w/AI and usage in the top EU countries
by population (as of 2024) Germany:
0
2020 2030 2040 2050 Around 11% of companies are using AI
technologies, focusing on automation,
14
manufacturing, and automotive
sectors (European Commission).
12 France: AI adoption is about 10%, with
10 key applications in healthcare and
CO2 emissions (MT)

Scenario finance (European Commission). Italy:


8
Frozen 7.5% of companies have adopted AI,
6 BAU wo/AI primarily in industrial sectors (European
BAU w/AI Commission). Spain: AI usage is growing,
4 Policy wo/AI but no specific percentage data is
2 Policy w/AI available for 2024. Spain is focusing
Policy w/AI & LEPG
0 on digital transformation (European
2020 2030 2040 2050 Commission). Poland: Adoption is around
3.7%, one of the lower rates in Europe
Energy consumption by scenario. BAU stands for business- (European Commission).
as-usual. The darker color for each scenario indicates
the average estimate and the lighter color for each
scenario indicates the estimated ranges from the Enter a prompt for ChatGPT
sensitivity analysis.[2]

32 www.elektormagazine.com
Tech Giants Developing AI Chips
Due to the global chip shortage caused by the > Google: Improving its Tensor Process- > Meta: Developing a custom chip for its AI
COVID-19 pandemic in 2020, the production of ing Unit (TPU) [4] technology for Google initiatives [9].
GPUs was severely impacted. The pandemic Cloud. > Huawei: Prioritizing AI chip production,
disrupted the global supply chain, resulting in > OpenAI: Exploring the development of slowing down smartphone production
delays in chip production and delivery. As a proprietary AI chips [5]. [10].
result, several companies have started creat- > Microsoft: Launched two custom chips — > Tesla: Created the Dojo AI chip [11] for
ing their own AI chips. Here’s a list of those Microsoft Azure Maia AI Accelerator and machine learning in autonomous driving.
companies: Azure Cobalt CPU [6]. > Baidu: Developed the Kunlun AI chip for
> Amazon: Released the Inferentia AI chip deep learning and speech recognition.
[7] and second-gen AWS Trainium ML > Alibaba: Released the Hanguang 800
accelerator [8]. AI chip [12] to enhance ML in cloud
services.
240435-01

AI Coding Assistant Adoption and Ongoing Challenges


In a recent survey conducted by Stack Overflow [3], it was found that developers are widely adopting AI coding assistants.

76%
of respondents either use
vs 70% from last year.
62%
now actively use AI tools
vs 44%
in the previous year.
or plan to use AI coding
assistants

What is the primary code assistant tool professional developers use?


ChatGPT 84%
GitHub Copilot 49%
Visual Studio IntelliCode 11%
Codeium 7%
Google Gemini, formerly Duet 5%
Tabnine 4%
Cody 3% Regarding efficacy and ethics, the primary benefit mentioned is increased
OpenAI Codex 3%
Amazon Q 3% productivity (81%), while 62% use AI to accelerate their learning. Most
Replit AI 2% developers (70%) do not see AI as a threat to their jobs, although ethical
AskCodi 2%
Codiga 1% concerns such as misinformation (79%) and source attribution (65%) are
Microsoft Copilot 1% prominent. The greatest challenge remains a lack of trust and understanding of
Mutable.ai 1%
Jetbrains AI 0.9% AI in coding workflows.
Phind 0.3%
Perplexity 0.3%
Claude 0.3%

WEB LINKS
[1] N. Flaherty, “AI can cut smart building energy management by over 19%,” eeNews, 2024: https://tinyurl.com/ai-smart-energy
[2] C. Ding, J. Ke, M. Levine et al., “Potential of artificial intelligence in reducing energy and carbon emissions of commercial buildings
at scale,” Nat Commun (2024): https://doi.org/10.1038/s41467-024-50088-4
[3] “2024 Developer Survey,” Stack Overflow, May 2024: https://survey.stackoverflow.co/2024/ai/
[4] Accelerate AI development with Google Cloud TPUs: https://cloud.google.com/tpu?hl=en
[5] A. Tong, M. Cherney, C. Bing, S. Nellis, “Exclusive: ChatGPT-owner OpenAI is exploring making its own AI chips,” Reuters, 2023:
https://tinyurl.com/chatgpt-chip
[6] J. Siegel, “With a systems approach to chips, Microsoft aims to tailor everything ‘from silicon to service’ to meet AI demand,”
Microsoft, 2023: https://tinyurl.com/microsoft-ai-chip
[7] AWS Inferentia: https://aws.amazon.com/machine-learning/inferentia/
[8] AWS Trainium: https://aws.amazon.com/machine-learning/trainium/
[9] F. Potkin, J. Zhu, “aExclusive: AI chip demand forces Huawei to slow smartphone production,” Reuters, 2024:
https://tinyurl.com/huawei-chip
[10] K. Paul, S. Nellis, M. Cherney, “Exclusive: Meta to deploy in-house custom chips this year to power AI drive,” Reuters, 2024: https://
tinyurl.com/meta-chip
[11] “TSMC Reportedly Commences Production of Tesla’s Next-Generation Dojo Chips, Anticipates 40x Increase in Computing Power
in 3 Years,” TrendForce, 2024: https://tinyurl.com/tesla-chip
[12] Y. Jiao, L. Han, X. Long, et al.,“Hanguang 800 NPU,” Alibaba Group: https://tinyurl.com/alibaba-chip

Bonus Guest-Edited AI Edition 33


GESTURE RECOGNITION

AI-Based Universal
IR Remote Control
Gesture-Controlled with MediaPipe and Raspberry Pi

By Antonio Aloisio (Italy)

If you are looking for a project to start


experimenting with AI, this might be the
right opportunity! With the help of a
Raspberry Pi 5, Google’s MediaPipe
Studio platform and a tiny plug-in
interface board, you may get a versatile
gesture recognition system to control
your TV or other devices operated
through IR remote controls.

HMI, short for Human-Machine Interface, is a term that refers to any


technology or device capable of making humans interact with machines.
HMIs are critical in a wide range of areas, from industrial manufac- Figure 1: Example of thumb-up gesture recognition. (Source: Google
turing to consumer electronics, and are essential for simplifying and https://tinyurl.com/34thk8xf)
optimizing interactions between users and machines.

The most commonly used HMIs are:


Applications range from industrial automation (used to monitor and
> Graphical User Interfaces (GUIs): are the most common control machines and industrial processes) to consumer electronics
and include graphical screens that allow users to interact with (touchscreens are common in consumer devices such as smartphones,
machines through icons, buttons and menus, typical of PC tablets, computers, and TV sets). In home automation systems, HMIs
operating systems, for example. allow users to control lights, thermostats, security devices, and other
> Voice user interfaces (VUIs): allow users to interact with smart home devices. They are critical in vehicles to enable users to
machines through voice commands. This type of HMI is becom- interact with navigation systems, entertainment systems and other
ing increasingly popular with the advent of voice assistance such features.
as Siri by Apple, Google Assistant, and Amazon Alexa.
> Touch user interfaces: allow users to interact with machines Interaction must follow dictates of ergonomics and functionality that
through physical touch, such as touchscreens, keyboards and are not always achieved in all HMIs; just think of the recent criticism
mice. by Euro NCAP against the complexity of vehicles that have shifted
> Gestural user interfaces: allow users to interact with machines key controls to center screens, forcing drivers to take their eyes off the
through physical movements, such as hand gestures detected road, increasing the risk of distraction accidents (source: ETSC [1]).
by cameras or motion sensors, which will be the focus of this Making HMIs more intuitive (user-friendly) is therefore one of the goals
project. that companies are increasingly trying to achieve.

34 www.elektormagazine.com
Interaction with machines is then an area we deal with daily, and
has become crucial in a wide range of industries, helping to improve
efficiency, safety and the overall user experience. Today, many of the Figure 2: Recognized points on palm — landmarks.
HMI systems take advantage of artificial intelligence (AI) for their (Source: Google https://tinyurl.com/34thk8xf)
operation.

The project we propose in this article uses hand gesture recognition to MediaPipe is defined by Google as on-device, meaning it is also capable
give commands to a television set. We will use an AI system to replace of running on an offline hardware device, without the need for an
one of the most common and “comforting” devices in everyday life, internet connection. This makes our projects portable and integrable
the remote control. At the end of the project, you’ll have a lot of fun in various contexts. Google adds the term no-code to its platform,
turning on the TV set with the “Jedi force” of palm opening! meaning it provides a system that requires little programming knowl-
edge to achieve its goal.
The approach of the project is playful, but it is intended to be a gateway
to the use of AI systems by everyone, in this case aimed at creating A concept we are familiar with from the Arduino universe, which
gestural HMI. disclosed the world of electronics and code writing even to those
who did not have the basics. MediaPipe also aims in this direction,
Software proposing in a simple way an originally very complex topic like AI.
AI is a field of computer science that focuses on developing systems
and technologies that can simulate human intelligence processes, Let’s see its potential at MediaPipe Studio gesture recognition webpage
i.e., think and solve problems that we humans are used to. Machine [2]. We need to log in with a Google account, allowing the browser
learning (ML), on the other hand, is a fundamental subset of AI that to use the webcam. We frame our hand, it doesn’t matter whether left
studies how to make a computer system learn from past data to make or right, as it also identifies which one it is, and perform one of the
predictions or decisions, without being explicitly programmed to do so. following gestures:

The first step in ML is the acquisition of data, which can be of various 1 - Fist
types, such as text, images, sounds, or numbers. They can come from 2 - Open palm
sensors, databases, or even social media. The importance of quality data 3 - Index finger pointing up
is critical in determining the success of an ML model. ML algorithms, 4 - Thumb pointing up
on the other hand, are the tools that enable computer systems to 5 - Thumb down
learn from data. There are various types of algorithms, each of which 6 - Victory symbol with two fingers
is suited to specific tasks. For example, regression algorithms can be 7 - I love you in the language of gestures (final position).
used to make predictions based on historical data, while classification
algorithms are useful for assigning categories to data. The page will show, in real time and overlaid on the video, 21
key palm points connected by colored segments, as visible in Figure 1.
Next comes the process of training an ML system (algorithm + data), The key points are also referred to as landmarks and represent the
which involves feeding the algorithm with labeled data; that is, data significant parts of the hands, such as fingertips, thumbs, palms, and
that already has correct answers associated with it. The algorithm then so on. Precise tracking of these landmarks provides insight into the
uses this data to learn the relationships. This step requires a certain pose and movements of hands within an application (Figure 2).
amount of time and computational resources, but it is critical to the
creation of accurate models. On the web page, below the video frame, there will also be a range of
additional information, such as the percentage of confidence in having
Once trained, the model must be evaluated to determine how well recognized the gesture performed and, of course, the type of gesture.
it performs on data that are not present in it. This step is crucial to MediaPipe then offers a solution called Hand Tracking that enables
understand whether the model can generalize well beyond the data real-time hand recognition and tracking within a video stream. This
with which it was trained. If the model does not meet the expected module of MediaPipe has been named HandLandmarks accordingly.
performance, it may need to be optimized by adjusting various param- The module begins by detecting the presence of hands in the video
eters or using tuning techniques. This process is known as model frame and identifies the regions of the image that contain them. Once
optimization and may require some experimentation to find the optimal detected, it begins tracking hand landmarks.
combination of parameters.
With the landmarks identified, the module can estimate the pose of
MediaPipe the hands within the video frame. This includes information such as
This big job of algorithm creation, training and optimization is provided hand orientation, finger direction, and other details that can be used
as Open Source by Google with the mighty MediaPipe platform. to interpret gestures. MediaPipe is based on TensorFlow lite, i.e., the
The meaning of the term MediaPipe is related to the concept of large ML platform (also from Google), but differs from it in that it is
media pipeline. already pre-trained. For example, gesture recognition takes advantage

Bonus Guest-Edited AI Edition 35


J1
1 2 LED1
3 4
5 6
TSAL7600
U1 1 7 8
9 10 Q1
R1
2 11 12
S 390Ω
13 14
15 16 2N3904
IR38DM 3

240433-002

Figure 3: Schematic of the simple, plug-in IR Rx-Tx interface. Figure 4: The small IR interface board, mounted on Raspberry Pi 5.

of about 30,000 images taken from the real world. You can also train You must now download the data model for MediaPipe gesture recog-
the system yourself, with images of other gestures, by following the nition at the link [5]. Place it in the same folder where you will create
tutorial at [3]. the Python program.

Have fun exploring the other ML systems provided by MediaPipe such The second Python library we will use is OpenCV (Open Source
as image classification, object or face detection. The documentation Computer Vision Library), used for computer vision and image process-
therein will allow you to delve into the topics of most interest. MediaPipe ing. OpenCV provides a wide range of features for image analysis and
is also multi-platform; in fact, you can create projects for Android, iOS manipulation, pattern recognition (recurring patterns or regularities
and Web (JavaScript). In our project we will use Python, i.e. one of the within a data set), object tracking, computer vision, and much more.
most popular programming languages in the ML field (and beyond)
for several reasons: its ease of use, the intuitive syntax — and the Let’s install with pip install opencv-python. We have every-
wide range of educational resources and libraries available — make thing to try out on our stand-alone system (application or system
it an excellent choice for beginners and programming experts alike. that can run independently). If you are already a Python developer,
use the editor you are used to — we used Geany — already installed
One article would not even suffice as a primer for learning the big world on Raspberry OS. In Listing 1, you will find the program you need
of TensorFlow, MediaPipe and Python. But we would like you to use it to write on the editor commented and explained in detail. Run it
to understand its capabilities and to enable you to direct your study (airplane icon in Geany). A new window will then open with the live
of indispensable topics in present and future computing. video stream and hand landmark. The recognized gesture will appear
in the editor terminal.
MediaPipe on Raspberry Pi
Let’s start practically, by installing MediaPipe on our Raspberry Pi 5 Note how in the match...case section we have left as a comment (in
so that we can use it on-device right away. Connect to your board as Python, with the # symbol at the beginning of the line) the os.system
best you are used to, although we recommend VNC, for simplicity and instructions, i.e., those operating system commands that will allow
power of use [4]. Python is native in the Raspberry Pi operating system. sending the IR signals, which we will make operational after dealing
Take administrator rights with the sudo bash command and make with the hardware aspect.
sure you have everything updated with apt update and apt upgrade.
Acquiring and Sending IR Signals
Install the MediaPipe library for Python with the terminal command For learning and sending the infrared (IR) signals, we will make a
pip install mediapipe. In Python, pip is a package management simple interface — whose schematic is shown in Figure 3 — with a
tool that makes it easy to install, manage, and update external librar- tiny PCB housing, an IR receiver and an IR transmitter LED. With a
ies and frameworks. convenient plug, it will directly plug into the Raspberry Pi GPIO header,
as illustrated in Figure 4.
The name pip is a recursive acronym that stands for Python Installs
Packages. Some versions of the Raspberry Pi operating system may For image capture, we’ll use a USB webcam connected to Raspberry Pi.
give a package installation error; if so, clear the external package The design is perfectly compatible with whatever cam you have for
management with the following command rm /usr/lib/python3.*/ your board. To give support stability to the PCB, we used the first
EXTERNALLY-MANAGED, and re-run pip. 16 pins (numbering from 1 → 3.3 V to 16 → GPIO 23), see Figure 5.

36 www.elektormagazine.com
Figure 5: Raspberry Pi 5 GPIO’s pinout. (Source: https://tinyurl.com/5dpvj5ne)

Actually connected are only four pins: nano /boot/firmware/conFiguratxt


(pay attention to the correct patch)
> Pin 2 → Vcc +5 V
> Pin 6 → GND Remove the comments (again as in Python the # character) to enable
> Pin 11 → GPIO 17 for the IR receiver the following lines:
> Pin 12 → GPIO 18 for the IR transmitter
# Additional overlays and parameters are documented:
Q1 transistor allows the IR LED to be powered at 5 V DC, increasing its dtoverlay=gpio-ir,gpio_pin=17
emitting power and providing a limited current on the Raspberry Pi’s dtoverlay=gpio-ir-tx,gpio_pin=18
GPIO, which output 3.3 V DC. The transmitter used is a TSAL7600 by
Vishay Semiconductors, a high radiating power 940 nm IR diode in a On some versions of RaspberryOS you might not find these lines at
clear plastic case. If you have some old remote control available, you all; in this case you simply have to write them yourself. Doing this way,
can also try using its IR LED. we are asking the operating system to set pin 12 (GPIO18) as the IR
transmitter and pin 11 (GPIO17) as the IR receiver.
The receiver is an IR38DM (also available as MIM-5385K2 by Unity
Opto Technology), a very sensitive IR sensor with preamplifier, demod- This operation is possible because these features are native in the
ulator, and filter, calibrated to the frequency of 38 kHz (600 µs burst/ Linux kernel. Reboot to make the configurations effective. Now we
pause) with built-in amplifier/squarer (Figure 6). need to install a key feature to implement our system.

The approach used is to store on Raspberry Pi the signal decoded by


the receiver, and then send it back out with the transmitter, matching
each gesture with an output signal.

The decoding done by the sensor and an additional library installed


on the board will allow us to have a sequence of numbers, which we
will store in simple text files, for each remote control button we would
like to implement.

Raspberry Pi has native functionality to enable the transmission and


reception of IR signal files. We open for editing the file /boot/firmware/
conFiguratxt.

For those unfamiliar with RaspberryOS, we recommend that all file


editing instructions be done with the nano system editor. This, unlike
GUI editors, when opened from the terminal with administrator rights
(sudo bash) allows opening, editing and saving all types of files,
including system files. So from the terminal type: Figure 6: The PCB with TX LED, boost transistor and RX module on the right.

Bonus Guest-Edited AI Edition 37


Listing 1: The Python code with the loop for the gesture recognition.
# Import of the necessary libraries
import os
import cv2
import mediapipe as mp
from mediapipe.tasks import python
# Maximum number of hands to be detected and path of gesture recognition model
numero_mani = 1
model_path = "gesture_recognizer.task"
# MediaPipe library inizialization
GestureRecognizer = mp.tasks.vision.GestureRecognizer
GestureRecognizerOptions = mp.tasks.vision.GestureRecognizerOptions
GestureRecognizerResult = mp.tasks.vision.GestureRecognizerResult
VisionRunningMode = mp.tasks.vision.RunningMode

# Variable to store the last gesture recognized


last_gesture = None
# Function to print the result of gesture recognition
def print_result(result: GestureRecognizerResult, output_image: mp.Image, timestamp_ms: int):
global last_gesture

for single_hand_gesture_data in result.gestures:


gesture_name = single_hand_gesture_data[0].category_name
# Checks if the recognized gesture is different from the last detected gesture
# Used to give an ir inpulse after each gesture
if gesture_name != last_gesture:
last_gesture = gesture_name
# Prints the new recognized gesture
print("Nuovo gesto riconosciuto:", gesture_name)
# Correspondences between the recognized gesture and the actions to be performed
# When you have ir commands available uncomment the os.system instruction
match gesture_name:
case "Open_Palm":
print("palmo aperto")
# os.system('ir-ctl -d /dev/lirc0 --send=on_off.txt')
case "Thumb_Up":
print("pollice su")
# os.system('ir-ctl -d /dev/lirc0 --send=volume_su.txt')
case "Thumb_Down":
print("pollice giu")
# os.system('ir-ctl -d /dev/lirc0 --send=volume_giu.txt')
case "Pointing_Up":
print("dito in su")
# os.system('ir-ctl -d /dev/lirc0 --send=canali_avanti.txt')
case "Victory":
print("vittoria")
# os.system('ir-ctl -d /dev/lirc0 --send=canali_indietro.txt')
# Options for the gesture recognizer
options = GestureRecognizerOptions(
base_options=python.BaseOptions(model_asset_path=model_path),
running_mode=VisionRunningMode.LIVE_STREAM,
num_hands = numero_mani,
result_callback=print_result)

38 www.elektormagazine.com
# Creating the gesture recognizer
recognizer = GestureRecognizer.create_from_options(options)
timestamp = 0
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
# Initialization of the hand recognizer
hands = mp_hands.Hands(
static_image_mode=False,
max_num_hands=numero_mani,
min_detection_confidence=0.65,
min_tracking_confidence=0.65)
# Initializing webcam video capture
# If you have multiple video input devices connected to Raspberry
# you need to type the correct number in place of 0
cap = cv2.VideoCapture(0)
# Main program cycle
while True:
# Capturing a frame by the webcam
ret, frame = cap.read()
if not ret:
break

# Frame horizontal flip


frame = cv2.flip(frame, 1)
# Frame conversion BGR to RGB (MediaPipe compatible)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Frame processing for hand detection
results = hands.process(frame)
# Frame conversion from RGB to BGR for visualization
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
# Creating a numpy array with the frame converted to RGB
np_array = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

# If hands are detected in the frame


if results.multi_hand_landmarks:
for hand_landmarks in results.multi_hand_landmarks:
# Drawing of hand landmarks on the frame
mp_drawing.draw_landmarks(frame, hand_landmarks, mp_hands.HAND_CONNECTIONS)
# Creation of an Image type object compatible with MediaPipe

mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=np_array)


# Asynchronous gesture recognition on the hand
recognizer.recognize_async(mp_image, timestamp)
timestamp = timestamp + 1 # Must monotonously increase in LIVE_STREAM mode

# Shows the frame with the detected gestures


cv2.imshow('Riconoscimento Gestuale’, frame)

# If the Esc key is pressed, stop the cycle


if cv2.waitKey(1) & 0xFF == 27:
break
# Release the video capture and close all windows
cap.release()
cv2.destroyAllWindows()

Bonus Guest-Edited AI Edition 39


Figure 7: Received signal from remote control, related to on-off button
in mode2 encoding. (Source: RealVNC www.realvnc.com/en/)

From the terminal:

apt install v4l-utils

The v4l-utils is an open-source utilities package


designed to work with Linux video devices (V4L,
Video for Linux). V4L is a Linux kernel subsystem
that allows applications to interact with video devices,
such as webcams, TV tuners, video capture cards and,
of course, IR signals.

The v4l-utils utilities provide a set of tools to config- Figure 8: Recording and sending the other IR signals from the remote control.
ure, control, and manage these devices. In Listing 1, (Source: RealVNC www.realvnc.com/en/)
you noticed that the ir-ctl instruction is associated
with the os.system command (i.e., a Python instruction that directly transmission, and it is also easy to identify because it’s quite a large
executes a feature belonging to the system). number, compared to the others.

It is one of the utilities within v4l-utils that allows you to control IR Save the file and return to the terminal (ctrl+x ; yes). Direct the trans-
devices. With ir-ctl, you can send and receive infrared signals. In mitter to the TV and write from the terminal:
the /dev/ directory are lirc0 file for sending signals and lirc1 file for
transmitting, which are features derived from the LIRC package, now ir-ctl -d /dev/lirc0 --send=on_off.txt
integrated into the OS kernel in the latest versions of Linux. To learn
more about, you may pop by here [6]. If everything worked, your TV will have turned on “by magic” (or off,
if it was already on). Perform the same procedure for the other keys,
Put it to the test now, by writing: as illustrated in Figure 8. You can, of course, change the matches as
you wish. Those for our project are shown in Table 1.
ir-ctl -d /dev/lirc1 --receive=on_off.txt
We recommend placing the Python file, MediaPipe template gesture_
The terminal will remain waiting for events. Take the remote control recognizer.task and txt files in the main home folder (in our project,
you want to “clone”, press the on_off button while directing it to the /home/admin).
IR receiver. Try to press it quickly, and only once, so as not to send
too many codes at the same time. Press ctrl+c to end the acquisition. Run the Python file, and place your hand in the webcam frame. Alter-
Analyze with nano the on_off.txt file created. nate the gesture commands with the fist — which has no matched
instructions — so that you can discriminate them properly. Figures 9a
The file should appear as in Figure 7. The received number sequence to 9d show the system at work, recognizing the finger pointing up (9a),
is in mode2 which is a specific type of encoding of the captured IR open palm (9b), thumb down (9c) and thumb up (9d).
signals. Each pair of numbers represents the pulse lengths (+, or
pulse) and the intervals between pulses (-, or space). Mode2 is also While you were controlling your device by opening your palm, didn’t
a feature of lirc, as already mentioned now integrated into the OS. To you feel like a Jedi, at least for a while?
know more, you may visit [7].

If you have pressed the on_off key for too long, you may have stored Table 1: Hand gesture correspondences with TV commands.
multiple lines of mode2 codes. You will then have to delete those that
repeat. In fact, the first line of the encoding is enough; the others are Hand Gesture TV Command txt File
practically repetitions of the received encoding (actually, you can see Palm Open On-Off on_off.txt
the similarity between the lines). Thumb Up Volume Up volume_su.txt
Thumb Down Volume Down volume_giu.txt
After deleting the unnecessary lines, go to the end of the first one
and delete the last value, which represents the timeout between Finger Pointing Up Channel Fwd canali_avanti.txt
signal sendings (between lines). This value is not needed in the Victory Sign Channel Rev canali_indietro.txt

40 www.elektormagazine.com
a b

c d

Figure 9: These four images show the main gestures recognized by the system. On the right of each one, you may read the recognition sequences, that vary
according to the outcome of the process. (Source: RealVNC www.realvnc.com/en/)

Further Applications Questions or Comments?


We have begun to explore the world of artificial intelligence and Do you have technical questions or comments about this article?
machine learning through a simple project, which nonetheless can You may write to the editorial team of Elektor at [email protected].
enable the construction of a course of study in a new and fascinating
field, towards which modern technology is rapidly heading. Also in the
maker field, Raspberry Pi offers the possibility of replacing our PCB
with any output device, allowing us to control, for example, any kind
Related Products
of electrical devices in our home.
> Raspberry Pi 5 (8 GB RAM)
A downloadable set of files for SW and PCB layouts for this project is www.elektor.com/20599
available at the Elektor Labs webpage [8].
240433-01
> Active Cooler for Raspberry Pi 5
www.elektor.com/20604

WEB LINKS
[1] European Safety Transport Council on EuroNCAP: https://tinyurl.com/3rs8z9cv
[2] MediaPipe Studio gesture recognition webpage: https://tinyurl.com/44jxnep8
[3] MediaPipe customization guide: https://tinyurl.com/y9bbpu5h
[4] RealVNC VNC viewer download page: https://tinyurl.com/3dvhjfru
[5] MediaPipe gesture recognition task download: https://tinyurl.com/4xsrfz8z
[6] LIRC webpage: https://lirc.org/
[7] Ubuntu webpage for ir-ctl tool usage: https://tinyurl.com/68xpjd22
[8] Elektor Labs webpage for this article: https://www.elektormagazine.com/labs/ai-based-universal-ir-remote-control

Bonus Guest-Edited AI Edition 41


IMAGE GENERATION

AI
for Product
Concept Design
A Tour of the World of AI-Based Art Generators
Figure 1: Rendering of a Hi-Fi amplifier
created with Midjourney by the author.

By Edwin van den Oetelaar (The Netherlands)

Over the past year, AI for image creation lightning speed. New online services and models appear every
has taken a huge leap, making this week. Image quality is improving by leaps and bounds. There now
seems to be a product for everything.
technology accessible to everyone. Does
this give electronics hobbyists and creators Convenience serves man — if you can’t come up with a prompt
a powerful new tool? A few sketches and a yourself or aren’t creative, there is a paid service that will help
you with sample prompts, styles and specific templates for every
well-formulated text prompt are all it takes challenge, such as logo design, color palettes, app designs and
to get a photorealistic representation of our fashion design. Everyone seems to be jumping on this train, and
ideas. But is it really that simple? And what commercial parties are integrating AI into their existing services.
In addition to these online services, more and better offline models
use is it, in practice? and tools are becoming available, such as Flux-1-Schnell and
Stable Diffusion mentioned above.

Since the advent of AI, I have always been truly interested in its Many photorealistic portraits created with these generators are
creative capabilities, and immediately wanted to try the new tools barely distinguishable from real photographs, even to practiced
made available on the Web, such as Midjourney, Stable Diffusion, eyes. Effects that were difficult to realize just a few weeks ago —
Freepik Sketch, and Dall-E 3.0. In this article, I would like to give you such as text in images — are now no longer a problem. Distorted
an opinion on them, although this list is not exhaustive and at the limbs became rare.
time of publication may be already out of date. In my experiments,
I tried to create a design concept for an audio amplifier that might AI offers a new source of inspiration. With simple textual input,
look beautiful. Using a combination of sketches, photos of exist- AI can generate different variations of a design, which can lead
ing devices and directed prompts, I tried to bring my vision to life to unexpected ideas. Tools such as Midjourney and Stable Diffu-
using Midjourney and other tools. Along the way, I’ll explain jargon sion XL allow users to create multiple mockups from a sketch or
terms such as prompt-engineering, inpainting, and style-transfer. prompt, which helps discover design options that might other-
wise be overlooked.
Moving at Lightning Speed
If I were to start from an initial observation, I would have to say Figure 1 shows a rendering of a Hi-Fi amplifier created with
that developments in Gen-AI image generation are moving at Midjourney. (Refer to text box Get Started with Midjourney.)

42 www.elektormagazine.com
Get Started with Midjourney
How to get started with Midjourney: a one-click roadmap! variations can be addictive, just like other online activities. Each
time you view a new variation, you get a dopamine kick, similar
> Go to Midjourney’s official website [1]. to what you experience when gaming or gambling.
> Click “Sign In” to log in with your Discord account or
Google account. Limitations, Mediocrity
> That’s all. Gen-AI such as Midjourney and Stable Diffusion work from a large
data set of existing images. AI combines elements from this data
to create a kind of “average” view. This can make it feel that truly
new images are difficult to create, since Gen-AI always falls back
Prompt Engineering on what it has “seen” before.
Prompt engineering is the targeted formulation of text commands
to guide Gen-AI, such as Midjourney and Stable Diffusion, in creat-
ing images. In the context of product design, this means using
precise words and descriptions to direct the AI to generate exactly
the desired shapes, styles and details. It’s all about precision in your
task, so that the Gen-AI creates images that match your vision.
This can be tricky, since the same prompt always yields different
variants, as shown in the four examples on Figure 2. This is because
AI uses a random number, called seed, which you can also fix with
Stable Diffusion.

A common use of ChatGPT (also a Gen-AI) is to generate prompts.


You can ask ChatGPT how best to set up a prompt, such as for
Midjourney. You will then get an explanation of how such a prompt
is constructed, weighting factors, flags, etc., with which you can
further experiment and iterate.

The Ease of Editing and Refining


A major advantage of Gen-AI is that modifying or deleting exist-
ing ideas is much easier than starting from scratch. This iterative
process allows designers to quickly explore different options. This
fits well with the modus operandi of many young hobbyists: try
something out first, then tweak it, where the quick result is a thrill.
Selectively removing elements from a generated image and then Figure 2: The same prompt produced four different variants of amplifier.
having it re-generated is called selective inpainting. Figure 3 shows
an example of this technique.

Limitations of Fun Graphics


Whether it is Gen-AI, 3D printing or laser cutting, there are often
countless iterations without regard to cost. It’s fun and fast, but
without a clear vision of the design, and without the right dimen-
sions and materials to match the function, you’ll get nowhere.
Thinking through what you want in advance, thinking through
the use cases and planning, is essential to working efficiently and
purposefully. You can’t give engineering parameters without design-
rules, materials, dimensions, without respecting any criteria or
logic.

The Addiction Factor, Keep Varying!


When you see what people generate with Midjourney, it seems like
it’s more of a game than a tool. People keep endlessly creating new
variations, hoping that a masterpiece will spontaneously emerge.
You can spend an entire evening trying out styles of photogra-
phers and artists like this. For hobbyists without time constraints, Figure 3: Application of the selective inpainting technique, to remove an
such as those in their attic, the endless generation of iterations and unwanted part from the generated image.

Bonus Guest-Edited AI Edition 43


Figure 4: Example of
AI-generated image that
comes from the blending
and the interpretation of
the two source images.

Smart prompt engineering allows users to force unique and surpris- Cost and Accessibility
ing combinations. The power of AI lies precisely in combining Traditional product design can be time-consuming and expensive,
elements in unexpected ways, creating images that feel original especially for hobbyists working with limited resources. Gen-AI
and different, even when based on existing data. While AI cannot tools significantly lower this barrier by making it possible to gener-
create entirely new things from scratch, it can produce results that ate designs quickly and inexpensively. Instead of spending hours
are perceived as unique because of the way it reinterprets famil- sketching and modeling, designers can now create dozens of images
iar elements. within minutes.

Using Your Own Images The availability of affordable or free Gen-AI makes this technol-
Incorporating your own photos and images into the AI design ogy accessible to a wide audience. Tools like OpenAI’s DALL-E
process can significantly improve results. By uploading images of (via ChatGPT website) and Flux or Stable Diffusion (via poe.com)
existing designs or inspiring objects, the Gen-AI can generate more offer even free access to basic functions, allowing hobbyists to get
specific and relevant designs. In Midjourney, you can upload and started in no time.
merge multiple images via the /blend function and also combine
them with a prompt, as shown on Figure 4, which illustrates the For makers, it may not be worth learning all the ins and outs of
merge of two images into a final one. GenAI tools. These tools change quickly and become obsolete at the
same pace. In addition, creating graphics is often not up the alley
Use of Weighting Factors and Style References in of electronics engineers, who are more focused on function than
Prompts form. Look around you for people whose hobby is GenAI-prompt-
Weighting factors in prompts can be used to emphasize certain ing, just as you have your own hobby. Collaborating with them can
elements of the design. This provides more control over the result be not only enjoyable, but also mutually instructive.
and helps create designs that more accurately reflect the intended
vision. You can use :: and numeric values for this purpose. Overview of Online AI Art Generators
Bing Image Creator
One example in Midjourney: If you want the AI to emphasize a > AI art model: DALL-E 3.
device in the foreground and not in the background, you can do > Platform: Web.
this with a prompt such as: > Cost: Free of charge.

/imagine a high-tech speaker on a table in a modern Bing Image Creator is the result of the collaboration between Micro-
living room, clean design, minimalist ::2 background soft and OpenAI. It uses the latest DALL-E model, DALL-E 3, and
blurred ::0.5 is currently available for free.

Here minimalist has a weighting factor of 2 compared to the other DALL-E 3 (via ChatGPT)
elements and background blurred just a weighting factor of 0.5. > Platform: Web (via ChatGPT).
> Cost: $20/month as part of ChatGPT Plus.
Style references refer to another image to adopt a specific style. You
do this by using --sref followed by the URL of the reference image. DALL-E 3 is a substantial upgrade over DALL-E 2, especially if you
have a ChatGPT Plus subscription. The results are significantly
In Midjourney, if you want to adopt a specific style of an image, better, and you have more control by combining it with ChatGPT.
use, for example:
/imagine futuristic device with blue accents --sref Canva
https://example.com/image.jpg > AI art model: Stable Diffusion.

44 www.elektormagazine.com
> Platform: Web, iOS, Android. > Cost: Free for 25 credits per month; from $5/month for
> Cost: Free; from $12.99/month for Pro with more AI features. 100 credits per month (and included with various Adobe
subscriptions).
Canva recently added a text-to-image art generator. This feature
integrates seamlessly with the rest of the template-based design Although you can use it online, it is now integrated directly into
app, allowing you to add AI-generated art to everything from social Adobe products such as Express and Photoshop.
media posts to birthday cards.
One of Firefly’s best features is the ability to create custom text
NightCafe effects with a written prompt.
> AI art models: Stable Diffusion, DALL-E 2, CLIP-Guided Diffu-
sion, VQGAN-CLIP. Quora Poe
> Platform: Web. A platform, Quora Poe, an application or service created by Quora,
> Cost: From $6/month for 100 credits (good for about 1,240 is available on the Web. This platform allows users to interact with
images per month). various AI models, including ChatGPT and other AI-based chatbots.
On it you can find, among others, FLUX-schnell at [2] and Stable
NightCafe offers additional features such as styles for DALL-E 2 and Diffusion at [3]. There will probably be a limited number of credits,
Stable Diffusion, and allows you to use older generative art models. but you can try them out.

OpenArt Other Online Services


> AI art models: Stable Diffusion, DALL-E 2, and other In my overall tinkering, I’ve also experimented with FreePik [4]. This
open-source models. tool offers an interesting feature: in addition to entering prompts
> Platform: Web. — like Midjourney or Stable Diffusion — you can sketch in real
> Cost: Free for 50 trial credits; from $10/month for 5,000 credits. time. As you draw, the image adapts to your sketch.

Like NightCafe, OpenArt offers additional features for Stable Diffu- What is noticeable, however, is that the image is constantly chang-
sion and DALL-E 2, plus access to additional open-source models. ing, making it difficult to control accurately. Sizing and techni-
You have more control over the specific details of the images you cal precision are lacking in all ImageGen-AI. Figure 5 shows an
generate. OpenArt also offers options such as sketch-to-image and example of rendering: the rendered image on the right is derived
a stock art transformer that adapts stock images to your needs. directly from the (very) rough sketch made by hand on the left.

Adobe FireflyFl FreePik is free for a limited number of actions per day, but if you
> Platform: Web, Adobe Express, Adobe Photoshop, and other really want to get started, a subscription is required. In addition
Adobe tools. to FreePik, there are numerous new online services now available.

Figure 5: AI helps! The


rendered image on the
right has been created
by Freepik starting from
the (very) draft, hand-
made sketch on the left.

Bonus Guest-Edited AI Edition 45


Of course, there are many others on the web: just type: “AI art About the Author
generators” in your search bar, and you’ll discover a world that Ing. Edwin van den Oetelaar is an expert and tech coach at Fontys
you probably weren’t aware of! ICT. He works with students on cool projects like building robots,
self-driving cars, and other electronics. Edwin loves teaching by
Offline Alternatives doing, helping students learn real skills through hands-on projects.
Flux.1-Schnell (I recommend this one): A fast and efficient Whether it’s designing circuits or creating new tech, he enjoys
implementation of Stable Diffusion, designed to run on consumer exploring the latest technologies and sharing his knowledge. In his
hardware. leisure time, he likes experimenting with electronics and keeping up
> PROs: Fast, efficient, and can run on less powerful hardware. with industry trends. For him, learning and creating should be fun,
> CONs: Possibly less customizable than the full Stable Diffu- and he loves helping the next generation of engineers to experi-
sion implementation. ence that too.

To test Flux.1 online or run it at home, visit [5]. Keep in mind


that you will need a powerful video card if you want to install Questions or Comments?
yourself, preferably an Nvidia with at least 12 GB VRAM and many Do you have technical questions or comments about this article?
CUDA cores. The more powerful the card, the less latency you will You may write to the editorial team of Elektor at [email protected].
experience.

Stable Diffusion web UI: if you would like to get started with this Author's Note
one on your own PC, you may take a look at [6]. Again, a powerful Those interested in learning more about AI may read the book,
video card is essential for a smooth operation. Living and Learning With AI, written (in Dutch) by my ICT faculty
colleagues [7].
Technical Limitations of Gen-AI in Design
Technical constraints on form and function make the engineer’s
job both interesting and indispensable. An engineer must consider
a wide range of requirements-from functional performance to
manufacturability, maintainability and recyclability, also known
Related Product
as Design for X (DFx). Gen-AI tools are currently not (yet) able to
provide for this process; while they can quickly generate pretty > D. Situnayake, Jenny Plunkett, AI at the Edge
pictures, the real value of good design lies in the practical appli- (O’Reilly, 2023)
cation of engineering knowledge and experience. www.elektor.com/20465

Future of Gen-AI in Design


New tools are becoming available daily; it feels like an adven-
ture, new discoveries every day. However, the role of the engineer
remains crucial in creating functional and manufacturable designs.
Gen-AI can currently serve primarily as a tool for quickly visualiz-
ing ideas, but the actual design process requires deep collaboration
between the engineer, designer and industrial designer to meet all
the complex requirements. Today’s AI tools do not yet sufficiently
help in this regard, but they can contribute to the creative process
by quickly generating visually appealing concepts. So for now, their
usefulness is limited to this aspect of the design process.
230514-01

WEB LINKS
[1] Midjourney’s official website: https://www.midjourney.com/
[2] FLUX-schnell at Quora Poe website: https://poe.com/FLUX-schnell
[3] Stable Diffusion XL at Quora Poe website: https://poe.com/StableDiffusionXL
[4] Pikaso’s website: https://www.freepik.com/pikaso
[5] Website for Flux.1 testing: https://huggingface.co/black-forest-labs/FLUX.1-schnell
[6] Stable Diffusion on GitHub: https://github.com/AUTOMATIC1111/stable-diffusion-webui
[7] R. Huijts, K. Suilen, D. Bloks, E. Saçan ”Leven en Leren met AI” (Noordhoff Business): https://tinyurl.com/hdej6mpm

46 www.elektormagazine.com
Get your hands on
cutting-edge
AI Hardware!
Raspberry Pi AI Kit Unitree Go2 Pro
The Raspberry Pi AI Kit includes the Raspberry Quadruped Robot
Pi M.2 HAT+ and a Hailo AI acceleration module The Unitree Go2 is a quadruped robot
for use with the Raspberry Pi 5. It provides an designed for the research & develop-
accessible, cost-effective, and power-efficient way ment of autonomous systems in the
to integrate high-performance AI. Explore fields of human-robot interaction (HRI),
applications including process control, security, SLAM & transportation. Due to the four
home automation, and robotics! legs, as well as the 12DOF, this robot can
www.elektor.com/20879 handle a variety of different terrains.
www.elektor.com/20357

Raspberry Pi AI Camera
The Raspberry Pi AI Camera is a
compact camera module based on the
Sony IMX500 Intelligent Vision Sensor.
The IMX500 combines a 12 MP CMOS
image sensor with on-board inferenc-
ing acceleration for various common
neural network models, allowing users
to develop sophisticated vision-based AI
applications without requiring a separate
BeagleY-AI SBC with GPU, accelerator.
DSP and AI Accelerators www.elektor.com/20953
BeagleY-AI is a low-cost, open-source,
Waveshare Jetson Orin Nano
and powerful 64-bit quad-core single-
AI Development Kit
board computer, equipped with a GPU,
This AI Edge Computing Development
DSP, and vision/deep learning accel-
Kit is based on the Jetson Orin Nano
erators, designed for developers and
Module providing rich peripheral inter-
makers. Users can take advantage of
faces such as M.2, DP, USB, etc.
BeagleBoard.org’s provided Debian
The kit also comes with a pre-installed
Linux software images, which include a
AW-CB375NF wireless network card
built-in development environment.
that supports Bluetooth 5.0 and dual-
www.elektor.com/20991
band WIFI, with two additional PCB
antennas, for providing high-speed and
reliable wireless network connection and
Programming Voice-controlled IoT Bluetooth communication.
Applications with Alexa and Raspberry Pi www.elektor.com/20762
This book is divided into two parts: creating Alexa skills
and designing Internet of Things (IoT) devices using a
Raspberry Pi. It covers topics like Alexa skill develop-
ment, in-skill purchasing, and using AWS Lambda, as
well as building smart home devices controlled by Alexa.
Readers also learn about MQTT messaging, creating
proactive notifications, and turning a Raspberry Pi into a
stand-alone Alexa device.
www.elektor.com/20400

Guest-Edited AI Edition 47
Join the
Elektor C mmunity
Take out a G O L D membership

membership!

The Elektor web archive from 1974!


8x Elektor Magazine (print)
8x Elektor Magazine (digital)
10% discount in our web shop and exclusive offers
Access to more than 5,000 Gerber files

Also available The Elektor web archive from 1974!


8x Elektor Magazine (digital)
The Digital G R E E N
membership
10% discount in our web shop and
exclusive offers
membership! Access to more than 5,000 Gerber files

www.elektormagazine.com/member

You might also like