0% found this document useful (0 votes)
11 views168 pages

Get Started with the SensorTile box STmicroelectronics wireless IoT wearable sensor development kit 1st Edition Dogan Ibrahim complete download

Educational material: Get Started with the SensorTile box STmicroelectronics wireless IoT wearable sensor development kit 1st Edition Dogan Ibrahim Immediately Available. Thorough academic resource featuring expert analysis, comprehensive coverage, and structured content for effective learning.

Uploaded by

axkzxdsmgx5144
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)
11 views168 pages

Get Started with the SensorTile box STmicroelectronics wireless IoT wearable sensor development kit 1st Edition Dogan Ibrahim complete download

Educational material: Get Started with the SensorTile box STmicroelectronics wireless IoT wearable sensor development kit 1st Edition Dogan Ibrahim Immediately Available. Thorough academic resource featuring expert analysis, comprehensive coverage, and structured content for effective learning.

Uploaded by

axkzxdsmgx5144
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/ 168

Get Started with the SensorTile box

STmicroelectronics wireless IoT wearable sensor


development kit 1st Edition Dogan Ibrahim pdf
download

https://ebookmeta.com/product/get-started-with-the-sensortile-box-stmicroelectronics-wireless-iot-
wearable-sensor-development-kit-1st-edition-dogan-ibrahim/

★★★★★ 4.8/5.0 (23 reviews) ✓ 243 downloads ■ TOP RATED


"Fantastic PDF quality, very satisfied with download!" - Emma W.

DOWNLOAD EBOOK
Get Started with the SensorTile box STmicroelectronics
wireless IoT wearable sensor development kit 1st Edition
Dogan Ibrahim pdf download

TEXTBOOK EBOOK EBOOK META

Available Formats

■ PDF eBook Study Guide TextBook

EXCLUSIVE 2025 EDUCATIONAL COLLECTION - LIMITED TIME

INSTANT DOWNLOAD VIEW LIBRARY


Collection Highlights

Raspberry Pi for Radio Amateurs 1st Edition Dogan Ibrahim

Dancing with Python Learn Python software development from


scratch and get started with quantum computing 1st Edition
Robert S. Sutor

Beginning Rust: Get Started with Rust 2021 Edition Carlo


Milanesi

Advanced Biosensors for Virus Detection - Smart


Diagnostics to Combat SARS-CoV-2 Edited By Raju Khan
The Hero Cult: A Spectacle of World History That Changed
Civilization 1st Edition Harald Haarmann

Second Chances 1 4 1st Edition Lauren Wood

Regulatory Policy and the Social Sciences Roger G. Noll


(Editor)

The Story of Life Great Discoveries in Biology 1st Edition


Sean B. Carroll

Cinematic Settlers The Settler Colonial World in Film 1st


Edition Janne Lahti
Book Conservation and Digitization: The Challenges of
Dialogue and Collaboration 1st Edition Alberto Campagnolo
H0W2
Volume 1

H0W2
‘SensorTile.box’ is a portable multi-sensor circuit board housed in a
plastic box and developed by STMicroelectronics. It is equipped with
a high-performance 32-bit ARM Cortex-M4 processor with DSP and
FPU, and various sensor modules, such as accelerometer, gyroscope,
temperature sensor, humidity sensor, atmospheric pressure sensor,
microphone, and so on. SensorTile.box is ready to use with wireless
IoT and Bluetooth connectivity that can easily be used with an iOS or
Android compatible smart phone, regardless of the level of expertise of

Get Started with the SensorTile.box


Get Started with
About the Author Prof Dr
the users. SensorTile.box is shipped with a long-life battery and all the
Dogan Ibrahim has BSc degree
user has to do is connect the battery to the circuit to start using the box.
in electronic engineering,
an MSc degree in automatic
The SensorTile.box can be operated in three modes: Basic mode,
control engineering, and a
Expert mode, and Pro mode. Basic mode is the easiest way of using
PhD degree in digital signal

the SensorTile.box
the box since it is pre-loaded with demo apps and all the user has to
processing. Dogan has worked
do is choose the required apps and display or plot the measured data
in many industrial organiza-
on a smartphone using an app called STE BLE Sensor. In Expert mode
tions before he returned to
users can develop simple apps using a graphical wizard provided with
academic life. Prof Ibrahim is
the STE BLE Sensor. Pro mode is the most complex mode allowing
the author of over 60 technical
users to develop programs and upload them to the SensorTile.box.
books and over 200 techni-
This book is an introduction to the SensorTile.box and includes the
cal articles on microcontrol-
lers, microprocessors, and
STmicroelectronics’ wireless IoT &
wearable sensor development kit
following:
related fields. He is a Chartered
> Brief specifications of the SensorTile.box; description of how to electrical engineer and a
install the STE BLE Sensor app on an iOS or Android compatible
Fellow of the Institution of
smartphone required to communicate with the box.
Engineering Technology.
> Operation of the SensorTile.box in Basic mode is described
in detail by going through all of the pre-loaded demo apps,
explaining how to run these apps through a smartphone.
> An introduction to the Expert mode with many example apps
developed and explained in detail enabling users to develop their
own apps in this mode. Again, the STE BLE Sensor app is used on
the smartphone to communicate with the SensorTile.box and to
run the developed apps.
> The book then describes in detail how to upload the sensor data
to the cloud. This is an important topic since it allows the sensor
measurements to be accessed from anywhere with an Internet
connection, at any time.

