PIR Shield¶
The PIR Shield wakes the OpenMV Cam from deep sleep on motion, draws an ultra-low 6 µA in standby, and adds eight white plus eight 850 nm infrared LEDs for illumination. Ideal for battery-powered surveillance and trail cameras.
For full datasheet, photos, and ordering see the PIR Shield product page.
Highlights¶
6 µA standby PIR sensor for years of battery operation
Eight 3500 K white LEDs and eight 850 nm IR LEDs (PWM-dimmable)
Pinout¶
Pin reference¶
Pin |
Function |
|---|---|
P7 |
PWM control for the white LEDs |
P8 |
PWM control for the 850 nm IR LEDs |
P9 |
Wakeup (alternative) |
P11 |
Wakeup (default) — pulls low when the PIR detects motion |
RAW rail |
Always-on power for the PIR sensor — keeps motion detection alive while the camera is in deep sleep |
3.3V rail |
Powers the shield’s on-board electronics |
GND rail |
Common ground |
Note
Each of P7, P8, P9, and P11 can be reclaimed for unrelated use. P7, P8, and P11 are connected by default through back-side solder jumpers — open the jumper on any pin you want to free. P9 defaults to disconnected: bridge its back-side jumper to route the wakeup signal to P9 instead (and open P11’s back-side jumper to release P11).
Note
P11 is the wakeup pin on all modern OpenMV Cams — leave the shield
on its default mapping for deepsleep() motion wake. The P9
alternative exists for legacy OpenMV Cams, which don’t have a
dedicated wakeup line — P9 lands on a regular GPIO that you’d
poll or attach an IRQ to instead.
Usage¶
PWM-dim the white and IR illumination LEDs:
from machine import PWM, Pin
white = PWM(Pin("P7"), freq=50_000, duty_u16=0)
ir = PWM(Pin("P8"), freq=50_000, duty_u16=0)
white.duty_u16(32_768) # 50% white
ir.duty_u16(16_384) # 25% IR
Wake the camera from deep sleep on motion. P11 (the default wakeup line) pulls low when the PIR triggers and resets the camera:
from machine import deepsleep
deepsleep() # the next motion event resets the camera