Making Raspberry Pi and Arduino Speak To Each Other
As part of our project requires a micro controller to do some of the functions, we need an easy way for that data to be communicated either way. The micro controller is a ATMEGA328p, which is well known for being the core of the Arduino Uno.
Serial
One standard that has been around for a while for making devices talk to each other is Serial UART. This requires 3 wires, a reference voltage (Ground), a transmit (data out), and a receive (data in). by connecting two chips from their transmit to the receive you can send data between them. you do however, need to know a few things, what speed and what voltage are two important variables (but not the only).
Different Voltages
The problem with the Raspberry Pi and the ATMEGA chip is I want the ATMEGA to be at a 5V logic, where as, the Raspberry Pi is at a 3.3V logic. If I were to connect these it is likely I would damage the Raspberry Pi.
Logic Level Converter
This is where a Logic Level Converter comes in. It connects to the 5V logic on one side and the 3.3V logic on the other side and keeps them completely Isolated.
Code
The next challenge was making a program in python to communicate over serial so I can use the code in my final program. for this I used the PySerial Library.










