VNH5019 powering causes ATMEGA reset

I would like to create a motor control garage door based on an ATMAGA 328PU as microcontroller mounted on a breadboard (Arduino libraries) and an single VNH5019 powered with an external 24V power supply.
I use a power relay controlled by an output of the Arduino through a transistor and resistors ( and a freewheeling diode ) which, for security reasons, switch on and off the VNH5019 power supply ( VIN = 24V ).
The problem occurs when switching on the relay that powers the VNH5019, it causes an initialization of the ATMEGA and sometimes an unstable behavior on the serial link.
I isolated the problem at the 5V supply (VDD) which also supplies the microcontroller and I suspect disturbances coming from this line to the microcontroller that cause initialization. It’s hard to visualize with my old analog oscilloscope but I tried to filter VDD with different capacitors, even with a serial diode that would block any current returns , but to no way.

If I disconnect the power supply of the VNH5019 VIN input, causing no load on the relay contacts, or if I disconnect VDD, there is no problem. Even if the motor is connected or not.
I found a relatively stable solution by using an output pin of the ATMEGA to power VDD after a delay of 200ms , once the disturbances are passed. But sometimes there is some initializations of the ATMEGA and I think this solution is not viable in time.

Thank you for your help



I do not understand what you mean by “initialization of the ATMEGA”. Is the AVR resetting? If so, you might try adding a large capacitor near the microcontroller to prevent it from resetting when voltage drops occur (if you have not already).

Could you post pictures and a wiring diagram of your setup? Could you post a simplified version of your code that demonstrates the problem? Could you also clarify what you mean by “unstable behavior on the serial link”?

- Jeremy

Hello Jeremy,
thanks for your reply.
What I mean about the AVR initialisation is, each time the relay switch, the ARDUINO code returns to the setup function. So I suppose that the AVR resets.
About my setup, the ATMEGA 328PU is on a standalone breadboard and I’m using an ARDUINO board (microcontroler removed) for uploading code and debugging by the serial line using this tutorial ( … wMd8bQalu4).
“unstable behavior on the serial link”, means that when the relay switch, the AVR code stops somewhere and I receive some weird characters in the Arduino serial console. I think it’s a another consequence of the AVR reset.
At first, when the relay switch, I though it was due to voltage drops and I added a 220µF capacitor on the +5V supply and a smaller one (10 nf), near the VNH5019. The power relay is powered by the 24V source so it should not “pump” on the +5V power supply. I also tried to supply the +5V with the ARDUINO board (USB) and it’s the same behaviour.
Tomorrow, I will send you the schematics and a simplified code to illustrate the problem, so you can reproduce it.

Were you still planning on posting a schematic and your code? They might be helpful in figuring out what is causing the issue.

- Jeremy