I want to attach a Raspberry Pi to my Arduino Zumo robot. The Arduino is powered by the 4 AA batteries and voltage regulator of the Zumo shield. My plan is to power the Raspberry Pi using an Anker USB portable charger in order to not drain the Zumo batteries. If it matters, I have this one:
amazon.com/Anker-Astro-Lipst … ords=anker
My question is whether or not it is safe to connect the Raspberry Pi and Arduino over USB-to-serial in this configuration. Since the Zumo shield voltage regulator keeps the Arduino at 5V and the Anker battery is regulated to 5V, this seems mostly safe. But I am certainly not an electrical engineer. I have a level shifter and could connect the Raspberry Pi GPIO serial running at 3.3V to the Arduino Tx and Rx pins, but that is extra wiring I would prefer to avoid unless it was truly necessary. Any feedback/guidance would be appreciated.
You must have a level shifter if you connect the 5V TX on the Arduino to the 3.3V RX on the Pi, but a simple resistive divider should do, say 1K and 2.2K.
You do not need a divider to connect the Pi TX to the Arduino RX, but it is a good idea to put a resistor (say 10K) between the two. This is due to a problem that arises when one MCU is powered up before the other (or one is powered off before the other), as there can be excessive current flow from “on” I/O pins into the MCU that is off.
It is safer to use a level shifter breakout board that is properly engineered to take care of these circumstances.
Thanks for the response, but that wasn’t really my question. I understand that if I use GPIO serial on the Raspaberry Pi, I must use a level shifter. But connecting an Arduino and a Raspberry Pi over USB-to-serial is normally safe without the level shifter. My question is, is it still safe to connect USB-to-serial when each device is powered by a separate battery?
In other words, this is perfectly valid if there is only one voltage source and the Raspberry Pi is powering the Arduino over USB:
dropbox.com/s/225vh6gxztoxk … 4.JPG?dl=0
Is this still a good idea with the Arduino and RPi powered from two separate batteries?
Thanks. So, just to be overly clear, we are saying this is an ok idea with the Anker battery powering the RPi and the Zumo shield powering the Arudino? It seems like both ends of the USB-to-serial cable should be at pretty close to 5V.
As Jim said, it should be fine to power your Raspberry Pi and Arduino from separate batteries and connect them over USB.