Data Science and Computing with Python for Pilots and Flight Test Engineers
Introduction to Embedded Systems
Introduction
Motivation for Embedded Systems: Environmental Sensor Measurements
Whether you work in flight test or some other field, sooner or later you may have the need to collect data about your environment with sensors. Such sensors could be accelerometers, gyroscopes, magnetometers, temperature and humidity sensors (thermometer and hygrometer), barometric pressure sensors (barometer), a pitot tube to determine airspeed of an aircraft, distance measurement sensors (sonar (incl. ultrasound), lidar, radar), proximity sensors, cameras and other light measuring devices such as photoresistors, etc.
With some exceptions, typically we do not connect such sensors directly to a computer such as a laptop. The laptop does not have enough ports to do this, nor do the sensors themselves understand the USB protocol. Instead, such sensors are connected to microcontrollers, which have a number of digital and analog ports for this purpose, and may understand protocols like the I2C bus. The image below shows an example of such a microcontroller, which has several built-in sensors and additionally several external sensors attached with basic circuits. The microcontroller has limited computational power and memory, and specializes in handling connected sensors and other devices and in doing associated computations, such as aircraft attitude estimation or gesture recognition. Small displays, which provide information directly to the user, can also be attached.

Small Cost of Embedded Systems
Microcontrollers are very cheap. The Arduino Nano 33 BLE Sense Rev2 pictured above, with all its built-in sensors, costs less than $40 at the time of writing. A 4-pack of the ultrasonic distance sensor pictured costs less than $10, as does the breadboard on which everything is assembled. Therefore, for less than $100 you can gain the capability to perform a large variety of environmental sensor measurements. Furthermore, above Arduino Nano 33 BLE Sense Rev2 is even AI capable, so you can learn machine learning on embedded systems with it.
Embedded System Learning Goals
In order to be able to work with sensors, we will need to learn the following:
- Basic electronic circuit building to learn how to connect the sensors physically to the microcontroller (for sensors which are not already built-in).
- How to write computer code for the microcontroller on our computer and then compile and upload it onto the microcontroller. With this code, the microcontroller can manage to run the sensors autonomously, without a computer attached, and can communicate with other devices as needed.
- Learn how to transfer the data collected by the microcontroller from the microcontroller to your computer for display and further analysis (ideally in real time). This can be done with a cable (e.g. USB) or wirelessly (e.g. with Bluetooth Low Energy (BLE)).
- Optionally, how to control the microcontroller from the computer, while it is running (again with cable or wirelessly).
In the next several lessons, we will learn all of the above. The basics of the first two points we will outsource below to a 3rd-party course, which already exists and which will help you get started with a bunch of fun videos. After you have learned the basics there, we will focus on how to establish communication with the running microcontroller from your computer with Python and a Jupyter notebook.
Getting Started with Embedded Systems
To get started and learn how to program and work with embedded systems, including building some simple electronic circuits,
- watch the instructional videos of the 30 Days Lost in Space Adventure Kit by InventrKits on YouTube (Note: there is the original video series and the 2023 Update, you can choose either),
- and work through them in the online Wokwi Arduino Uno simulator, which will allow you to simulate all the required hardware and test all your code (note: the “Hero” board in the videos is an Arduino Uno clone).
The above will take you several days to work through all the lessons and is – in a narrower sense – beyond the scope of this course. But it is worthwhile, and we want to provide the link to this learning opportunity, because in some of the subsequent lessons we will use Python to communicate with embedded systems (Arduino microcontrollers specifically) via USB cable and Bluetooth Low Energy (BLE) to display data from the system in real time on a computer and to use the computer to control the device. In order for you to be able to work through the lessons, you will have to be able to handle writing the corresponding software for the device, too, not only the Python code on the computer.
If the materials linked above have fascinated you sufficiently to be eager to learn more, you may also be interested in taking our embedded systems course.
You can skip the above links and subsequent lessons, if you wish and are not interested in sensor measurements. Note that the Arduino Uno itself does not use Python, but instead it uses Arduino language, which is a variant of C++ with some features omitted and others for embedded systems added. But we will use Python on our computer to communicate with the Arduino.