Design challenge n.11: Watchdog

A project log for Green BMS

Open source Bluetooth Smart Battery Management System

Sergio GhirardelliSergio Ghirardelli 10/21/2021 at 09:560 Comments

Microcontrollers can crash.

This can happen for sketch mistakes, but also for failures in the microcontroller itself... so it can happen.

When this happens, the outputs remain frozen at the last value and this led me to an important question:

What would happen if the Arduino Mega crashes while charging the battery, with the charge consent output active?

The risk is to lose the protection of the BMS due to overvoltage of the cells, with bad consequences on the battery pack.

For this reason I have inserted 2 levels of watchdog control:

1) Software: in case of crash, the microcontroller is restarted, but this protection for me wasn’t enough, so I added the watchdog ...

2) Hardware: I made a circuit independent from the microcontroller, using the NE555 integrated circuit.

Here is the scheme:

It works like this:

Arduino Mega provides a digital output called "Heartbeat". It is a square wave with a period of 500 ms.

When this signal is present (software OK), the watchdog circuit closes the relay "K0" which has the function of supplying all the relays including those for enabling the charge and discharge.

When the Heartbit signal is blocked , at a high logic level or at a low logic level (software crash), after the delay time of 5 seconds (t = 1,1* R11*C5) the relay K0 is disconnected opening relays supply.

This solution satisfied me, because with few components, I made the system safer in case of Arduino crash.