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.
I can't understand this point
The reset happening even no motor connected to relay. When relay closes and opens.
Try placing a series diode that isolates the 10uF and 0.1uF MCU capacitors from the 100uF capacitor and connect the inductor coil on the anode side of the diode (so the inductor coil can only draw current from the 100uF capacitor and cannot draw current from the 10uF and 0.1uF capacitors).
.
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