# HC-SR04 Ultrasonic Sensor - rpi-srf - status not available

**URL:** <https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955>\
**Category:** General\
**Created:** [19 February 2020 03:19 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955 "2020-02-19T03:19:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![abegun](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@abegun](https://discourse.nodered.org/u/abegun)\
**Post date:** [19 February 2020 03:19 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/1 "2020-02-19T03:19:47Z")

</div>

Hi,

I'm using the rpi-srf node with the HC-SR04 ultrasonic sensor but all I get is a status reading node-red:rpi-gpio.status.not-available

How can I get a proper reading from the sensor and what am I doing wrong?

Any help would be greatly appreciated!

Thank you

[Capture\_PiSRF\_Error1|690x174](https://discourse.nodered.org/uploads/short-url/2jbiRdKwJaV2VEoHrTw7lbLeyq8.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2020 10:42 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/2 "2020-02-19T10:42:06Z")

</div>

Did you try a forum search using 'ultrasonic sensor' or 'sr04' to see if someone has done this before?

---

<div class="post-metadata">

**Author:** ![abegun](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@abegun](https://discourse.nodered.org/u/abegun)\
**Post date:** [19 February 2020 12:20 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/3 "2020-02-19T12:20:52Z")

</div>

Hi zenofmud,

Thank you for your reply. I have spent over a week searching for an answer regarding this question. After trying for a while to fix it, I ultimately factory reset the raspberry pi and redownloaded raspbian and the other softwares. Finally, I was able to get it to work after a complete reset.

Thank you

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2020 12:29 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/4 "2020-02-19T12:29:22Z")

</div>

If you had looked at the various threads after searching for 'sr04' you might have discovered [node-red-node-pisrf](https://flows.nodered.org/node/node-red-node-pisrf).

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 February 2020 12:34 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/5 "2020-02-19T12:34:45Z")

</div>

errr- they did - that is the node being used (see link in OP)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [19 February 2020 13:03 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/6 "2020-02-19T13:03:24Z")

</div>

The node works for me (trig connected to pin10 - echo to pin 8, gnd to pin6 , vcc to pin 1)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/81a1992d97f7efcbea2c315ddee493cfeb27124a.jpeg)

There are a a few things to check

Have you got a newer 3.3V compatible version?

If using an old 5V version - you need to use some resistors to reduce the echo signal voltage

> **[Interfacing HC-SR04 Ultrasonic Sensor with Raspberry Pi](https://electrosome.com/hc-sr04-ultrasonic-sensor-raspberry-pi/)**
>
> In this tutorial we will learn about interfacing HC-SR04 Ultrasonic Distance Sensor with Raspberry Pi. Here we are using Python programming language.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2020 13:04 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/7 "2020-02-19T13:04:38Z")

</div>

oh...sorry I missed that. when I looked at the image, I saw the message under the node "node-red:pi-gpio.status.not-avaliable' and (foolishly) jumped to the conclusion they were using the rpi-gpio node.

---

<div class="post-metadata">

**Author:** ![abegun](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@abegun](https://discourse.nodered.org/u/abegun)\
**Post date:** [20 February 2020 13:21 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/8 "2020-02-20T13:21:28Z")

</div>

Hi cymplecy,

Thank you for your reply. Regarding whether or not the HC-SR04 is 3.3V compatible, I'm not really sure. But I would assume it is probably the newer one and therefore should be 3.3V compatible, as I got it recently (2 months ago) at Micro Center ([https://www.microcenter.com/product/613642/leo-sales-ltd-ultrasonic-sensor-module](https://www.microcenter.com/product/613642/leo-sales-ltd-ultrasonic-sensor-module)).

As mentioned in your linked tutorial I am using the same resistors and setup. A factory reset on the Raspberry Pi has solved the problem, although I never figured out the exact root of the issue. But all is good now that it is finally working.

All the best!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 February 2020 13:36 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/9 "2020-02-20T13:36:42Z")

</div>

> [@abegun](#):
>
> A factory reset on the Raspberry Pi

What do you mean by a factory reset?

---

<div class="post-metadata">

**Author:** ![abegun](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@abegun](https://discourse.nodered.org/u/abegun)\
**Post date:** [21 February 2020 19:39 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/10 "2020-02-21T19:39:24Z")

</div>

Hi Colin,

When I say a factory reset, I meant that I formatted the SD Card and then reinstalled Raspbian OS.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 March 2020 19:39 UTC](https://discourse.nodered.org/t/hc-sr04-ultrasonic-sensor-rpi-srf-status-not-available/21955/11 "2020-03-06T19:39:26Z")

</div>

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