Welcome! Log In Create A New Profile

Advanced

Enable power supply with Arduino.

Posted by mccoyn 
Enable power supply with Arduino.
December 14, 2009 06:17PM
Before I can let my reprap run unattended, I need a way to shut it down when a build is complete. I think the simplest thing will be to shut off the power supply using the green wire. How do I do this?

My guess is I just connect the wire to a pin on the Arduino and hold it at Gnd during a build and set it to 5V when the build is done. Or do I use an analog pin and set it to AnalogRead (floating) to shut it down?

Edited 1 time(s). Last edit at 12/14/2009 06:23PM by mccoyn.
Re: Enable power supply with Arduino.
December 14, 2009 09:19PM
Hmm it will only work if you are powering the Arduino from USB. Then you can then use a digital output pin from the Arduino. I would also like to electricaly isolate the switching process from the Arduino by using that pin to switch a transistor or Fet with a reed relay or relay to switch the PSU on and off.

If you are using the PC powersupply like I am to power the the Arduino. Then its a little bit catch 22 like.

To remove the problem you could make the printhead go to a specific position where it can switch off a mechanincal switch that you switch on to start the RepRap print.


Bodge It [reprap.org]
=======================================

BIQ Sanguinololu SD LCD board BIQ Stepcon BIQ Opto Endstop
BIQ Heater Block PCB BIQ Extruder Peek clamp replacement BIQ Huxley Seedling
BIQ Sanguinololu mounting BIQ standalone Sanguinololu or Ramps mounting Print It Stick It Cut it


My rep strap: [repstrapbertha.blogspot.com]

Buy the bits from B&Q pipestrap [diyrepstrap.blogspot.com]
How to Build a Darwin without any Rep Rap Parts [repstrapdarwin.blogspot.com]
Web Site [www.takeaway3dtech.com]
Re: Enable power supply with Arduino.
December 14, 2009 09:32PM
I have an eco power board where all power is shutdown if the computer is turned off.

shutdown -h 0 shuts the system down at the end of a print run and you don't loose a pin on the arduino controling the reprap PSU.

In theory if the reprap has an issue it could signal the computer to shut itself down as a fail safe.

Stephen

See [www.originecostore.com.au]
Re: Enable power supply with Arduino.
December 14, 2009 11:10PM
mccoyn: the green wire is a ttl-level signal wire which turns on the psu when held low. setting it to either 5v or letting it float will turn off the psu. One idea would be to set your arduino to be powered by the psu, then connect a momentary button between the wire and ground, so the button turns on the psu, the arduino then pulls the line low while it prints, then lets it go and everything turns off when complete. a fet or bjt would be handy in this situation so the arduino isn't powered by the sensing current on the green wire through its protection diodes.
Re: Enable power supply with Arduino.
December 15, 2009 06:38PM
To turn the power supply off I did this:

    pinMode(POWER_SUPPLY_PIN, INPUT);

which will make the pin float.

To turn the power supply on I did this:

    pinMode(POWER_SUPPLY_PIN, OUTPUT);
    digitalWrite(POWER_SUPPLY_PIN, 0);

which sets the pin to ground.

I connected the green ATX wire to the POWER_SUPPLY_PIN and connected a black wire from the power supply to the GND of the Arduino to make sure everything worked out correct.

The only downside is that when I disconnect the USB from the Arduino (thus unpowering it) the power supply turns on. I would prefer that it default to off until the Arduino turns it on.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
If you rewire your main board (Arduino or whatever you happen to use) to be powered from the +5 Standby (purple wire) on the ATX connector, it will remain on and can control the rest of the system by driving the Green wire high or low (reverse logic, pull low to turn power on). It can also read the Grey wire to determine if the powersupply is on and happy. This is how your computer does it (it keeps a small MCU on so Wake-on-LAN works, and powers on with a button).
Re: Enable power supply with Arduino.
December 17, 2009 07:57AM
I thought about that. The problem is that my board wants at least 7V on its supply. I'm thinking about short circuiting the 5V regulators on the Arduino by connecting the 5V standby to both the power connector and a 5V pin.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Sorry, only registered users may post in this forum.

Click here to login