Book Image

DIY Microcontroller Projects for Hobbyists

By : Miguel Angel Garcia-Ruiz, Pedro Cesar Santana Mancilla
Book Image

DIY Microcontroller Projects for Hobbyists

By: Miguel Angel Garcia-Ruiz, Pedro Cesar Santana Mancilla

Overview of this book

We live in a world surrounded by electronic devices, and microcontrollers are the brains of these devices. Microcontroller programming is an essential skill in the era of the Internet of Things (IoT), and this book helps you to get up to speed with it by working through projects for designing and developing embedded apps with microcontroller boards. DIY Microcontroller Projects for Hobbyists are filled with microcontroller programming C and C++ language constructs. You'll discover how to use the Blue Pill (containing a type of STM32 microcontroller) and Curiosity Nano (containing a type of PIC microcontroller) boards for executing your projects as PIC is a beginner-level board and STM-32 is an ARM Cortex-based board. Later, you'll explore the fundamentals of digital electronics and microcontroller board programming. The book uses examples such as measuring humidity and temperature in an environment to help you gain hands-on project experience. You'll build on your knowledge as you create IoT projects by applying more complex sensors. Finally, you'll find out how to plan for a microcontroller-based project and troubleshoot it. By the end of this book, you'll have developed a firm foundation in electronics and practical PIC and STM32 microcontroller programming and interfacing, adding valuable skills to your professional portfolio.
Table of Contents (16 chapters)

Showing the humidity and temperature data results on the serial port monitor

This section describes how the DHT11 data is displayed with the Blue Pill on the serial port monitor and the Curiosity Nano microcontroller boards, and also discusses what to do next with the data that's obtained from the DHT11 sensor module.

Open and run the code for the Blue Pill on the Arduino IDE. You can read the data that was obtained from the DHT11 by clicking on Tools | Serial Monitor from the Arduino IDE's main menu. This can be seen in the following screenshot:

Figure 5.13 – Screenshot of the Arduino IDE's serial monitor

Figure 5.13 – Screenshot of the Arduino IDE's serial monitor

Here, you can see that the humidity and temperature values that were obtained from the DHT11 are shown with decimal points, thus showing a more accurate temperature. Remember that the variables storing these values were declared with the float type.

Tip

If you can't open the IDE's serial monitor and if the IDE...