# Powering Raspberry Pi From ATX

**URL:** <https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887>\
**Category:** Raspberry Pi\
**Created:** [28 April 2022 01:19 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887 "2022-04-28T01:19:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremiah177112](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Jeremiah177112](https://forum.core-electronics.com.au/u/Jeremiah177112)\
**Post date:** [28 April 2022 01:19 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/1 "2022-04-28T01:19:39Z")

</div>

Hi all, I have a situation where I want to put a raspberry pi inside a rack-mounted computer case. Since I want to include full size 12V case fans I will obviously need a 12V source. Since the case has space for a standard PC power supply I am considering buying a cheap power supply and then wiring a custom cable to adapt the 5V and ground pins of the ATX pins to the USB-C input to power the pi. Then I could take 12V power to the fans separately.

I realize I loose PWM support but I am prepared to use a transistor on the ground side of the fans to act as a rudimentary PWM control of the fans. If necessary I am prepared to run the fans at a constant speed.

I also notice that if I could somehow get my hands on a computer module I could use a smaller (and cheaper) 12V power supply. But as best I understand I would have to take the 12V for the fans from the power supply before it gets to the pi, a feasible task. That obviously assumes that I could get my hands on a compute module.

I guess what I’m asking is whether there is any possible issues I haven’t considered or even if a better method exists.

Regardless thanks for all the help, Jem.

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [28 April 2022 01:51 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/2 "2022-04-28T01:51:52Z")

</div>

Hi Jem,

One way around this would be to use 4-pin “PWM” fans, they have a transistor built in that handles switching PWM on and off, you’d just need to wire that 4th pin into a GPIO on your Pi, you just need to find a fan that is happy being driven from 3.3V:

> <https://raspberrypi.stackexchange.com/questions/118235/can-i-control-a-4-pin-fan-with-a-raspberry-pi-without-adding-more-circuitry/118389#118389>

Alternatively, some mosfets with 10k pullup resistors on a protoboard on top of the Pi would do the job too, freeing you to use whatever fans you liked:

> **[N-channel power MOSFET - 30V / 60A](https://core-electronics.com.au/n-channel-power-mosfet-30v-60a.html)**
>
> When you need to switch a lot of power, N channel MOSFETs are best for the job. These FETs can switch over 60A and 30V and are TO-220 package so they fit nicely...

> **[Adafruit Perma Proto Bonnet Mini Kit](https://core-electronics.com.au/adafruit-perma-proto-bonnet-mini-kit.html)**
>
> Design your own Bonnet or pHAT, attach custom circuitry and otherwise dress your Pi Zero with this jaunty prototyping Bonnet kit! To add to the Adafruit Bonnet party...

Andreas Spiess has a good video on this, worth giving it a look:

[![](https://img.youtube.com/vi/oJ32CMxliCQ/maxresdefault.jpg "#138 Variable Speed Cooling Fan for Raspberry Pi using PWM and PID controller") ](https://www.youtube.com/watch?v=oJ32CMxliCQ)

Let us know what you think of the above!

-James

---

<div class="post-metadata">

**Author:** ![Jeremiah177112](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Jeremiah177112](https://forum.core-electronics.com.au/u/Jeremiah177112)\
**Post date:** [28 April 2022 04:31 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/3 "2022-04-28T04:31:53Z")

</div>

> [@James](#):
>
> [gpio - Can I control a 4-pin fan with a Raspberry Pi without adding more circuitry? - Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/118235/can-i-control-a-4-pin-fan-with-a-raspberry-pi-without-adding-more-circuitry/118389#118389)

This is an interesting point but since I’m using a rack-mounted computer enclosure I don’t expect I’ll be able to find a 3.3/5V 120mm case fan.

> [@James](#):
>
> Alternatively, some mosfets with 10k pullup resistors on a protoboard on top of the Pi would do the job too, freeing you to use whatever fans you liked:

Perhaps I’m being naive but since the MOSFET/Transistor would be connecting and disconnecting the ground a pull up resistor would be unnecessary and would work outright. And my watching of the linked video appears to agree with my understanding.

Thanks James!

Is anyone familiar enough with ATX/Ras Pi power input to know if I will run into any obscure functionality that will give me grief?

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [28 April 2022 05:49 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/4 "2022-04-28T05:49:09Z")

</div>

Hi Jem,

Seems I got that a bit wrong, Andreas is using a pull_down_ resistor instead.

He does talk of omitting a protection resistor between the gate and the Pi pin, but that’s for making sure it doesn’t draw too much current at very high frequencies.

The pulldown is useful if your pin defaults to an input (hence floating) before your code starts, or the connection to the Pi is interrupted. A floating gate will switch the FET constantly and generate some heat and unwanted behavior.

-James

---

<div class="post-metadata">

**Author:** ![Jeremiah177112](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Jeremiah177112](https://forum.core-electronics.com.au/u/Jeremiah177112)\
**Post date:** [28 April 2022 09:39 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/5 "2022-04-28T09:39:05Z")

</div>

> [@James](#):
>
> The pulldown is useful if your pin defaults to an input (hence floating) before your code starts, or the connection to the Pi is interrupted. A floating gate will switch the FET constantly and generate some heat and unwanted behavior.

Ah I see. I’ll do some experimentation to confirm my own understanding, thanks for the tip.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [28 April 2022 09:59 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/6 "2022-04-28T09:59:11Z")

</div>

Hi James  
Just butting in a bit here but

> [@James](#):
>
> He does talk of omitting a protection resistor between the gate and the Pi pin, but that’s for making sure it doesn’t draw too much current at very high frequencies.

That series resistor is there to protect the Pi GPIO pin. At the instant of switch on the Gate of the Mosfet presents a short to ground to the Pi pin due the the Gate capacitor resulting in potentially high current. The same applies the other way, the gate capacitor has to be discharged and this series resistor prevents destructive currents in and out of the Pi pin.

So I think this Andreas is asking for trouble omitting this resistor and should not be publishing and spreading the word.

The value is a bit of a compromise as if too high the Mosfet switching time is slowed down possibly causing overheating when switching larger currents. A value of about 1k seems to do the job in most cases although for high current applications I have seen as low as 10Ω but the Gate then is interfaced with some transistors or a specialised driver to supply the charging/discharging current.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![G177630](https://avatars.discourse-cdn.com/v4/letter/g/f07891/32.png) [@G177630](https://forum.core-electronics.com.au/u/G177630)\
**Post date:** [28 April 2022 14:19 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/7 "2022-04-28T14:19:20Z")

</div>

> [@Jeremiah177112](#):
>
> then wiring a custom cable to adapt the 5V and ground pins of the ATX pins t

May be this will be useful  
[https://www.amazon.com/Breakout-Splitter-Connector-Computer-Electronic/dp/B099RJ7572/ref=sr\_1\_3?keywords=atx%2Bbreakout%2Bboard&qid=1651155399&sr=8-3&th=1](https://www.amazon.com/Breakout-Splitter-Connector-Computer-Electronic/dp/B099RJ7572/ref=sr_1_3?keywords=atx%2Bbreakout%2Bboard&qid=1651155399&sr=8-3&th=1)

---

<div class="post-metadata">

**Author:** ![G177630](https://avatars.discourse-cdn.com/v4/letter/g/f07891/32.png) [@G177630](https://forum.core-electronics.com.au/u/G177630)\
**Post date:** [29 April 2022 13:02 UTC](https://forum.core-electronics.com.au/t/powering-raspberry-pi-from-atx/13887/8 "2022-04-29T13:02:09Z")

</div>

> [@Jeremiah177112](#):
>
> But as best I understand I would have to take the 12V for the fans from the power supply before it gets to the pi, a feasible task.

You can also get 2 pin 12V fans and use [this Instructables](https://www.instructables.com/PWM-Regulated-Fan-Based-on-CPU-Temperature-for-Ras/) to make a PWM controlled by Pi. I made one for 5V fan for my Pi 4.  
G
