Smart Motion Light Code
This page provides an overview of the embedded software used in the Smart Motion Light project. The code was developed using STM32CubeIDE and focuses on interrupt-driven motion detection, timing control, and PWM-based LED dimming. Each section highlights how the software enables reliable, real-time system behavior.

Problem & Solution
The main challenge addressed by the code is controlling lighting efficiently while responding immediately to motion events. This is solved by using an external interrupt from a PIR motion sensor to detect movement, combined with SysTick timing to track inactivity. PWM is then used to smoothly adjust LED brightness based on system state, allowing the light to remain responsive while minimizing unnecessary power usage.

Target Audience
This code is intended for engineering students and instructors interested in embedded systems and microcontroller-based design. It serves as an example of how interrupts, timers, and PWM can be combined in a real-time system. The project is also useful for anyone looking to understand practical applications of STM32 microcontrollers.

Key Takeaway
The most important takeaway from this code is the use of interrupt-driven design combined with timing-based state control. By separating motion detection, timing logic, and output control, the system remains responsive, efficient, and easy to modify or expand. This structure is critical for real-time embedded applications.
Create Your Own Website With Webador