Hello im new in using raspberry pi and node-red and i am doing a smart parking project using ultrasonic sensors. How can I use node-red with an ultrasonic sensor to detect the car if the spot is taken or not and get results and publish it in a website?
Welcome to the forum.
Which bit don't you know how to do?
Using node-red to get sensor readings then publish it to a website
I don't know exactly what you mean by 'publish it to a website' but I suggest getting the sensor reading working first.
What sensor are you using and how is it connected to the pi?
Im using Hc-sr04 sensors and its connected using gpio pins, is that right? Sorry
If you search the forum for that sensor I think there may have been some posts about them.
I've tried but no luck, I already have the python code working. I'm trying to use node red to send sensor reading to a webpage because the website im trying to make will supposed to tell if a sensor/spot is occupied or vaccant.
try the node-red-contrib-pisrf node
its working, now how do I display an if else message if the car distance is lets say 5cm then it will send an "occupied" message then if its >5 then it will send "available" message.
If you add a switch node - you can check the values coming from the pisrf node and send them to one output if its 5cm or less and another output otherwise.
You can then use change nodes, on each output, to change the message from a number to occupied or available
Thanks cymplecy this helped a lot
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.