If your contacts are potential-free, having a 5V Arduino should not be an issue, because you will never bring Arduino’s and the KNX voltages together.
If your contacts are 2 pins (or even 3 pins), which get switched by a relay (you should hear it clicking), those should be shorted together or opened. You can check this with your multimeter set to Resistance and toggling the KNX binary output.
Another way is a single output, that is pulled HIGH or LOW by your KNX system. You can check this by connecting your multimeter in VOLTAGE mode between the KNX’s GND Pin and the binary output. If it shows a positive voltage, you should not connect your Arduino to this and use an optocoupler or relay instead and refer to the paragraph above.
Either way, in your Arduino sketch you choose any digital or analog pin and set the pin mode to INPUT_PULLUP
. This enabled the built-in pull-up resistor in the ATMEGA controller. You do not need to connect any resistor by yourself.
If you read the state with digitalRead(pin)
, it will always be HIGH, when not connected or your KNX output is NOT TRIGGERED, OPEN, or however they will call it.
As soon as you connect your pin to GND on the Arduino, or to the GND of the arduino, that you run through the Relay or Optocoupler, or you connected your Arduino’s GND to the KNX GND, then the Arduino Input will read a LOW
when doing a digitalRead(pin)
.
This is because the resistance is lower than the internal pull-up resistor, that will only pull the signal HIGH when there is really nothing else happening.
The wiring works like described in this Arduino Tutorial post. You can upload this sketch, connect your PC and try it out on your KNX output, relay or optocoupler.