# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/140/297/medium800/adafruit_products_6426-04.jpg?1760029692 )

We stock many low cost ["Passive IR" Presence / Motion sensors](https://www.adafruit.com/search?q=pir+sensor), and they're very popular for detecting motion from humanoids and pets 5 to 20 feet away. (They possibly work on zombies, not guaranteed, depends on how warm they are). The vast majority of PIR sensors use a larger infrared receiver, a processing chip (sometimes integrated into the receiver) and a lens. However, this makes them kinda chunky. Also most have a digital, or maybe analog signal output - which makes them very simple.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/298/medium800/adafruit_products_6426-02.jpg?1760029730 )

The **Adafruit STHS34PF80 IR Presence / Motion Sensor** is like a deluxe version of the classic PIR sensor in that it has an IR sensing element that works up to 4 meters away and doesn't require a lens, which makes it easier to integrate into small enclosures. It also comes with a full I2C interface so you can get detailed information about how much IR was detected, and whether there's presence, movement, or temperature changes.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/299/medium800/adafruit_products_6426-03.jpg?1760029771 )

Nice sensor right? So we made it easy for you to get right into your next project. The surface-mount sensor is soldered onto a PCB and comes with a 3.3V regulator and level shifting so you can use it with a 3V or 5V logic microcontroller or single board computer without worry.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/300/medium800/adafruit_products_6426-01.jpg?1760029793 )

The custom made PCB is in the [**STEMMA QT** form factor](https://www.adafruit.com/?q=stemma%20qt%20sensor), making them easy to interface with. The [STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt) on either side are compatible with the [SparkFun Qwiic](https://www.sparkfun.com/qwiic)&nbsp;I2C connectors. This allows you to make solderless connections between your development board and the STHS34PF80&nbsp;or to chain it with a wide range of other sensors and accessories using a [**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable). [QT Cable is not included, but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch)

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/140/303/medium800/adafruit_products_double.jpg?1760033931 )

The default I2C address is **0x5A**.

## Power Pins

- **VIN** &nbsp;- this is the power pin.&nbsp;It can be powered by 3V or 5V. Give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V.
- **3Vo** - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like.
- **GND** &nbsp;- common ground for power and logic.

## I2C Logic Pins

- **SCL** - I2C clock pin, connect to your microcontroller's I2C clock line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **SDA** - I2C data pin, connect to your microcontroller's I2C data line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) -** These connectors allow you to connect to development boards with **STEMMA QT** (Qwiic) connectors or to other things with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204).

## Interrupt Pin

- **INT** - This is the interrupt pin. Its polarity and output type can be set in software over I2C.

## Power LED and Jumper

- **Power LED -** In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **on**. It is a green LED.
- **LED jumper&nbsp;** - This jumper is located on the back of the board and is labeled **LED** on the board silk. Cut the trace on this jumper to cut power to the " **on**" LED.

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## CircuitPython and Python

It's easy to use the **STHS34PF80&nbsp;breakout** with Python or CircuitPython, and the [Adafruit\_CircuitPython\_STHS34PF80](https://github.com/adafruit/Adafruit_CircuitPython_STHS34PF80) module. This module allows you to easily write Python code to read ambient and object temperatures with the sensor.

You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First wire up the breakout to your board exactly as follows. The following is the sensor wired to a Feather RP2040 using the STEMMA connector:

- **Board STEMMA 3V** to **breakout STEMMA&nbsp;**** VIN (red wire)**  
- **Board STEMMA GND** to **breakout**  **STEMMA** **GND (black wire)**  
- **Board STEMMA SCL** to **breakout**  **STEMMA** **SCL (yellow wire)**  
- **Board STEMMA SDA** to **breakout**  **STEMMA** **SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/316/medium640/adafruit_products_feather_stemma_bb.jpg?1760037414)

The following is the breakout wired to a Feather RP2040 using a solderless breadboard:

- **Board 3V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/317/medium640/adafruit_products_feather_bb_bb.jpg?1760037462)

## Python Computer Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired with I2C using the STEMMA connector:

- **Pi 3V** to **breakout STEMMA** **VIN (red wire)**  
- **Pi GND** to **breakout**  **STEMMA** **GND (black wire)**  
- **Pi SCL** to **breakout**  **STEMMA** **SCL (yellow wire)**  
- **Pi SDA** to **breakout**  **STEMMA** **SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/318/medium640/adafruit_products_piStemma_bb.jpg?1760037491)

Here's the Raspberry Pi wired with I2C using a solderless breadboard:

- **Pi 3V** to **breakout** **VIN (red wire)**  
- **Pi GND** to **breakout** &nbsp;**GND (black wire)**  
- **Pi SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Pi SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/319/medium640/adafruit_products_piBB_bb.jpg?1760037516)

## Python Installation of STHS34PF80 Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-sths34pf80`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_STHS34PF80** &nbsp;library, and its dependencies, into the **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folders and file:

