# Library needed for Motion Sensor HC-SR50x

**URL:** <https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408>\
**Category:** Hardware Interfacing Questions\
**Created:** [January 5, 2023, 12:02pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408 "2023-01-05T12:02:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gheppy](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gheppy](https://forum.xod.io/u/gheppy)\
**Post date:** [January 5, 2023, 12:02pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/1 "2023-01-05T12:02:24Z")

</div>

Hello,  
I’m at the beginning of the journey and I can’t figure out which mode to use to connect an HC-SR505 or HC-SR501.  
From what I’ve seen, I can’t find any library for a motion sensor.  
Can someone help me with a library for this sensor.

Info:

> **[HC-SR505 Mini PIR Motion Sensor](https://www.elecrow.com/hcsr505-mini-pir-motion-sensor-p-1382.html)**
>
> HC-SR505 Mini PIR Motion Sensor

> **[HC-SR505 pdf, HC-SR505 Description, HC-SR505 Datasheet, HC-SR505 view :::...](https://pdf1.alldatasheet.com/datasheet-pdf/view/1284342/ETC1/HC-SR505.html)**
>
> HC-SR505 Datasheet, HC-SR505 datasheets, HC-SR505 pdf, HC-SR505 integrated circuits : ETC1 - Mini PIR Motion Sensor ,alldatasheet, Datasheet, Datasheet search site for Electronic Components and Semiconductors, integrated circuits, diodes, triacs and...

Thank you

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [January 5, 2023, 12:44pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/2 "2023-01-05T12:44:45Z")

</div>

Take a look at:

> **[Infrared Pyroelectric Motion Sensor (HC-SR501) — Biomaker.org](https://www.biomaker.org/block-catalogue/2021/12/17/infrared-pyroelectric-motion-sensor-hc-sr501)**
>
> The HC-SR501 sensor is a passive infrared (PIR) motion sensor which can be used to detect movement of humans or animals.

---

<div class="post-metadata">

**Author:** ![gheppy](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gheppy](https://forum.xod.io/u/gheppy)\
**Post date:** [January 5, 2023, 12:55pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/3 "2023-01-05T12:55:29Z")

</div>

Thank you for the prompt reply and for the information.  
It helps me a lot.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [January 5, 2023, 3:18pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/4 "2023-01-05T15:18:55Z")

</div>

According to the specs you posted for the HC-SR505, it just requires a digital read. If output is high, motion has been detected; otherwise there is no motion. No library is required, just the built-in digital-read node.

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [January 5, 2023, 9:50pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/5 "2023-01-05T21:50:51Z")

</div>

Absolutely! The page I linked to describes how to use the sensor with XOD and provides a couple of example patches.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [January 5, 2023, 9:55pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/6 "2023-01-05T21:55:36Z")

</div>

Ah. Sorry. I didn’t look into it & assumed you were recommending a different model of the sensor. It is not obvious that biomaker site would be a XOD reference, but the group has been using XOD & participating here in the past.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [February 4, 2023, 9:56pm UTC](https://forum.xod.io/t/library-needed-for-motion-sensor-hc-sr50x/6408/7 "2023-02-04T21:56:04Z")

</div>

Closed on February 4, 2023, 9:56pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
