Skip to content
R

Battery

Using 18650 Holder Battery with Raspberry Pi

What is the 18650 Holder?

18650 Holder practical reference

A basic single-cell 18650 battery holder, the standard building block for portable and battery-powered maker projects. It's simply a molded plastic clip with spring-loaded metal contacts sized for the common 18650 cylindrical Li-ion cell, giving a solderable or wire-lead connection point without needing to solder directly onto the battery itself — which is important, since soldering onto an 18650's bare terminals can damage the cell and is generally discouraged.

Key specifications

  • Cell compatibility: Single 18650 Li-ion cell (18mm diameter x 65mm length)
  • Contact type: Spring-loaded positive and negative metal contacts, no direct soldering to the cell required
  • Output: Raw, unregulated battery voltage — typically 3.0V-4.2V depending on charge state
  • Connection: Bare wire leads (usually red/black) or PCB-mount pins, depending on holder style
  • Mounting: Surface-mount screw holes or PCB-through-hole pins, model-dependent
  • Protection: None built in — holder is purely mechanical; use a protected 18650 cell or add a separate protection/charge circuit (e.g. TP4056) for safe charging and discharge cutoff

Pinout and connection notes

The holder itself provides no charge control or over-discharge protection — pair it with a charge/protection module like the TP4056 (with built-in DW01 protection) if the project charges the cell in place, and always observe correct polarity since 18650 cells can vent or be damaged if reverse-connected.

  • + (Positive lead): Connects to the cell's positive terminal via the spring contact
  • - (Negative lead): Connects to the cell's negative terminal via the spring contact

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.

Troubleshooting and reproducibility

Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.

Setting Up 18650 Holder with Raspberry Pi

Library

Adafruit-MCP3008 by Adafruit

pip3 install adafruit-circuitpython-mcp3xxx

Wiring

Component pinRaspberry Pi pinNote
+ (Positive lead)R1 (100k) to MCP3008 CH0, R1 also to +Pi has no built-in ADC — this goes through an MCP3008 over SPI, not directly into a GPIO pin
+ (Positive lead)R2 (150k) from MCP3008 CH0 to GNDSame divider ratio as the ESP32, since the MCP3008 also references 3.3V
- (Negative lead)GND (shared with MCP3008 and Pi)Common ground

Swipe sideways to see every column →

Python

Raspberry Pi GPIO pins are digital-only — there is no analog input on the header, so measuring an analog quantity like battery voltage always needs an external ADC such as the MCP3008 shown here. Enable SPI first with sudo raspi-config (Interface Options -> SPI).

Related Components

Related Guides & Projects