Hello,
I have an electric door lock, which works with 12 volts. I've built an Arduino (Mega2560) system, which based on specific conditions opens the electric lock. For that purpose I use a simple 5V relay (SRD-05VDC-SL-C) that controls when the current can flow in the electric lock circuit.
Issue: When the relay turns off, the Arduino restarts.
When I disconnect the 12V power supply, then I don't have this issue. The relay just turns off, without resetting the Arduino and I can turn it on and off as many times as I want the issue does not occur. However as soon as I turn on the 12V power supply again, the issue occurs immediately after the first relay turn off. I have read I should use a Schottky diode to prevent EMF/EMI caused by the coil in the relay, but it did not solve my problem. I also tried to add a 1000uF capacitor, but that also did not solve the issue.
Do you have any idea how this problem can be solved?
I attached the design for better understanding.
Arduinio restarts after relay turns off
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Arduinio restarts after relay turns off
Your door lock is also a relay and is probably where your getting a spike. Put a diode across that also.
- ncseffai
- Posts: 7
- Joined: Thu Feb 09, 2017 4:06 pm
Re: Arduinio restarts after relay turns off
Hello,
I tried the diode as you suggested but it did not solve the problem. However one of my friend suggested to use optocoupler instead of coil-relay and it did solve my issue!
Thanks for your suggestion and your help.
Regards,
Norbert
I tried the diode as you suggested but it did not solve the problem. However one of my friend suggested to use optocoupler instead of coil-relay and it did solve my issue!
Thanks for your suggestion and your help.
Regards,
Norbert
Please be positive and constructive with your questions and comments.