Author Topic: Use 5v signal instead of a switch  (Read 1419 times)

Colin

  • NewMember
  • *
  • Posts: 8
  • Country: england
Use 5v signal instead of a switch
« on: March 19, 2017, 01:57:37 PM »
Hi,

I would use a 5v signal instead of a switch. If there is a continue 5v on this signal wire the pi must be startup. When it is 0v the pi must be shutdown.

Is this possible with the ATXRaspi. Instead of using a switch on the ATXRaspi a 5v signal?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Use 5v signal instead of a switch
« Reply #1 on: March 19, 2017, 05:12:13 PM »
It's possible but you will need to add some extra circuitry, a transistor perhaps.
Right now the BUTTON connection (2 left most pins on the TOP header) are: BTN and GND. When these 2 are connected, that is a button "press". The "BTN" signal is a pulled up GPIO high impedance input of the MCU.
I haven't tried it but I think you can do it with an N channel transistor, where you leave the BTN at 5V when 5V is at the gate, and pull down the BTN line when 0V is applied. That way the transistor acts as the button, activated by your 5V "digital button press".
Also don't forget that this will require latching mode, so you need to follow the guide to add the 10K resistor that tells the MCU this is a latching operation (ie not momentary button).

Colin

  • NewMember
  • *
  • Posts: 8
  • Country: england
Re: Use 5v signal instead of a switch
« Reply #2 on: March 21, 2017, 01:50:01 PM »
Also don't forget that this will require latching mode, so you need to follow the guide to add the 10K resistor that tells the MCU this is a latching operation (ie not momentary button).
Where can I find this?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Use 5v signal instead of a switch
« Reply #3 on: March 21, 2017, 03:01:57 PM »
Have you looked at the guide?

https://lowpowerlab.com/guide/atxraspi/assembly-install/

By the way here's how it can be done from software, I think that will match what you need except your signal should be 5V to the transistor gate.
The given script for that software shutdown should work without modification.

https://lowpowerlab.com/guide/atxraspi/full-pi-poweroff-from-software/

« Last Edit: March 21, 2017, 03:04:45 PM by Felix »

Colin

  • NewMember
  • *
  • Posts: 8
  • Country: england
Re: Use 5v signal instead of a switch
« Reply #4 on: March 23, 2017, 11:33:16 AM »
Thanks, just orderd a ATXRaspi to try it.