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?

  • \$\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 -- Codidact.com Feb 6 '17 at 21:27