Skip to content

Instantly share code, notes, and snippets.

View smithjacobj's full-sized avatar

Jacob Masen-Smith smithjacobj

View GitHub Profile
@smithjacobj
smithjacobj / simple-18v-1s-bms.ino
Created September 6, 2021 07:43
Source for a basic Arduino Uno 1S BMS I created for a DeWalt 20v MAX project.
//
// edit these
//
// how long should we wait for inrush to stabilize?
const int kInrushWait = 2 * 1000; // 2 seconds
// what voltage should this shut off at?
const float kMinSafeVolts = 14.f;
// test the divider at 25v and set the output value here.
const float kActualOutputAt25v = 4.98f;
// how long should we sleep for before allowing output again? really, we just