C1001 Human Detection Sensor problems.
Ok, so I connected the sensor module to a XIAO ESP32C3 board. The board has pins marked RX and TX so I connected these to the RX / D7 and TX / D6 pins. (i.e.: Serial1.begin(115200, SERIAL_8N1, /*rx =*/RX, /*tx =*/TX); Now RX resolves to the same as D7 - GPIO20 and TX resolves to D6 - GPIO21)
I used the "basics.ino" file provided by DFROBOT Github site and included the library in the lib folder of a PlatformIO project.
Compiles and all is well that far but when it runs it comes back with "init error!!!".
So I tried it with other pins like D0 and D1 etc all respond the same way.
If I change the statement in the code to: Serial1.begin(115200, SERIAL_8N1, /*rx =*/TX, /*tx =*/RX); i.e. the Pin marked RX on the sensor board is connected to a pin defined in the Serial.begin1(....) statement as TX and the pin on the sensor board marked as TX is connected to the pin defined as RX, then it appears to work; However, it does not appear to reliably sense my presence it most always says some one is present.
The motion detection value does seem to change according to sitting perfectly still or moving. But when I walk out of the room a long distance it does not reliably sense that I am gone. Sometimes when I return and get close to the sensor it will say "No one is present" for a second or so before returning to say "Someone is present".
I hooked up a beeper to D10 so I can hear when it returns no one is present even from a long distance.
I tested the sensor on both 3.3V and 5.0V no change.
So now I am confused:
1. Why does it work when I swap the RX and TX pins in the Serial1.begin(...) statement opposite to what it defines as being the RX and TX pins?
2. Why if I walk out of the room does it not switch to no one being present? Does it sense something else besides a human presence?
Any one have any ideas before I return the board as defective or something?
Thanks.