Posts: 274
Joined: Fri Jan 27, 2012 1:34 pm

Automated ATX PSU control - Help please

Thu Mar 06, 2014 4:23 pm

I'm looking at using a RasPi to control a ATX power supply
I want to be able to turn it on/off, control one of the 5v lines, control two of the 12v lines and check the power good line.
This should enable me to safely power on and more importantly power down a 3D printer attached to it. With the 5v line being attached to a simple 5v led light.
I know if you connect the ground to Power Supply On line it turns the psu on and keeps it on until its disconnected.
But controlling the others is where I'm a little lacking.

Is it a case of just getting 2 5v relays (the Power Supply On is 5v right??) and 2 12v relays and wiring them up for the control with a 5v to 3v logic converter for the power good line?



Fingers crossed someone has done something similar.

Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Automated ATX PSU control - Help please

Fri Mar 07, 2014 9:34 am


Could you expand your explanation please.

Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Automated ATX PSU control - Help please

Fri Mar 07, 2014 9:59 am

I didn't answer earlier, because I haven't done anything similar.

But - why not just use a single mains relay to shut off the entire thing? Provided you're happy with mains wiring of course. The raspi and relay would be powered by a separate supply.

If I wanted to switch the 5V and 12V lines myself by separate relays, I wouldn't use an ATX supply - because various people have warned not to run these supplies without a load. I would build my own supply, or buy a simpler 12V supply and add a 5V regulator to it. That sounds like a safer and more predictable method...

Posts: 274
Joined: Fri Jan 27, 2012 1:34 pm

Re: Automated ATX PSU control - Help please

Fri Mar 07, 2014 11:23 am

Sorry I'll explain it more, be-warned its a bit of a wall of text.
I'm in the process of re-building/upgrading my RepRap 3D printer. Way back when the RasPi was first announced to the public I mocked up plans for using the RasPi in place of a laptop/desktop for slicing (generating g-code) and sending g-code to my printer.
On thing lead to another and my plans got lost and my printer gathered dust.

Fast forward about 3 years, I've rekindled my interest in 3D printing and dug out my plans.

To cut costs most DIY 3D printers use an ATX psu for power using the 12v rails (in the region of 20a), as the cheaper ATX psu's can have stability issues when just using the 12v rails most people attach something to the 5v lines which solves the issue of stability. Long story short a cheap ATX psu needs both 5v and 12v.
In my case I attach a 5v usb LED light which gives both the 5v rail load and lights up the print bed.

As you may or may not be aware some prints can take 12h+ to run and FDM printer involve 160c+ temperatures, so they aren't things you want to run with no-one in the house or something you want running when everyone is asleep.

This is were the Raspberry Pi comes in. I have a camera module which will allow me to remotely monitor the print and I can attach the RasPi to the printers electronics via usb which allows me to send prints.
Thats all fine as long as everything works fine however if something goes wrong I need to be able to remotely turn off the printer.
Which is were the Power Supply On relay is needed, breaking circuit instantly cuts out the psu and still allows you to start it back up by reconnecting.

The 5v and 12v relays are extras, but would allow me to remotely control the LED light and remotely power down/up the printer after/before a print.
The Power OK line is high when the psu is working fine, low then not. If I can read this line I can set it so it will never power on the printer if there is an issue.

Here's a rough image of the current setup (green board is the electronics for the printer). Red being the 5v line, yellow the 12v, green the power supply on and browns are earth/ground.
What I need help with is the wiring for controlling each of the non-brown cables via the RasPi as well as monitoring the power ok line (not sure) which is a 5v line.

Return to “Automation, sensing and robotics”