Page 1 of 1

Controlling Christmas lights of different voltages - common ground OK?

Posted: Wed Nov 28, 2018 12:00 pm
by piglet
I'm currently using some IRLB8721 MOSFETs off three GPIOs to control a 12v led strip. The 12v supply's ground is connected to the Pi's ground.

Sort of like this, but using a Pi (this is the clearest wiring diagram I could find):

https://learn.adafruit.com/rgb-led-strips/usage

If I want to add into the mix another set of lights, controlled by another MOSFET on another GPIO pin which need another independant 5v supply can I just connect that supply's ground to the existing grounds?

I think that should be OK - but don't want to get myself into trouble!

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Wed Nov 28, 2018 3:10 pm
by mahjongg
Normally you should switch the led strips on the low side (between the led strips negative wire and ground), not on the high side as that would necessitate the gate voltage varying between 0V and 12V, which is not directly possible with a PI (you will need a so-called "high-side driver").

If you use a low-side driver, you can indeed switch one 5V and another 12V strip without problems.

by the way, if you implement two different high-side drivers, one for 5V and another for 12V, then you can also combine the grounds.

Ground should ALWAYS be the common reference.

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Wed Nov 28, 2018 3:30 pm
by piglet
Thanks,

Yes, I'm switching at the ground end on the led strip.

I had come to the conclusion that I did have to make a common ground. Otherwise there's no way for the MOSFET to know when the Pi GPIO signal is high or low as that can only be by reference to the ground.

Learning stuff all the time. I like learning.

I don't like the moment of first turning on power to a circuit I've checked over several times, while wondering whether I've missed something and am going to let out all the magic smoke. So far so good...

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Wed Nov 28, 2018 9:51 pm
by piglet
Yuup. It works with the extra 5v supply, common ground. All the hardware is working as intended.

Now to complete the code.

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Sun Dec 02, 2018 11:40 am
by default_user8
For future reference, a ground is a ground is a ground. They don't have to all tie into the same physical point, reference the first line of this post. Ground IS the common, even when it is referenced as "case" ground or "frame" ground, it's still ground. Not saying you in particular, don't understand this, just pointing it out for other people that may read this post. It's a hard thing for some people to wrap their head around. Hope this is helpful!

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Mon Dec 03, 2018 10:06 am
by Burngate
default_user8 wrote:
Sun Dec 02, 2018 11:40 am
For future reference, a ground is a ground is a ground.
Except when it isn't.

You can get devices with one terminal marked ground, but if the supply is floating, it isn't connected to the soil in your garden.
Just sayin'.

Re: Controlling Christmas lights of different voltages - common ground OK?

Posted: Tue Dec 04, 2018 6:49 pm
by mahjongg
GND is NOT the same thing as EARTH, in fact GND is just some assigned potential in a schematic that is used to reference other voltages to.