interface raspberry pi zero with arduino via UART

interfacing arduino with a raspberry pi zero using uart
interfacing arduino with a raspberry pi zero using uart

I wanted to use a pi zero to log data captured by a arduino nano every.  The idea was to capture a screen session and parse the data with perl regular expressions.  Initially, I simply connected the UART pins directly.  You have to criss-cross the TX / RX lines.  I got a few readings from the arduino, then screen would terminate.  I was aware the logic levels were different (5V for the arduino, 3.3V for the pi) and thought that was the issue.  I connected a logic level converter and has the same result.  The issue was that I needed to disable getty.

disable getty on raspberry pi to connect to arduino via uart
disable getty on raspberry pi to connect to arduino via uart

After disabling getty,  I was able to maintain an open session between the pi and an arduino.

pi zero connected to an arduino via uart at 9600 baud
pi zero connected to an arduino via uart at 9600 baud

This output is messy, but not at all difficult to parse with perl.  The main thing is that it does not terminate suddenly because getty is disabled.  I forgot to mention that I was ssh’d into the pi zero via USB.  See my previous posts on how to enable ethernet via usb on a pi zero.

Leave a Reply

Your email address will not be published. Required fields are marked *