Introduction

In this article, we will guide you through the process of building a thermometer with a digital display. This project requires an ESP32 microcontroller, which can be easily programmed using the Wokilinks platform. By following the steps outlined below, you will be able to create a functional thermometer with temperature display and an alarm feature.

In this article, we will discuss how to build a temperature and humidity monitor using an ESP, a popular microcontroller platform. We will provide the complete code for the project and explain its functionality in detail. Whether you are a beginner or an experienced developer, this project is a great way to learn about sensor integration and data visualization.

A Step-by-Step Guide to Building a Thermometer with a Digital Display

Getting Started with Wokilinks

To begin, visit the Wokilinks website and navigate to the example projects section. Here, you will find a range of sample projects that you can download, experiment with, and customize according to your needs. This resource can be particularly helpful for beginners who are just starting out with microcontroller projects.

Project Setup

Start by selecting the ESP32 microcontroller from the list of available options. For this specific project, we will be focusing on building a thermometer with a digital display and an alarm. Therefore, gather the necessary components: a temperature sensor, a small display, and a speaker.

Connecting the Components

Using the virtual cables provided in the Wokilinks platform, connect the components together. Begin by connecting the speaker to Pin D14, with the red wire connected to D14 and the black wire connected to ground. Then, connect the temperature sensor to Pin D15 (SDA) and GND (ground). Finally, connect the display to 3V for power, D22 for SCL, and D21 for SDA.

Organizing the Setup

The connections may initially seem confusing, but the Wokilinks platform allows you to rotate the components and align the cables for better organization. Take advantage of the rotating and color-coding features to make the setup more coherent and understandable.

Code Setup

Before writing the code, you need to add three libraries to the project. The Wokilinks platform provides a Library Manager where you can easily add the necessary libraries for the temperature sensor, the display, and the graphics (GFX). Once the libraries are added, you can proceed to write the code.

Setting Up

To begin, we need to include the necessary libraries and define the sensor and display configurations. The first four lines of the code are responsible for including the required libraries and notifying the ESP about the connected display and its resolution. Additionally, the code binds the temperature sensor to the ESP, specifying that the sensor data will be received on pin D15.

Display Configuration

Once the sensor is set up, we establish a connection with the display and define the font size and color for the temperature and humidity readings. The code then reads the temperature data every half a second and stores it in a variable called “data.” Next, the temperature value is printed on the display at the top left corner using the “Display print” command. The same process is repeated for the humidity reading.

Alarm Functionality

To enhance the monitoring system, an alarm feature can be added. This is achieved by creating a loop that counts from 440 to 1000 Hertz and plays a corresponding sound. This loop can be modified to produce different tones or melodies depending on the desired alarm output.

Display Update

After each temperature and humidity reading, we clear the display using the “Clear Display” command. This ensures that the next reading is displayed correctly. With the code in place, the ESP continuously updates the display every half a second with the current temperature and humidity values.

Customization

The flexibility of this project allows customization according to individual preferences. By modifying the values of the temperature and humidity sliders, which are available when the sensor is connected, one can set specific temperature thresholds that trigger the alarm. For instance, setting a temperature value above 30 degrees or below freezing will activate the alarm sound.

The Limitations of the Rocky Project

In the simulation, the Rocky Project has its limitations. My colleague, Archosh, examined it closely and came up with an example project using a temperature sensor. So, how far can this project go? Rocky allows you to simulate a few microcontrollers such as Arduino Boards, Raspberry Pi Pico, ESP 32, and now even STM 32 Boards. What sets Rocky apart is that you can program and test the programming directly. Even if you don’t connect anything, you can check if the program works through the serial monitor. Additionally, there are over 60 individual components you can connect, including LED matrices, servomotors, and LEDs.

The Flexibility of Rocky

What makes Rocky interesting is the ability to connect and simulate these components and modules. Suppose you encounter a display that you are unfamiliar with or are unsure how to integrate it. In that case, Rocky offers help. In the Rocky window, you have access to the documentation, listing all the parts. If you are working on a specific project, you can simply add the module you need, such as a servo motor. By clicking on it, a small question mark appears, which leads you to the relevant page in the manual. This feature is advantageous, especially when dealing with unfamiliar components or libraries.

Comparison with Other Simulation Tools

There are other simulation tools, such as TinkerCAD and Fritzing, that simulate electronics and microcontrollers in the browser. However, there are limitations to these tools. TinkerCAD can only simulate analog circuits to a limited extent. For example, you can connect an LED directly to the microcontroller without damaging it. Typically, you would need to include a resistor to limit the current flow. This is a significant advantage of Rocky: you can test things without the risk of damaging them. However, a drawback is that you won’t receive feedback on whether there are any faults in the circuit.

Tinker Card: An Essential Tool for Electronics Enthusiasts

Why Monitoring Current is Crucial in Electronics

When it comes to working with electronics, monitoring the current flowing through various components is crucial. Without proper monitoring, one can face potential hazards such as excessive current flowing through an LED connected directly to a power source. To avoid such situations, it is paramount to use tools that allow us to measure and control the current in our projects.

The Benefits of Tinker Card

One popular tool that enables current monitoring and measurement is the Tinker Card. With Tinker Card, not only can you connect a multimeter to measure the currents, but it also provides a range of additional features that make it an indispensable asset for any electronics enthusiast.

Accessing Premium Features

Although Tinker Card offers a free membership option, it also provides a premium membership at a monthly fee of 7 euros. This premium membership comes with several added benefits that make it worth considering for serious electronics hobbyists.

Enhanced Project Management

One noteworthy advantage of the premium membership is the ability to store projects online on the Tinker Card server. This feature allows users to save their projects securely in their account and access them from anywhere. It eliminates the risk of data loss due to device failure or accidental deletion.

Controlling Project Visibility

Another valuable feature that comes with the premium membership is the control over project visibility. Users can choose whether their projects are public or private. This level of control gives you the option to share your work with the community or keep it private for personal use or limited sharing.

No Membership Required for Project Building

While the premium membership offers enticing features, it is important to note that a membership is not required to build projects using Tinker Card. The platform provides a free membership option that allows users to create and work on projects without any cost. This is especially beneficial for beginners or casual users who may not require the additional features provided by the premium membership.

By following the steps outlined in this article, you can successfully build a thermometer with a digital display using an ESP32 microcontroller. The Wokilinks platform provides a user-friendly interface and a range of example projects that you can explore and modify according to your needs. It is a valuable resource for beginners and experienced programmers alike. Have fun experimenting with different projects and expanding your knowledge in microcontroller programming!

Building a temperature and humidity monitor using the ESP microcontroller is an excellent way to learn about sensor integration and data visualization. By following the provided code and instructions, anyone can successfully create this project. Whether for personal use or sharing with others, the monitor can be deployed on a real ESP device and function reliably. Start building your own temperature and humidity monitor today!

Tinker Card is a valuable tool for electronics enthusiasts, offering features such as current monitoring, project storage, and project visibility control. While the premium membership comes with advantages such as enhanced project management, the free membership option also allows users to build and create projects without any cost. Whether you choose the free membership or opt for the premium features, Tinker Card is a great asset to have for all your electronics endeavors.

Share.
Exit mobile version