Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Drive a relay using MCU

Status
Not open for further replies.

jeyes56

Member
Hi guys, i have here a relay and MCU, i want to drive the relay using MCU,

i already made the circuit and when i try to switch the relay, it is working properly without load of relay,

but, when the relay is loaded, my MCU is restarting, what should i do here?

please help me....

here is my schematic,

**broken link removed**
 
Last edited:
Don't go to the link. (don't click on the icon) adf.ly/5ks3l en less you want to watch a video.
 
zzzz,, it's not a video,, im not spammer, its a shortened link, click the skip add on the upper right corner to see the image...
 
I'm not sitting through an advert in order to help you. Why don't you post the image here?

Mike.
 
Last edited:
You need capacitors on your power supply and diodes across your relay and electromagnet.

Edit, google "7805 schematic" and "Flyback diode".

Mike.
 
Last edited:
Yes, your load is putting big spikes on your power supply and you don't have any capacitors to stop them getting to the mcu. You also need flyback diodes on both coils or you will shorten the life of various components.

Edit, electrolytics alone will not do, you need the small ceramics as well.

Mike.
 
Last edited:
hi, i already include a diode on my circuit, and a 0.1uF capacitor in the LM7805, but still, the problem is there,, what happened?
 
i place the diode on the relay, i also place a 0.1uF on the output of the lm7805, where should i place the ceramic? and what value should i place?
Yes, your load is putting big spikes on your power supply and you don't have any capacitors to stop them getting to the mcu.

do you mean that the load from the 24V (the electromagnet) affects the 9V source when the relay is activated?
 
Last edited:
Post your complete circuit and we may be able to help.

Edit, have you checked the supply voltage with the load activated?

Mike.
 
Last edited:
oh i forgot to mention, when i added a load, and the load is powered, the system is become ok, the main problem is when the switching is done,
for example,
i activated the relay, the system restart, and become ok again,,
i also forgot to mention that the relay config is normally closed, the load is active even the relay is not activated, and if i activate the relay, the load will deactivated,
 
Have you included the flyback diode at the Relay coil and the Magnet?

The ceramic capacitators of 100...220nF have to be included at the 7805 at the input to GND and the Output to GND as near as possible at the Pins of the Voltage Regulator.

Additional a 100nF ceramic capacitator should be included at every IC as near as possible at the supply pins.

When a coil was switched off the magnetic field inducts power to the electrical connections.
Because the circuit is open this voltage can achieve very high values in that no current was drawn.

The Flyback Diode draw current out of the coil an so the induction voltage is quite low.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top