Jessica123
Posts: 7
Joined: Tue May 09, 2017 6:24 pm

Controlling a 100 watt single output power supply?

Fri May 12, 2017 5:02 am

I am hooking up a light to this power supply :

https://www.amazon.com/gp/product/B007K ... UTF8&psc=1

What I really want to know, is if there is a way I can use a raspberry pi to turn the light on or off.

Does anyone have a resource I can read online? I have been searching like crazy - but I am unable to find what I need - and I figure some of y'all might be able to help :)

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 7:58 am

Get a relay board designed for Pi and capable of 12V 10A.

You could also use a solid state switch, either bought in or built, but currents approaching 10A make circuit design and build quite scary.

Either way you need thick wires -- at least 1.5 sq mm.
Signature retired

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 8:11 am

It may come under the title of '12V inline switch', that is if you are switching after the power supply.
A quick search of the forum picks up this
viewtopic.php?f=37&t=14624
Might give you the info you need to search on, but see if there are any prebuilt on places like Alibaba etc.
Over kill on the number of switches?
https://www.modmypi.com/electronics/rel ... lay-module

You can get mains inline switches as well, at least in the UK (usefully for aquarium strip lights or lamps etc) these are about £10 on Amazon in the UK.


Then it's on to programming.

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 8:20 am

bensimmo wrote: You can get mains inline switches as well, at least in the UK (usefully for aquarium strip lights or lamps etc) these are about £10 on Amazon in the UK.
True, but you really need to know what you are doing and how to keep you and your Pi safe if you want to control mains electricity. I've also seen some really awful wiring on low cost mains products -- some imports certainly do not meet UK regulations. Caveat emptor.
Signature retired

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 12:27 pm