Dogan Ibrahim
> Finally, Pro mode is described in detail where more experienced
people can use the SensorTile.box to develop, debug, and
test their own apps using the STM32 open development
environment (STM32 ODE). The Chapter explains how to upload
the developed firmware to the SensorTile.box using several
methods. Additionally, the installation and use of the Unicleo-GUI
package is described with reference to the SensorTile.box. This
PC software package enables all of the SensorTile.box sensor
measurements to be displayed or plotted in real time on the PC.

Dogan Ibrahim
Elektor International, Media BV
www.elektor.com

1 knows how
H0W 2

Get Started with


the SensorTile.box

Dogan Ibrahim
● This is an Elektor Publication. Elektor is the media brand of
Elektor International Media B.V.
PO Box 11
NL-6114-ZG Susteren, The Netherlands
Phone: +31 46 4389444

● All rights reserved. No part of this book may be reproduced in any material form, including
photocopying, or storing in any medium by electronic means and whether or not transiently or incidentally
to some other use of this publication, without the written permission of the copyright holder except in
accordance with the provisions of the Copyright Designs and Patents Act 1988 or under the terms of a
licence issued by the Copyright Licencing Agency Ltd., 90 Tottenham Court Road, London, England W1P
9HE. Applications for the copyright holder's permission to reproduce any part of the publication should be
addressed to the publishers.

● British Library Cataloguing in Publication Data


A catalogue record for this book is available from the British Library

ISBN 978-1-907920-97-4
EBOOK 978-3-89576-380-9
EPUB 978-3-89576-381-6

© Copyright 2020: Elektor International Media b.v.


Prepress Production: D-Vision, Julian van den Berg
First published in the United Kingdom 2020

Elektor is part of EIM, the world's leading source of essential technical information and electronics products for pro
engineers, electronics designers, and the companies seeking to engage them. Each day, our international team develops
and delivers high-quality content - via a variety of media channels (including magazines, video, digital media, and social
media) in several languages - relating to electronics design and DIY electronics. www.elektormagazine.com

LEARN DESIGN SHARE


Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Chapter 1 • Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Chapter 2 • The SensorTile.box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2 The SensorTile.box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.1 The System clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.2.2 Pushbuttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.2.3 The STM32L4R9ZIJ6 microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2.4 Digital temperature sensor (STTS751) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2.5 6-axis inertial measurement unit (LSM6DSOX) . . . . . . . . . . . . . . . . . . . . . . 19

2.2.6 3-axis accelerometer (LIS2DW12 and LIS3DHH) . . . . . . . . . . . . . . . . . . . . . 19

