Skip to the content
PCBKitNew board
2 layersSensr circuit, the printed circuit board in 3D

Sensr circuit

ma-ha/pv-mon5

IoT: Monitor Photovoltaic (PV) System with LiFePO4 Batteries

Copper layers
2
Thickness
1.6 mm
Parts
23
Nets
40
Pads
92
Tracks, vias
111, 23
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
20 Mar 2022
Updated
28 Feb 2026

Overview

Sensr circuit is an open-source printed circuit board by ma-ha, from the ma-ha/pv-mon repository on GitHub, published under the MIT licence. It is a 2-layer board with 23 parts on 40 nets, routed with 111 tracks and 23 vias.

It is built around the WEMOS D1 MINI and CD74HC4067M. Its parts include 17 resistors, 3 ICs, 2 connectors and 1 capacitor. It belongs with the ESP8266 boards of this library.

Main components

2

README

README.md

Monitor Photovoltaic (PV) System with LiFePO4 Batteries

Measure:

  1. LiFePo4 cell and block voltage
  2. Current and voltage from solar panel strings
  3. 230 V output current
  4. 230 V fallback current

Setup

Send data via WiFi to local "IoT Server" and make data accessible in InfluxDB.

STATUS: WIP, partially tested

LiFePO4 (aka LFP) batteries are known as safe and the voltages may not be dangerous for humans.

BUT ... WARNING: LFP batteries contain a lot of Energy! Shorts can cause enormous sparks, melt metal and cause fire.

Check your circuits twice for shorts (soldering problems)! Be careful touching the circuit with metal tools (e.g. multimeter tips). Put the circuit in a safe enclosure!

Sensor Device

The device measures up to 16 voltages and sends them to the IoT Server.

Hardware is cheap and simple, based on:

  • an ESP8266 "D1 Mini" controller with WIFI
  • a CD74HC4067 as 16 channel (or 74HC4051 as 8 channel) multiplexer board
  • Pololu D36V6F3 Step-Down Voltage Regulator for 3.3 V supply

The sensor is designed to connect via a "8s JST XH " y-splitter cable between the battery and the BMS. Alternatively connect Pin1 to "minus", Pin2 to the plus of 1st cell, Pin3 to the plus of 2nd cell and so on.

Sensor PCB

Sensor Firmware

To upload the firmware to the "D1 Mini" via the Arduino IDE, you must add http://arduino.esp8266.com/stable/package_esp8266com_index.json as "Additiona Boards Manager URLs" in the "File" > "Settings" menu. Then install the newest version in "Tools" > "Board" > "Board Manager" the "esp8266". For me the "NodeMCU v0.9" board works fine.

Then just

  • connect the D1 Mini via USB
  • double click the bat-mon-firmware.ino to oben it in the Arduino IDE and
  • click the "Upload" button to compile the code and program the module

The sensor will read out the voltages once per minute and send them to the "IoT API Server".

WARNING: If you use the Arduino IDE for NodeMCU, you will overwrite the LUA SDK. If you want back the Lua SDK, use the “flasher” to re-install the firmware. You can download the flasher from their Github page https://github.com/nodemcu/nodemcu-flasher.

Server Set Up

The "server" (a PC is ok) need to run an "IoT API Server", where the sensors post readings data and an InfluxDB to store and analyze the data.

To make things as easy, I recommend to run the server and the DB as Docker containers.

InfluxDB

The Influx DB stores the sensor data as timelines. You can query data and show data as graphs on dashboards using your browser.

Prepare a folders for DB, e.g.

text
mkdir ~/influxdb2
cd ~/influxdb2
mkdir db
mkdir config
export DB_DIR=$PWD

Start InfluxDB docker server:

text
docker run -p 8086:8086 -d --restart=always --name influxdb \
  -v $DB_DIR/db:/var/lib/influxdb2 \
  -v $DB_DIR/config:/etc/influxdb2 \
  -e DOCKER_INFLUXDB_INIT_USERNAME=mysuerpadmin \
  -e DOCKER_INFLUXDB_INIT_PASSWORD=mysuerpadminpassord \
  -e DOCKER_INFLUXDB_INIT_ORG=my-org \
  -e DOCKER_INFLUXDB_INIT_BUCKET=pv \
  influxdb:2.1-alpine

Open http://localhost:8086 in your browser and finalize the set up.

