Introduction: Arduino Controlled ATX Power Supply
Can a microcontroller control its own power? Well nearly!
An ATX power supply, either new or from an old PC, is a great way to power Arduino and other microcontroller projects. That is covered in several 'ibles such as this one. However, because of some of the special features of an ATX, we can use it as a "smart" supply that's even better.
This is a very simple 'ilbe that will allow you to make a lead that will allow you to control an ATX power supply from your microcontroller. That way you can use your old ATX as a silent, low-waste power supply for low current microcontroller applications and switch it under firmware control to a high-current monster supplying tens of amps at 5V and/or 12V.
A video showing the idea in action is embedded in the final step.
Total cost of the control lead is a few pounds and you will not damage your power supply in any way so it can be used for other applications later if you wish.
Step 1: Things You Need:
This project requires:
An ATX motherboard extension cable (£2 inc delivery from e-bay)
3 jumper leads
A 1K resistor (value not critical)
Some heat-shrink tube
Tools:
Soldering iron & solder
Clippers
Lighter to shrink the heat-shrink
For use:
An ATX power supply
A 5V microcontroller such as an Arduino
High power transistors etc to control stuff.
Step 2: Background
An ATX supply is a wonderful thing!
Looking at the sticker of this supply that I picked up new for £15, we see that it can supply a well-regulated:
20A at 3.3V
30A at 5V
30A at 12V
Plus a stand-by current of:
2A at 5V
Now 2A at 5V is ample to run nearly any 5V microcontroller, while 30A at 5V or 12V is enough to power pretty much anthing short of an aluminium plant.
All we need to do is tap into the 5V standby power to run our controller board and then switch on the high-current supply when we need it.
Step 3: Making Up the Connector
The ATX power connector is well known and the pinout is available online, such as here:
What we need is the stand-by 5V power (purple), the control wire (green) and any of the black ground wires.
Start with the female end of the connector (well, I take that to be the female end - the one in the first picture) and clip off everything we don't need close to the connector. Then clip off purple, green and black close to the other end. Slip some hear-shrink over these three and strip these wires and the jumper wires we are connecting to.
We are going to add a 1K resistor to the control wire just because we can and it avoids any risk of excess current flowing when we pull it low with the microcontroller. So, solder the resistor to the green jumper lead and then to the green wire from the ATX extender. Solder the purple and black wires to the corresponding jumpers (in my case red and black). Finally, heat your heat-shrink.
Step 4: Controlling and Using Your Arduino ATX
Power your Arduino with the purple (red in the picture) ATX wire to +5V (don't use Vin) and the black ATX wire to Gnd.
Connect the green ATX wire to any control pin. I have used A0 (D14) because you can see it in the picture but a general digital IO pin works just as well.
Plug in your ATX and your Arduino will be powered bu the main power and probably the fan will stay off.
When you need full power just issue the command:
pinMode(ctrlPin, OUTPUT);
To turn the main power back off, use:
Equally, to turn off, you could simply set it to:
to set the pin to high resistance again.*
Now all you need to do is connect your high current load to any of the MOLEX type connectors from the ATX supply and control them with transistors, MOSFETs etc as you normally would. When you reach the point in your sketch when you want full power, just issue the above command and fire up the 30A supply!
Note - you should be careful powering your Arduino direct to the +5V. If you also connect the USB cable then you could get a current flowing to you USB port of your PC so take care to connect only one power source at a time.
The ATX specification suggests that you can either hold the line at +5V or disconnect (set high resistance) to turn off the main power: http://www.formfactors.org/developer%5Cspecs%5Catx2_2.pdf
Step 5: ATX Control in Action
Edit - full dawn/sunrise alarm clock instructable now here: https://www.instructables.com/id/LED-Dawn-Sunrise-Alarm-Clock-Nightlight-Secur/
You can see that the Arduino controling the time display is powered the whole time but initially the fan on the ATX is not running. That's because we are only using the standby power.
When I fire up the main LED lamp (about 9W of LEDs at the moment but will be more later), the Arduino powers them by switching on the main ATX power and you see the fan start to run. When the main light goes off again, so does the main power.
For an alarm clock project it's very useful because you don't want the noise of the fan running all night. There are many similar situations where the muscle of the main ATX power is only needed occasionally.
Hope you find it useful.
Ugi
46 Comments
6 years ago
does the green wire have any voltage on it that would damage the Arduino
thanks
Dwight
Reply 6 years ago
Some of them can source nearly 100ma from the PS_ON when connected to GND. That shouldn't hurt your Arduino during testing***, but it will not turn the PSU on, since the Arduino isn't rated to sink more than 40ma. See my comment above for details and how to fix the issue.
*** Trying to sink more current than your Arduino can sink will most definitely burn up the pin (or your board) if the current is high enough and you let it run long enough. The only reason this probably won't kill your board, is because it is only a bit over the max amperage spec, and because you would recognize a problem and unplug it before damage occured.
Reply 6 years ago
The green wire should be a high-impedance "sensing" connection, like an Arduino "input" pin so should not be any threat to your Ardu'.
I put a 1K on that line out of an abundance of caution because that limits the current if there were any issues. However, it should be completely unnecessary.
My only caveat here is that there are many makes and builds of ATX power supplies and although they should all conform to similar standards I have not made any attempt to test them widely. It is therefore just possible that _your_ ATX supply is different to those I have tried. I think the chances are very small, but if in doubt, put a meter on the pin, then ground it and measure the current flowing.
Ugi
6 years ago
I was testing this on some old PSUs from my "closet of obsolete computers".
For some of them, I needed to use an NPN transistor to get the PSU to turn on, because they sent >90ma from the PS_ON to GND. (More than an Arduino can sink)
To solve the issue, I hooked the transistor up like below, and changed the code to be high for ON and low for OFF. Most any NPN you've got in your bin should work.
NPN Transistor connections:
Base <--> 2.2K resistor <--> ctrlPin
Collector <--> PS_ON
Emitter <--> GND
(These were PSUs that may or may not have been flaky enough to be the reason they ended up in my "closet of obsolete computers". Not PSUs that I would trust to run a computer well. PS_ON being low-impedance could easily because these PSUs were "bad". They all worked well enough for the non-computer destinations I planned for them. :) )
7 years ago on Introduction
This is a great job!
Do you think its possible to connect an arduino and a raspberry pi to the 5v standby?
Reply 6 years ago
Yes, you can, BUT..... I've heard a few saying if you try to connect some of the arduinos (R2 and back) +5V line, it can do damage to the circuit that switches from the USB +5V to the regulator +5V.. (haven't actually seen this myself.. Duiemilinova worked fine..) as long as you're not pulling too hard on the 2A standby (with an arduino? not likely.)
Reply 7 years ago on Introduction
That depends a lot on what you are using your RPi for and the spec's of your ATX.
The power supply I used was rated for 2A at 5v standby. Now we know a normal Arduino will run off a computer USB port which provides 500mA max, so providing you are not adding too many high-power devices to that, we'll say that needs 0.5A.
For normal use they recommend 5v 1.2A for the RPi: https://www.raspberrypi.org/help/faqs/#powerReqs
However, if you are using lots of USB ports on the RPi then you might need more.
For normal use, however, we need 0.5A for the Arduino and 1.2A for the RPi, which makes 1.7A, fitting nicely inside the 2A standby available. So looks like for a "normal" setup, it should work fine.
Ugi
Reply 7 years ago on Introduction
Thanks a lot for your valuable input.
7 years ago
Great job!
One question: can i boost the voltage from the atx +5vsb to 9v using a LM2577 DC-DC Step up Power Module Adjustable Voltage Power Converter Module so i can power the arduino using the power jack (7-12v) so i can also use the usb connection without having to hack the usb cable (power) nor use the 5v pin ?
Reply 7 years ago
Hi - Thanks for your interest.
So long as you don't draw more current than your individual 5vsb allows then yes, certainly you can do that. You are burning power stepping up and then regulating back down, but it is formally a more "correct" way to power the Arduino. You could probably boost to 7-8v rather than 9v, however.
You should expect that to boost 5v to 9v, assuming a less than perfect efficiency, you would approx double the current drawn. Therefore, if your +5vsb is rated 2A on your ATX (that's what mine says) then you should not expect to draw more than 1A at 9V. I doubt you need to use more than that, bearing in mind that anything you need to power beyond the Arduino itself can always come direct from the +5Vsb.
Good luck with your project!
Ugi
Reply 7 years ago
Thank you for your reply..
is mi intention is to only power the arduino from the 5vsb, so i can still control the psu, and remain with a active normal usb connection, all other devices will be powered from the psu 12v rails.
8 years ago on Step 3
Great work. I am looking to do this with a Raspberry Pi. Any reason that it wouldn't work? The Pi uses 3.3v GPIO, but that shouldn't have a problem pulling down the 5v signal from the PSU provided that the unregulated ground ground on the Pi is connected to the GPIO ground. Let me know if you've tried it. Thanks,
Reply 8 years ago on Step 3
Not tried it but no reason I can think of why it shouldn't work. Just two points that occur to me (they are probably obvious):
You will need to switch by going from High Impedance (input) state to pulling low - I don't expect you can turn the power off reliably by pulling "high" to 3v3.
It makes me more inclined to put the resistor in the circuit to avoid any stray currents. I can't immediately see how the situation would be different but I would hate to see you "bake" your Pi!
Would be interested to know how it goes.
Ugi
8 years ago on Step 3
Great work. I am looking to do this with a Raspberry Pi. Any reason that it wouldn't work? The Pi uses 3.3v GPIO, but that shouldn't have a problem pulling down the 5v signal from the PSU provided that the unregulated ground ground on the Pi is connected to the GPIO ground. Let me know if you've tried it. Thanks,
8 years ago on Introduction
Just a note to let you know I have added this instructable to the collection:
Encyclopedia of ATX to Bench Power Supply Conversion
>> https://www.instructables.com/id/Encyclopedia-of-ATX-to-Bench-Power-Supply-Conversi/
Take a look at about 70 different approaches to this project.
Reply 8 years ago on Introduction
Great - sounds like a useful collection!
Ugi
8 years ago on Introduction
I accidentally fried my arduino when I hooked it to the power supply. Oops...
8 years ago on Introduction
Guys i got a question, with this i can control when the psu is on or not, but can i use the psu to control a blinking led, the same way i do it with the arduino for example?
8 years ago on Introduction
Is there any issue with using an ethernet shield and power flowing back through? Or does that only affect the USB connector? Also would rigging a DC jack from the ATX 5v power supply be a safer way?
Reply 8 years ago on Introduction
I have not used the ethernet shield but this should be exactly the same as using the shield with USB power. If the shield is safe to use from usb then it should be fine with direct 5v power.
Connecting to the Jack connector or Vin only works if you have around 7 to 12v . There is no 12v standby on an ATX as far as I'm aware.
Ugi