Configuring PIR sensor system with low-battery alert
Passive infrared (PIR) sensors are behind everyday motion detection, from security systems and smart lighting to wildlife cameras. They work by sensing changes in infrared radiation as a warm body moves through their field of view.
A traditional PIR analog front–end needs multiple op amps, passive filters, and comparators, and it often uses mechanical potentiometers for sensitivity adjustment. Those potentiometers wear out and are hard to reach in sealed enclosures. This article explores a simpler approach.
A single configurable mixed-signal device combines two-stage high-gain amplification, button-controlled sensitivity through digital rheostats, window comparators for motion detection, low-battery monitoring for lithium coin cells (< 2.8 V), and power gating for longer battery life.
The article walks through the design step by step. You can open the ready-to-use design file in the free Go Configure Software Hub, inspect the logic, and adapt it to your own system.
Theory of operation
PIR signal conditioning
The raw output of a pyroelectric sensor is a very low-amplitude, low-frequency signal (typically a few millivolts). To detect motion reliability, this signal must be amplified and filtered.
As detailed in a standard PIR design theory, the signal conditioning chain typically consists of:
- Stage 1 amplification: A non-inverting amplifier with high gain and band-pass filtering to reject high-frequency noise and DC drift.
- Stage 2 amplification: A second inverting or non-inverting stage to bring the signal to a detectable logic level.
- Window comparator: Compares the amplified signal against high and low thresholds to generate a digital pulse when motion is detected.
Digital sensitivity control
In this design, altering the gain of the Stage 2 amplifier controls sensitivity. Instead of a fixed resistor or mechanical potentiometer, mixed-signal device’s internal digital rheostat macrocells are used.
The resistance is placed between Stage 1 and Stage 2. By pressing the UP or DOWN buttons, you can modify the counter value of the rheostat, changing the inter-stage resistance. This change in impedance alters the signal amplitude fed into Stage 2, thereby increasing or decreasing system sensitivity to motion.
Low-battery detection
Since the mixed-signal device—SLG47001—is designed for coin-cell operation (for example, CR2032), monitoring battery level is critical. The system uses a comparator configuration to check if the supply voltage from the coin drops below 2.8 V.
The logic compares half the supply voltage against a stable internal reference voltage (1.4 V) to check if the coin-cell is depleted. When this condition is met, a visual indicator (LED) pulses for 25 ms every 2 s to grab attention to replacing the cell with less battery consumption.
Power management and enable logic
To maximize battery life, the system uses the SLG47001’s ability to dynamically power gate its internal analog and digital macrocells. The design includes an active-low Enable functionality controlled through PIN 1 (~EN Pin).
- Global shutdown: When the ~EN Pin is de-asserted (Logic Low), the internal logic propagates a disable signal to the active components.
- Macrocell gating: The GreenPAK connection matrix is configured to route this signal to the PWRUP or ENABLE ports of the power-hungry blocks.
- Operational amplifiers: Both Stage 1 and Stage 2 amplifiers are disabled, cutting their quiescent current.
- VREF and source-sink buffer: The internal voltage reference (1.4 V) and the VDD/2 dividers are turned off. The S/S Buffer, which is a voltage follower providing the 1.4 V reference to the comparator, is also turned off.
- ACMP: The analog comparators and the oscillator (OSC0) used for the blinking logic are gated.
- Leakage only: In this state, the IC consumes only leakage current (typically in the nano-amp range), significantly extending the shelf life of the CR2032 coin-cell when the device is not in use.
- Wake-up behavior: When ~EN is pulled high, the EN_POR (Power-On Reset) signal initializes the logic, and the analog blocks wake up.
Electronic design
Schematic overview
The components in the circuit are minimal, relying on the SLG47001 for the heavy lifting. The following list shows the major components and how they are connected in the schematic:
- Output: A red LED for the low-battery indicator and a green LED for the motion detection indication. These are active-low; the LEDs illuminate when the pin sinks the current flowing through the LED.

