I'd like to connect a 12V access control device to the Arduino, but I lack the understanding.

How can the signals from and to the device be done when they have different voltages?

I am afraid that the 12V would brick the Arduino.

  • 1
    Opto-isolators are your friend here... – Majenko Nov 11 '18 at 12:42
  • 1
    D0 an D1 are weigand26 for external reader. it should be 5 V – Juraj Nov 11 '18 at 17:01
  • @Juraj Interesting. I can't find info on this, and the vendor doesn't understand my question. I guess I'll just buy it and measure it myself. – Ivan Nov 11 '18 at 17:38
  • where do you see that this version has D0 D1 pins? – Juraj Nov 11 '18 at 17:47
  • @Juraj I'm sorry, I linked the wrong one. I fixed the link. Here it is here as well. – Ivan Nov 11 '18 at 17:56

You could use an opto-coupler:

An opto-isolator (also called an optocoupler, photocoupler, or optical isolator) is an electronic component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal. Commercially available opto-isolators withstand input-to-output voltages up to 10 kV and voltage transients with speeds up to 25 kV/μs.

A common type of opto-isolator consists of an LED and a phototransistor in the same opaque package. Other types of source-sensor combinations include LED-photodiode, LED-LASCR, and lamp-photoresistor pairs. Usually opto-isolators transfer digital (on-off) signals, but some techniques allow them to be used with analog signals.

Here is an example schematic and packaging:


If you have a heavy load (although this does not seem to be your case) then they can also be used in conjunction with relays - here is an eight channel opto-coupler relay module board:

12V 8 Channel Level Trigger Optocoupler Relay Module For Arduino

12V 8 Channel Level Trigger Optocoupler Relay Module For Arduino showing optocouples

  • I see. So the way this would work is: - 12V power to the access control. - 5V power to the Arduino. - A wire from the D0, D1 pin on the access control, to the opto-coupler, and a wire from it to the Arduino in a digital pin. Is this correct? – Ivan Nov 11 '18 at 12:50
  • @Majenko Can you please tell me if my comment above is accurate? – Ivan Nov 11 '18 at 12:59
  • An opto-coupler is like an LED on one side and like button on the other. You treat it pretty much like those items. – Majenko Nov 11 '18 at 13:10
  • On the input side of the board, connect an Arduino output pin to the the input of one of the opto- or relay inputs. Connect the Arduino Ground (and +5v if the board calls for it) to the respective board inputs. On the output side of the board, If the access device just needs a contact closure, connect those two device connections to the Common and Normally Open contacts of the same opto where you connected the Arduino pin. Or if the device needs switched 12v, Connect +12v to the Common contact and the device's switched input to the Normally Open contact. – JRobert Nov 11 '18 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.