Introduction: One Button to Rule Them All (Single Button for Power and Input)

As mentioned in my DIY e-kayak series, I have been working on a breakout board for a cool little button circuit I found! For the kayak controller, I needed a way to switch on power and also provide inputs to the system. I wanted to save space and keep a minimal design so having two buttons was off the table. That lead me to an interesting chip, the PMIC (power management IC) on / off controller.

This little chip was exactly what I was looking for. With this IC, the first press of the button wakes up the chip from it's deep current saving sleep and sets an enable pin high. This enable pin can be used to turn on / off a voltage regulator. Any button presses after this act as regular inputs and a long button press will disable the enable pin and put the chip back to sleep.

When I say "little chip", I'm not exaggerating. This thing is literally smaller than a grain of rice. That made soldering / prototyping very difficult. That's why I decided to create a PCB breakout board so that I can re-use this circuit in projects moving forward and take advantage of the small form factor.


Big thanks to PCBWay for sponsoring this project! They created the PCBs and stencils and shipped to the U.S. all within about one week! Check them out if you need any PCBs, 3D prints or machining done! Get $5 off your first order with my link!


Check out my YouTube video deep diving all the technical details and check out my personal blog! Make sure to sign up for my newsletter so you never miss a project!

Supplies

  1. Solder Hot Plate
  2. Solder Paste


This project is open source! The whole repository can be found here.

Consider supporting me by buying me a coffee!

Step 1: Breakout Breakdown

I wanted this breakout board to handle all my power needs for any new project I create moving forward. That meant it needed to have the on/off controller but also needed a way to re-charge the battery. I designed the breakout so it could charge a single cell LiPo battery and provide a battery level indication.

I based charge and voltage regulator designs off the Adafruit feather power scheme.

Step 2: STM6601 on / Off Controller

The brain of this board is the STM6601 on/off controller IC. It monitors the push button and enables / disabled power, all while drawing .6 micro amps of current in sleep mode and 6 micro amps during regular operation.

The chip works by idling in a deep sleep state looking for push button activity to wake up. It can run in sleep mode for decades off of a single cell LiPo. 

Power Enable 

The first push of the button brings the IC out of sleep mode and sets an enable pin high. This enable pin is tied to a 3.3V regulator. When enable goes high, the regulator turns on, providing 3.3V out. A long push of 3.5 seconds sets the enable pin back low, which turns the 3.3V regulator off, and places the chip back into deep sleep.

Interrupt / Push Button Out 

The breakout board has two output signals that are used to read additional button presses. Once the IC is awake, any further button presses result in the INT (interrupt) pin pulsing low. An under voltage condition can also cause the INT pin to pulse low. The PB_OUT (push button out) pin can be checked to verify if an interrupt was triggered by a button press or under voltage condition. 

The following pins are open drain outputs: PB_OUT, INT and RST. This means they are pulled up to 3.3V by default and are active low. 

Push Button Input 

The SmartClick breakout board has a small onboard push button. Jumper pins 9 and 10 also provide a place to wire in your own external push button. 

Step 3: Battery Charger Circuit

I wanted to drop this breakout board into any project as a complete power system solution. That meant I needed a built in battery charger. 

The SmartClick has a MCP73831, single cell LiPo charger IC. It is configured to charge at 100mA and has LED indication during charge. The BAT_SENSE (Battery sense) pin can be read by a microcontroller to measure the battery voltage.

The battery sense pin is connected to a resistive voltage divider which scales the battery voltage in half. This provides a safe voltage level to be read by any microcontroller. The battery input and micro-USB charge port are diode OR'd together so the circuit will still get power during battery charging. Because of this diode, the battery sense pin sees a .7V drop. So the equation to convert battery sense pin output to true battery voltage is: (BAT_SENSE_V * 2) + .7.

Step 4: 3.3V Regulator

As mentioned, the SmartClick breakout has a built in 3.3V regulator which is enabled / disabled by the STM6601. The regulator is a SPX3819 and provides a max output current of 500mA. 

Step 5: Soldering / Testing the PCB

Soldering:

This PCB is 16.5 by 24 mm large. This was the smallest PCB that I have fully hand soldered and my first time trying out stencils. It was the perfect opportunity to buy a new tool, a solder hot plate! I meticulously placed every part onto my board after applying a thin film of solder paste. I plugged in my new tool and... the 25V power adapter fried. Amazon was sending a replacement but I'm impatient so I took out the clothes iron instead. Now the iron worked great but I have one major piece of advice. Think through how you are going to remove the board before you start... My hand slipped and all my tiny 0603 parts went everywhere (watch the YouTube video to see my sadness).

I got the replacement hot plate, re-placed all my components and this time did not screw it up! I intentionally put the larger components on the top side of my board so I could use a stencil on the back, then hand solder the top.

Testing:

Shorts:

I started out testing my new board for shorts. Not seeing any power shorts, I decided to plug in a battery. Probing the 3.3V output line, it went high as soon as I plugged in my battery. This should have idled in an off state until a push of the button. Further inspecting my schematic, I made a really dumb mistake. I wired the on-board push button as a short, routing right around the switch contacts. So I had to remove the push button from the board and only use the external push button header pins for now. After plugging in an external button, it worked like a charm. The 3.3V output would stay off until I pressed the button once. Additional button presses would fire pulses out of the INT pin and a long button press would shut off the 3.3V output.

Battery Charger:

The next circuit to test was the battery charger. I plugged in the charge micro-USB cable and immediately saw the charge LED dimly lit. This LED should only light up once the battery is connected and is charging. I based my charge design exactly from the Adafruit Feather charging scheme so was very confused. I went down rabbit holes, swapping and removing capacitors, removing ORing diodes and banging my head into a wall. Nothing was working. Then I picked up a Feather board and was able to replicate the exact same issue! It turns out, you have to have a battery plugged into the board first, before you plug in the charge micro-USB cable. My charge circuit worked great after doing things in this order.