Charger Design Specifications

0:44

Below is a ready-to-flash Arduino-style sketch for your nRF52840 (e.g. Adafruit Feather nRF52840 Express or any board that exposes the raw nRF52840 pins).
• STAT from MCP73831T-2ACI/OT is open-drain, active LOW while charging.
• Green LED (front-panel indicator) is wired so that driving the MCU pin HIGH turns the LED ON.
Adjust the GPIO numbers (#define) to match your PCB routing.

Cpp


/*
 * Wireless-controller charging LED
 * Works with MCP73831 STAT pin (active-LOW while charging)
 * Target MCU: nRF52840, Arduino-core
 */

#include 

/* ---------- Pin definitions (edit to match your board) ---------- */
#define PIN_STAT  11   // nRF52840 P0.11  TASKS_HFCLKSTOP = 1;   // stop external 64 MHz crystal
}

void loop()
{
  bool charging = (digitalRead(PIN_STAT) == LOW);  // LOW = charging
  digitalWrite(PIN_LED, charging ? HIGH : LOW);

  // Sleep 250 ms; Arduino-nRF52 core will enter low-power idle
  delay(250);
}
How to flash (example with Adafruit nRF52840 Feather):

Bash


arduino-cli board attach arduino:mbed_nano:nano33ble
arduino-cli compile --fqbn arduino:mbed_nano:nano33ble
arduino-cli upload  -p /dev/ttyACM0 --fqbn arduino:mbed_nano:nano33ble
If you later enable BLE or other tasks, move the LED update into a non-blocking timer or an RTOS task—logic remains identical.
That’s all you need: STAT LOW → LED ON (charging), STAT HIGH → LED OFF (full / absent).
Find MCP73831
Add green LED
Label STAT net
Pull-up resistor
329 days

To get started, talk to Flux or create a New Document.

Documents

    Documents are markdown text files which describe project goals, capture details, or even simulation outputs.

    Assets

    No assets added.

    charger pcb

    charger pcb thumbnail
    Welcome to your new project. Imagine what you can build here.

    Properties

    Properties describe core aspects of the project.

    Pricing & Availability

    Distributor

    Qty 1

    Arrow

    $0.10–$0.31

    Digi-Key

    $11.54–$12.26

    LCSC

    $4.49

    Mouser

    $12.27

    TME

    $1.65

    Verical

    $0.12–$0.68

    Controls