Problem with sharing ground

Hi:

I have four componemts

1 x arduino (doesn't really matter witch one)
1 x INA219 This component is for measuring voltage and current). INA219 High Side DC Current Sensor Breakout - 26V ±3.2A Max [STEMMA QT] : ID 904 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
1 x 12 VDC regulated power supply with 0...10VDC control. https://www.meanwell-web.com/content/files/pdfs/productPdfs/MW/PWM-40/PWM-40-spec.pdf
1 x DFR0971 for sending 0..10 VDC signal to the power supply. Gravity: 2-Channel 0-10V I2C Digital to Analog DAC Module - DFRobot

The porpuse is to regulated the power supply from the arduino(with the help of DFR), and also measure voltage and current with the INA. Arduino communicates with INA and DFR via I2C interface.

Arduino, INA and DFR all share ground, and INA also needs to be connected to "power supply GND" to give good voltage readings. ...

The issue is that when I connect all the circuit, INA measures but DFR does not regulated, and if I disconnect the cable that connects "power supply GND" to INA, DFR regulates, but INA does not measure correctly.....

Probably the issue is coming from the fact that in the power supply documentation they specific tell you not to join the 0VDC from the control signal with the "power supply GND".

At the end I think I need to separate the GND of the DFR from the rest, but I don't know how.

I've tried to power the DFR with another 5V power supply, but it does not work (or at least the I2c interface doesn't communicate with the arduino...)

When INA is not connected to the "GND from the power supply", I can measure voltage with a multimeter and still DFR9071 regulates correctly, so I know it can be done..., of course the multimeter has his own "not share ground"...

Any help appreciate!!!

Better post the schematic of the whole circuit, including all modules.

I think that both INA and DFR have separated grounds for the load side and for the Arduino side, so it should work. But put the schematic, even hand drawn (better than Fritzing), otherwise is difficult to say anything.

1 Like

Here it is:

GND is the white cable.

IMHO all the grounds are communicate inside the modules...

Use separate grounds for power and signal(voltage) reading. Large wire for power ground, any size for signal ground. Let them meet only at the ground of your power supply.

1 Like

In the datasheet of the power supply it says: Do not connect DIM- with Vo-.

image

And... by the datasheet of the DFR it looks like both GND are connected:

So, it's connecting the DIM- and Vo- of the power supply :face_with_diagonal_mouth:

It's bad luck that the INA219 needs both grounds connected. Why can't it just read the relative voltage and encode in the I2C interface?

Anyway, I think that you have to think a way to get around this problem. Maybe a mosfet to connect it only for the reading. Or read the voltage in a different way.

Thanks for the help...

I think puttiing this between the power supply and the DFR would solved the problem (plus an aditional 24V power supply...):

I understand is a kind of optocoupler...

The problem is that is 100 bucks..., too much for the proyect. :frowning:

Maybe I can use one of this devices instead of the DFR, directly using the PWM 5V signal from the arduino to control de power supply.
(If I'm not wrong it's a 5V PWM converter to 0-10 Vdc, isolated):

https://www.amazon.es/gp/product/B0789738RC/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

From the image I can see what seems to be an optocoupler...I need an aditional power suppply, but I think GND is isolated from the PWM - input (DIN-), though I'm not 100% sure...

I'll see on Monday when it arrives :slight_smile:

Thanks for the help.

All you need to control that LED supply is a (1k) resistor and an opto coupler.

Opto transistor connected across the DIM pins,
Opto LED with CL resistor driven from an Arduino PWM pin.

I don't see the need for anything else.
Leo..

I think that Wava is right. You can use the PWM signal of the arduino and isolate it with an opto coupler,

taking into account that you need 10V to drive the power supply.
Maybe you could get the 10V from the power supply with an LDO.
-- Edit: not needed, see next comments.

Another option would be not reading the voltage with the INA219. What do you need it for? If you don't need precision you could try to calculate it from the current. If this is not linear enough, with a look-up table of 10 or 20 values. I don't know if this would be sufficient or could work in this case.

