Hardware Hookup
In this section, we will go over how to connect to the Soft Power Switch - JST 2mm.
Connecting via PTH
For temporary connections to the PTHs, you could use IC hooks to test out the pins. However, you'll need to solder headers or wires of your choice to the board for a secure connection. You can choose between a combination of header pins and jumper wires, or stripping wire and soldering the wire directly to the board.
Input Power
The board was designed to be used with single cell LiPo batteries with the built-in 2-pin JST connector. Simply insert the LiPo Battery into the JST connector labeled as IN.
Of course, power can also be soldered directly to the PTH as well.
Power Supply | Soft Power Switch - JST 2mm |
---|---|
1.8V to 5.5V Typically 3.7V if using a LiPo Battery (Red Wire) |
VIN |
GND (Black Wire) | GND |
Remember, the Soft Power Switch - JST 2mm also supports battery charging. If the target device has onboard LiPo charging, current can be passed back through the switch circuit and charge the battery. For more information about LiPo battery charging and care, make sure to check the tutorial on Single Cell LiPo Battery Care.
Output Power
For boards that have a built-in 2-pin JST connector for LiPo batteries, you can splice two JST cables together. Then you can insert it between the Soft Power Switch's JST connector labeled OUT and the other end will be inserted into the JST connector of the target board being powered (in this case, the SparkFun IoT RedBoard - ESP32 Development Board).
Of course, power can also be soldered directly to the PTH as well. Since we are powering the output with a single cell LiPo battery, you will need to connect it to your system's battery input. In this case, VBATT net was labeled as + on the board. Depending on your system, it may be labeled as VBAT, RAW, or VCC. Make sure to check the board's hardware design before deciding to connect VOUT to your system.
Soft Power Switch - JST 2mm | SparkFun IoT RedBoard - ESP32 Development Board |
---|---|
VOUT | + |
GND | - |
Note
The voltage range of the Soft Power Switch - JST 2mm is between 1.8V to 5.5V. Users can also connect a different power source and connect the output to VIN or 5V of their system. Just make that the voltage is within the operating range of the target device.
External Button
For users that need to connect an external button, you will simply need to connect one terminal of the button to BTN and the other terminal to GND. In this case, IC hooks and F/M jumper wires were used to connect an external momentary push button.
Soft Power Switch - JST 2mm | Button |
---|---|
BTN | Normally Open Pin |
GND | Common Pin |
Off and Push
To connect to the OFF and PUSH pins with a microcontroller, you will need two GPIO pins with code to control or read the Soft Power Switch Mk2. Depending on your microcontroller, you may need to adjust the pin connections and definitions with respect to the microcontroller's GPIO pins.
Soft Power Switch - JST 2mm | SparkFun IoT RedBoard - ESP32 Development Board |
---|---|
OFF | 32 (or A4 )
|
PUSH | 14
|
Tip
Remember, the PUSH pin requires a pull-up resistor when connecting it to a microcontroller's GPIO pin. You can use the internal pull-up resistor on the microcontroller so that the pin is not floating.
Arduino Serial Output
To view the Arduino's serial output when powering the system with a LiPo battery, you will need to wire a 3.3V Serial Basic Breakout to the Arduino's serial UART. In this case, we connected to the SparkFun IoT RedBoard - ESP32 Development Board primary UART port. Depending on your microcontroller, you may need to adjust the pin connections and definitions with respect to the microcontroller's UART pins.
3.3V Serial Basic | SparkFun IoT RedBoard - ESP32 Development Board |
---|---|
TXO | 3/RX-0 |
RXI | 1/TX-0 |
GND | GND |