Uncategorized

rpi arduino notes

Asked 
Active today
Viewed 43 times
2

I have Pi4 on a UPS and a 3.3 volt Arduino (Nano 33 IOT) supplied without a UPS protection.

I am designing a system where Pi monitors a 3.3V Arduino pin to know if there is a power outage (and shut down orderly if needed). Upon power return, Arduino would detect if Pi is off (by monitoring the 3.3V Pi pin) and briefly open the Pi power supply circuit to reboot the Pi. The Arduino-Pi connections diagram is below.

Pi-Arduino connection

Is it safe to connect the a GPIO Pi pin directly to the Arduino’s 3V3 pin, and vice versa as depicted in the schematic? Or should I have a 220 Ohm resistor between the Pi’s GPIO and Arduino’s 3V3 pin and between the Arduino’s D and Pi’s 3V3 pin?

  • Please confirm if you think my redrawn schematic is OK, before I move on. Cheers. – tlfong01 18 hours ago   
  • @tlfong01, I am not sure I see your schematic – kb__ 1 hour ago
  • @kb, Ah my schematic seems to be have been deleted with my post. And the reason given by the moderator is the following: “Why was your post deleted? See the help center.”. I might need to visit the help centre later. In the mean time, I can post my schematic as a comment. And you can ask me more questions on my schematic. – tlfong01 11 secs ago   Edit   

3 Answers

1

First the diagram you listed will NOT WORK and risks damaging either or both devices.

If you want to directly connect devices they MUST use a common reference. This is normally the 0V pin/s (often incorrectly labelled Gnd).

It is “safe” to connect a 3.3V logic device to the Pi, and you could connect 3.3V power pins (although I would NOT do this).

If you want to connect I suggest you use a series resistor, although it is better practice to use a voltage divider (e.g. 1kΩ and 2.2kΩ). This avoids problems due to any differences in nominal 3.3V voltage.

Any voltage >2.2V will definitely be detected by both the Pi and 3.3V Arduino.

  • Thank you for the reply. I had the Pi 3v3 connected to Arduino’s D pin and it worked fine, but I had doubts about how safe it was in a long run. Will connecting the GND of Pi and Arduino to a common ground and putting a 220 Ohm resistor between the Ardiono’s D pin and Pi’s 3v3 and another between the Pi’s GPIO and the 3v3 from Arduino fix the problem? – kb__ 2 hours ago
  • A series resistor will protect the Pi (although I would use a higher value ~1kΩ) but a divider consisting of 1kΩ and 2.2kΩ would be better. NOTE the 10kΩ resistors you have shown do nothing (without a series resistor), but if you are going to use 2 resistors 1kΩ and 2.2kΩ would be better. – Milliways 2 hours ago
  • So placing a 1k Ohm resistor on the lead coming out of the 3.3V Arduino pin and keeping the 10k Ohm pin where it is now is going to achieve 3V going to the GPIO PIN according to the Vout = Vin * (10000/11000). Am I correct? As for the common ground, is it OK to just connect GND pins of Arduino and the Pi, or should they both be connected to an independent ground bolt in the enclosure? – kb__ 30 mins ago

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: