A HEStore order arrived on Thursday, and on Friday I used part of it to build a prototype MeshCore repeater. The brains are a Seeed Studio XIAO nRF52840 + Wio-SX1262 pair that had arrived earlier; everything else is about power: four 18650 cells, a cell protection BMS, and a CN3791 solar charger for an 18 V, 10 W panel.

The charger’s operating point

The CN3791 holds the panel voltage above a set value and draws only as much current as the panel can deliver at that voltage. The value comes from the divider on the MPPT pin:

VMPPT = 1.205 V · (1 + R1 / R2)

The CN3791 module as shipped, close-up of the SOLAR IN connector and the divider resistors

The CN3791-M12V I bought is meant for a 12 V panel: R1 = 178 kΩ, R2 = 22 kΩ, which puts the operating point at 10.95 V. An 18 V panel’s maximum power point is well above that, so R2 had to come down to about 13 kΩ.

Handwritten calculation: R1 = 178 kΩ, R2 = 22 kΩ to 13 kΩ, a 15 kΩ + 18 kΩ series pair in parallel with the 22 kΩ

I didn’t want to desolder the SMD resistor, so I soldered a 15 kΩ + 18 kΩ series pair in parallel with it instead. 22 kΩ ∥ 33 kΩ = 13.2 kΩ, which moves the operating point to 17.45 V. That’s right where it should be.

The modified CN3791 module with two through-hole resistors soldered in parallel with the 22 kΩ

From 4S to 1S4P

The four-cell 18650 holder comes wired in series (4S), but the nRF52 needs the voltage of a single Li-ion cell. So I rewired it as 1S4P: all four cells in parallel, the voltage of one cell with four times the capacity.

The spring side of the holder with the springs bridged

The other side of the holder with the screw terminals bridged and the output lead

An HX-1S-3540 BMS went on the side of the holder to protect the cells against overcharge, overdischarge and short circuits.

The HX-1S-3540 BMS on the side of the holder, under heat shrink

Putting it together

On the nRF52 the battery leads had to be soldered directly to the BAT pads. The first assembly, with a single cell:

First assembly: the XIAO nRF52840, the CN3791 charger, and the holder with one cell

I also connected a BME280. The ZephCore firmware’s device tree already has it, so it reads temperature, humidity and pressure without any changes.

The BME280 sensor wired to the XIAO, with the holder now holding more cells behind it

The first telemetry on the phone: battery at 4.10 V, and the BME280 reporting 31.1 °C, 24% humidity and 1012 hPa. The 31 degrees aren’t the living room’s doing; the board had just been soldered.

MeshCore app screenshot: battery 4.10 V, temperature 31.1 °C, humidity 24%, pressure 1012 hPa

What’s next

It turns out the device tree also has an INA219. I didn’t know that when I placed the order, but it’ll be in the next one, and then I’ll see the battery’s charge and discharge current too. After that it’s just drawing graphs from the data, putting it all in a box, and mounting it somewhere sensible instead of the living room window.