Shadow_Saunter
Posts: 54
Joined: Thu Mar 22, 2018 2:04 pm

Powering RPi inside of PC case

Sun Nov 11, 2018 8:47 pm

I am going to mount a pi inside of my computer case to drive LED's and collect sensor data. I am planning to solder a micro-USB connector to a 4 pin molex to power my pi from my ATX power supply. Obviously my ATX p/s is supplying power to my windows pc and peripherals. I think this will work, but I was hoping for some feedback from people with more electronics experience than me.

1. Should I add anything that I haven't considered to that setup?
2. Would I be better off trying to power this pi through the 5VDC pin?

Thanks

ejolson
Posts: 3421
Joined: Tue Mar 18, 2014 11:47 am

Re: Powering RPi inside of PC case

Sun Nov 11, 2018 9:20 pm

Shadow_Saunter wrote:
Sun Nov 11, 2018 8:47 pm
I am going to mount a pi inside of my computer case to drive LED's and collect sensor data. I am planning to solder a micro-USB connector to a 4 pin molex to power my pi from my ATX power supply. Obviously my ATX p/s is supplying power to my windows pc and peripherals. I think this will work, but I was hoping for some feedback from people with more electronics experience than me.

1. Should I add anything that I haven't considered to that setup?
2. Would I be better off trying to power this pi through the 5VDC pin?

Thanks
With the molex connector the PC will have to be powered on for the Pi to work. Networking could be provided by connecting a wired Ethernet dongle to one of the PC motherboard internal USB headers and running a short network cable to the Pi network port inside the box.

Alternatively, instead of putting the Pi inside you could run 5V from the ATX supply to outside the PC. I've seen older Pentium-class PCs equipped with barrel connectors that provide external power to custom speaker systems. A similar setup could power an externally mounted Pi.

Note that if you are only collecting sensor data through GPIO, a Pi Zero can be powered using the standby 5V from an ATX supply. In this case, the PC would not have to be running for the Pi to work.

User avatar
DougieLawson
Posts: 35805
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Powering RPi inside of PC case

Sun Nov 11, 2018 9:26 pm

Since it's a RPi Zero you can power it from ANY USB socket without any problems. The Zero's power budget is even lower than my old A+ and that runs OK at 500mA.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Shadow_Saunter
Posts: 54
Joined: Thu Mar 22, 2018 2:04 pm

Re: Powering RPi inside of PC case

Sun Nov 11, 2018 9:59 pm

It's not a zero, and I want to drive LEDs inside the case too.

The biggest concern that I see when people ask about powering a pi from the 5VDC rail is having to bypass the built in protective circuits. I just want to use the intended power connector to connect to a Molex from a higher end ATX p/s that is in use by a completely separate PC system.

I think there's no problem, but I"m asking because I'm not SURE there's no problem!

User avatar
DougieLawson
Posts: 35805
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Powering RPi inside of PC case

Sun Nov 11, 2018 10:08 pm

If it's not a Zero, then why not?

For B+, 2B, 3B, 3B+ you should always power through the microUSB or you'll bypass the power management. Wiring a Molex connector to a microUSB is the safest way.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Shadow_Saunter
Posts: 54
Joined: Thu Mar 22, 2018 2:04 pm

Re: Powering RPi inside of PC case

Sun Nov 11, 2018 10:19 pm

Thanks to both of you. I don't care much about keeping it on while the pc is off, because I'll be measuring operating temps with the sensors. I guess beating up the SD card with improper shutdowns is a concern, but this PC is always on.

MarkTF
Posts: 297
Joined: Tue Mar 03, 2015 4:59 pm

Re: Powering RPi inside of PC case

Mon Nov 12, 2018 6:26 pm

Shadow_Saunter wrote:
Sun Nov 11, 2018 10:19 pm
Thanks to both of you. I don't care much about keeping it on while the pc is off, because I'll be measuring operating temps with the sensors. I guess beating up the SD card with improper shutdowns is a concern, but this PC is always on.
If all you want to do with the sensor data is to display some sort of status via LEDs or small numeric display then a micro-controller solution might be more appropriate than Raspberry Pi as they typically aren't susceptible to improper shutdown. The Arduino ecosystem is a nice novice entry point for micro-controller projects.