- **adafruit\_bus\_device/**
- **adafruit\_register/**
- **adafruit\_sths34pf80.mpy**

![CIRCUITPY drive](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/sths34pf80_sths34pf80_simpletest.py.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

## Example Code

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_CircuitPython_STHS34PF80/blob/main/examples/sths34pf80_simpletest.py

First, the STHS34PF80 sensor is recognized over I2C. Then, in the loop, it prints out the ambient temperature, presence detection and motion detection data.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/522/medium800/adafruit_products_Screenshot_2025-10-16_092255.png?1760620982 )

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Python Docs

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Arduino

Using the STHS34PF80 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the [Adafruit\_STHS34PF80](https://github.com/adafruit/Adafruit_STHS34PF80) library, and running the provided example code.

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the sensor VIN.

Here is an Adafruit Metro wired up to the sensor using the STEMMA QT connector:

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/308/medium640/adafruit_products_metroSTEMMA_bb.jpg?1760037288)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** &nbsp;**GND (black wire)**  
- **Board SCL** to **breakout** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **breakout** &nbsp;**SDA (blue wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/140/309/medium640/adafruit_products_metroBB_bb.jpg?1760037308)

## Library Installation

You can install the **Adafruit\_STHS34PF80** &nbsp;library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/304/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1760034780 )

Click the **Manage Libraries ...** menu item, search for **Adafruit STHS34PF80** , and select the **Adafruit STHS34PF80** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/140/305/medium800/adafruit_products_Screenshot_2025-10-09_143720.png?1760035068 )

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/140/306/medium800/adafruit_products_Screenshot_2025-10-09_143731.png?1760035075 )

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!

## Example Code
https://github.com/adafruit/Adafruit_STHS34PF80/blob/main/examples/sths34pf80_simple/sths34pf80_simple.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the STHS34PF80 recognized over I2C. Then, the ambient temperature, presence detection and motion detection are printed to the Serial Monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/493/medium800/adafruit_products_Screenshot_2025-10-15_111946.png?1760541608 )

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Arduino Docs

# Adafruit STHS34PF80 IR Presence / Motion Sensor

## Downloads

## Files

- [STHS34PF80 Datasheet](https://cdn-shop.adafruit.com/product-files/6426/sths34pf80.pdf)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-STHS34PF80-IR-Presence-Sensor-PCB)
- [3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/6426%20STHS34PF80%20IR%20Presence%20Sensor)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20STHS34PF80%20IR%20Presence%20Motion%20Sensor.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/140/301/medium800/adafruit_products_schem.png?1760030142 )

![](https://cdn-learn.adafruit.com/assets/assets/000/140/302/medium800/adafruit_products_fab.png?1760030153 dimensions are in inches)

![](https://cdn-learn.adafruit.com/assets/assets/000/140/386/medium800/adafruit_products_6426_STHS34PF80_IR_Presence_Sensor.jpg?1760371515 )


## Primary Products

### Adafruit STHS34PF80 IR Presence / Motion Sensor

[Adafruit STHS34PF80 IR Presence / Motion Sensor](https://www.adafruit.com/product/6426)
We stock many low cost ["Passive IR" Presence / Motion sensors](https://www.adafruit.com/search?q=pir+sensor), and they're very popular for detecting motion from humanoids and pets 5 to 20 feet away.&nbsp;&nbsp;(They possibly work&nbsp;on zombies, not guaranteed,...

In Stock
[Buy Now](https://www.adafruit.com/product/6426)
[Related Guides to the Product](https://learn.adafruit.com/products/6426/guides)

## Related Guides

- [FruitBox Sequencer: Musically Delicious Step Pattern Generator ](https://learn.adafruit.com/circuitpython-fruitbox-sequencer-musically-delicious-step-pattern-generator.md)
- ["Mother of all Demos" USB Keyset](https://learn.adafruit.com/usb-keyset.md)
- [ESPHole Ad Blocker](https://learn.adafruit.com/esphole-ad-blocker.md)
- [MACROPAD Hotkeys](https://learn.adafruit.com/macropad-hotkeys.md)
- [Adafruit PiCowbell Proto for Pico](https://learn.adafruit.com/picowbell-proto.md)
- [CircuitPython Libraries and Jupyter Notebook on any Computer with MCP2221](https://learn.adafruit.com/jupyter-on-any-computer-with-circuitpython-libraries-and-mcp2221.md)
- [Feather TFT STEMMA Case](https://learn.adafruit.com/feather-tft-stemma-case.md)
- [ESP32-S3 BLE iOS Media Controller](https://learn.adafruit.com/esp32-s3-ble-ios-media-controller.md)
- [CircuitPython Animated Holiday Wreath Lights](https://learn.adafruit.com/circuitpython-animated-holiday-wreath-lights.md)
- [Adafruit ADS7128 8-Channel ADC and GPIO Expander](https://learn.adafruit.com/adafruit-ads7128-8-channel-adc-and-gpio-expander.md)
- [Reading QR Codes with the Tiny Code Reader](https://learn.adafruit.com/reading-qr-codes-with-the-tiny-code-reader.md)
- [WiFi Weather Station](https://learn.adafruit.com/wifi-weather-station-arduino-cc3000.md)
- [Adafruit SPA06-003 - Temperature + Pressure Sensor](https://learn.adafruit.com/adafruit-spa06-003-temperature-pressure-sensor.md)
- [Holiday Tree with Feather RP2040 Scorpio](https://learn.adafruit.com/holiday-tree-with-scorpio.md)
- [Standalone AVR Chip Programmer](https://learn.adafruit.com/standalone-avr-chip-programmer.md)
