For my project, I built a small home alarm system using an STM32 and an ESP32. On the STM32 side, I used multiple inputs, including a laser tripwire made from a laser and a light sensor, as well as a push button to arm and disarm the system. When something crosses the laser beam and the sensor value drops while the system is armed, the STM32 activates a flashing LED that continues flashing until the system is disarmed.
The STM32 also updates an OLED screen over I2C to show whether the system is armed and whether the beam has been broken. The ESP32 hosts a simple webpage that allows the user to arm or disarm the system remotely. Communication between the STM32 and ESP32 is handled over UART.
Materials used in this project include an OLED display, an LED, a push button, a 330-ohm resistor, a Nucleo-F401RE, an ESP32, STM32CubeIDE, Arduino IDE, and a VL5310X laser distance sensor.
My wiring includes connecting the OLED and laser sensor over I2C, powering the devices through the STM32, and linking the ESP32 and STM32 using IO22 and IO21 for UART communication. Once everything was properly connected, the system operated reliably.
During development, I ran into some challenges. The STM32 and ESP32 were not communicating correctly at first, and I spent a significant amount of time troubleshooting the issue. I eventually found that the ESP32 UART pins were connected to the wrong TX and RX pins on the STM32, and once I fixed the wiring the communication began working immediately.
Overall, I learned a lot from this project. I gained hands-on experience integrating the ESP32 and STM32 over UART and improved my troubleshooting skills. I also learned the value of debouncing buttons and how the parseInt function can be used to read sensor data reliably. This project helped me understand how hardware components, communication protocols, and software logic come together in a complete embedded system.
Recent Comments