Finally create or copy an API token for the API server, via "Data" manu and "API Tokens" tab.

IoT API Server

The "API Server" is a tiny JS app and listens on 8899.

Devices can post JSON data to the endpoint http:/server-ip:8899/<bucket>/<data-type>?key=<api-key>

JSON data is e.g.:

text
{ src: 'Bat1_7', fld: 'U', val: 0.06 }

Start on Console

Put the InfluxDB API key into the two YAML files in the iot-api-server/config/ dir.

If you modify the API_KEY, don't forget to chage that also in the bat-mon-firmware.ino.

To start the server on the console for testing, execute:

text
cd iot-api-server
npm install
export NODE_ENV=DEV
node app.js

To send some test data execute: mocha test/testPostApiSvr.js

Run as Docker Server

Build and install the IoT API Server:

text
cd iot-api-server
docker build -t mh/iot-api-server . 
docker rm iot-api-server
docker run -d -e NODE_ENV=MAIN --link influxdb:influxdb  -p 8899:8899  --name iot-api-server  mh/iot-api-server

To send some test data execute (require npm install -g mocha once):

text
export NODE_ENV=DEV
mocha test/testPostApiSvr.js

Parts

23
QtyValueFootprintReferences
81Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR2, R4, R6, R8, R10, R12, R14, R16
89Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R3, R5, R7, R9, R11, R13, R15
133uFCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC1
13k9Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_VerticalR17
1CD74HC4067MAudioChannel:74HC4067DBU2
1Conn_01x03_MaleConnector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ2
1Conn_01x09_MaleConnector_PinHeader_2.54mm:PinHeader_1x09_P2.54mm_VerticalJ1
1Pololu-D24V3F3AudioChannel:Pololu-D24V3F3U3
1WeMos_D1_miniModule:WEMOS_D1_mini_lightU1

Questions

What parts does the Sensr circuit use?

23 parts, built around the WEMOS D1 MINI and CD74HC4067M. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Sensr circuit KiCad files?

From the ma-ha/pv-mon repository on GitHub, at the commit this page was made from: the board is sensor16ADC/sensr-circuit/sensr-circuit.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Sensr circuit design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers312 × 140 mmTsynth2 Rev1.3, the printed circuit board in 3D

    Tsynth2 Rev1.3

    Electrotechnique/TSynth-Teensy4.1

    TSynth for Teensy 4.1

    108 parts182
  • 2 layers422.4 × 118.2 mmMidiMood (tht), the printed circuit board in 3D

    MidiMood (tht)

    silveirago/MidiMood

    This repository contains the code for a custom MIDI controller project called MidiMood, built using an ATmega32U4 microcontroller (or similar).

    53 parts82
  • 2 layers248.9 × 120.7 mm16nx, the printed circuit board in 3D

    16nx

    16n-faderbank/16nx

    16nx is a controller for musical instruments. Sixteen faders,MIDI over USB and jack, CV out, and I2C out. Based around RP2040.

    171 parts76
  • 4 layers100 × 100 mmOPDM, the printed circuit board in 3D

    OPDM

    brenonsantos/OpenPDM

    OpenPDM is an open-source programable Power Distribution Module for your car

    156 parts75MIT
  • 2 layers215.9 × 101.6 mmIps20, the printed circuit board in 3D

    Ips20

    gzweigle/open-hybrid-piano

    Building a hybrid MIDI digital piano

    135 parts61GPL-3.0
  • 2 layers152.4 × 95.3 mmControl board, the printed circuit board in 3D

    Control board

    carsonrobles/fpga-guitar-pedal

    FPGA based guitar effect station.

    51 parts36
  • 2 layers100 × 100 mmEavesdrum module, the printed circuit board in 3D

    Eavesdrum module

    tobigun/EavesDrum

    EavesDrum is an e-drum trigger module project, designed for musicians and makers. It allows you to connect drum pads or piezo triggers and converts their signals into MIDI events.

    103 parts25GPL-3.0
  • 4 layers33 × 65.5 mmOM FlexGrid Rigid PCB, the printed circuit board in 3D

    OM FlexGrid Rigid PCB

    Open-Muscle/OpenMuscle-FlexGrid

    60-sensor wearable with flexible PCB and pressure matrix

    65 parts19CERN-OHL-S-2.0