Soft power button

Discussion in 'Guides, Mods, and Upgrades' started by Jonas, Sep 10, 2016.

  1. Jonas

    Jonas Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    53
    Likes Received:
    29
    Hello

    I didn't like that the power button was "hidden" behind the power cable (I'm right handed). And I have seen that some of you has put in a power button on the front. I liked that idea, so I did a version of that myself. I put in a 5V power supply for the raspberry pi. This power supply was connected directly to 240V. I also made a HAT for the raspberry pi. It looks like this.
    image.jpeg
    I connected 5V to the HAT from the new power supply and removed the 12V/5V DC/DC converter. The HAT powers the raspberry pi. I routed one 240V lead to the green screw connector, which is hooked up to a relay on the HAT, and then from the green screw connector to the 24V power supply. The other 240V lead and the earth goes directly to the 24V power supply.

    I wrote a short program in Python and then added a couple of lines in ~/.octoprint/config.yaml

    A short press of the power button starts the printer, but a slightly longer press (0.8s) is needed to turn the printer of. Here is a video of it






    I got the inspiration to the circuit from this video



    and this web page

    http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/
     
  2. Tim

    Tim Member

    Joined:
    Apr 1, 2016
    Messages:
    18
    Likes Received:
    9
    Very cool! Accessing the power button at the back of the box is something I've found mildly annoying, I like your solution.
     
  3. Stefan

    Stefan Well-Known Member

    Joined:
    Feb 17, 2016
    Messages:
    323
    Likes Received:
    43
    To get this right, the raspi is always on, and you can swtich th3 printer (PSU) on and of this way.

    Nice, but I'm comfortable having mains on the HAT, I would make a separate PCB with the relay, like this
    http://www.sainsmart.com/arduino-pro-mini.html
     
  4. Jonas

    Jonas Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    53
    Likes Received:
    29
    @Stefan Yes, I understand your concern. I'm not completely comfortable with the mains on the HAT, but I decided to do it this way anyway. I guess mostly because I was impatient and wanted it done when I had some time to spend on the printer. And a Raspberry pi is fairly cheap :)
     
  5. Stefan

    Stefan Well-Known Member

    Joined:
    Feb 17, 2016
    Messages:
    323
    Likes Received:
    43
    :D yes it is cheap, but I guess a mains short cut would kill all eletronics and even you.
     
    Jonas likes this.

Share This Page