I am trying to read a potentiometer data over firmata with node-red. potentiometer connects to analog pin of arduino and arduino is connect to raspberry pi 4 over usb.
Program runs good and i can get the data from arduino but connection lost very often. Connection establish after 1 second but it cuts off so often.
What can i do to correct this?
The transfer rate is so high and i don't need a speed like this. Can i decrease the connection speed? and how can i do that? Or is there a harware solution in there? i mean a capacitor or a resistance connection to sensor can deal the problem?
In your Arduino sketch you should have line like this:
Adjust the numeric value to desired speed. Try
9600or19200. (also possible values2400,4800,9600,14400,19200,38400and there are more). Please note that you should configure connection from NodeRed side either to match the baud rate.This is what you need to do to adjust the serial port connection speed.