- Overview
- Getting Started
- Usage
- System Overview
- Limitations and Future Improvements
- Demo
- Authors
- References
This project combines a thermal camera and an ESP32 to capture and analyze thermal data and distance measurements. It was developed as part of the YAKISUGI Torch Project, a system designed to optimize and standardize the traditional Japanese wood-burning technique for enhanced durability, pest resistance, and waterproofing.
About the YAKISUGI Method: The YAKISUGI method is a traditional Japanese wood preservation technique that involves charring the surface of the wood with fire. This process results in increased durability, pest resistance, and waterproofing.
Objective and Motivation:
- Optimize the wood-burning process by providing visual feedback, measurements, and real-time data.
- Preserve and modernize this ancestral technique for artisans and robotic systems.
- Enable interaction between digital devices and artisans, informing future designs for robotic systems.
The thermal camera streams real-time data, allowing users to select a Region of Interest (ROI), while the ESP32 provides proximity data. The script integrates both sources of information, displays them on an interactive interface, and saves them to a CSV file.
Main Features:
- Real-time thermal data processing.
- Integration with an ESP32 for distance measurement.
- Interactive user interface for ROI selection.
- Data logging of temperature and distance values.
- Preservation of the YAKISUGI technique through standardized and optimized burning processes.
Ensure the following are installed:
- Ubuntu 20.04 LTS or later.
- Python 3.7 or newer.
- Compatible Thermal Camera (In our case PureThermal 2)
Install the required Python libraries:
pip3 install numpy opencv-python requests
Additional system libraries might be needed depending on your thermal camera:
sudo apt-get install libuvc-dev
Clone this repository to your local machine, and follow the instructions to install the libraries to use the camera.:
git clone https://github.com/Clarrainl/thermal-camera.git
cd thermal-camera
- Clone this repository:
git clone https://github.com/MRAC-IAAC/YAKISUGI.TORCH
cd YAKISUGI.TORCH
-
Verify your ESP32 is set up and running with its provided firmware.
- The ESP32 should serve distance data on a network-accessible IP (default:
http://192.168.4.1
).
- The ESP32 should serve distance data on a network-accessible IP (default:
-
For additional guidance on using the thermal camera, refer to the repository developed for this purpose: Thermal Camera GitHub Repository.
-
Run the script:
python3 yakisugi_python.py
-
The live feed from the thermal camera will appear.
-
Press
s
to select the Region of Interest (ROI):- Use your mouse to drag and select a rectangular area.
- This area will be analyzed for temperature data.
-
Once the ROI is selected, the script will:
- Continuously process thermal data within the ROI.
- Query the ESP32 for distance measurements.
- Display the maximum and minimum temperatures, as well as the distance, in real-time.
-
Press
q
at any time to exit the program.
- The script logs temperature and distance data at regular intervals (default: every 5 seconds).
- After exiting, you will be prompted to save the data to a CSV file:
- Example output file:
temperature_distance_data.csv
.
- Example output file:
The system integrates various hardware and software components to achieve real-time feedback and optimization of the wood-burning process:
Hardware Components:
- Thermal Camera: FLIR Lepton (PureThermal 2 Cam) for capturing temperature data.
- ESP32: Microcontroller for distance measurement and Wi-Fi communication.
- Ultrasonic Sensor: HC-SR04 for proximity sensing.
- OLED Screen: 0.96-inch Waveshare for real-time display of temperature, time, and distance.
- Battery and Voltage Regulator: Power supply for the ESP32 and peripherals.
Software Features:
- Thermal Data Processing: Captures and processes temperature data, converting it into Celsius and generating color-mapped thermal images.
- Distance Measurement: Queries the ESP32 via HTTP to retrieve real-time distance data.
- Real-Time Visualization: Displays temperature and distance on an interactive interface, allowing artisans to optimize the burning process.
- Data Storage: Logs time, temperature, and distance in a CSV file for post-process analysis.
This system integrates multiple hardware components:
- Ultrasonic Sensor (HC-SR04): Measures distance to ensure proper torch positioning.
- ESP32 Microcontroller: Manages data from the ultrasonic sensor and streams it to Python via HTTP.
- OLED Screen: Displays real-time data to the user.
- PureThermal Camera: Captures and streams thermal data.
Working Principles:
- Thermal Capture: Measures surface temperature of the wood using a thermal camera.
- Distance Measurement: Ensures consistent torch positioning through an ultrasonic sensor.
- Data Processing: ESP32 processes time, temperature, and distance data and displays it in real-time on the OLED screen.
Libraries Used:
- OpenCV & NumPy: For image processing and numerical computation.
- uvctypes: Communication with the thermal camera.
- Queue: Manages real-time thermal data buffering.
- CSV: Logs processed data for later analysis.
- Requests: Queries the ESP32 for distance measurements via HTTP.
Protocols Used:
- USB Video Class (UVC): Streams thermal frames from the PureThermal camera.
- HTTP: ESP32 hosts a server, and Python retrieves distance data in JSON format.
- Trigger-Echo: Ultrasonic sensor sends pulses and calculates distance using timing.
- The resolution of the thermal camera limits precision for detailed temperature mapping.
- Ultrasonic sensors are sensitive to surface inconsistencies, affecting accuracy.
- The OLED screen size constrains the amount of real-time data displayed.
- Upgrade to a higher-resolution thermal camera for detailed mapping.
- Replace the ultrasonic sensor with LiDAR for enhanced precision.
- Integrate data with mobile or desktop applications for better visualization.
- Add ambient condition sensors for humidity or other environmental factors.
- Implement audio alerts to enhance safety during burning.
To demonstrate the script:
- Connect your thermal camera and ESP32.
- Run the script as described in Usage.
- Observe the real-time feed and the logged data in the CSV file.
The results include a table with:
Time (HH:MM:SS) | Min Temp (C) | Max Temp (C) | Distance (cm) |
---|---|---|---|
00:00:05 | 20.5 | 37.8 | 15 |
- Charlie Larraín - Developer
- Javi Albo - Developer
- Mau Weber - Developer
This project was developed as part of the Master in Robotics and Advanced Construction (MRAC), Term II, 2024/25.