I wanted to connect an Arduino Nano to either my Pi 3B+ or my Zero W preferably my Zero. When I connected my Nano to my Pi Zero and ran a simple script with the python 3 serial library, it didn't work. I did the same with a 3B+ which didn't work either. I then tried connecting a normal Arduino Uno which worked just fine with both the Pis. I tried looking up the issue, but I didn't find any solutions related to connecting a Nano to any kind of Raspberry Pi. I think it might have something to do with the drivers because my Windows laptop recognizes my Nano.
A shortened version of my python script:
import serial from time import sleep string = "" sleep(2) arduinoSerialData = serial.Serial('/dev/ttyACM0', 9600) sleep(2) #print statements are for debugging while(True): sleep(1) arduinoSerialData.write(b's') sleep(1.3) string = arduinoSerialData.readline().decode('ascii') string = string+string+string+string f = open("soil.txt","w+") f.write(string) f.close print(string)
I'm using a standard Arduino Uno and Nano With the given Serial Cable.
Note: I'm using the "Arduino IDE Linux ARM 32 bit" on my Pi to code the Arduino. It recognizes my Uno and works with it but does not work on my Nano which is why I suspected it's some kind of driver issue.