You don't even need that. When you leave the DIM pins unconnected, the supply is on, and when you short them, the light is off. What does that tell you.
Leo..

Ah, ok. So it works also just connecting and disconnecting the pins from each other, with the variable resistance mode, I see. I was thinking in feeding a 10V PWM, but it's not needed.
I have never used those regulated power supplies.

Yes, then is much simpler. Just an octo coupler and a resistor. The DFR is not needed.

Thanks for all the replies.

@anon27210439, The project involves more elements, but I didn't want to complicate more for simplify porpuse.., I tried the table approach,, but as the consumption can have electrical motors running at different speeds with variable resistance... the voltaje can vary even with the same control signal from DRF...., that is why I need to measure the actual voltage.

@Wawa, What do you mean by "LED supply?, I don't know what you are refernig to...

When talking about an optocoupler are you talking about something like this?

https://www.amazon.es/dp/B07YHQBCZ7?psc=1&ref=ppx_yo2ov_dt_b_product_details

This is arriving today, as the power supply can also be modulated with a 0-10VDC PWM signal, maybe instead of the DFR, I can use the optocoupler, that will convert a 0-5VDC PWM signal coming from an analog output of the arduino, to 0-12VDC PWM (isolated) that I can use to control the regulated power supply?... I'll try it today when it arrives, I think I will need a smalll 12VDC power supply, but does not an issue... :slight_smile:

You don't need the 10V for anything, If I understand it right.
You can connect an PWM arduino pin to the octo coupler, and it directly across the DIM+, DIM- pins. This way:

With the Arduino PWM you will be switching from a resistance of 1KΩ and floating (very high).
Variable resistance is the third operation mode of the power supply:


But switching from full on to full off.
I have no experience with these devices, but this what I understand from the comments of Wawa and the datasheet.

1 Like

Check this example with the 4N35

Thanks for the explanation and the links.

As far as I understand, there are three ways con control the regulated power supply:
1- With a variable power supply from 0 to 10 VDC:

image
2-With a 10V PWM:


3-With a variable resistance (0 to 1K). I tried with DS3502 from adafruit, but is 100K and it doesn't work.

In the 3 cases I need the optocoupler to separecte Dim- from "general control GND of the rest of the devices...". But as far as I understand, options 1 and 2 need and external power source, and the optocoupler doesn't give you that, that is why I think I need the aditional 12 VDc power source.

This is what I'm planing to do(option 2) with the optocoupler is coming today:

Yes, what I mean is the third option but NOT with a variable resistor.

The opto-coupler will work as a switch. If you connect it like in my schematic, across DIM+ and DIM-, it will quickly switch between only 2 resistance values: 1KΩ or infinite. You don't need to put any voltage there.

Then, the power supply will be switching quickly: ON and OFF, and with the Arduino PWM you regulate switching speed and therefor the power level.
I'm not sure if this will work, I think so. Maybe others have more experience with this and will comment also.
You can just try.

1 Like

YOU have posted a link to a constant voltage LED supply.
"DIM" refers to (LED) brightness.

You have now added motors into the equation. Don't know how this supply "dims", Could be PWM or current control. Not sure how motors reacts to that.

@anon27210439 Post#13, move the resistor to the LED side.
Leo..

@anon27210439 you were absoluty right. With the optocoupler I bought, the power supply is perfectly regulated with the PWM signal coming from the arduino, no need for an extra 12 VDC power supply :grinning: .

Sadly a new issue has arrise and I don't no how the hell happens. INA 219 measures the voltage badly when regulating the power supply,(it appears to go up and down in more or less a random way..) though when measure with a multimeter voltage goes up and down perfectly linear...., I'm going to try with an external voltage measure sensor and see what I get...

When the power supply reduces voltage, Motor reacts keeping current more or less constant, so at the end the power goes down progresivly when voltage goes down(and viceversa).