microcontroller crash problem

Thread Starter

ouafae

Joined Jun 11, 2019
52
First of all, I would like to thank all the members of this forum who share their knowledge without hesitation.

my problem is the crash of a microcontroller.
Indeed, I control relays from a microcontroller but my problem is that after some relay switching my microcontroller crashes and resets.

I use as decoupling circuit a 40 ohm inductance and two parallel capacitors of 47 uF and 100 nF.

the control voltage is 5V.

do you have any suggestions?
 

Thread Starter

ouafae

Joined Jun 11, 2019
52
no,
Indeed, I inserted this inductance to remove the current peaks due to relay switching.
You mean maybe there's a voltage drop because of the inductance. Right?
 

LesJones

Joined Jan 8, 2017
4,174
Are the contacts on the relay switching any load when the problem occurs ? On your schematic there seems to be two different sources of the + 5volts. One comes from regulator IC3 and the other from a filtered X5. What do you mean by"a 40 ohm inductance" ? Inductance is measured in henries but the inductor will also have resistance. If your inductor has a DC resistance of 40 ohms the voltage at it's output will drop when the relay coil is energised. This voltage drop will depend on the relay coil resistance. A picture of the construction of your device may help to show if the problem could be coupling between the relay signal and sensitive inputs on the microcontroller or poor ground path layout.

Edit. I have just looked at the data sheet for the relay. It shows that the relay coil has a resistance of 125 ohms. So if your inductor has a DC resistance of 40 ohms then when the relay is energised the voltage at the output of the inductor will drop to 3.8 volts. (125 x 5 volts/(40+125).)

Les.
 
Last edited:

LesJones

Joined Jan 8, 2017
4,174
It sounds like you need a snubber network across the relay contacts and possibly a varistor across the load. What is the nature of the load ? You should also keep the mains wiring as far as possible away from the low voltage wiring.

Les.
 

ericgibbs

Joined Jan 29, 2010
18,766
I don't see that the problem is the inductance.

Have you tried it.?
I guess you are aware the noise margin on the MCU signals is dependent upon the Vsupply.
So as the Vs sags the inputs are more susceptible to noise pick up.
E
 

Thread Starter

ouafae

Joined Jun 11, 2019
52
I measured the voltage at the inductance terminals, it is always 4.45V even at the time of the crash
I always separate the cables from the mains and low voltage cables.
 

ericgibbs

Joined Jan 29, 2010
18,766
I measured the voltage at the inductance terminals, it is always 4.45V even at the time of the crash

As it is possibly a noise problem, have you used and oscilloscope to check the 5V line when the relay is switching.?

Update:
Added the relay diode [ missed it on first sim] also increased the system standing current.
 

Attachments

Thread Starter

ouafae

Joined Jun 11, 2019
52
I measured the voltage at the inductance terminals, it is always 4.45V even at the time of the crash

As it is possibly a noise problem, have you used and oscilloscope to check the 5V line when the relay is switching.?

Update:
Added the relay diode [ missed it on first sim] also increased the system standing current.
yes, from time to time and not always I see a loud noise on the 5V line when switching.
 
Top