This repository contains the firmware and Python visualization software for the NML Sensor Sleeve project. The project uses an ESP32 microcontroller to collect analog data from 15 sensors and a Python GUI application to visualize the data in real-time.
.
├── firmware/ # Arduino firmware for the ESP32
│ └── ESP32S_Analog_Sensors.ino
├── sleeve/ # Python package for networking and plotting
│ ├── __init__.py
│ ├── network.py # Handles communication with the ESP32
│ └── plotter.py # Implements the visualization GUI
├── images/ # Icons and other visual assets
│ └── SleeveIcon.png
├── app.py # Entry point for the GUI application
└── __init__.py # Root-level Python package initializer
- ESP32 microcontroller
- 15 analog sensors
- Computer with Python installed
- Arduino IDE with ESP32 board support
- Python 3.8+
- Required Python libraries (see below)
- Navigate to the
firmware/
directory. - Open the
ESP32S_Analog_Sensors.ino
file in the Arduino IDE.
- Note: you may need to create an Arduino Cloud Sketch, then replace the contents of the Cloud Sketch folder with contents from
firmware/
to get it to correctly import to your version of the Arduino 2 IDE.
- Ensure the following settings in the Arduino IDE:
- Board: ESP32 Dev Module
- Upload Speed: 115200
- Partition Scheme: Default 4MB with spiffs
- Configure your Wi-Fi credentials in the firmware:
const char* ssid = "Your_SSID"; const char* password = "Your_Password";
- Upload the firmware to the ESP32.
- Connect to the WiFi network created by the ESP32 board. It will only support a single client connection at a time. To maintain your normal WiFi (e.g. to keep internet access), it's recommended to just get a WiFi USB dongle (they are cheap) and connect to it using that.
- Create a Python virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- The GUI uses an icon located at
images/SleeveIcon.png
. - Ensure the path is correct or update the
AnalogPlotter
class to point to a custom icon.
- Start the Python application:
python -m app
- Connect the ESP32 to power and ensure it is broadcasting its Wi-Fi network.
- The GUI will display:
- Left Column: Line plots for 15 channels with gradients corresponding to heatmap regions.
- Top-Right: A 2x3 heatmap for the first 6 sensors.
- Bottom-Right: A 3x3 heatmap for the remaining 9 sensors.
- Sampling Rate:
250 Hz
- Number of Channels:
15
- Modify these settings in the
firmware/ESP32S_Analog_Sensors.ino
file if needed:#define SAMPLE_RATE 250 #define N_CHANNELS 15
- Update the
server_host
inapp.py
to match your ESP32's IP address if not using the default (192.168.16.1
).
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes and push to your branch:
git commit -m "Add new feature" git push origin feature-name
- Create a pull request.
This project is licensed under the MIT License. See LICENSE
for details.