This time, we plan to use the human body sensing module + Bluetooth to sense whether there is someone and get relevant information from the Bluetooth APP.
For the Bluetooth part, we still use the Bluetooth DEMO to read UUID: C101, READ VALUES 01 means someone is coming, 00 means no one is coming.
The external interrupt (EXINT) is directly connected to the NVIC. EXINT contains 23 edge detectors for generating interrupt requests. Each interrupt line can be independently configured with its trigger event (rising edge, falling edge, or both edges).
The interrupts can be individually masked; the pending register maintains the status of all interrupt requests. Up to 16 external interrupts can be selected from GPIO.
Human body sensing module
After passing through the amplifier, BISS0001 converts the pulse signal into more intuitive high and low level outputs. When someone outputs high, the output is high, and when no one outputs low.
The module interface has only three pins, ground, power, and data lines; they are counted as GND, VCC, and OUT respectively.
When the probe detects someone moving, OUT=1; when no one moves, OUT=0;
Therefore, we can treat it as an independent button, which is 1 when pressed (someone moves) and 0 when released (no one moves).
Previously, netizens reminded us to pay attention to voltage issues and to connect FT pins, such as PA8, etc.
Port the interrupt configuration and interrupt handling functions to the Bluetooth DEMO program. Add interrupt initialization to the initialization function and add the interrupt handle to the DEMO.
if(flag_hw == 1)
{
at_cmd_send(AT_RESULT_OK1);
}
else
{
at_cmd_send(AT_RESULT_OK0);
}
When downloading the program, just like before, delete the old one first and add the new firmware
After downloading, connect to Bluetooth for testing.
Testing in pedestrian and non-pedestrian environments
01 means a person is detected
00 means no person is detected
The test results show that when someone comes, the Bluetooth reads 01, and the Bluetooth is very stable without any disconnection.