The mains one are pretty good (the one I'm thinking about)

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 3:42 pm

bensimmo wrote:The mains one are pretty good (the one I'm thinking about)
Link? Then we can all buy a good one!
Signature retired

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Controlling a 100 watt single output power supply?

Fri May 12, 2017 5:26 pm

davidcoton wrote:
bensimmo wrote:The mains one are pretty good (the one I'm thinking about)
Link? Then we can all buy a good one!
SF Innovations iirc

Jessica123
Posts: 7
Joined: Tue May 09, 2017 6:24 pm

Re: Controlling a 100 watt single output power supply?

Sat May 13, 2017 1:41 am

Hey everyone!

Thanks for the replies!! I will research tonight! :)

Jessica123
Posts: 7
Joined: Tue May 09, 2017 6:24 pm

Re: Controlling a 100 watt single output power supply?

Sat May 13, 2017 5:21 pm

Hey again!!

I looked at the relay module :

https://www.modmypi.com/electronics/rel ... lay-module

I have another question, though - this has 8 channels, I would use one to power the light, but using the other 7 - would I be able to power fans like these? https://www.newegg.com/Product/Product. ... -_-Product

If so, do I need to put anything between the relay module and the fans to reduce the power going to them? Sorry for all the questions, this is an exercise in learning how to do stuff more complicated that buzzers and LEDs - haha

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Controlling a 100 watt single output power supply?

Sat May 13, 2017 6:58 pm

Relays are old fashioned. You should look at using power mosfets.
Example: https://www.sparkfun.com/products/10213

/emgi

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Sat May 13, 2017 9:03 pm

Jessica123 wrote:Hey again!!

I looked at the relay module :

https://www.modmypi.com/electronics/rel ... lay-module

I have another question, though - this has 8 channels, I would use one to power the light, but using the other 7 - would I be able to power fans like these? https://www.newegg.com/Product/Product. ... -_-Product

If so, do I need to put anything between the relay module and the fans to reduce the power going to them? Sorry for all the questions, this is an exercise in learning how to do stuff more complicated that buzzers and LEDs - haha
That module looks suitable. It will also control fans, just on-off no speed control. You will need to wire the correct supply voltage to the fan relays -- not sure from the listings whether they run on 5V or 12V.
Signature retired

Jessica123
Posts: 7
Joined: Tue May 09, 2017 6:24 pm

Re: Controlling a 100 watt single output power supply?

Sun May 14, 2017 2:41 am

I actually don't need speed control on the fans - I just need them to come on and off :)

So with that in mind - I take it I wire it like this :

Mains power -> 100 watt single output power supply -> 8 channel relay -> LED and Fans.

My question here, is where would the Pi sit in all of this? I take it I can hook the Pi to the relay module and turn those on or off as needs be?

Also - Regarding the other reply about the MOSFET - would that be a better solution for at least the LED? Then use the relay module separately just for the fans?

klricks
Posts: 6508
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Controlling a 100 watt single output power supply?

Sun May 14, 2017 3:56 am

Jessica123 wrote:I actually don't need speed control on the fans - I just need them to come on and off :)

So with that in mind - I take it I wire it like this :

Mains power -> 100 watt single output power supply -> 8 channel relay -> LED and Fans.

My question here, is where would the Pi sit in all of this? I take it I can hook the Pi to the relay module and turn those on or off as needs be?

Also - Regarding the other reply about the MOSFET - would that be a better solution for at least the LED? Then use the relay module separately just for the fans?
The 12V output of the power supply will need to be wired to 9 places........ The relay board power connection AND to the common terminal of EACH relay.
(I am assuming that the mains will be connected to the power supply directly and always on or controlled by a manual switch),

The fans / light would be connected to the NO relay contacts.
Grounds from each all tied together and connected to the power supply ground.

8 GPIO's of your choice will be connected to the IN1-IN8 relay board terminals plus a ground wire from RPi to relay board,

Then you will need to write code to turn each of the relay's on or off according to when you want the light and fans to be turned on. For example you might want turn a fan on at a certain time of day or maybe add a temperature sensor and have the RPi turn on a fan(s) when the temp goes above a certain set point etc.

What is your project about and why do you need 7 independently controlled fans?

Forget the MOSFET's unless you are prepared to do soldering.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Sun May 14, 2017 8:10 am

What @klricks said.
If you are going to use relays at all, there is no advantage (except possibly learning) using a MOSFET for one channel. It's quicker and cheaper to use ready-built stuff (that's another learning point :o ). So if you could find a ready-built MOSFET module, that might be worthwhile. It needs to have opto-isolation to make sure your 12V never gets close to your Pi (there is not so much of an issue with relays, they provide isolation by their nature).

If you go the DIY route, the risk of accidentally putting 12V on your Pi is not negligible :( , and you would probably want to build the MOSFET circuit with opto-isolator, not too difficult but not trivial either.
Signature retired

Jessica123
Posts: 7
Joined: Tue May 09, 2017 6:24 pm

Re: Controlling a 100 watt single output power supply?

Sun May 14, 2017 7:23 pm

Thanks for the info.

Regarding the individually controlled fans - that isn't a necessity - what is important is that they are independent of the light.

In reality - I guess none of this project is actually important, I am not building anything to keep - just setting little project goals, and then getting more complicated as I move along through each one.

I basically want to have all of the fans to be able to come on or off, and not take the state of the light into account when doing so.

That said, maybe one of the fans should take the light into account, given that the light is probably going to get fairly hot, and will have to be attached to a heatsink, with a fan - that one would come on with the LED.

User avatar
davidcoton
Posts: 3951
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Controlling a 100 watt single output power supply?

Sun May 14, 2017 9:18 pm

So you need two relays, controlled from two outputs (GPIOs) on the Pi. Connect the light and one fan to one relay, the other fan(s) to the other relay.
If the fan needed a different voltage from the light, you would use two relays but (subject to checking the current required on the input) both could be connected to the same GPIO.

Think it through, draw it out, and come back if there are still questions.
Signature retired

Return to “General discussion”