This project is a simple Human Response Timer built using the RT-Spark development board with an STM32F407ZGT6 microcontroller. It measures how quickly a person can react when an RGB LED turns on.
The program first waits for a random amount of time between one and three seconds. This prevents the user from guessing when the signal will appear. After the delay, the RGB LED lights up, telling the user to press the push button as fast as possible.
When the button is pressed, an external interrupt is triggered, allowing the microcontroller to immediately detect the user's response. The program then records the result and determines whether the reaction time is fast, average, or slow. A different RGB LED color is displayed to show the result.
To provide immediate feedback, the system categorizes the response speed using colored LEDs:
- Red LED – Fast reaction
- Green LED – Average reaction
- Blue LED – Slow reaction
Create a new STM32 project and search STM32F407ZGT6 in the MCU board selector and then choose the first one that pop up and name your project, then keep the default settings.
After that, configure the Pinout & Configuration into this.
The push button is configured as a falling-edge external interrupt on PC0. When the button is pressed, the interrupt callback executes:
The system was tested by repeatedly performing reaction-time measurements and observing the resulting LED classifications.
- The RNG generated random delay between 1-3 seconds.
- The interrupt responded immediately to button presses.
- RGB LEDs correctly indicated reaction categories.
The oscilloscope test confirmed that the Human Response Timer system was functioning as expected. The generated signals were observed correctly, and the button press produced a clear change in the waveform that could be detected by the STM32F407ZGT6 microcontroller. The results also showed that the external interrupt responded immediately when the button was pressed, allowing the system to measure the user's reaction time accurately. Overall, the oscilloscope helped verify the timing and operation of the hardware and demonstrated that the project was working properly.
This project successfully created a Human Response Timer using the STM32F407ZGT6 microcontroller and RGB LED. The system measures how quickly a user reacts when the RGB LED turns on. It uses a random 1-3 seconds delay to prevent the user from predicting when the signal will appear and an external interrupt to detect button presses quickly.
During testing, an issue was observed where the program remembers a button press made before the RGB LED turns white, causing the system to register a response even when the user pressed the button too early. Despite this limitation, the project successfully demonstrates basic embedded systems concepts such as GPIO control, interrupts, random number generation, and user interaction.






Comments