Not enough power over Raspberry Pi?

Hello!

I'm building an audioplayer that is based on Raspberry Pi 3 B+, but the buttons and controls are through and Arduino Uno.

So I built a prototype on Arduino and it works - connected PN532 NFC-module and a SSD1306 screen.

Now I want to hook it through Raspberry Pi - the finished device should have one power input.

I tried to powering schemes:

  1. Power to Raspberry Pi. From Raspberry 5v pin to a breadboard, where the NFC module and the screen draw power. Arduino is connected via USB (both power and I plan to use its serial port for communication).

It looks the most simple, however this way NFC and screen don't work - my guess it's because they start up before the Arduino does (power through 5v pin starts instantly, but the USB turns on some seconds later). Is my guess right?

  1. Power to Raspberry Pi. From Raspberry Pi only the Arduino via USB, and the devices connected only to Arduino power as usual.

This way, it seems the power losses are too much, even the NFC module PWR led is very dull or goes out.

How do I fix it?

Thanks!

From Raspberry 5v pin to a breadboard, where the NFC module and the screen draw power.

Drawing power from the GPIO connector is not the best idea. Have you paralleled up the two 5V pins along with at least two ground pins.

While that might help the GPIO pins have a limited current draw, do you know how much current you are expecting?

my guess it's because they start up before the Arduino does (power through 5v pin starts instantly, but the USB turns on some seconds later). Is my guess right?

I wouldn’t think so.
Why are you using an Arduino anyway? The Pi has enough pins without needing help.

Grumpy_Mike:
Drawing power from the GPIO connector is not the best idea. Have you paralleled up the two 5V pins along with at least two ground pins.

While that might help the GPIO pins have a limited current draw, do you know how much current you are expecting?

Is the 5V pin is the GPIO connector?
I thought it's sort of a dedicated one.

I haven't tried to parallel two 5v, need to try.

I guess max current will be under 100mA:
Uno: ~50-80 mA
NFC: 5mA
LED screen: 5mA

Grumpy_Mike:
I wouldn’t think so.
Why are you using an Arduino anyway? The Pi has enough pins without needing help.

Well, it was in the original project I'm looking at (though the setup there is pretty different).

While connecting to RPi directly seems like a simpler way, I have an impression that it will be harder to talk to the devices this way.

Will give it a shot.

Is the 5V pin is the GPIO connector?
I thought it's sort of a dedicated one.

Yes it is on the 40 pin GPIO connector, I don’t know of any other.

I guess max current will be under 100mA:

That should be fine for that connector.

I have an impression that it will be harder to talk to the devices this way.

What gives you that idea?

Grumpy_Mike:
What gives you that idea?

Well, I started doing it on Raspberry, and there are usual Linux issues for me - a lot of dependencies, many of which deprecated, or are not ready for ARM/Raspberry.

Grumpy_Mike:
Drawing power from the GPIO connector is not the best idea. Have you paralleled up the two 5V pins along with at least two ground pins.

Did you mean paralleling 5v from Raspberry together with 5v from Arduino to power Arduino peripherals?

Did you mean paralleling 5v from Raspberry together with 5v from Arduino to power Arduino peripherals

No absolutely not, you must never do that.

I told you to parallel up the GPIO pins on the connector. Pins 2 and 4 are 5V so connect them together and on to power what you need to power. Same with the grounds on pin 6 and 9.

there are usual Linux issues for me

Same for me trying to maintain code of the Pi is a PITA.

Grumpy_Mike:
No absolutely not, you must never do that.

I told you to parallel up the GPIO pins on the connector. Pins 2 and 4 are 5V so connect them together and on to power what you need to power. Same with the grounds on pin 6 and 9.

Thanks!
Sorry, I'm just a web-developer, not used to frying stuff after trying.

Grumpy_Mike:
Same for me trying to maintain code of the Pi is a PITA.

PITA indeed.

Hey!

Appeared, the initial issue from the first post with Arduino x Pi was only in that I did not put the wires over the antenna of the NFC module (but underneath, and then it works unstable).
I reconnected and it's fine.

But now I have another stupid question:
Arduino Uno actually has two sets of SCL/SDA pins. And it's not widely mentioned. As seen at Imgur: The magic of the Internet . The question: is it possible to connect multiple devices on one set of SCL/SDA pins?
I2C looks like it could support that.

Arduino Uno actually has two sets of SCL/SDA pins. And it's not widely mentioned.

That is because the second set is used as a boot loader for add on boards called a HAT. ( Hardware on top ). They issued a set of hardware features you had to adhere to be compliant. I don't think they caught on as much as they expected.

The question: is it possible to connect multiple devices on one set of SCL/SDA pins?

Yes that is what the I2C bus is all about. As long as each device has a unique address you just connect them up and away you go. If devices have the same address then there are tricks you can pull to get round this.

Note that the Pi is a 3V3 system and as such the I2C lines get pulled up to 3V3. If you try and communicate with a device that is connected to the 5V line and has 5V I2C lines you must include a bidirectional logic level shifter, to prevent damage to the Pi.

Speaking of the Linux thing, the I have always found the I2C on the Pi a bit ropy, with some releases working fine and other releases being a bit flaky. Most of the time you can get round this by using error detecting software like Pythons try ... except ... structure. I have to put up with this sort of thing because I get paid to write articles and books about the Pi.

Arduino Uno actually has two sets of SCL/SDA pins. And it's not widely mentioned.

@Mike, the OP is asking about Uno not Pi here.
@beshur, they are just duplicate pins: SDA/SCL are duplicates of A4/A5 on Uno. On Mega, it will be different pins, not A4/A5, I can't remember, but whichever they are, the SDA/SCL pins are in the same position as Uno, but also duplicates of 2 other pins. This is so that shields which connect to i2c bus will work on both Uno and Mega.

As Mike says, the idea of i2c, and other bus systems like SPI, is to have multiple devices connected to the same pins.

@Mike, the OP is asking about Uno not Pi here.

Doh!
In my defence I would like to say that I had just come back from the supermarket and one of the bottles of beer I bought had jostled against another and was starting to foam. Therefore, I was forced to open it completely and drink it. I thought this was a very noble act on my behalf.

My brain must have bypassed the Arduino altogether, because it knows that there are not two sets of I2C lines on them but jumped to the Pi because there are and one is not talked about much. With the recent launch of the Pi version 4, they trumpeted this extra interface despite that fact that it had been on the previous versions 2 & 3 stretching back to 2012.

And with that fact the defence rests, your honor.

Thank you a lot for replies, guys!

I just reconnected the screen and the NFC in parallel to the regular A4 and A5 and it worked this time.

The beer foam makes up for it, Mike!