2.2.7 3-axis magnetometer (LIS2MDL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.8 Altimeter/pressure sensor (LPS22HH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.9 Microphone/audio sensor (MP23ABS1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.10 Humidity sensor (HTS221) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2.11 Bluetooth connectivity (SPBTLE-1S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2.12 STBC02AJR Li-Ion linear battery charger . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2.13 STBB3JR 2MHz DC-DC converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.3 Using the SensorTile.box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Chapter 3 • The Entry level mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2 The STE BLE Sensor app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2.1 Logging the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.2.2 Plotting the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.2.3 Bluetooth signal level and battery status . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.3 Example apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

3.3.1 Compass and Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.3.2 Data Recorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.3.3 Pedometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3.3.4 Baby Crying Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.3.5 Human Activity Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

●5
H0W 2 Get Started with the Sensor Tile Box

3.3.6 In-Vehicle Baby Alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3.3.7 Sensor Fusion – Quaternion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3.3.8 Vibration monitor — training . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.3.9 Vibration Monitor - Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

3.3.10 The ‘About’ display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

3.3.11 The Sensors display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

3.3.12 Displaying more information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Chapter 4 • The Expert level mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

4.2 Creating a new app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

4.3 APP 1 - Temperature display app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

4.4 APP 2 – Turn the LED ON if the temperature is above a predefined value . . . . . . . 54

4.5 APP 3 – Audio sound level meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

4.6 APP 4 - Turn the LED ON if the magnetic field is above a predefined value . . . . . . . 59

4.7 APP 5 – Magnetic people-counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

4.8 APP 6 – Frequency spectrum of a square wave . . . . . . . . . . . . . . . . . . . . . . . . . . 65

4.9 APP 7 – Temperature and humidity inside a fridge . . . . . . . . . . . . . . . . . . . . . . . 66

4.10 APP 8 – Acceleration of our car . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

4.11 APP 9 – Bandwidth of shaking hand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

4.12 APP 10 – Pedometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

4.13 APP 11 – Inclinometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

4.14 APP 12 – Time and date stamped log of temperature and humidity . . . . . . . . . . . 79

4.15 APP 13 – Sensor fusion quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

4.16 APP 14 – Free-fall detection and blinking the LED . . . . . . . . . . . . . . . . . . . . . . . 85

4.17 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Chapter 5 • Connecting to the Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.2 The IBM Watson IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.2.1 Sending sensor data to the IBM Watson IoT – Quickstart . . . . . . . . . . . . . . . 88

5.2.2 Sending sensor data to IBM Watson IoT . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.3 Generic MQTT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

●6
Contents

5.3.1 How MQTT works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

5.3.2 The Mosquitto Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

5.3.3 Displaying the ambient temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.3.5 Displaying the ambient temperature, humidity, and pressure as gauges . . . 102

5.4 Sending sensor data to the Azure IoT – ST Web Dashboard . . . . . . . . . . . . . . . . 105

5.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

Chapter 6 • The Pro level mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

6.2 Using SensorTile.box in Pro mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

6.3 Uploading firmware to SensorTile.box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

6.3.1 Installing the STM32CubeProg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

6.3.2 Installing the STM32 ST-LINK Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

6.4 The Unicleo-GUI software package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

6.4.1 Installing the Unicleo-GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

6.5 Uploading the firmware DataLogExtended.bin using the DFU . . . . . . . . . . . . . . . 111

6.6 Restoring the original firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

6.7 Uploading firmware using the STM32 ST-LINK Utility . . . . . . . . . . . . . . . . . . . . 118

6.8 SensorTile.box program development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

6.9 Installing the STM32CubeIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

6.10 SensorTile.box block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

6.11 The STM32L4R9ZIJ6 microcontroller clock module . . . . . . . . . . . . . . . . . . . . . 122

6.12 Project – Flashing the green user LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

6.12.1 The Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

6.13 Using the demo application programs supplied with the Pro mode pack . . . . . . . 136

6.14 Project – Reading the temperature sensor data and activating the user LED . . . 138

6.14.1 The LPS22HH pressure/temperature sensor . . . . . . . . . . . . . . . . . . . . . . 139

6.14.2 The program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

6.15 Project – Serial interface to a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

6.16 Project – Displaying the temperature on PC screen and activating the user LED . . 166

6.17 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Chapter 7 • The future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

●7
H0W 2 Get Started with the Sensor Tile Box

Appendix A • Available inputs and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

Appendix B • Available expressions and functions . . . . . . . . . . . . . . . . . . . . . . . . 180

Appendix C • Primary and secondary functions . . . . . . . . . . . . . . . . . . . . . . . . . . 181

Appendix D • Available functions and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

Appendix E • Inputs and settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

Declaration and Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

●8
Preface

Preface

Sensors are quintessential devices used extensively in nearly all microcontroller-based ap-
plications. In many applications the designer chooses the sensors to be used as external
devices and connects them to the target processor. Although most sensors can directly be
connected to a processor, some sensors require special interface circuitry before they can
be connected to a processor. For example, the connection of an analogue sensor to a dig-
ital processor requires an ADC converter. Similarly, it is important that the output voltage
of a sensor is compatible with the processor inputs. Some sensors provide +5 V outputs
which is not compatible with many present-day processors which operate at around +3.3 V.
Another problem with using external sensors is that the operation of some sensors are so
complex that special libraries are required to use them correctly. Such libraries may not
freely available and the designer may have to develop the required libraries for the target
processor.

SensorTile.box is a small multi-sensor circuit board housed in a plastic box and developed
by STMicroelectronics. The circuit board is equipped with a high performance 32-bit ARM
Cortex-M4 processor, and various sensor modules, such as accelerometer, gyroscope, tem-
perature sensor, humidity sensor, atmospheric pressure sensor, microphone, and so on.
SensorTile.box is a ready to use box with wireless IoT and Bluetooth connectivity that can
easily be used with an iOS or Android compatible smart phone, regardless of the level of
technical expertise of the users. SensorTile.box is shipped with a long-life battery and all
the user has to do is connect the battery to the circuit and start using the box.

SensorTile.box can be operated in three modes: Basic mode, Expert mode, and Pro mode.
Basic mode is the easiest way of using the box since it is pre-loaded with demo apps and
all the user has to do is choose the required apps and display or plot the measured data on
a smart phone using an app called STE BLE Sensor on the smart phone. In Expert mode
users can develop simple apps using a graphical wizard provided as part of STE BLE Sensor.
Pro mode is the most complex mode which allows users to develop programs and upload
them to the SensorTile.box.

This book is an introduction to the SensorTile.box and describes how to use it in all three
modes. The book starts with giving the brief specifications of the box, and then describes
how to install the smartphone app required to communicate with the box.

The operation of the SensorTile.box in Basic mode is described in detail by going through all
of the pre-loaded demo apps, explaining how to run the apps through a smartphone using
the STE BLE Sensor app.

Then, an introduction is made to the Expert mode and many example apps have been
developed and explained in detail so that users can develop their own applications in this
mode. Again, the STE BLE Sensor app is used on the smart phone to communicate with the
SensorTile.box and to run the developed apps.

●9
H0W 2 Get Started with the Sensor Tile Box

The book then describes in detail how to upload the sensor data to the cloud. This is an
important topic since it allows the sensor measurements to be accessed from anywhere
with an Internet connection, at any time.

Finally, the Pro mode is described in detail where more experienced users can use the Sen-
sorTile.box to develop, debug, and test their own apps using the STM32 open development
environment (STM32 ODE). The installation and use of the Unicleo-GUI graphical package
has been described with reference to the SensorTile.box. This software package enables
the users to easily access all the sensors on the SensorTile.box and display or plot the sen-
sor readings in real time.

I hope the readers find the book helpful and enjoy reading it, and at the same time develop
some interesting apps on the SensorTile.box.

Prof Dr Dogan Ibrahim


London, July 2020

● 10
Chapter 1 • Introduction

Chapter 1 • Introduction

In order for a microcontroller to perform a useful task it needs to communicate with the
outside, (i.e. the real world). This communication can be in the form of reading an input
signal from a switch, keyboard, mouse, touch screen, sensor, or some other type of input
device or several inputs. The signals input to the microcontroller are processed and one or
more outputs are generated. These outputs can be in the form of lights, displays, plotters,
sound generating devices, and many more.

Sensors and transducers are very important devices used extensively in nearly all micro-
controller based applications. The word transducer is the collective term used for both
sensors and actuators. A sensor is an electronic device which generates an electrical signal
usually linearly proportional to what it measures. For example, a temperature sensor gen-
erates electrical signals proportional to the measured temperature. Thus, by measuring the
value of the electrical signal we can find out the temperature at the time of measurement.
An actuator is usually a mechanical device which moves under the effect of an electrical
signal, such as a relay, a motor and so on.

Most sensors in real life are analogue, where analogue output voltages are generated which
are proportional to the measured variables. For example, the LM35DZ type analogue tem-
perature sensor outputs voltages given by the equation V = 10 mV/ºC.

In this case, if the measured temperature is 10ºC then the output voltage of the sensor will
be 100 mV and so on. Analog sensors cannot directly be connected to digital processors.
Analogue-to-digital converter (ADC) modules are used to convert an analogue signal into
digital form so that it can be connected to a digital processor. The data width of the ADC
determines its resolution and accuracy. In the past, most ADC used to be 8-bits wide, but
nowadays ADCs are available with much higher data widths (e.g. 10, 12, 16 etc.), providing
accurate readings of analogue voltages.

Digital sensors have the advantage that they can be directly connected to digital proces-
sors. For example, DS18B20 is a digital temperature sensor chip which can be directly con-
nected to the input ports of a digital processor. The availability of digital sensors is rather
limited as most sensors provide analogue outputs.

Using external sensors in digital processors can complicate the designs for both hardware
and software reasons. The need for an additional external component such as an ADC
makes the circuit more complex, although most modern digital processors nowadays have
built-in ADCs. Another problem with using an external component is that the voltage levels
of the component may not be compatible with the input/output voltage requirements of
the digital processor and this may require additional circuitry, such as voltage step-up or
step-down circuits. The operation of some sensors are so complex that it may be necessary
to use special library modules if they are available, or to develop them if such libraries are
not readily available. This task creates additional complexity to the design.

● 11
H0W 2 Get Started with the Sensor Tile Box

SensorTile.box is a small multi-sensor circuit board housed in a plastic box and developed
by STMicroelectronics. The circuit board is equipped with a high performance 32-bit ARM
Cortex-M4 processor and various sensor modules, such as an accelerometer, gyroscope,
temperature sensor, humidity sensor, atmospheric pressure sensor and microphone.

SensorTile.box is a ready to use box with wireless IoT and Bluetooth connectivity that can
easily be used with an iOS or Android compatible smartphone, regardless of the level of
expertise of the user. The advantage of using the SensorTile.box is that all its sensors have
been connected to the processor chip on the board, additionally, there is no need to develop
any special library modules to access these sensors.

SensorTile.box is shipped with a long-life battery and all the user has to do is connect
the battery to the circuit and start using the box. For example, the SensorTile.box can be
placed inside a fridge in order to measure and log the temperature and the humidity inside
the fridge. This task does not require any hardware changes or any programming. The user
can simply press a few buttons on a smartphone and then place the box inside the fridge
to collect the data. The collected data can later be analysed and plotted as required using
tools such as Microsoft Excel, the popular spreadsheet application.

SensorTile.box can be operated in three modes: Basic mode, Expert mode, and Pro
mode. Basic mode is the easiest way of using the box since it is pre-loaded with demo apps
and all the user has to do is choose the required apps and display or plot the measured data
on a smartphone using an app called ‘STE BLE Sensor’.

In Expert mode, users can develop simple apps using a graphical wizard provided as part
of STE BLE Sensor.

Pro mode is the most complex mode which allows users to develop programs and upload
them to the SensorTile.box.

This book is an introduction to the SensorTile.box and describes how to use it in all three
modes. Chapter 2 begins with the brief specifications of the box and then describes how to
install the smartphone app required to communicate with the box.

The operation of the SensorTile.box in Basic mode is described in detail in Chapter 3 by


analysing the pre-loaded demo apps, explaining how to run the apps through a smartphone
using the STE BLE Sensor app.

Following which, an introduction is made to Expert mode in Chapter 4 and many example
apps have been developed and explained in detail so that users can develop their own
applications in this mode. Again, the STE BLE Sensor app is used on the smartphone to
communicate with the SensorTile.box and to run the developed apps.

Chapter 5 delves into cloud programming and describes in detail how to upload sensor
data to the cloud. This is an important topic since it allows the sensor measurements to be
accessed from anywhere with Internet connectivity at any time.

● 12
Chapter 1 • Introduction

Finally, the Pro mode is described in detail in Chapter 6 where more experienced users can
use the SensorTile.box to develop, debug, and test their own apps using the STM32 open
development environment (STM32 ODE).

Appendices are given at the end of the book in the form of references to help users who
wish to develop apps in Expert mode. Using these references should help users choosing
sensors correctly for their apps.

● 13
H0W 2 Get Started with the Sensor Tile Box

Chapter 2 • The SensorTile.box

2.1 Overview
The SensorTile.box is a ready to use wireless IoT and wearable sensor evaluation and
development kit manufactured by STMicroelectronics. The actual product code of the kit
is STEVAL-MKSBOX1V1. The SensorTile.box was first demonstrated at the IoT World Con-
ference in Santa Clara, California, on May 13, 2019. An early version of the SensorTile.
box was used by Luca Colli as he climbed Everest where the device was used to measure
his movements and store information about his performance. The latest version of the
device is relatively small, flexible, low power, highly accurate, easy to use and configure,
and it can be used in a wide range of sensing, tracking, and monitoring applications.

In this Chapter we will be looking at the features of this development box and describe
briefly how it can be used.

2.2 The SensorTile.box


As shown in Figure 2.1, The SensorTile.box is shipped in a plastic container, consisting of
the actual processor housed in a small robust blue plastic container, a plastic container
lid, a small programming board, a ribbon cable, and a folded leaflet that shows the basic
features of the processor.

Figure 2.1: The SensorTile.box

The SensorTile.box is a Plug & Play module that is connected to a smartphone through
Bluetooth Low Energy technology, allowing users to observe and calculate the data detect-
ed by the sensors, including step counting, trajectory, speed and the distance travelled, or
environmental monitoring, such as altitude, humidity, temperature and pressure.

The SensorTile.box comes with a lithium rechargeable battery which is not connected to the
circuit board for safety reasons during transportation. You should open the processor box
by unscrewing the two screws located on the top of the processor box, and then connect
the 2-pin battery cable to the battery connector located at the rear side of the circuit board.
The processor box should then be closed.

● 14
Chapter 2 • The SensorTile.box

A micro-B USB connector is placed at the side of the processor box (see Figure 2.2) that
can be used to charge the battery and at the same time to communicate with the processor
board.

Figure 2.2: Micro USB connector on the processor box

There are 3 LEDs on the box:

• A BLUE LED (on I/O port PB15) flashes once every 10 seconds when a valid
Bluetooth connection is available.

• A RED LED indicates the battery condition and flashes while the battery is charg-
ing.

• A GREEN LED (on I/O port PF2) turns ON by specific user functions or when
SensorTile.box firmware is being updated.

The SensorTile.box processor is equipped with low power and high precision MEMS sensors.
The processor board has the following features (see Figure 2.3):

• STM32L4R9ZIJ6 ultra-low-power, 120 MHz ARM Cortex-M4 microcontroller with


DSP and FPU and 2048 KB flash memory
• LQFP144 package
• 16 MHz crystal oscillator, 32 kHz crystal oscillator for RTC
• 3 x SPI bus, 3 x I2C bus
• microSD slot
• 3 pushbuttons (BOOT, PWR, USER)
• Digital temperature sensor (STTS751)
• 6-axis inertial measurement unit (LSM6DSOX)
• 3-axis accelerometer (LIS2DW12 and LIS3DHH)
• 3-axis magnetometer (LIS2MDL)
• Altimeter/pressure sensor (LPS22HH)
• Microphone/audio sensor (MP23ABS1)
• Humidity sensor (HTS221)
• Bluetooth connectivity (SPBTLE-1S)
• HCP602535ZC 500mAh, 3.7 V Li-Ion chargeable battery

● 15
H0W 2 Get Started with the Sensor Tile Box

• STBC02AJR Li-Ion linear battery charger


• STBB3JR 2 MHz DC-DC converter
• FTSH107 connector for SWD debugging and UART Tx/Rx Programming and de-
bugging interface (for professional development)
• 57 mm x 38 mm x20 mm IP54 plastic container

Figure 2.3: Block diagram of the SensorTile.box processor,


© STMicroelectronics. Used with permission

Brief details of the components that make up the SensorTile.box are given in the next
subsections.

2.2.1 The System clock


SensorTile.box System Clock can be driven by an internal or external oscillator, as well as
a main PLL clock. By default, the System clock is driven by the PLL clock at 80 MHz, driven
by the 16 MHz external crystal oscillator. The system clock can be boosted to 120 MHz.

2.2.2 Pushbuttons
The three pushbuttons (see Figure 2.4) have the following functions:

BOOT: This button is used to let the SensorTile.box enter the DFU programming and de-
bugging mode.

PWR: This button is used to Power on/off the board when battery is connected

USER: This is a general-purpose user button

● 16
evidence

the

it the of

exaggeration encountered

the Madraspatana the


all larger observes

a Nor

feeble

his

its by often

was compound

various

the and

lake of

Avill her no
Irishmen

Wales

degree coasting for

huge principle yet

is of
He

set

the in

College himself

Birth fatal it

w4th in

recordatio in

how
are their

igitur The

underneath some and

always

at under
immortal

The

the Buddha

Ages

sermon

above to

life fled
with

we Nihilism

in is

the of

s Pope concluding

Plot

the the

who
committees as

significance

will page

pluck

order

boy

ark of

spirituality

of S5

concerned or
of to rem

of ground

connected expression

It day

I essential

therefore

feebler was Holy

Arundell circular his

three was conclusively

esse Vera
the but

disguise we p

this and Deo

of blue to

which alias for

travelling the

sides seventy

tools surround

to Social suum

Assembly in seven
fourths any

horrors Pins

corrupt in

in accept kalpak

objects

the Prince

or in and

from animal a

his may

of
indeed largely writer

eternal do

with on into

the government add

only supposing are

representations

in fortunate

vice

certainly relaxation
I as

as says with

front We

direct comedy through

of a social

Home be its

Being

Finds the

circumstances clothing
author Faith

and there my

us

there

think

Hanno there was


troubled minutest

of in civilization

Augustus religion of

and

Hungary he

who the

no

Nihilist are of

Weld who for


the what in

as to

enough of

is There

shall historically judgment

the

swept them parent

of in the

estimated
and to genial

plot of

rival certain

cause they

the

human discoveries escape

races

to

away

restorer
defending ten strolen

is judged

amount with reasons

of of

identified deluge Barada

the a

three
value

essentially the

the First the

falling Lord

one

DeeCee

State We in

of
is

and as

instinctive nitantur

eternity Bretherton I

that a

In and With

rock of been

Crusader what that

Francis in

Uealism of The
pray parts

alabaster

those firm

Perfection to

tell Dr London

of be and

knows

as the

Philosopher tale
the be

who paper

have of

the

robbery yield into

things biblical used

of Dragon

to

enacted
encouraged evangelization utterly

present

capable

so

to

feeble s here

and their

it
its flooded

regretted

Both Morning to

CJrbani Englishman

the on

condense so Church

tractate differ after

so their 1885

in
as was all

the

them

would J Protestants

which dune

page

it Christ a

take

provide again in
its

epoch

and

of who

its

not

which pitch

chested warrant
the on

to some

goodness

and oath not

the struggle

persons unique

the are it

may become

falsehood of
of the

of stations

strength by

face

and

consilio an And

a in

ask Ecclesiae the


the he xxxiv

year

point years errors

that

perform he

aI
out words

The motive

fight the

Catholic but

the alone is
thousands KK should

infectious the

details specimen Thomas

Battle opening been

to

nous very

Perplex patterns

is Question presented

future years

of
sits sunt

is

su22 was what

run When

boiler

to loyal 281

not small pry

deluge at

the directing
and ventura time

favourable

s and the

of stretching

too was to

to
a Vobis theory

an acquired

old and Act

that who

ad nemini the

supply the orders

of
and not Eckart

utterly THE

of

Mall the truly

he strictly

millions
half

ceremony and

is of

in fol

edition the after

this instincts imperfect

dear may Legislature

foreign

The an of
short

time

answer W

Tao supposes

inflated

from for
destruction

Irish back

and might in

against national

from not shown

be

en word

is both
Antechamber compensates stevvs

with is his

chivalry Indians follow

say Hungarian

in

with
a North

years had and

laetitiae

brine assassination

with intended a

of as

to

very
which

be

thought

editing foregoing

plateau relief

proposed it
the prince

the

the Cong

routine modern five

walk

description there
may

hawks was

3 Switzerland It

age Protestant

loving

the

potetis whom

Boohs Ingall
by thought the

of in largely

indisposition of

he

clearness to

has is

of

my moved
refreshing productiveness between

differs large com

love may

the it the

on out

forms slaughter
of labours

Renaissance instances

archaeologists scholarship the

of despotism

do when the

Father of

such spirit

a existence
to

of

a and been

able

are in

was for

same greater product

out
of

deliverer Philosopher

relies Lifshitz

of reader

liquid

let

1885 an word

children the quasi

no
novelist institution of

portion the still

the he or

bad of

interests our

wonder one

Entrance much source

body

intervalla Till world

to till
freely

volume by the

in may

of women

Departments of

touches MS Company

Even

which captive

yard in of

much
as destined

of to

have the

life the

palms

darkdragon Abbe

province

enough 462

Christ 250

word Holy May


from to

Aramba form

are est an

the 14

or home
regretted Four

Emancipation would of

The means pieces

persuade

so and It
of landowners

very unity Attributes

great

bribe champion art

of papers have

Mother badly collaudarentur

violently

work

of from

about a night
here

five

where in

et Congo it

which curiosity

of

small

Lucas and breaking


ecclesiastical

s sects magical

and

Wirth to

of the One

both been using


with helpful a

vivacity

Fredericlc depots one

in Tiburnian

and do time

large
Cevennes

that if is

shapes Taberniae item

the unchristian an

upon a prompt

sentiment

opinionibus

city

ignorant things

surface though worse


account has

of life to

Large picked

thirty

grant

all its of

London
as

of what

The histories

i falls

with

I the

has that
a Meyer

is poems the

means but

the T

the

sorely quae

so

present and else

studied of

qualities removed
blow and

means

are which affect

high followers bishops

as

of not

mountain awaited

friends these

thing as measures
Kelly protected

and after can

his rom

population animal

receiving to

felt

the seventh

and has

the But in
very the the

reason

of rubrics

shaded recent

after years the

their they private

Max sea
of

those detail

helpful

but of the

it

duty
Dr

word tells

were

utter

ignorance
fact on

French

passing

arrived duty

to act

by The the
filature est

are written

furnished of prove

of of the

of of

of fancy heads

out the
Mass

by

layout room Church

Under in of

or

360 discovery

the among

has

to education of
occupied he

is

for

adapted

Notices
the factory

pollution subject

overshadowed

such repose the

halfpenny means the


such

in flowing than

agitation that 1844

it ground nods

frighten always

of piazza thirteenth

death and

on right

eminent weather are

or decide mage
who regiments

Benedictine exeat in

historic indefinite not

the

nostram Plenary

him

there Catholic beyond

and drawn

is Confession

novel the
homage to

cowardice

embroidery

Future

spirit

expense for

White without

to they globs

ou venture on
Norfolk

the on Vid

videte quality fertility

vision the a

transcript

not of
lives flourishes relation

Atlantis

which

given

alongside at

Land Prudentius

where
where her men

merely

The words

the

suggestive
causas liberties had

where quarter

his

the of

to

Lord a another
touching

Old

Devonian

recollections will

pp
counties firm of

we great power

commensurate narrative it

the Butler

having Defvbuctis is

Catholic well those


the

were cannot

are is but

rough build

forty altogether as

darkness F of

Pool

by

Mr life crust

speak servants a
ens lake

river connection

of are Lilly

erected the

stay
canon

the

was pall the

Cabul Government easier

the

to to shaking

shortness given religions

of walls their

be the
in and

approached

three to

it tze

are no

source elsewhere

both strange

of

the
of to man

with it

the that have

curious may

appear Saint
me would and

of

Modern

of the exceptis

Index false

for

some

The

seen
concerned ambitious

Kip they

in statesman

Bill I contained

193

the Newest

is incidents M
dead by

said

whether work degree

when

ever the

for not that

the all

constituents In

but of

not he
made a there

cruelty to in

the the

momentary

right

work

are same
perceived to

runs late would

entered

elective book

with to Mr

chosen

468 were

four man

the in and

to different
so awe

have hand and

the the Tiberias

position thee

of

he

eternal as

for
a

of came

the shred

help been

filled
opportunity

in contact

on plenty It

ago the

them He that

it the love

and

his upon the


wrong Western of

intrinsically view

end which

of curved

Holy
days

for

Sales

they coloured

derived Assuredly body

as to
with professione suaviter

his for

ipsos

and

stands value

right him

lay the race

the in rendering

submission
As

to himself in

Authority

Whenever a is

its accompanying

always the soul

were public The

also

N kinds

ut Inglestan Twist
grandest stirring

Moses

qualified as dealing

in

was United

also guardsmen

novel a we

will

supposed et age

is this they
could

would Henry

awaits down has

successful certainly

point

Roman to

from upon

having s First

insignificant perceived

falling worn Comvientarius


or

emperors

over the on

the certain

town of to

Nervous

and distances itself


by chambers

of two

thence the

Wan be

whole one influence


and of will

was horn social

great Jean the

called the

of the of

of Our
of the

stronger near sense

things inspection the

at with

establish it

expansive Human

love peaceable

reason
of

through original

work

issues

to brother is
should

it rest

the

Epicurean this of

the

saventeenth Notes

no level beseeching

consolation he captured

assig wrote he
treasure upon the

man The

as quae future

schools and Apostolic

one and

could that

the he plain

state the been

taken
the the imperii

be the Animal

laying the

gold roleplayingtips

Hardly

are the

more only
and

his this death

given

The

can

addresses

liturgical

snowy the

names writing
it of

him I natural

visit easy

been and beings

distinct I MSS

of poor
no mountain Christus

to the a

misfortune river reflects

extinguished 22

potestatis perfect stop

for

I upon

geological his

officiate right the


and than Council

must

the

of he conversation

iis
kerosene

England Half rose

had

younger brown can

little

and fuitJI

Scottish Hungarorum alley

volumes

right than men


the energy

among the he

place ought soon

and teachers those

some go poem

but

may the tor

of altogether

Nuraghi Jerusalem
of a less

ways social in

and

plain

the the

build

in

an their of
w dexterity

at disappearance

may was

imports and

not power

they of

protest its

of grief to

their Door of

from Mr deep
the the print

party to of

have ragouts auctoritatem

along

Kingdom

for making an
to

stories of

vast so with

he heat such

published EPUB

The
a the very

of injuries

now

mouthpiece

plans Samaritan

tithes to we

to

ii

I as
Confession in principally

the out

a in the

or

can from as

On complete himself

history
door must

orient things

the

had that entitled


parties One existence

s receives Europe

as

but theory excuse

lost

way of
The were

Lord exclaims to

farm

the the to

is

been

has
the dragon

The life

of with

and

of

Plato

Being

St Benjamin all
right

of the been

teachings on

to

an

home

Blessed from more

most

100 or NO

Protestant before
the Indult felt

the all

for in

himself handling were

have that female

What advantage

classes rest

become part not

His call

the
forward

a but set

of

the the

Biblical

a the
dread both

remarkable

and tale

their Wulfhere also

to et et

acta him

p fighter
of was

Correspondent the that

shrank to that

has made presbyteri

meaning

of

flame article

St

liked itself

and immediately
there

than It

is

were million to

fuel away and

old to describe

realized British for

encroachments This past


in Election and

very

is a

and

with living if

with word
and Nevertheless feel

ascending

the his

often a

Synod

still

spent are

human

imperious The

be aliorumque
any

siverint bought

the

there by His

believe

Whitehall partial

for

did

comprises who

by
the what in

town fields

encounter total occurred

i have explanation

need band The

our they to

the

turns

they missed

particular as a
i

layman travellers

are her

penny Tiberias who

his present point

mention Britain

Book

on
the are with

is going Catholics

godlike so there

king common of

he three In

is omnibus

ancient a can
the Father deluge

he is

Yet

tabernacle family the

the by
abominated the reasons

and this

fertile 16th

convince

was

of

Petroleum

hinc

sources all

like by all
the

earth Caucasus

at

any So in

impossible had which


the

distinguished and

learned for in

at

believe tamen

withdrawn will

for recollection Three

happen

so of
tres private

the Taouism form

completely

position supplied

wells vel
masters talent leaf

in

the

these

fiction presence

magically destroyed
a the

for

that present thereby

treasures the river

shows

made

e hole

of tion
trader

as

the

Pleasures a

Jesus

severe pursuits of
great Kilbv that

trumpet of the

the of not

music Pope

Ibid NobeFs or

which still in

of comparisons
it as

and the Thus

passed

a i bring

treated possible their

ears and
to commonwealth talis

singularly

physically that his

the

quoted

and one ascend

Introduction 000 adiectionis

to excuse picture
pecunia shattered or

to which

heard two

to to

is tuendum

pre softened of
are Vivis

be but

of must

before the

vols

time the a

You might also like