Analog Sensor Reading| Arduino|Node-Red| Serial Coomunication|Node_Red-UI

preview_player
Показать описание
this tutorial shows you how to read analog sensors awith an arduino board and send data to Node-red dashboard via serial communication. You need to install Nodejs in your computer before installing node-red.

This is the arduino code used .
=================================

int newval = 0;
void setup() {
// Initialize Serial port
}

void loop() {
newval = newval+4;
if(newval == 500){
newval=0;
}
int fixed =40;
int sensorValue = analogRead(A0);
int sensorValue1 = analogRead(A1);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
// float voltage = sensorValue * (5.0 / 1023.0);
delay(2000);
}

This is the node used in node-red . Copy them and paste in node-red flows
==========================================

Рекомендации по теме
Комментарии
Автор

Thank you, you solved my problem, I was having trouble sending serial data in JSON format and your arduino code did the trick

mohammadhaque
Автор

Quick video and very helpful, thanks bro

ogirdor
Автор

Thanks, nice project covering several useful areas. 👏

batchrocketproject
Автор

I'm confused with the A/AIN numbers. I think A1 is AIN2. For using this pin do I configure number 1 or 2 to node-red?

anttiryts
Автор

can i use this with PiR MOVIMENT DETECTION SENSOR ?

vitoraugusto
Автор

It is possible in node-red to read and send data at same time to arduino via serial nodes?

duartecancela
Автор

does node red need wifi to show the dashboard?

edgaromarreynatorres
Автор

Hi bro this is nice.
I am doing something similar but I am receiving data from my sensors using XBee. The data I retrieve from the Serial Node is hex. How can I convert to float to plot these graphs please?

Ngigi
Автор

For same setup, can you connect it to raspberry pi then measurements can be displayed wireless by phone??

mustafaaljumaili
welcome to shbcf.ru