I'm totally ignorant at wiring, so I asked an electrical engineer to do it for me.
the door strike open when I plug in the power supply and closes otherwise
I uploaded my code which I believe that there is nothing wrong with it but the arduino can't connect to the door strike
here are photos of the wiring, please help if you see anything wrong with it, thank you
Boy! That is one seriously confusing set of photos, taken from different angles and not really showing clearly all the connections. Nor can I see whatever is powering the relay (or what you are using to power the UNO).
you moved things between photos. wires in in different places. it would have been much better to use some wire ties (from bread or rolls) and looped the wires to make direct runs and not have them go in and out of the pictures.
where is the 5v power ?
the orange connects to brown that goes out of any photos. looks like it is on the 5v.
if the relay 5v and not the same 5v as the arduino ?
the strike is strictly and only on the relay.
no idea where the power is for the logic.
and unless you tie the grounds together you will not have reliable operation of that FET.
here is my paint version, colors do not match yours.
looks like the only thing you are not showing is the 5v power supply.
why an DC to DC ground to ground would effect things is not understood.
why does it fail when you connect grounds ?
the 12V can remain isolated, but the arduino and FET must share grounds. shown by my large thick green line.
.you did not post a link to the FET. this may or may-not be correct for the one you are using.
make sure of the pin connections on that FET or you might blow things out
I see you have a 9v and not 5v. fix that on your wiring
pick any digital pin to fire that FET
you should add a DIODE on the FET to prevent back EMF spikes
dave-in-nj:
.you did not post a link to the FET. this may or may-not be correct for the one you are using.
make sure of the pin connections on that FET or you might blow things out
I see you have a 9v and not 5v. fix that on your wiring
pick any digital pin to fire that FET
you should add a DIODE on the FET to prevent back EMF spikes
you mean I should add an LED?
can you please tell me where exactly should I put it
I'm using the transistor that comes with the Arduino stater kit
If i want to replace the battery with other power source like the circle port of the arduino, how can I do this?
which wires should I put in the relay that replaced the battery wire?
I thought that when you posted an image, that the site grabs it and makes a copy.
it is clear that they are linked. how to I post to the site directly ?
best to put the relay on the same power at the strike if they are both 12V.
if this is ultimately a stand alone installation, you can run the Arduino from the same 12V
also, you can power your Arduino from the same 12v. just add a cap to the power input lines to help clip spikes.
you do not have anything else here. are you controlling this with wi-fi or blu-tooth ?
there are no switches shown as yet.
also, I put the signal on pin 9, is that where you want it ?