I'm new to pi's extending.

I've a MB102 breadboard, coupled with a powersupply.

I plugged a 9V power supply, and it's working (powersupply => resistor => led on).

I'd like to interface some components using the Pi's GPIO.

Because there would be two generators (the pi and the external power supply), how should I cable it ?

I hesitate to connect pi's and powersupply ground together, because I'm not sure how electrical laws apply in this case.

How should I put it all together ?

[Edit]: target cabling:

enter image description here

  • This is a good question so I have changed the title to better reflect the central issue (whether it turns out the regulator uses something other than 9V does not make a difference). – goldilocks Jan 25 '16 at 14:25
  • @goldilocks: as I said in my edit, the power supply outputs exactly 3.3V (the actual part I used does not have pwm). 9V are the DC transfo. – Steve B Jan 25 '16 at 14:38
  • Not sure to understand your PIN remark. windtopik.fr/wp-content/uploads/2014/11/RPI-GPIO-N-.png. I plugged GND and GPIO15, didn't I? – Steve B Jan 25 '16 at 14:39
  • BTW it is a bad idea to use gpio 14 and 15 as input/output pins. They are for UART (serial communication) and you will have to reconfigure them. Use a pin that does not have a special purpose (eg. gpio 17, 27, 22, 23). But it still does not make sense with V+ on the other end. – goldilocks Jan 25 '16 at 14:51
  • @goldilocks: In a previous try, I connected the PI's pin like that : +3.3V ==> resistor ==> led ==> GPIO. In this try, I simply replace the pi's 3.3V by the external supply +3.3V. Of you think it's wrong, I may miss something – Steve B Jan 25 '16 at 14:56

There is no risk in connecting the GND of the power supply and the RPi together - actually, to create useful circuits most of the time this is required so that the +9V from the power supply and the +5V/+3V3 coming from the Raspberry Pi are relative to each other on the GND.

Regarding the +9V power though, you need to make sure that this does NOT come into contact with the Pi (either directly or via a circuit you're making). It would likely blow up your Pi. What you can do is use a transistor or a relay, powered by the RPi, to switch +9V circuits on your breadboard.

Alternatively, you can just use the power coming from the RPi's GPIO output pins (3V3 signal level) to power simple circuits like those containing a few LEDs, just note that the maximum amperage the RPi can supply that way is 16mA per pin, with a total maximum over all pins of 50mA.

There are tons of good tutorials on the web (try Adafruit as an example) on how to start working with circuits on the RPi.

| improve this answer | |
  • Thanks, actually, the powersupply has a regulator and can output 3.3 or 5V. If I understand you correctly, is what I put in my edit correct ? – Steve B Jan 25 '16 at 13:19
  • to create useful circuits most of the time this is required so that the 9V from the powersupply and the 5V/3V3 coming from the Raspberry Pi are relative to eachother. can you explain this a bit better please, its very confusing, +9V? -9v, what does relative to each other mean? – Piotr Kula Jan 25 '16 at 15:18
  • 3
    Makes sense to me and I am no electrician. This is exactly the explanation I needed when I was confused about this, I think (which was not long ago). You have 2 voltages, they are relative to each other, one is 3.3 and one is 9, the difference is 5.7, but what ensures that exact difference is the common 0 -- ground. I guess saying that voltage is not an absolute value is useful, it is always relative. – goldilocks Jan 25 '16 at 15:36
  • 1
    I just updated the answer to make it 'absolute'ly clear that relativity is acquired by combining the GND. Also best to mark DC currents and annotations using + or - symbols, since GND is technically -9V as used on technical data sheets. Where 9V is typically interpreted as AC. (I know we have a context of battery here but semantics go a long way in teaching people more while reading in-between the lines) – Piotr Kula Jan 25 '16 at 17:28
  • 2
    Remember that all a 9V battery does it to try to establish a 9 volt difference between its terminals. If you connect its (-) to your system's common ground, then you'd measure its (+) as 9V, but if you connect its (+) to GND, then you'd measure its (-) as -9V. Attach one each way ((-)Bat1(+)=GND=(-)Bat2(+)) and you have both +9V and -9V, or attach GND=(-)Bat1(+)=(-)Bat2(+) and you have +18V. Voltage isn't a point measurement; it's always the difference between 2 nodes -- when someone talks about the voltage at a node, they're almost always omitting "... relative to the common ground.". – Rob Starling Jan 25 '16 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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