1

I want to know if is it possible to power the logic circuit of an external component used with raspberry pi not in the way shown below (using the 3.3v or 5v ang GRND GPIO),

but with an external 3.3v or 5v power supply like AA batteryexample logic circuit powered by raspberry pi GPIO

NOTE

I'm not talking about the powering of the WHOLE CIRCUIT or THE RASPBERRY ITSELF, but, in this case, the powering of the 5V 2 CHANNELS RELAY MODULE.

3 Answers3

2

In general, yes this is possible.

You must connect the grounds of both power supplies together at some point.

You must also make sure that no 5 V logic signals that come from your 5 V logic are connected to pins on the Pi, as this can permanently damage the Pi. There is no danger of damage if GPIO outputs from the Pi are connected to logic inputs in the 5 V logic, but you must verify that the 5 V logic will interpret the 3.3 V signal from the Pi as a logic '1'.

Elliot Alderson
  • 196
  • 1
  • 7
2

Yes - you can definitely do that. Two things you must keep in mind:

  1. The RPi and the external battery-powered hardware must operate at a common reference potential. This is easily accomplished by connecting the two GROUND points together.

  2. RPi GPIO pins are biased at 3.3V, and they are rather fragile. You must properly interface them to your external circuitry to avoid damage or simple malfunction.

    • If the GPIO pin is used as an output, you should be aware of its ability to source or sink current. This document explains the limitations on sourcing and sinking current in some detail. As a general "rule of thumb", I would advise against sourcing or sinking more than 8-10mA from any single pin.

    • If the GPIO pin is used as an input, you should be certain that the input signal never exceeds 3.3V. There's very little margin for error here, but that's not to say it's a difficult problem - it only means you need an interface circuit capable of limiting the voltage seen by the GPIO. This is one example of such an interface circuit.

Please note that these are general guidelines. You've not given us any details on your external hardware, so there's not much else to be said. If you're concerned about anything in particular, feel free to edit your question.

Seamus
  • 18,728
  • 2
  • 27
  • 57
1

You CAN power external components; indeed for some this is recommended.

It is (generally) essential to share Gnd connections (opto-isolated devices are a possible exception).

There is actually no need in this case, as the Pi 5V can easily supply the current needed by 2 relay coils.

HOWEVER if you are using a relay module similar to that pictured they are UNSUITABLE for the Pi without additional components or modifications.
See Can you use a 5V Relay Module with the Pi?

Milliways
  • 54,718
  • 26
  • 92
  • 182