Figure 1 The schematic diagram highlights low-power detection and indication. Source: Renesas
- Sensor: Standard PIR sensor connected to the non-inverting input of the first op amp.

Figure 2 See the path for PIR signal up to motion detection. Source: Renesas
- Buttons: Two tactile buttons connected to GPIOs with internal pull-up resistors for sensitivity control. These are active-low, using the internal pull-up on the I/Os.

Figure 3 Here is how sensitivity-change buttons work. Source: Renesas
- Switch: A slider switch is used to power on the PIR sensing through enabling all the internal blocks in the SLG47001 mixed-signal device. This is active-low, using the internal pull-up on the I/Os.

Figure 4 Power-on switch enables sensing through all the internal blocks in the SLG47001. Source: Renesas
- Power: A coin-cell battery acts as the primary power source. Then, bulk and decoupling capacitors are added.

Figure 5 Coin-cell acts as the main power supply. Source: Renesas
Passives selection for op-amp band-pass filter
Overall, the gains for the two stages are:
- Stage 1 with OPAMP0: Based on R5 and R4, it’s fixed at 1+(1 MΩ/47 kΩ), which is a gain of 22.3.
- Stage 2 with OPAMP1: For the variable gain at Stage 2, the gain varies based on the value of Rheostat0.
- The minimum gain is when Rheostat0 is at its maximum value of 100 kΩ. Combined with the Rheostat1 value of 10 kΩ, it’s 1+(1 MΩ/110 kΩ), which is a gain of 10.1.
- The maximum gain is when Rheostat0 is at its minimum value of around 100 Ω. This is negligible compared to the Rheostat1 value of 10 kΩ. Overall, it’s 1+(1 MΩ/10 kΩ), which is a gain of 100.
The final gain is the multiplication of the gain of the two stages, changing from a gain of 225 to 2,230.
PCB design
The hardware implementation features a compact, four-layer PCB designed to fit within a small enclosure or mount directly to a wall. All the signal and power routing are on the layer with components assembly, except for one track. So, the design can also be two-layered to optimize cost. The layout prioritizes signal integrity for the high-impedance PIR sensor node.
- Top-side layout: The top side houses the PIR sensor and the UI text only.
- PIR Sensor (U1): Centrally located to maximize the detection field of view.

Figure 6 PCB’s top side houses PIR sensor and UI text. Source: Renesas
- Bottom-side layout: The bottom side is dedicated to all other components in the surface mount (SMD) form factor.

Figure 7 PCB’s bottom is dedicated to all other components except PIR sensor. Source: Renesas
- Battery holder: A surface-mount holder for a CR2032 coin-cell battery. This placement saves board space and allows for easy battery replacement without exposing the sensitive electronics on the top side.
- SLG47001 (U2): Placed close to the sensor to minimize trace length for the sensitive PIR_OUT signal. Short traces reduce susceptibility to EMI, which can cause false triggers.
- Decoupling: Power supply filter capacitors are placed directly beside the SLG47001 power pins and connected through vias to GND to ensure a clean voltage source for the internal operational amplifiers.
- User interface:
- The UP and DOWN tactile switches are reverse-mounted SMD types, easily accessible on the top with a clean interface.
- The Motion Detection (green) and Low Battery (red) status LEDs are also reverse-mounted, positioned for clear visibility during battery alerts or motion detection.
- The ~ENABLE input is provided with a slider switch to the side.
GreenPAK design
The internal logic is configured using the GreenPAK Designer software. PIR_band_pass_configurable.aap is the design file which implements the design shown in Figure 8. The same file can be used for simulation described in Simulation section.

