Pololu Pushbutton Power Switch - Arduino reading the button

Attached is a image of my current setup, which allows for the the first button press to turn on the Arduino. Subsequent button presses do not shut down the power, which is great. What I’m trying to achieve is being able to have the Arduino read when that same button is pressed additional times (besides the first press).
So in essence:

  1. First press of the button turns on the Arduino
  2. Second press of the button is detected by the Arduino and starts a shutdown process
  3. When the Arduino is finished shutting down, it sets “off pin” on the switch and powers down.

What is the setup to allow the above without causing additional battery drain?
Thank you for your help,


I’m very new to embedded electronics. It seems to me like the solution would involve connecting a wire from an open digital pin on the Arduino to either the positive side of the push button with a pull - down resister towards ground or the negative side with a pull - up towards positive.

Here are two setups I’ve tried, but no luck. (see attached images)

Is what I’m trying to achieve even possible with this switch? could you provide a simple example setup where your switch would:

  1. first push of a button power a controller on.
  2. subsequent button pushes of that same button did not power off the controller.
  3. the controller was able to detect when that button was pressed.

Hello, King.

Your drawing is nice, but it would be good for you to specify what the SparkFun part is and which pushbutton power switch of ours you are using.

When the button isn’t pressed, the voltage on that switch node will either be your battery voltage (when the circuit is in the off state) or some fraction of that (when the circuit is in the on state). You can just measure that voltage with a meter to know the voltage in your particular situation. So, you need some circuit that can tolerate up to your maximum input voltage and does not draw much power since that part of the circuit would always be exposed to power, even when the switch circuit is in the off state. I don’t have a great solution off the top of my head, and the feasibility of making the circuit also depends on your skills and your constraints on things like operating voltage and what is good enough for an “off” situation.

Since you seem to be boosting your battery voltage, your try2 drawing might actually work (try1 is just always going to give you 0V on the Arduino pin, so that’s not going to go anywhere). You should realize the resistor you have in there is not a pull-up or pull-down, but you want one there as you have it to limit the current going into the Arduino when it is turned off. If you put an actual pull-up after that resistor (either externally or in your Arduino), you should get voltage levels that are on both sides of your logic threshold. For instance, let’s say that switch node goes to half your battery voltage, or about 2V, in your situation. If you have that 10k resistor going to a 20k pull-up to 5V, your input would be at 3V when the button is not pressed and 1.67V when your button is pressed, which might be on the two sides of your logic threshold on a particular pin. You can see how this is not a great solution and you might have to mess around to get the right resistor values, but if you just need one instance to work, it might be good enough. You should definitely look at the voltages with a meter, with the button pressed and not pressed, and with the switch in the on and off state, to make sure you’re getting useful voltage swings. Remember, you could have a fine signal on the pin and just be missing it because of a mistake in your code.

- Jan

Jan, Thanks for your response!

I’ll try messing around with the try 2 setup. When I tried it last night, as soon as I plugged in the line from from the Arduino pin to the power side of the button, it triggered the Pololu switch. The Arduino was still able to shut the power off through the off pin, but the led light on the Pololu switch stayed on. Normally when The switch is in the off state but the Arduino and the LEDS on the switch are off, which made me think I did something wrong.