Welcome! Log In Create A New Profile

Advanced

ATX supply to power RPi / RAMPS / OctoPi

Posted by milt 
ATX supply to power RPi / RAMPS / OctoPi
March 27, 2014 06:09PM
I've done quite a bit of googling and think I have this figured out, but I would like someone to double check me.

The Goal: Use an ATX power supply to provide 5v standby to power a Raspberry Pi which is connected (and powering) the Arduino / RAMPS stack. When ready to print, RPi will send G-Code to RAMPS to turn on the ATX power supply (via PS-ON pin) and provide the 12V to RAMPS for steppers, hotend, heated bed, etc... This is all designed to be used with OctoPrint for remote printing.

Wiring: Motherboard 24pin connector will be cut off the PSU. Yellow and Black wires will go to RAMPS terminal block to provide +12V and ground, respectively. Purple 5v standby and black wires will be spliced to a micro-USB to provide constant power/ground to Raspberry Pi (and thus to the Arduino/RAMPS stack). Green wire will be connected to the PS-ON pin on RAMPS.

Questions:
1) Will this work? 5v Standby should provide enough power to run RPi and Arduino/RAMPS, right?
2) Do I need to remove the D1 diode (pre-installed on my RAMPS board) to prevent damage to the electronics? I'm thinking I don't need to...
3) For the PS-ON signal to work, do I need to run a separate ground wire to the RAMPS board or will the grounds at the terminal blocks work?
3) Some tutorials for using ATX power supplies indicate a need to put a on the 5V rail in order to get the PSU to power on. Would the RPi on the 5V Standby work for this? Or does the load need to be on the 5V non-standby rail?

I apologize if none of this makes sense. I'm trying...
Thanks!
Re: ATX supply to power RPi / RAMPS / OctoPi
March 27, 2014 08:38PM
1) The 5v standby rating should be on a label on the psu, and bigger than the consumption of the stack both rpi and arduino together, and their ratings will be on their specifications, but that would probably be max ratings and the boards will consume less. If the 5v standby rating is like 1-1.5-2a, probably should work.
2) The D1 would be reverse biased in this case, it will block, so i also think you do not need to remove it.
3) I think all the black wires are all technically the same ground, they would come from same place so there should be no difference which one you use for which purpose. Only the v+ rails would be separate. The gnd at ramps block will work as it will connect through psu with the gnd from the usb - this can be checked for continuity.
4) Usually to power up psu you need to connect the green wire to a black wire, that is to put it to gnd. I am not sure i understand where the 5v comes in. Usually when pins are not used and nothing is done to them they can have voltages like 2v or so. Which perhaps can turn on the psu (not really sure about that tho). I guess you are worried about the ps_on pin not having a default state, and then use 5vsb for that, could enable the internal pullup, use an external pullup (to 5v standby), or use a signal mosfet with a 3v3+ vth gate to better isolate the green wire from arduino pin parasitics or voltage values in forbidden region. Again not sure if that is required or not, but i think it should not be the case.

All in all i think it makes sense to me at least. Nice approach btw with using vsb. Do you plan to use ssh, and a local display manager even, or how will you connect?

Edited 1 time(s). Last edit at 03/27/2014 08:52PM by NoobMan.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 27, 2014 10:21PM
Thanks for the detailed answers. I really appreciate it. As for my question about the 5v load, I found this on the reprap wiki... not sure how I missed it before.

Quote

Many PC PSUs (not all) require a base load on the 5V rail to work properly. Connecting an old CD drive or a 12V light bulb (into the 5V rail, see picture) are well proven methods to get this load.
Wether you need a base load or not has to be tried. If even tiny loads on the 12V rail cause the PSU to turn off, a base load is required. Also, a base load never hurts.

I guess I'll wait and see if my PSU works without this or not.

The end goal is to run the printer using OctoPrint. It's a web interface (hosted by the RPi, in this case) that you upload your g-code to which in-turn sends it to the printer via Repetier. This way I can use my laptop or even tablet to upload g-code from the local network, or I could port-forward the RPi IP and run the printer via a web browser from anywhere. It also provides an optional webcam interface for timelapse and a lot of other features. Really nice UI and super easy to install, for me at least. Check it out.

Thanks again. I'll try to report back after I've wired everything and let people know if anything blew up.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 05:27AM
I'm really interested in this.
Its something I've been thinking about doing for a while, but never got around to it.
I got a little lost in all the extras you could add to the setup, for some reason changed my mind and am contemplating just getting a 12v psu with 7805 for the RasPi.


My Reprap blog

jds-reprap.blogspot.com
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 07:45AM
How are you going to power the Arduino before you turn the power supply on? Via USB from the RPi? I think you'll have issues as the RPi doesn't have much current capabilities via it's USB port, especially if you're also using wifi or have a camera attached to the RPi.

The route I took was to use a cheap 4 port powered USB hub, cliped off off the wall wart and instead spliced the power connector to +5vsb. One usb cable goes from the hub to the RPI micro USB power connector. This obviously provides the power for the RPi. No data goes across this connection. Then from the RPi USB Type A connector, another connection back to the hub. From there, I have a connection that goes to the Arduino. There's plenty of power left that I can also have my USB camera and EDIMAX wifi adapter plugged in at the hub.

Before the powered hub, I had intermitten issues when setting things up if I tried to use both the camera and wifi at the same time. Plus I had to have a hub anyways since I needed 3 USB ports and I wanted to keep everything with just basic USB connections.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 10:51AM
I am planning on powering the Arduino from the RPi with USB. I'm actually doing that right now with a 2A wall wart powering the RPi and USB to the Arduino/RAMPS stack. Haven't run into any problems yet, but I don't have anything connected to the RAMPS...

I have an Edimax wifi dongle installed and the official Raspberry Pi Camera module, so the Pi itself is consuming a bit of power. Any idea how much current the Arduino Mega 2560 and RAMPS need? I'd like to connect to the network via ethernet cable rather than wifi eventually for additional bandwidth and to reduce power consumption on the Pi.

I pulled out the ATX PSU from an old desktop last night and checked it out. Label says it provides 2A to the 5V standby, so that is great. Multimeter reads 5V from purple wire when PSU is plugged in but not "on". Shorting the green wire to ground turns the PSU on and I got +12V from all yellow wires. 12V rail supplies 20A on this supply, if I remember correctly.

Unless I'm missing something I think this will work. Still uncertain on the D1 diode... When the 12V supply is on, the Arduino will be getting power from both the USB and from the RAMPS board, right? Is that okay?
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 02:27PM
About D1, if the 12v is supplied the diode become forward biased and conducts to mega regulator input pin, so that regulator can make 5v from the 12v supply instead. Nothing wrong with that, if you look at the black power jack on the mega, that is actually the same thing 12v input, and right behind it there is a smd diode that is also named D1, and after that diode its the exact same line, Vin from the Vin pin. So its how it is supposed to be, 12v comes in through a diode, goes to Vin for the regulator.

The Vin pin on mega is provided after the diode, because that is how the mega designer figured to do it. I guess they thought Vin would be a pin to supply 12v from the jack to the "shield" - hence no diode. Ramps instead, uses it in reverse, to provide power to the mega, thats why it has to use an additional diode instead because the D1 on the jack is not used anymore so it has to replace it. Basically the D1 on ramps and the D1 on mega are the same thing: prevent 5v regulator output to discharge in the output stage of the atx psu. In the 5v regulator current normally goes from 12v input to 5v output, but also at shutdown, 12v falls first, then 5v is still up and it discharges back to the 12v line, that is to discharge the caps on the 5v line etc, so the 5v regulator can conduct from 5v to the 12v line when the 12v line is lower than 5. This way if you would supply 5v directly through usb and 12v line is at zero, the D1 diode would not be there, the 5v from usb would go into the atx psu 12v output stage and the caps there, which if are too big could for example draw a turn-on current bigger than what 5v usb can afford. Or dunno, something else, anything can happen, the designer didnt knew what ppls would use as supply.

So both D1 are good to have there, and they sort of make sense.

You can figure out what happens, not all 5v are created perfectly so check the 5vsb if its 4.82v and the regulator on the arduino makes like 4.97v, then you can figure which one is what - and when. If you supply from 5vsb and then supply 12v instead and the 5v on arduino changes value, then that has to be from the regulator. It should be no problem whatsoever, either way. Both 5vsb and what the regulator makes from 12v all of these have same gnd, come from same psu, so there should be no problem or no issues using either or both. Ofc - imo.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 03:00PM
Awesome! Thanks for the clarification, Noobman. I think I understand most of what you are saying... I'll take the rest on the faith that you are smarter than me. Thanks again.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 28, 2014 03:44PM
Dont take faith, when you find things like this you rather should read documentation and find out more. Its a genuine occasion to become better, by all means do not let these moments pass by because of "faith". Faith is bad and leads to bad things.

If you open the mega sources, and find the regulator name, and then check NCP1117 datasheet and read at start of page 10 under "protection diodes". And to convince that is true, feed the usb with 5v and check the voltage on the open Vin line, should be 5v perhaps minus a small dropout. If the ramps D1 would not block this voltage, it would reach back into whatever its connected at that pin. Basically D1 keeps the 5v flowing out of the arduino back through the Vin pin, which in our case leads inside atx psu.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 29, 2014 03:41PM
Got it all wired up and it works great! Only problem I ran into was that the firmware I had installed on the Arduino did not have PS_DEFAULT_OFF defined. Therefore when I plugged in the power supply the RAMPS got 12V. Since the RAMPS was already powered up I couldn't connect the RPi to the Arduino/Ramps... It would try to connect then say "Machine State: Closed". Not sure if this is default behavior or if something else is going on.

At any rate, putting "#define PS_DEFAULT_OFF" into my configuration.h file and uploading to the MEGA fixed the problem. 12V stays off until I send the command "M80" to turn it on. "M81" turns it back off.
Re: ATX supply to power RPi / RAMPS / OctoPi
March 29, 2014 06:39PM
Nice going and congratulations smiling smiley
Re: ATX supply to power RPi / RAMPS / OctoPi
January 07, 2016 04:53PM
Hello Guys. I have sucessfully connected and shut down my atx power supply, but I have one problem: my ramps is powered trough USB and the atx. When I switch off the atx with m81, it turns off, but my Ramps has power trough the USB connection from my PC. the problem is: When I disconnect the USb cable, the atx ist switching on for ~1s, and immediatly switching off and the back on and so on. Until the capacitors in the atx are empty, then it stops. What can i do? Is it because of the pull up?

Thanks!

Dominik
Re: ATX supply to power RPi / RAMPS / OctoPi
May 07, 2016 10:01PM
Have you gotten this to work? I know its been two years and i am looking for a way to do exactly this. I work better using a wiring diagram. I was wondering if you can cook something up real quick?
Re: ATX supply to power RPi / RAMPS / OctoPi
August 03, 2016 12:17PM
Not sure if this is the right place to ask, I'm using a std power supply so have put in a relay to use M80 / M81. M80 is supposed to be ON and M81 OFF, I have allocated pin 20 to turn the relay ON and OFF, well my seems to inverted, M81 turns ON the relay and M80 turns it OFF! the down side it works well with the relay but turns the heating OFF on the bed and nozzle? Any ideas how to change this or correct it? My boards is a MKS Base, ver 1.4.
Re: ATX supply to power RPi / RAMPS / OctoPi
August 03, 2016 02:47PM
Stupid question, why have you got the PC plugged? Do you run everything from the PC? or can your printer be stand alone and print from the SD card?
Re: ATX supply to power RPi / RAMPS / OctoPi
August 03, 2016 02:48PM
Quote
clydefrog
Hello Guys. I have sucessfully connected and shut down my atx power supply, but I have one problem: my ramps is powered trough USB and the atx. When I switch off the atx with m81, it turns off, but my Ramps has power trough the USB connection from my PC. the problem is: When I disconnect the USb cable, the atx ist switching on for ~1s, and immediatly switching off and the back on and so on. Until the capacitors in the atx are empty, then it stops. What can i do? Is it because of the pull up?

Thanks!

Dominik

See q above
Re: ATX supply to power RPi / RAMPS / OctoPi
December 05, 2016 01:34PM
Hi Guys,

I just installed my ATX power supply and wired everything as it should.

I have a problem:

I turn on the printer, connect to the printer via Repetier host. Ok so far.

I send M81 command. Printer turns off. Great.

I send M80 command...Nothing??

I tried with the standby 5v connected, disconnected, with diode D1 installed, D1 removed...same thing...

Any thought?

Thanks!
Sorry, only registered users may post in this forum.

Click here to login