Figure 8 The GreenPAK Designer software implements the design shown in this diagram. Source: Renesas
Analog front-end
- OPAMP0 (Stage 1): Configured as the first gain stage, taking the raw PIR input from PIN 6.
- OPAMP1 (Stage 2): Provides the second stage of amplification. Its input comes from Stage 1 through the digital rheostats.
- DigitalRheostat0 (RH0): Configured as a variable resistor. It’s controlled by the internal counter logic driven by the UP/DOWN external pins. Its initial resistance is set at 49.6 kΩ, giving an initial gain of 17.8.
- DigitalRheostat1 (RH1): Acts as a constant resistance (~10 kΩ) in the feedback/input path to set the base gain range.
- Control: The UP button decreases resistance (increasing gain), and the DOWN button increases resistance.
Motion detection logic
- ACMP (analog comparator):
- Configured as a Window Comparator (Channels 0 and 1) to monitor the output of OPAMP1.
- Thresholds for Channels 0 and 1 are set symmetrically around the reference voltage (0.25 VDD and 0.75 VDD).
- If the signal swings outside this window (motion is detected), the output goes HIGH.
- Output: The signal is routed to PIN 19 (PIR Detect Pin) through a NOR gate to give an output if any of the two comparators are triggered and make it active-low for LED to indicate.
Sensitivity control logic
- Debounce: 50 ms delays (CNT3/DLY3 and CNT4/DLY4) filter the mechanical bounce from the UP (PIN 15) and DOWN (PIN 16) buttons.
- Counter control: The debounced signals drive the clock inputs of the digital rheostats, stepping the resistance up or down.
Low-battery monitor
- Reference voltage (VREF 0A0 + S/S buffer): VREF 0A0 to an output of 1.4 V is fed to the S/S buffer whose output at PIN 20 is fed to PIN 17 as the reference voltage for the Comparator Channel 2.
- ACMP Channel 2:
- IN+: With 0.5x gain of VDD
- IN-: Connected to the internal 1.4 V reference
- Low-frequency clock: A 0.5-Hz clock is generated by a counter with the input of 4 Hz (OSC0/512).
- Indication: The AND operation of a 0.5 Hz clock and the ACMP Channel 2 is connected to a 25 ms one-shot timer to pulse the LED on PIN 18. This gives a low duty cycle for the LED, therefore drawing low power.
Power management
- ~ENABLE Pin (PIN 1): When high, the system is active. When LOW, the EN_POR signal gates the internal oscillators and operational amplifiers, reducing quiescent current to a minimum.

Figure 9 The above image displays VBAT waveform setting. Source: Renesas
Simulation
Low-battery threshold
A trapeze pattern is used for the VBAT signal to simulate the battery voltage going below the threshold of 2.8 V and coming back up to 3.0 V. This is to evaluate how the 0.5-Hz signal—mentioned in the low-battery monitor section—is used with the output from ACMP Channel 2 to trigger the 25 ms one-shot timer and thus create a low-duty-cycle square wave to enable the Low BAT LED.

Figure 10 Here is a view of the low-battery indication simulation. Source: Renesas
Sensitivity adjustment and PIR triggering
A signal of 2-mV amplitude and 1-V offset is fed as input to Stage 1. The UP and DOWN signals are toggled multiple times, simulating button presses, as seen in the first two waveforms in Figure 11. This changes the Rheostat0 value and, therefore, the gain of Stage 2. You can see this in the amplitude of the Stage 2 output, which is the sine wave in green. When the amplitude is below 1/2 VDD, the ACMP Channels 0 and 1 are not triggered, so PIR detect does not toggle at that time.

Figure 11 See the sensitivity changes along with PIR trigger simulation. Source: Renesas
PCB testing
Low-battery threshold
The supply voltage VDD is changed between 3.0 V and 2.6 V in 50-mV steps using the VDD from GreenPAK Lite development board to power the system. Go Configure Software Hub in Emulation mode controls the VDD change.
The ~LOW_BAT signal toggles for 25 ms every 2 s whenever the VDD goes below 2.8 V, as seen in the Saleae waveform capture in Figure 12. The low-duty-cycle pulses in D6 channel above the VDD signal may be hard to identify because of the short pulses.

