Raspberry Pi - Arduino Serial Communication
by AdrieSentosa in Circuits > Raspberry Pi
353094 Views, 161 Favorites, 0 Comments
Raspberry Pi - Arduino Serial Communication
![RaspPi-Ardu.jpg](/proxy/?url=https://content.instructables.com/FMN/FA9V/IH3OZR99/FMNFA9VIH3OZR99.jpg&filename=RaspPi-Ardu.jpg)
In this project, we will be making a communication between Arduino and Raspberry Pi which transfer vital information by sending data one bit at a time.
Serial communications are essential for every Micro-controllers to communicate between Micro-controllers and another device. The Micro-controller sends these 1 and 0 (bits) that contain necessary information one by one, or Serially. These bits form together and turn into bytes (composed of 8 bits). For further information, check it out sparkfun binary tutorials.
It’s a fairly easy project and can be used either on its own or part of something bigger (Check it Out >> Integrated Weather Station).
List of Material
![102068.jpg](/proxy/?url=https://content.instructables.com/FGT/JRY8/IH9GX1IA/FGTJRY8IH9GX1IA.jpg&filename=102068.jpg)
For this project, we will be using:
- Arduino boards (mine Arduino Uno Rev3)
- Raspberry Pi 2
- USB cable cost :~1.00 USD
Hardware Connection
![102067.jpg](/proxy/?url=https://content.instructables.com/FGE/EMWY/IH9GX1KN/FGEEMWYIH9GX1KN.jpg&filename=102067.jpg)
In common, the connections are fairly easy. Just connect Arduino USB Plug to Raspberry PI with USB cable and check the connection between Arduino and Raspberry pi by type "ls /dev/tty*" in Raspberry Pi terminal, the result should be content "/dev/ttyACM0" and you are good to go.
Raspberry Pi Programming
Below is the Raspberry Pi Serial Communication code. Upload serial_test.ino code to your Arduino (Mine Arduino Uno Rev3) , Run serial_test.py Python code in Raspberry PI, Connect Arduino to Raspberry Pi through USB cable, and you should have no problems.
Enjoy!
![102066.jpg](/proxy/?url=https://content.instructables.com/FMW/AO07/IH9GX3N4/FMWAO07IH9GX3N4.jpg&filename=102066.jpg)
After making sure that everything works smoothly, you can take this project into bigger project (Check it Out >> Integrated Weather Station)!
Power through batteries or a plug and you’re good to go!