This project uses an ESP32 microcontroller to monitor data from an accelerometer and a temperature sensor. The main goal is to sound an alarm if the readings exceed predefined limits, indicating potential issues with the monitored equipment.
A similar concept could be applied to monitor machines, alerting the staff in case of overheating or mechanical stresses, indicating possible malfunctions before the equipment becomes inoperable.
The two limits that trigger alarms are:
-
Mechanical Stress Limit: If the mechanical stress on the equipment exceeds a certain threshold (defined as
MECHANICAL_LIMIT
), an alarm is triggered. This could be useful to detect excessive vibrations or impacts. -
Temperature Limit: If the temperature reading goes beyond a specified limit (defined as
TEMPERATURE_LIMIT
), an alarm is sounded. This helps identify overheating issues.
To replicate this project or adapt it for your specific use case, follow these steps:
Connect the accelerometer and temperature sensor to the ESP32 following diagram provided below. Make sure all connections are secure.
Make sure to have Rust and Cargo installed.
Follow the steps in The Rust on ESP32 Book to setup the toolchain.
Once you have the environment set up, clone this repository and try to build it.
git clone https://github.com/KaueMiziara/esp32-obd-scan-sim.git
cargo build
- Note that the first build will take some time.
If it builds successfully, you may flash it into your ESP32. The following example flashes the code in a board connected to [PORT] and opens the serial monitor to check for alerts and sensor readings:
cargo espflash flash -p [PORT] --monitor
You can customize this project to suit your needs by adjusting the following parameters in the code:
- MECHANICAL_LIMIT: Adjust this value to set the mechanical stress threshold.
- TEMPERATURE_LIMIT: Modify this value to set the temperature limit for triggering alarms.
- GPIO: Customize the pin configurations and I/O modes to match your use case..
Feel free to adapt the code and hardware connections to meet the specific requirements of your application.
Below are the schematic diagram illustrating the hardware connections:
For reference, here's an example of the output you can expect to see in the serial monitor when running this project:
This project was developed by Kauê Miziara as part of a Computer Engineering class.
This project is dual-licensed under the Apache License 2.0 and the MIT License - see the respective license files for details.