To connect the microcontroller with the game engine, a serial communication object is created with a baud rate that matches the value set in the Blueprint of the plugin. Data is retrieved from the Arduino using the analogRead() function and sent to Unreal Engine via Serial.println(). In Unreal, the data is received and read using the Serial Read Line function after a successful connection to the serial communication port.
For the prototype of the technical implementation testing, I connected an LED controlled by a potentiometer to an Arduino, which sends the mapped potentiometer data to Unreal Engine via serial communication.
Arduino LED code.
LED connected to the PIN 3
Potentiometer input on A0, performs an Analogue Read from A0pin and stores it in the sensorValue variable
The mapped value is sent from Arduino
Serial.println :
“Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or ‘\r’) and a newline character (ASCII 10, or ‘\n’). This command takes the same forms as Serial.print().”

Reading multiple data

screenshot image from: Arduino C# Serial Communication Connected to Multiple Sensors