https://www.arduino.cc/

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Powering RPi inside of PC case

Mon Nov 12, 2018 7:27 pm

If you want always on power to the Pi consider using the 5v standby line present in the 24 pin ATX connector. Check your PSU's spec but there should be at least a couple of amps avilable there less whatever the PC motherboard uses.

If you don't want to modify your PSU get a cheap extension cable and mod that. Two "scotchlok" type connectors should be all you need on the PSU end - one on 5vsb and one on ground.

While I wouldn't want to do this with one of the more power hungry models, I've had success running Pi Zeros and zeroWs this way.
This space unintentionally left blank.

Shadow_Saunter
Posts: 54
Joined: Thu Mar 22, 2018 2:04 pm

Re: Powering RPi inside of PC case

Wed Nov 14, 2018 7:33 pm

Thanks for the feedback! This is a performance build and I just want to dress it up with some lights. The case lights marketed towards case mod-ers are disappointing and leave a lot to be desired. I want to drive them with a pi, but I also want to run some sensors for water temp/ambient temp.

I soldered a micro-USB onto the 5V wire in a molex connection and it is working fine. I discovered that the 5VDC molex is present even when my Windows machine is asleep, ie: In the Windows10 "Power and Sleep" settings, I have mine set to sleep when unattended after a period of time. When it sleeps the pi stays on, so improper shutdowns are much less of a worry now!

I haven't tried closing it up in my case yet, but for now it is reaching my wifi, so I can ssh into it. If that doesn't work I have a switch on my desk that I can plug into and run a lan cable to the pi. I like the idea of connecting to a USB header, but my IoT stuff is on a separate NAT and I want this pi on the IoT NAT.

gospina
Posts: 3
Joined: Thu Jan 17, 2019 8:20 pm

Re: Powering RPi inside of PC case

Thu Jan 24, 2019 8:48 pm

