I have done this in a different manner. I have used the UART TX pin of RPi connected to the RX pin of the arduino and sent serial messages from Arduino to RPi. That worked fine. But the thing is, what you have done is correct and has to work. Please make sure that you have connected Arduino's ground and RPi ground together. ------------------------------------------------------------------------ If you not do that and try the same code it has to work. Because the RPi and Arduino are in two different circuits, so in order to work, make them one make GROUND common.