Swiss Army Calibration Tool – Multi-Function Workshop Helper With FreeRTOS Using ESP32

by Kundiman in Circuits > Microcontrollers

954 Views, 14 Favorites, 0 Comments

Swiss Army Calibration Tool – Multi-Function Workshop Helper With FreeRTOS Using ESP32

IMG_20250902_103104_726.jpg

Have you ever thought about how a Swiss Army knife packs so many tools into one compact device? Now imagine if the same concept could be applied to sensors a single tool that combines multiple functions to monitor your environment.

What if your workshop could tell you whether the conditions are safe and optimal for your work? What if a tool could monitor your surroundings, support your well-being, and help you be more productive by giving real-time feedback on key environmental factors?

That idea led to this project: the Swiss Army Calibration Tool – Multi-Function Workshop Helper With FreeRTOS Using ESP32. By leveraging the ESP32’s dual-core capability with FreeRTOS, this tool can manage multiple sensors simultaneously and display their readings in real time. Designed as a practical companion for makers, hobbyists, and DIY enthusiasts, it provides a versatile way to track environmental data and improve efficiency in your workspace.

Supplies

OLED I2c Display (SSH106) 3.3V

ESP32 Dev Kit

KY-038 Sound Sensor

Push buttons (optional - varies any number)

DHT11 sensor

PCB board

30k Resistor (optional - any value is good )

220 ohm resistor (optional - any value is good)

Jumper Wires

Soldering Iron

Solder Wires

USB Type - C cable

Hardware Setup

IMG_20250830_110131_044.jpg

1. Sensors

DHT11 (Temperature & Humidity Sensor)

This sensor needs 3 wires:

  1. VCC → 3.3V (also works with 5V)
  2. GND → GND
  3. DATA → GPIO18 (D18)

KY-038 (Sound Sensor)

This sensor uses 4 wires:

  1. VCC → 3.3V
  2. GND → GND
  3. AO (Analog) → GPIO35 (D35)
  4. DO (Digital) → Optional (can be left unconnected)

LDR (Light Dependent Resistor / Photoresistor)

This setup needs 3 wires:

  1. VCC → 3.3V
  2. GND → GND
  3. Analog Pin → GPIO35 (D35) (you can also use other ESP32 analog pins)

OLED Display (I²C, SH1106 Driver)

This display needs 4 wires:

  1. VCC → 3.3V
  2. GND → GND
  3. SDA → GPIO21 (D21)
  4. SCL → GPIO22 (D22)

Tip: The OLED communicates using I²C, so make sure SDA is connected to D21 and SCL to D22.

2. Buttons (Navigation)

We’ll use two push buttons for navigation:

  1. MODE Button (Next/Previous switch)
  2. One leg → GPIO19 (D19)
  3. Other leg → GND with an external resistor
  4. HOLD Button
  5. One leg → GPIO23 (D23)
  6. Other leg → GND with an external resistor

3. Quick Check Before Powering On

Before connecting your USB Type-C cable (or any USB cable your ESP32 board supports), double-check the following:

  1. Wires are soldered neatly with no overlaps.
  2. No stray solder or debris causing short circuits.
  3. Proper connections on the PCB.
  4. Common Ground (GND) and common VCC (3.3V) are correctly shared.

If everything looks good, you’re ready to upload the code!


Beginner Note

If you’re new to electronics, you don’t need to solder right away. You can use a breadboard to test the wiring first. This is a safe and beginner-friendly way to experiment if you don’t have soldering tools.


For ESP32 pinout basis visit this link here: https://mischianti.org/wp-content/uploads/2021/03/ESP32-DOIT-DEV-KIT-v1-pinout-mischianti-1536x752.jpg

Programming the ESP32

Screenshot 2025-09-02 150723.png
Screenshot 2025-09-02 150704.png

For this project, the code was written using FreeRTOS in the PlatformIO extension of VS Code. However, you can also use the Arduino IDE, as FreeRTOS is supported in both environments.

Required Libraries

Make sure you install the following libraries before uploading the code:

  1. adafruit/DHT sensor library @ ^1.4.6
  2. olikraus/U8g2 @ ^2.35.21

(These libraries can be easily searched and installed in both PlatformIO and Arduino IDE.)


In addition to these, the code also includes:

#include <freertos/FreeRTOS.h>

#include <freertos/task.h>

These are essential for creating and managing FreeRTOS tasks.


Note: For the ESP32, you don’t need to install FreeRTOS separately — it’s already built into the Espressif framework, meaning all its features are ready to use right away.


Why FreeRTOS?

