Mcu reset when I turn on relay.

Status
Not open for further replies.
Hi,

The reset happening even no motor connected to relay. When relay closes and opens.


Like this ?
What is the value if L?



I have tried another code without using push button .the code print a message at the begining then turn relay on for 5 sec then turn it off for 5 sec . The pic reset once the relay turned on.somtimes no reset when the relay on but it reset once the relay become off.


I will try a separate power supply once I get another transformer or battery .


I tried a 1n4148 instead of 1n4007, the same problem occurred.

I am using bc547 npn and the following relay.



The power supply able to run the relay.

I tried to use led instead of the relay no problem occurred.


I am using solderless breadboard.


.

Additionally, as alec_t said in post 10, check your grounding scheme. The microcontroller circuitry can share a common ground connection to C7. But the emitter of Q1 must have it's own path to C7.

I can't understand this point
 
Was gonna say this. Remove the button from the system, and just switch the relay on after a delay.

EDIT: I must've missed the post above - only saw after posting.
 
You could try adding ceramic caps in parallel with the electrolytics either side of the 7805.

Mike.
 
You don't need the L. Wire mcu on right side of diode and relay on left side.


This indicates you might have more than one problem, one of which might be debouncing. Debounce your button and isolate the relay supply.
 
Almost every time somebody says their circuit has a problem then it is built in a mess of wires all over the place on a solderless breadboard.
Many of the connections on a solderless breadboard are intermittent.
The stray capacitance between the rows of contacts and wires all over the place couple high frequencies.
Maybe the magnetic force in the relay coil couples a voltage into a few of the nearby wires all over the place.

If you use a properly laid out pcb then your circuit will probably work properly.
 
Hi,

Yeah it sounds like noise that resets the uC.
Alternately, if the relay draws a lot of current relative to the ESR of the power supply and that causes a momentary drop in supply voltage which of course then resets the CPU because it thinks power has been cut and then returned.
A cap across the power supply with one lead near the relay and the other near the ground of the transistor that drives the relay will help solve the reset problem if it is the current draw of the relay causing it.
 
Just an little extra bit of information that the TS has not provided. From the picture of the relay I looked on ebay to see if any of them gave the current or power of the coil. I eventualy found one that claimed that the coil power was 0.45 watts. So the current will be just under 100 mA.
I have been using a PIC16f877 in a camera switching unit for years driving 8 relays with no problems. This is the schematic.


This is a picture of the construction. As you can see it is rather a rats nest with no special precautions about screening or supply decoupling. (The 100 nF supply decoupling capacitor is for the proccesor is mounted underneath it in the space between the sides of the socket).

Les.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…