User avatar
piglet
Posts: 884
Joined: Sat Aug 27, 2011 1:16 pm

Controlling Christmas lights of different voltages - common ground OK?

Wed Nov 28, 2018 12:00 pm

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!

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11220
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

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

Wed Nov 28, 2018 3:10 pm

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.

User avatar
piglet
Posts: 884
Joined: Sat Aug 27, 2011 1:16 pm

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

Wed Nov 28, 2018 3:30 pm

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...

User avatar
piglet
Posts: 884
Joined: Sat Aug 27, 2011 1:16 pm

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

Wed Nov 28, 2018 9:51 pm

Yuup. It works with the extra 5v supply, common ground. All the hardware is working as intended.

Now to complete the code.

User avatar
default_user8
Posts: 549
Joined: Mon Nov 18, 2013 3:11 am

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

Sun Dec 02, 2018 11:40 am

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!
Two heads are better than one, unless one's a goat head.

User avatar
Burngate
Posts: 5604
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact: Website

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

Mon Dec 03, 2018 10:06 am

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'.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11220
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

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

Tue Dec 04, 2018 6:49 pm

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.

Return to “Other projects”