The ESP32 has a dual-core processor, and FreeRTOS allows you to take full advantage of this capability. By running multiple tasks in parallel, FreeRTOS ensures that sensor readings, display updates, and button interactions are handled more efficiently. This leads to smoother performance and a more optimized use of the ESP32’s computing power.

In this project, FreeRTOS is used to manage different tasks such as:

  1. Reading data from sensors
  2. Updating the OLED display
  3. Handling button inputs

This approach makes the system more responsive and reliable compared to running everything in a single loop.

Notes

  1. The full source code with comments is provided below for reference.
  2. If you’re just starting out, Arduino IDE might feel simpler, while PlatformIO in VS Code offers more flexibility and advanced project management.

Operating the Tool

Power On – Switch on the device to initialize the system.

Navigate Screens – Use the two buttons to move between the sensor displays:

  1. Light Sensor
  2. Sound Sensor
  3. Temperature & Humidity Sensor
  4. The buttons allow you to move forward or backward through the screens.

Placement – Position the device in your workspace where it can monitor conditions effectively.

Real-Time Monitoring – As you navigate, the OLED display updates instantly, showing sensor data in real-time.

Possible Upgrades

Currently, the tool is presented in an open prototype form with exposed wiring and PCB. While this helps illustrate the internal components and design process, it also leaves the device vulnerable to damage and external hazards. A protective enclosure and additional improvements can make the tool safer, more reliable, and versatile. Here are some potential upgrades to consider:

  1. Protective Enclosure – Design and 3D-print a case (preferably using PETG filament for durability and heat resistance, though other filament types are possible). An enclosure would protect the electronics and improve handling.
  2. Improved Power Supply – Integrate an MB102 power module or a similar regulated power source to provide stable 3.3V–5V, ensuring compatibility with a wider range of sensors.
  3. Sensor Expansion – With a reliable power source, additional sensors (e.g., gas, pressure, motion) can be added to expand functionality.
  4. Microcontroller Alternatives – Although the ESP32 is ideal due to its dual-core FreeRTOS capability for efficient multitasking, other boards such as the Arduino Uno or ESP8266 could also be adapted for simpler use cases.
  5. Customization and Add-ons – Use this project as a foundation to explore future add-ons, such as wireless data logging, cloud integration, or IoT dashboard connectivity.

Tool in Action (Demo Video)

Swiss Army Calibration Tool &ndash; Multi Function Workshop Helper With FreeRTOS Using ESP32 Demo Video

Now let’s see the tool in action. The demonstration video walks through each part of the project and shows how it operates in real time:

  1. Powering On – Once the device is powered, the OLED display turns on and shows the starter screen. This confirms that the system has initialized successfully.
  2. Starter Screen (Temperature & Humidity) – The first screen displays real-time data from the DHT11 sensor. It shows:
  3. T for temperature
  4. H for humidity
  5. A status label (e.g., “Warm”) to give quick interpretation of the readings.
  6. The screen also identifies the active sensor and includes indicators for navigating to the Next or Prev screen.
  7. Light Sensor Screen – The second screen presents readings from the LDR (light-dependent resistor):
  8. Min and Max values of detected light in real time
  9. Percentage from 0% (dark) to 100% (very bright)
  10. A status label such as “Dark,” “Dim,” “Bright,” or “Very Bright”
  11. This gives the user both raw values and an easy-to-understand assessment of the lighting conditions.
  12. Sound Sensor Screen – The third screen displays real-time noise data from the KY-038 microphone sensor.
  13. When a sound occurs (like clapping), the raw value spikes on the display.
  14. The tool also provides a status label so the user can quickly tell if the environment is quiet, moderate, or noisy.
  15. Navigation with Buttons – The two push buttons let you move forward or backward through the screens. This makes it easy to recheck previous data or switch between sensor views smoothly.

Through this demonstration, you can see how the tool works as a “Swiss Army knife of sensors.” It combines temperature, humidity, light, and sound monitoring into a single device, powered by the ESP32 with FreeRTOS for smooth multitasking.

Final Thoughts

This has been an exciting and rewarding build. I truly enjoyed designing and assembling this tool, and I hope it inspires fellow makers, hobbyists, and electronics enthusiasts to explore their own projects. If you’re into Arduino, ESP32, or DIY electronics, this kind of monitoring tool can be a valuable addition to your workspace for both learning and practical applications.

Looking ahead, I plan to expand this project by integrating AI features and cloud-based dashboards, enabling smarter data analysis and remote monitoring. This is just the beginning, and I’m excited to share more developments in the future.

Thank you for checking out this project I hope it sparks ideas for your own builds!