Hello everybody,
Need your assistance ASAP.
I’ve built a small project using Arduino Mega and I think that I have a reverse voltage issue.
Attached in a sketch of the problematic part in my setup.
I have 2 power supplies of this kind: http://www.ebay.com/itm/231667699743?_trksid=p2057872.m2749.l2649&var=530894013663&ssPageName=STRK%3AMEBIDX%3AIT
One provides 5V which drives the relay module and the second one provides 12V which drives the Arduino through the 12V input jack and the ElectroMagnet through the relay module.
The ElectroMagnet is of this kind: http://www.ebay.com/itm/60KG-132lb-Electric-Magnetic-Lock-Fail-Secure-DC-12V-for-Door-Entry-Access-36L7-/131678535197?hash=item1ea8a6fe1d:g:3KsAAOSw~otWcTIO
The relay module is of this kind: 16-channel 5v Relay Shield Module With Optocoupler for Arduino for sale online | eBay
5V from Arduino is connected to the 16 channel relay module (didn’t connect the ground because I don’t want the Arduino to drive the relay module). The Arduino controls the specific relay with digital output.
I also have a micro-switch connected to other digital pin and controls other stuff.
The problem started when I connected a switch between the ElectroMagnet and the relay module. Theoretically it has no connection to the Arduino but when I press it (it’s in normally closed mode) and the ElectroMagnet is turned off the other switch, the one connected to the Arduino is toggled and switches on whatever it should turn on. When I turn off the Magnet using the Arduino's digital out everything works fine.
I believe that I have a debounce issue caused by reverse voltage coming from the ElectroMagnet whenever I manually turn it off.
I can try enlarging the debounce delay (currently 50 milliseconds) and perhaps it will solve the issue but I would like to get to the route cause and try to prevent the reverse voltage coming back to the Arduino.
I connected a Schottky Diode (1N5819) in series to the electro magnet: between Vcc-in of the magnet and Vcc-out of the relay module and it didn’t help.
I connected a Schottky Diode (1N5819) in parallel to the electro magnet: between Vcc-in and GND and it didn’t help.
I’m not sure what is it I’m doing wrong, the diode should prevent the reverse voltage but it doesn’t, perhaps I should use other Diode?
Perhaps I need to connect it differently? Perhaps other (simple) solution, like maybe connecting the Arduino to a different power source and not to the same one the electro magnet uses ?
Your help would be greatly appreciated