0
\$\begingroup\$

This question already has an answer here:

I want to use four pins on an Arduino Uno as digital inputs pins for four 12V DC outputs. I know I have to use a voltage divider first (with resistor values being 14kOhm and 10kOhm) to get the correct voltage range (0-5V) and also use the internal 20kOhm resistors on the Uno to achieve this.

My first idea was to not use the internal resistors on the Uno, but instead use external ones, to pull the voltage to zero, when nothing is connected to the input (prevent floating values). A colleague suggested the usage of the internal pullups on the Arduino, but I have no idea how to wire this up now.

Can someone explain it to me somehow?

\$\endgroup\$

marked as duplicate by Nick Alexeev Feb 6 '17 at 21:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ if you connect 12V to arduino pins directly, you will damage your board. the better way to use 12V input is through optocouplers. Similar question was asked before and has a quite good answers. electronics.stackexchange.com/questions/43498/… \$\endgroup\$ – kenan bilen Feb 6 '17 at 21:11
  • \$\begingroup\$ Unless you are absolutely sure that the 12Vdc sources are estremely stable, i.e. they cannot exhibit voltage spikes, your prospective setup will make your MCU inputs at risk of being damaged. See this answer for more details. \$\endgroup\$ – Lorenzo Donati Feb 6 '17 at 21:27