# Hall magnetic sensor KY-003 signal in Dashboard

**URL:** https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463
**Category:** General
**Created:** [22 June 2021 07:22 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463 "2021-06-22T07:22:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Blu3](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Blu3](https://discourse.nodered.org/u/Blu3)
#### Post date: [22 June 2021 07:22 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/1 "2021-06-22T07:22:07Z")

</div>

Hello everyone,

iam new in the Node-RED community and an absolute beginner in programming (which i want to change).

At the moment i have my Raspberry and a KY-003 hall magnetic sensor. The connection to the Raspberry is no problem.  
A magnet should be held to the sensor and the signal should be recognized in Node-RED. Furthermore I want to see in a dashboard how often per minute a magnet was held to the sensor (More or less: RPM). Unfortunately I can't even manage to get the signal read out.

Is there anyone here who can tell me if my project is easy or hard, if there are already solutions for it or can help me with it?

Thanks a lot

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [22 June 2021 07:29 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/2 "2021-06-22T07:29:45Z")

</div>

Hi Blu3, welcome to the forum.

> [@Blu3](#):
>
> At the moment i have my Raspberry and a KY-003 hall magnetic sensor. The connection to the Raspberry is no problem.

What / how have you connected to RPi?

Have you used any other application to read the value from sensor? (i.e. have you verified it is working and the RPi can see it)

> [@Blu3](#):
>
> iam new in the Node-RED community and an absolute beginner in programming

As a new user, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

### Author: ![Blu3](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Blu3](https://discourse.nodered.org/u/Blu3)
#### Post date: [22 June 2021 11:35 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/3 "2021-06-22T11:35:33Z")

</div>

Hi Steve-Mcl, thank you for your answer.

> [@Steve-Mcl](#):
>
> What / how have you connected to RPi?
> 
> Have you used any other application to read the value from sensor? (i.e. have you verified it is working and the RPi can see it)

I have connected the sensor with the RPi with connecting cables. The signal is on GPIO24 (V+ is on pin 1 and Ground on pin 6).  
The sensor itself has a small LED that lights up when a magnet is held in front of it. This is fortunately the case for me.  
Unfortunately I don't know how to start my "project" in Node-RED.

I was able to get and visualize the data from a DHT11 sensor quite well. But this was essentially due to the custom node for this sensor. That made it easier for me.

> [@Steve-Mcl](#):
>
> As a new user, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Thanks for the recommendation. I have watched the videos and now understand some things much better. On the weekend I will watch some again to understand some topics even better.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [22 June 2021 11:53 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/4 "2021-06-22T11:53:52Z")

</div>

> [@Blu3](#):
>
> I was able to get and visualize the data from a DHT11 sensor quite well. But this was essentially due to the custom node for this sensor.

Well as you have connected to GPIO you can simply use the [node-red-node-pi-gpio](https://flows.nodered.org/node/node-red-node-pi-gpio) nodes to read the state of that input

> [@Blu3](#):
>
> I have connected the sensor with the RPi with connecting cables. The signal is on GPIO24 (V+ is on pin 1 and Ground on pin 6).

so the next step is to see values coming in on the RPi on GPIO24

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9c4a10832a73c10058653c92c25b6559ee2a081e.png)

---

<div class="post-metadata">

### Author: ![Blu3](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Blu3](https://discourse.nodered.org/u/Blu3)
#### Post date: [28 June 2021 07:12 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/5 "2021-06-28T07:12:12Z")

</div>

Hi Steve-Mcl,  
sorry for my late reply. Unfortunately I could not deal with it again sooner.  
And thanks for the help.

I now get two signals from the sensor.  
A 0 when a magnet is held to the sensor and a 1 when the sensor is taken away.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24c7804f4ea4ab140ba1b2683d129ec8d0204e7d.png)

Can you tell me if I can evaluate the two signals separately, so that only the 0 is counted and I come closer to the evaluation in RPM?

---

<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: [28 June 2021 07:35 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/6 "2021-06-28T07:35:13Z")

</div>

You can send it through a Switch node set to only pass the value 1 to the output and ignore other messages.

---

<div class="post-metadata">

### Author: ![Blu3](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Blu3](https://discourse.nodered.org/u/Blu3)
#### Post date: [28 June 2021 08:50 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/7 "2021-06-28T08:50:04Z")

</div>

Hi Colin,  
thank you. I think I am quite far in the meantime. With the switch I managed that only the 0 is let through as signal. Then I used a counter node to count the msg. Signals.  
Then I set msg.payload = msg.count so that only the counted value is the output.  
I can already display this graphically.

Now I have a last problem: The counted number is displayed over the time. But this is not RPM because the current axis can only go up because the counted value gets higher and higher.  
Does anyone have an idea how I can calculate and display the counted value per minute over time?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [28 June 2021 09:04 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/8 "2021-06-28T09:04:30Z")

</div>

Perhaps this node will help: [node-red-contrib-msg-speed (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-msg-speed)

---

<div class="post-metadata">

### Author: ![Blu3](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Blu3](https://discourse.nodered.org/u/Blu3)
#### Post date: [28 June 2021 09:36 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/9 "2021-06-28T09:36:44Z")

</div>

yes it works. thank you soooo much

---

<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: [12 July 2021 09:37 UTC](https://discourse.nodered.org/t/hall-magnetic-sensor-ky-003-signal-in-dashboard/47463/10 "2021-07-12T09:37:03Z")

</div>

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