i’m working on a project that has a raspberry pi as the brain and an Arduino that act as a node. I was wondering if can-bus is the best way to communicate and if it is how do I go about programming it in?
hjfisher022:
I was wondering if can-bus is the best way to communicate and if it is how do I go about programming it in?
There is no best way to communicate. Each protocol has its advantages and disadvantage. Without knowing more about your requirements its hard to give you advice.
Here are a few points about some popular protocols available for Arduino and Raspberry Pi
I2C - simple, two wire, slow (kbit/s), short distance
SPI - simple, 3 or 4 wires, fast (Mbit/s), short distance
UART - simple, asynchronous, 2 wires, short distance
CAN - requires transceiver (robust communication), slow (max 1Mbit), medium distance
Ethernet - complicated (hardware and software), very fast, can go around the entire planet
Bluetooth - complicated, wireless, short and medium distance, low power, slow
WiFi - complicated, wireless, medium and long distance, high power requirement, very fast