A direct connection between the Raspberry Pi and Arduino was prohibited, because of its electrical potential differences, which is 3.3 volts for the Raspberry Pi and 5 volts for the Arduino. Bi-directional Logic Level Converter should be used to separate them.