Figure 12 See the low-battery indication of ramping down of input voltage. Source: Renesas
Sensitivity adjustment verification
- To verify the variable gain, a sine wave generator is used to get a 1 mV peak-to-peak sine wave at an offset of 1 V (simulating a human target movement), which is injected into the PIR input.
- To test sensitivity adjustment:
- Inject 1-mV sine wave to Stage 1 input.
- The ~ENABLE pin is connected to GND to power all the internal circuitry of the IC.
- Press the UP button multiple times to increase sensitivity to its maximum value.
- Press the DOWN button multiple times to increase sensitivity to its minimum value.
- Observe the amplitude change at the output of Stage 2 (OPAMP1).
- Observe the PIR output pin change state when the output is greater than the windowed threshold.
- The ~ENABLE pin is floated to pull it up with the internal pull-up to power off all the internal circuitry of the IC.
Results: The Saleae logic analyzer capture in Figure 13 demonstrates the operation of the two stages of OPAMP as well as change in sensitivity.

Figure 13 Note the change in gain of Stage 2 in hardware with press of the UP and DOWN buttons. Source: Renesas
It’s worth noting that the input signal is too low to be captured by the logic analyzer and is not included in the waveform in Figure 13.
Specifically, the following are the results of the sensitivity adjustment verification:
- OFF to ON: Initially at the 70s mark in the image, the ~ENABLE pin is HIGH, therefore disabling both the OPAMPs and making their output low. On the transition to LOW, the amplification of both stages is shown to start. The settling time for the two stages depends on how much time has passed since the last time the ~ENABLE pin was LOW.
- Gain increase: From around 77s to 102s, you can see that the UP button is pressed multiple times which increases the amplitude of the Stage 2 output.
- Comparator trigger: Around the 100s mark, the ~PIR_OUT connected to a LED goes LOW whenever the peak of the sine wave of the Stage 2 output crosses the comparator threshold on either side, therefore pulsing this active-low output.
- Gain decrease: From around 104s to 119s, the DOWN button is pressed multiple times decreasing the gain and, therefore, the amplitude of the Stage 2. You can see that the PIR output also becomes constantly high during this time.
- Gain increase and decrease again: The same cycle is repeated.
- ON to OFF: The ~ENABLE pin going HIGH just before the 140s mark shows power-off.
Working with a PIR sensor
The test procedure described in Sensitivity adjustment verification section is adopted when testing the circuit with the PIR sensor and its Fresnel lens. The only difference is that to provide a significant change in the input signal the tester moves in front of the PIR sensor.

Figure 14 The waveform is shown with a PIR sensor as input. Source: Renesas
As seen in Figure 14, after increasing the sensitivity through pressing the UP button, human movement triggers the PIR_OUT signal during the ~25s to ~35s period. Subsequently, with the decrease in sensitivity through pressing the DOWN button, the same movement results in a reduced amplitude of the Stage 2 output, which is insufficient to trigger the PIR_OUT signal.
Figure 14 also shows the settling time of the Stage 2 output in the first 10s as well as the powering down of the circuit with pulling the ~ENABLE signal high after the 50s mark.
What a mixed-signal device can do
The design we explored in this article demonstrates how a mixed-signal device can simplify a battery-powered PIR system by integrating signal conditioning, adjustable sensitivity, low-battery monitoring, and power management. Digital gain adjustment provides flexible control of PIR sensitivity, while the integrated analog and logic resources help reduce external circuitry and support a compact, low-power implementation.
Overall, the approach provides a practical foundation for PIR applications requiring reliable motion detection, adjustable sensitivity, and efficient power use.
PrithviRaj Narendra is an embedded systems consultant who specializes in taking concepts from napkin sketches to mass-manufactured realities. He holds deep domain expertise in Lithium batteries and Battery Management Systems (BMS), alongside a strong background in crafting modular, cloud-connected IoT architectures using bare-metal and RTOS environments.
Related Content


