Mosfets flicker on and off while off

Thread Starter


Joined Oct 13, 2021
My first post here. Hope it found its way to the correct forum.

I designed a circuit in EasyEDA and ordered PCB + parts. Now when I have built the circuit it is working except that all mosfets are randomly turning on and off without any reason. What could cause this? The behavior is a flickering, like som radio disturbance. It can be one or many LEDs flickering. Its totally random.

The PCB is meant to be a driver board for loads. I have a ESP32 that controls 6 mosfets and I can connect different loads to it, like a heater and fan. The board is also able to measure temperatures and the power it uses.

Designed working principle:
- I connect my electric car battery to the board (94 VDC)
- A regulator turns 94V to 12V
- Another regulator converts 12V to 3,3V
- 3,3V goes to ESP32, 12V to "12V AUX FETs" + FET driving optoisolators. 94V goes to the heater FET and two auxilary FETs for random usage
- ESP32 reads temperatures and runs the heater as needed. It can also drive the other fets if needed
- ESP32 reads board voltage and current from a INA220 via I2C. INA220 gets current reading from 0,02 ohm low side shunt and voltage from a voltage divider on the 94V line

FET driving principle:
- ESP32 is giving signal to an optoisolator. Optoisolator output is connected to 12V, which goes to mosfet when optoisolator is active. There is a 10k pull-down resistor to turn off the fet when optoisolator is not active. See attachment "FET control circuit".

- For each FET there is a LED that turns on when the FET gets 12V to its gate. These leds are flickering randomly when FET is turned off. When a led is flickering, the mosfet is a little bit active (giving 50-80% output voltage compared to input, measured with multimeter)
- FET LEDs can flicker also when the FET is on. I find this very strange. I have tried with 12VDC and 6VDC input voltages and same happens
- The LED that is turned on when a temperature reading is taken is also flickering. It is connected straight to ESP32 output pin via resistor. This can happen even when the pin is off by MCU (digitalWrite(pin, LOW))
- The problems are present regardles if ESP32 is connected to the board or not. I can activate the fets with dip switches

I would really appreciate if someone could help me with this problem. I am only a hobbyist and my knowledge does not help me with this. The only thing my mind has come up with is some ground currents, but is it so?