A 3.7V Li-Ion battery is a single-cell rechargeable power source commonly used to supply portable electronic projects. It provides a nominal 3.7V output and is connected with POS/+ as the positive supply and NEG/- as ground.
| Pin | Signal | Description |
|---|---|---|
NEG |
ground | Negative battery terminal — return path for the 3.7V Li-ion cell |
POS |
power | Positive battery terminal — supplies nominal 3.7V Li-ion output |
| From | To | Wire |
|---|---|---|
x1:NEG |
board:GND |
black |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println("3.7V Li-Ion Battery example");
Serial.println("This component is a power source, so it is not read by the Arduino like a sensor.");
Serial.println("In this canonical example, the battery negative terminal is connected to GND only.");
Serial.println("The battery positive terminal is intentionally left unconnected because Arduino Uno cannot be safely powered from a bare 3.7V cell on a documentation page example.");
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(250);
digitalWrite(LED_BUILTIN, LOW);
delay(750);
}
Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free