I need to turn on and off a small 12v lock, I'm powering my Arduino Uno via the power jack with 12V and wondered if I could use this.
According to the Arduino UNO documentation "You can supply voltage through the vin pin, or, if supplying voltage via the power jack, access it through this pin."
Since the 12v is available through the vin pin I decided to use this to power the lock via a relay, I've tried it and everything works fine. The questions I have are:-
1 Are there any issues with using the vin pin to power an external device
2 My relay has optoissolation, do I need to use this since I'm only connecting 12v DC
3 Will the optoisolation even work since there is a common ground between the vin pin powering the relay coil and the arduino output pin powering the diode that triggers the relay.