Did this work for you? I bought a molex to 2 USB connection and used miniUSB cable to connect to raspberry Pi 3B+.
I did this to power a Raspberry and an LCD screen. 1 hour later, Raspberry pi was fried, no longer worked :(.
I'm trying to come up with alternatives but this really set me back a bit. How did you do it?

ejolson
Posts: 3421
Joined: Tue Mar 18, 2014 11:47 am

Re: Powering RPi inside of PC case

Mon Jan 28, 2019 6:45 pm

gospina wrote:
Thu Jan 24, 2019 8:48 pm
Did this work for you? I bought a molex to 2 USB connection and used miniUSB cable to connect to raspberry Pi 3B+.
I did this to power a Raspberry and an LCD screen. 1 hour later, Raspberry pi was fried, no longer worked :(.
I'm trying to come up with alternatives but this really set me back a bit. How did you do it?
A Molex to USB power cable sounds correct. You may want to check voltages before proceeding. It is possible the Pi shorted out by touching a metallic part of the case. Maybe it would be best to properly mount the Pi on some standoffs before proceeding.

gospina
Posts: 3
Joined: Thu Jan 17, 2019 8:20 pm

Re: Powering RPi inside of PC case

Mon Feb 11, 2019 4:57 pm

Thank you for the response. I think I did end up touching something pins 1 & 2 on GPIO will fry it in a nanosecond, so I'm guessing that could be it. I'm going to go forward with tying into the 5V SB power for the Pi for my project. Now, did you look at tying into the "POWER_OK" +5V cable to check whether or not the power is "ON" for the main computer? I was thinking of doing that somehow, connecting it to a Logic Converter 5v to 3.3v and connecting it to one of the GPIO pins. Do you think that will work? do I need a ground as well?

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Powering RPi inside of PC case

Mon Feb 11, 2019 5:42 pm

gospina wrote:
Mon Feb 11, 2019 4:57 pm
Thank you for the response. I think I did end up touching something pins 1 & 2 on GPIO will fry it in a nanosecond, so I'm guessing that could be it. I'm going to go forward with tying into the 5V SB power for the Pi for my project. Now, did you look at tying into the "POWER_OK" +5V cable to check whether or not the power is "ON" for the main computer? I was thinking of doing that somehow, connecting it to a Logic Converter 5v to 3.3v and connecting it to one of the GPIO pins. Do you think that will work? do I need a ground as well?
Just tap one of the 3.3v lines on the motherboard connection. Those are only live when the PSU is on and can be feed diretly to a gpio but a current limiting series resistor is probably sensible.

Pull the gpio low and look for a high to indicate that the PSU is on.

Note: the PSU state gives no indication of the stae of the software on the PC. It could have crashed, failed to boot, not have an OS installed, etc
This space unintentionally left blank.

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

Re: Powering RPi inside of PC case

Mon Feb 11, 2019 5:49 pm

There is one elephant loose in the PC case. If Power is NOT OK, either with PowerOK off or no 3V3 on the PC motherboard, it is quite likely that the power to the Pi is down as well, so the Pi knowing that Power is NOT OK is adacemic :o :shock: :(
Signature retired

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Powering RPi inside of PC case

Mon Feb 11, 2019 6:33 pm

davidcoton wrote:
Mon Feb 11, 2019 5:49 pm
There is one elephant loose in the PC case. If Power is NOT OK, either with PowerOK off or no 3V3 on the PC motherboard, it is quite likely that the power to the Pi is down as well, so the Pi knowing that Power is NOT OK is adacemic :o :shock: :(
Indeed. But: "[...] tying into the 5V SB power for the Pi for my project. Now, did you look at tying into the "POWER_OK" +5V cable to check whether or not the power is "ON" for the main computer?" (emphasis mine). The stated aim isn't to check it power is good, simply whether it's on or not.

Plus, the 5vSB line is always on as long as the PSU is connected to the mains* regardless of whether the main PC is "on". POWER_OK and 3.3v will only be available once the PSU is fully on. (*yes, if the PSU has a built in switch or the mains supply has one this needs to be on).

So it's perfectly posible for the Pi to have power while the 3.3v and POWER_OK lines do not (nor would any other lines from the PSU).
This space unintentionally left blank.

Earlton2
Posts: 61
Joined: Mon May 27, 2013 1:13 am
Location: Tonight it's -28C
Contact: Website

Re: Powering RPi inside of PC case

Thu Feb 14, 2019 1:10 am

i would mount the pi on a piece of wood that slides into an empty harddrive slot. the nuts on db25 and de9 connectors make a good standoff with 4-40 bolts. re power i tend to run 5v and ground into the gpio connector using a 10-pin header at pos-1 . for simple projects this gets me i2c and tx/rx which i've used for rtc and tmp107 temperature probes. your piece of wood might be big enough to build some additional circuitry on. i tend to build in the single pushbutton circuit which supports halt and restart.

ejolson
Posts: 3421
Joined: Tue Mar 18, 2014 11:47 am

Re: Powering RPi inside of PC case

Thu Feb 14, 2019 6:22 am

Earlton2 wrote:
Thu Feb 14, 2019 1:10 am
i would mount the pi on a piece of wood that slides into an empty harddrive slot. the nuts on db25 and de9 connectors make a good standoff with 4-40 bolts. re power i tend to run 5v and ground into the gpio connector using a 10-pin header at pos-1 . for simple projects this gets me i2c and tx/rx which i've used for rtc and tmp107 temperature probes. your piece of wood might be big enough to build some additional circuitry on. i tend to build in the single pushbutton circuit which supports halt and restart.
Wood is also good because it doesn't give off toxic fumes unlike plastic and polyester when they catch fire.

I built a super-cheap cluster by mounting a bunch Pi computers to a block of wood using coat hangers and aquarium tubing. So far everything has worked splendidly. Pictures are here.

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

Re: Powering RPi inside of PC case

Thu Feb 14, 2019 9:40 am

Earlton2 wrote:
Thu Feb 14, 2019 1:10 am
re power i tend to run 5v and ground into the gpio connector using a 10-pin header at pos-1 . for simple projects this gets me i2c and tx/rx which i've used for rtc and tmp107 temperature probes.
As always, be aware that powering through the GPIO header bypasses the power protection circuitry. There is no room for error. (This is irrelevant for all variants of Pi0 which have no such circuit.)
Signature retired

Return to “General discussion”