0

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?

zoltan hulle
  • 1
  • 1
  • 1

1 Answers1

0

In your Arduino sketch you should have line like this:

  Firmata.begin(57600);

Adjust the numeric value to desired speed. Try 9600 or 19200. (also possible values 2400, 4800, 9600, 14400, 19200, 38400 and 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.

rumata28
  • 385
  • 1
  • 6