I'm more of a programmer than an electronics person so I apologise in advance if I misuse terminology or if the answer to this would be obvious if I had more experience.
I have just received a PPK2 and I wanted to profile a "TZT Mini PIR Motion Human Sensor Automatic Detector Module AM312 Sensor".
I connected everything as shown in "A". That hookup was based on my reading of section "6.4 Logic port" of the PPK2_User_Guide_v1.0.1.pdf.
I put the PPK2 in "Source meter" mode and set the supply voltage to 3300mv. I enabled D0 and power output, started a capture and triggered the PIR sensor. The trace was as shown in "A". In the un-triggered state, the DUT consumed 14μA. When triggered it spiked briefly then settled to 136μA. However, the D0 trace did not go HIGH to show the DUT going active.
After trying a different logic port (no difference), I decided to disconnect the VCC-VCC lead, as per "B", and try again. This time D0 went HIGH each time I triggered the DUT, going LOW again after ~3 seconds. The current spiked when the DUT was triggered but, apart from the spike, consumption remained at 14μA throughout. I think of this as the expected behaviour.
(I have conducted the same test with a bench power supply set to 3.3v, a μCurrentGold, and an oscilloscope. The result is similar to "B". I can see the PIR DATA line go high but, apart from a brief spike, current consumption is the same whether the PIR is triggered or not. So I have some confidence that the traces in "B" are correct.)
Without changing the wiring, I:
1. Quit nRF Connect.
2. Turned the PPK2 off and on again.
3. Started nRF Connect again.
4. Repeated the test.
The result is shown in "C". This time the the spikes appeared each time I triggered the DUT, the consumption remained at 14μA, but the D0 trace did not go HIGH to show the DUT going active. It is sort of a hybrid of "A" (no D0 trace) and "B" (spikes on transition but otherwise 14μA throughout).
I have repeated this cycle several times and the result is always the same. The first time power is applied to the circuit, D0 will not follow the PIR signal until VCC has been connected, then disconnected.
My second set of tests used an ESP32 development board. GPIO32 was connected to the PIR data line. GPIO2 is the on-board LED which illuminates when HIGH. A small sketch (attached) running on the board:
1. Initialises during setup() by reading the state of GPIO32 and conforms GPIO2 to the same state as GPIO32.
2. Runs a loop() which senses when GPIO32 changes state, waits 100ms, and then conforms GPIO2 to that state observed for GPIO32.
The overall pattern is similar, but not identical, to the first set of tests. Unlike "A", "D" does not show any reaction to the PIR being triggered. Neither does the ESP32 board (the on-board LED does not change). "E" and "F" both show the expected pattern.
Not shown is another test. My starting point was "D" (ie 3v3 VCC reference connected). I disabled power output from the PPK2, disconnected the 3V3 VCC line, started a trace and then enabled power output from the PPK2, The D0 trace (the onboard LED) starts and remains HIGH, while the D1 trace (the PIR) starts and remains LOW. What actually happens on the board is that the LED turns on then off. This is because the startup() code reads the state of GPIO32 (the PIR) and sets GPIO2 (the LED) to be the same. In other words, the ESP32 thinks the PIR is triggered - yet the PPK2 D1 trace suggests it is not. When I subsequently trigger the PIR, the current trace is as per "E" and "F" but D0 remains HIGH and D1 remains LOW. On the board, the LED turns on, then off again after ~seconds, indicating that the board is receiving transitions from the PIR. Those transitions are just not making it to the PPK2.
The documentation says DUT VCC should be connected to the PPK2. I assumed that VCC was providing a voltage reference for logic-level shifting. I don't understand why I don't get sensible results from the logic inputs when VCC is connected, nor why VCC needs to be connected and then disconnected before the logic inputs will behave sensibly.
Any ideas?