Arduino Pi

Step 1: Step 1: Connecting the Arduino and Raspberry Pi

This step assumes you are using the external UART for connecting the Raspberry Pi with an Arduino Mega 2560. It's also possible to use this with another Arduino.

The Arduino uses 5V logic but the Raspberry Pi uses 3.3V logic, so a conversion must be made. I decided to build a circuit but you can also use Sparkfun Logic Level Converter. Note that the schematic is a bit wrong R3 should be 10k instead of 10 ohm!

Arduino Pi

The next image shows how the logic level shifting circuit should be connected with the Raspberry Pi. In the next step the Raspberry Pi gets configured and the first data can be send.

Step 2: Step 2: Configuring the Raspberry Pi

The Raspberry Pi sends all terminal output over the external serial to disable this behaviour the following file needs to be edited: sudo nano /etc/inittab the following line needs to be commented out by placing a hashtag before it (#):


Now the terminal stops listening on the UART pins but the debug information is still being send, to change this the following file needs to be edited: sudo nano /boot/cmdline.txt and the following part should be removed:


Now upload the following script on the Arduino (I call it a pass through script):

  // Open serial communications to PC and wait for port to open:
  Serial.println("Connected to PC");
  // set the data rate for the Bluetooth port
Arduino Pi schematic}
voidloop()// run over and over

Next we can test the connection by sending the following command, the images show the result:

echo-e"This is the text I want to display on my Arduino \r\n">/dev/ttyAMA0

Step 3 will setup PHP or Python

For more detail: Arduino Pi

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
Scroll to Top