In this project, the Obstacle LED on the IR Sensor module glows, and an external LED connected to PA7 toggles when an obstacle is detected. This is achieved by configuring an external interrupt for the 'OUT' pin of the IR sensor module. When the IR sensor detects that something is nearby, it's 'OUT' pin goes low. Due to this, the'PA0' pin of the stm32f407 which is configured as an input, is connected to the 'OUT' pin of the sensor module. Whe the IR sensor module goes low, an external interrupt is generated, and the external LED connected to PA7 glows.
The connections made here are as follows,
IR Sensor | STM32F407 |
---|---|
VCC | 5V |
OUT | PA0 |
GND | GND |
LED | STM32F407 |
---|---|
Anode | PA7 |
Cathode | To GND through a resistor |