SDA SCL 5V GND different power supply; errors

I am having an issue regarding getting sensor data in node red

i am using an MPRLS sensor. arduino nano and pi
pi is getting 5V from a strong power supply (not the normal netconnector)

i can get the MPRLS to work if i use:

Nano 5V
Nano GND
Nano A4 SDA
Nano A5 SCL

But things get odd when i swap the power supply:

this does not work
pi 5V
pi GND
Nano A4 SDA
Nano A5 SCL

this does not work
external power supply 5V
external power supply GND
Nano A4 SDA
Nano A5 SCL

Does anyone know why? and is this normal?

To me, at least, your explanation is not clear. It might be a good idea to draw a circuit diagram (even a photo of a Diagram). This might help us understand better what you are trying to do.

Ok. i'll draw.
3 drawings so might take a few min
This works 100% as it should. Nano is powered through USB
image

This seem to work (i2c adress is visible, not sure about the code)

This does not work:
Nano is powered through USB

This does not work:
Nano is powered through USB

I suspect you have not joined GND on all components.

1 Like

That is correct. should I connect all the GND? or only the 5V hardware (I have a DRV8255 powered with 12V)

Ground must be common. But why not power the microprocessor from your power supply and the sensor from the microprocessor - then you would avoid all of the issues.

what do you mean?

Also from 12V? I thought this could damage things (5V gnd and 12V gnd combined)

Unless I've misunderstood, in your 2nd image, you powered the sensor from a power supply but the MPS from USB. Power the MPS from the power supply and let the sensor take its power from the MPS. Then you, by definition, have a common ground and no issues and you've saved yourself an extra (USB) power supply that is no longer needed.

Ah, the nano, Yes there is 12V applied to it in the testing. didn't change the problem. I used the usb to also check serial monitor on arduino IDE.

Are you telling me that you are powering the sensor from 12v? If so my suggestion won't work of course. But I assumed that the sensor was low voltage since you said you could power it from the MPS. In fact, if your power brick is outputting 5v, you've probably blown your sensor anyway as the picture shows that it needs 3.3v which the MPS can provide easily. Just feed 5v from the brick into the Vin pin on the MPS and connect the brick's gnd to the MPS gnd. Then wire the sensor to the MPS.

Not good, don't apply USB and external power to the nano at the same time or you risk blowing the USB port on your laptop.

1 Like

the Adafruit MPRLS has an input voltage from 3-5V
The nano has an input voltage from 6-20V

Then thats easy. As I said, power the nano from the power supply and the sensor from the nano, I don't know what the issue is? You don't need to mess with gnd connections then since the nano's gnd will be the power supplies and the sensor will be the nano's so they are all the same by design.

1 Like

The problem is that I don't understand why this happens (seems to me important that I learn from this :smiley: ) - and that I have many devices running on 5V that in the future might run on something that might not give enough current

And why I think this is important is to make sure nothing is wrong with my circuit - as I am doubting that atm

Interesting, Why this hypothesis?

I'm no electronics expert but I know that you need to have common ground between sensors and power. I'm sure you can find a sensible explanation on the internet somewhere.

2 Likes

I am going to test this!

Because in your image there is no black wire joining the sensor and arduino.
And because in your images of setups that do work, there is a black line joining all devices, even though one such connection is via the USB C port.

I am not an electronics expert but I have read many times that devices need common GND, otherwise they have no way of distinguishing between logical 1 and 0.

@TotallyInformation seems to have confirmed that you need a common ground. Do you have a reason to doubt the assertion?

ps I am not a big fan of Arduinos, principally becaue they don't have wifi.
I see no advantage in connecting the sensor to the Arduino versus direct to the Raspberry Pi.

This is, of course, a different topic.

There are, however, several reasons to prefer a microprocessor board for sensors/relays over a Pi. The first being that a failure of an MPS board is generally cheaper than a Pi. Pi's do not have buffered and protected GPIO's either I don't believe so it is pretty easy to release the magic smoke.

Secondly, an MPS will give you real-time control which is remarkably hard on a Pi because a Pi is designed for general purpose computing, not real-time sensing and control.

There may be other reasons but those are the basics as fa as I understand them.