How to get a potential free contact from an arduino?

Hi,
i have build a wiegand controller with an arduino nano to open my door with rfid.

I get a signal output on one of the D-Pins of the arduino.

In my house i have a knx installation and some free binary inputs (potential free).

The arduino gives me a 5V Signal ithink, so i can´t connect this to the binary input directly.

Can someone tell me, how i can do this very easy? Maybe with an - in german - “optokoppler”?

Which one do i need and can i use this without any additional parts?

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.

I think you misunderstood me.

My arduino is the switch and i´m getting 5V on the D-Pins of it.

My KNX binary inputs can measure only potential free contacts - like reed contacts in windows.

So if i put a wire in the two contacts of the binary input and put the two wires togethter - without any power - the contact gets closed.

I´m afraid, that the 5V of the arduino will kill the binary inputs.

So i think i need a optocoupler / reed-relais or something else which gives me a closed contact without any power output.

Hey there,
since i presume that you are a german nativ speaker here a link regarding the potential free inputs knx binary inputs.
In a nutshell, the potential free contacts provide their own voltage to probe if the switch is closed or not and therefore you are on the right path with an optocoupler.
An example with scematic is this isolating circuits from your arduino.
If you look at the diagram you see how the optocoupler is connected and instead of the fan control you can directly connect those two pins to the binary input.
Hope that helps and feel free to ask if you still struggle. (good for better understanding is also great scott youtubes channel with tutorial optocouplers & relais)
Greetings Anton

Yes, i´m a native german speaker.

Please can you give me a link to aliexpress or something similar to the needed part for my arduino?

The arduino is my doorcontroller and if someone has the right rfid card, my arduino gives a signal on D7 - this signal i want to bring onto my potential free knx binary input.

So what would be the simplest working thing? A ready to use 5V relay board? This i can use without any soldering? Or do i need resistors/capacitor or something similar for this too?

Maybe this:

relais
https://de.aliexpress.com/item/1pcs-KY-019-5V-One-1-Channel-Relay-Module-Board-Shield-For-PIC-AVR-DSP-ARM/32802892040.html

relais with optocoupler
https://de.aliexpress.com/item/Smart-Electronics-FT232RL-FT232-FTDI-USB-3-3-V-5-5-V-to-TTL-Serial-Adapter/32801726574.html

or

https://de.aliexpress.com/item/5-pcs-1-Channel-RM-Optocoupler-Relay-Module-Shield-for-Arduino-ARM-PIC-AVR-DSP-Electronic/1671974644.html

reed relais:
https://de.aliexpress.com/item/10pcs-lot-SIP-1A05-SIP-1A05-DIP4-reed-relay-5V-Voltage-Hot-Sales/32822265139.html

or a simple optocoupler without relais:
https://de.aliexpress.com/item/1-Channel-Optocoupler-Isolation-Module-Input-12V-No-Din-Rail-Holder-PLC-Processors-80KHz-PC817-EL817/32719957788.html

Which one is the right for me?

I would go with the second one
https://www.aliexpress.com/item-img/Smart-Electronics-FT232RL-FT232-FTDI-USB-3-3-V-5-5-V-to-TTL-Serial-Adapter/32801726574.html?spm=a2g0x.10010108.1000017.1.7b5f10e3B7xLLt
cheap and easy, can also be used for other stuff.
Let me know how it works out for you :slight_smile:

Would you share the code for the arduino wiegand? Thank you for your consideration.

Here you go: https://blog.thesen.eu/teil-1-rfid-codeschloss-fuer-den-keymatic-abus-funk-tuerschlossantrieb-ersatz-fuer-km300-cac-cft-1000/

It is in german.

But now i use an esp8266 with esp-rfid