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
Hi Blu3, welcome to the forum.
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)
As a new user, I recommend watching this playlist: Node-RED Essentials. 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.
Hi Steve-Mcl, thank you for your answer.
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.
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.
Well as you have connected to GPIO you can simply use the node-red-node-pi-gpio nodes to read the state of that input
so the next step is to see values coming in on the RPi on GPIO24
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.
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?
You can send it through a Switch node set to only pass the value 1 to the output and ignore other messages.
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?
yes it works. thank you soooo much
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.