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?

EDIT based on the comments below:

The proposed solution:

enter image description here

7
  • Please confirm if you think my redrawn schematic is OK, before I move on. Cheers.
    – tlfong01
    Oct 24, 2019 at 7:09
  • @tlfong01, I am not sure I see your schematic
    – kb__
    Oct 24, 2019 at 23:17
  • @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
    Oct 25, 2019 at 1:17
  • @kb, There you are, my schematic: imgur.com/gallery/17GDkoT. Comments and questions welcome! Cheers.
    – tlfong01
    Oct 25, 2019 at 1:33
  • @kb, In the deleted answer, I also gave some references on grounding. You might also read the following if you find my references helpful: raspberrypi.stackexchange.com/questions/104863/…
    – tlfong01
    Oct 25, 2019 at 1:42

2 Answers 2

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.

5
  • 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__
    Oct 24, 2019 at 23:07
  • 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
    Oct 24, 2019 at 23:12
  • 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__
    Oct 25, 2019 at 0:46
  • As I implied in my answer "Gnd" is not actually ground - the Pi floats WRT Ground (unless connected externally). Join the common 0V pins directly. Whether this should be connected to any external Ground depends on your overall design and layout.
    – Milliways
    Oct 25, 2019 at 1:33
  • I edited my question and added a schematic depicting what I understand you suggest. Is that correct? I understand I do not need to use the second gnd pin on Pi, just did not want to cross the wires for clarity. Thank you for helping me understand it better.
    – kb__
    Oct 25, 2019 at 2:14
1

Whatever you do yo must not connect things directly. Us a resistor between these power source connections. The Arduino will be ok. But the rpi will burn if anything goes wrong. Use the analog reading codes for both end to read the voltages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.