Elektor_Mag_-_January-February_2021

([email protected]) #1

10 January & February 2021 http://www.elektormagazine.com


For our project we need only the ESP32, the display and the recharge-
able battery. The other features are still there, of course, and will no
doubt find a use in other applications.

The display on the M5StickC is small but it shows a sharp and colourful
image. User interface designers will be challenged to display informa-
tion within the small area available. The thermal sensor image works
well on the display and we have a couple of lines available to show
readings as text. The display driver library allows plenty of scope for
fancy graphics, animations and festivals of light and colour: let your
imagination run riot!

The 80 mAh lithium-ion battery can power the M5StickC running flat
out for around an hour. It is charged over a USB-C connector at 5 V
and 500 mA using the cable supplied connected to a standard USB-A
socket. A small button on the side turns the device on, while holding
the button down for six seconds turns it off.

Cooperation
The sensor breakout board is plugged into the external expansion
connector. It can be connected either flat on its back using a right-an-
gled header, or using a straight header to make measurements along
an axis parallel to the longest edge of the device. This allows it to be
‘fired’ at its target (Figure 6). Any 3D-printing wizard should be able
to quickly whip up a neat enclosure for either configuration.

The M5StickC expansion connector has eight connections. We only
use the 5 V output, ground, the two I^2 C pins carrying data and clock
signals (SDA on GPIO26 and SCL on GPIO0), and the INT inter-
rupt signal that we connect to GPIO36. The BAT, 3V3 and 5 V input
connections are unused. Note that GPIO36 can only be used as an
input, a little piece of information that might save you a while in track-
ing down any problems.

Currently, the interrupt feature is not implemented in the software. The
sensor chip is able to generate an INT signal when a specified minimum
or maximum temperature threshold is exceeded. In fact, this can be

of the internal circuitry of the sensor. The free download accompa-
nying this project [9] includes layouts of the two layers of the board
and the component-mounting plan. Those in search of an easy life
can purchase a ready-made module from the author.


M5StickC, the Jack of all trades
Any smartphone with a WiFi interface and a touch screen for input
and output makes a perfect user interface for MTheCam. In order to
use the WiFi interface to communicate with the sensor we equip it
with a ‘smart’ data transmitter comprising of an SoC (system on a
chip) with a microcontroller and a WiFi peripheral.


We decided to use an Espressif ESP32 [4]. This module includes every-
thing a developer’s heart could wish for and it is inexpensive and
power-efficient. Moreover, it supported by the Arduino ecosystem. The
only electronics needed besides the sensor and the ESP module is a
5 V power supply, either from USB or, for mobile use, from a recharge-
able battery. Looking in the Elektor Store our eyes fell upon a product
in a dazzling shade of orange that includes an ESP32 and some other
interesting components, the M5StickC [5], which is perfect for the job.


The M5StickC crams rather a lot into its tiny 50 mm by 26 mm by 14 mm
enclosure. It contains an ESP32-Pico with 4 MB of flash and 520 kB of
SRAM, an 80-by-160 pixel 0.96 inch display, a six-axis motion sensor,
a real-time clock, a power management unit, a red LED, an infrared
LED to allow it to be used as a remote control, a MEMS microphone,
an 80 mAh rechargeable battery, a USB-C port, a Grove connector
(power, ground and two I^2 C ports) and an 8-way header with three
ports and power supply — enough to make even the most jaded
engineer sit up and pay attention!


The small dimensions, display and rechargeable power source mean
that the M5StickC can be used as a rather natty smart watch, for which
a suitably garish strap and mount is included. It certainly makes a
fashion statement as Figure 5 shows! Who needs the boring products
of a certain Californian fruit company to which you can’t even plug
anything in?


R 1
3k

R 2
3k

R 3
3k

R 4
20

C 1

(^1) 16V
C 2
(^1) 16V
C 3
(^1) 16V 5
C 4
(^1) 16V
J 1
1 2 3 4 5 6 7 8
VCC
180337-
Sensor element
Thermistor
I C I/F
AD_SELECT
Selector
AMG
Control DVDD-PC
AVDD-PC
IC
ADC Gain
ROM
amp
SDA
SCL
INT
GND
VPP
VDD
NC
NC
NC
1 0
NC1 1
1 2
1 3
NC1 4
2
1 2 3 4 5 6 7
8
GND^9
EXT_VDD
GPIO
GPIO
GPIO
VBAT_Li_Ion
VESP_3V
VBUS_VIN
To M5Stick-C
expansion
connector
Figure 4: Circuit of the AMG88xx sensor breakout board showing its internal architecture.

Free download pdf