First time fireup DiyBMS

Today I found the time to solder the final components to the monitor boards and ESP32 controller board.

After fireing up the board I was surprised by the easynes of use of the interface and the way it looks. My compliments it looks and works great.

During my first test and soldering the boards I found a few issues that might need some attention.

  • the airgaps for K1 and K2 are a bit small for example the gaps on the side of the common track should go all the way up to the end of the track. The way it is now does not cover the space in between the coil pins and the common track. Also on some other points the tracks for the coils are dangerously close to the switching tracks of K1 and K2. This is a safety issue.
  • the emergency off J1 connection triggers emergency by connecting the pins. A regular emergency switch is disconnecting to pins instead of connection. Also a emergency device that is connected to J1 will not trigger emergency if it gets disconnected. I think it is safer to reconfigure J1 that it triggers emergency the moment the two pins are disconnected from each other.
  • I’m missing security on entering the BMS web interface that can lead to unwanted change of settings by people with wrong intentions.
  • finally nntp time setting does not respond to timezone hour change and daylight saving changes.

But despite my comments above I think this is a great project I could load firmware to all my 50 monitor modules from the controller board super fast, connecting 20 of them with all only 1 18650 cell on it worked without a problem and it nicely could balance the cells that all had a random SOC.

The upcoming days I will dive in what is being published via MQTT to see if I can get that stored in a DB and create a dashboard with it.

I hate to only say when something is not working so I searched the code to figure out why time zone and daylight savings wasn’t working.

@stuart : If you change line 1459 in main.cpp of the ESP32 controller the issue is solved.
Original line 1459

configTime( mysettings.minutesTimeZone * 60, mysettings.daylight * 60, mysettings.ntpServer);

Timezone and daylight savings fix, new line 1459

configTime( mysettings.timeZone * 3600 + mysettings.minutesTimeZone * 60, mysettings.daylight * 3600, mysettings.ntpServer);

@stuart A proposal to change the way “Emergency Stop (J1)” works. As I wrote above I think it is more safe to invert “Emergency Stop (J1)” that means to run in safe mode both pins need to be actively connected. This way you can connect multiple safety devices in series, when one of the devices detects a failure or runs out of power (gets broken) it will activate emergency.

An other option is to trigger emergency by states change of J1 see code below. This could come in place of the code part starting on line 658.

// Albert 03-04-2021 - Convert Emergency Stop (J1) to trigger on status change
static bool PrevInputStateEmergencyStop = InputState[6]; //On startup we assume system is not in Emergency and set J1 state in static bool
if (PrevInputStateEmergencyStop != InputState[6] )       //If state of J1 changes from initial state trigger emergency.
  emergencyStop = true;

Disadvantage of this code is the assumption there will never be a emergency at power up. Might be dangerous as a system in emergency is rebooted.

Thanks for the feedback Albert. Really useful.

I don’t disagree with the suggest to change the ESTOP feature, originally I designed it for switches like these []
which have both NO/NC contacts.

The current circuit has a pull up when normally open, and pulled to ground when closed.

The difficulty with swapping its function now, is that some people may have already implemented it as it is (brought switches etc.) so if I suddenly swap the meaning/purpose of the ESTOP, its going to break existing users installations.

It would most likely need to be one of the configuration options on the web page, which makes it a much larger change.

Thanks for the NTP stuff. I’ll put that in the code today.

Do you have any recommendations on this?

I’ve been using 2.5mm traces, which limits the size of the cut outs. I could reduce the trace with (as I’m using both sides of the board) but that could run into current handling problems if people genuinely try and run 10Amp through the relay.

I’ve moved the 5V rail further away from the K1 relay, as that was quite close.

I think this is probably a result of having the have the relays turned 90 degrees, due to the size constraints on the board.

@stuart Swapping the relays 90 degrees no option, then the case will not fit anymore. To be honest I think KiCad will not accept moving the traces more away from the coil pin so a cut out will fit in between that might give issues on the other side. A option can be a tinned trace for common that way it can be less wide

The EM switch change to make it configurable is the best option but also the most work. My try to make it respond to state change is also far from safe.