Connecting Wiegand RFID Card Reader to Photon, Pins are kept being interrupted


I am trying to connect a Wiegand RFID card reader to a Photon.

The RFID card reader is powered with an external 12V power supply.
And its WG0 and WG1 are connected to the Photon’s D2 and D3.
Using a multimeter, WG0, WG1 to GND = 5V.

The Photon is powered with USB connected to my computer.
And I have tested codes from these 2 threads:

  1. Wiegand support for Photon (Solved)
  2. [SOLVED] Using wireless to eliminate wiegand wiring

Touching a smartcard to the reader will not display anything on the screen.

So I added several Serial.println here and there and I can see that pin D2 and D3 are kept being interrupted all the time, even though there is no card near the RFID reader.

void WIEGAND::begin()

void WIEGAND::begin(int pinD0, int pinIntD0, int pinD1, int pinIntD1)
	// original codes...
	pinMode(pinD0, INPUT);
	pinMode(pinD1, INPUT);
	attachInterrupt(pinIntD0, ReadD0, FALLING);
	attachInterrupt(pinIntD1, ReadD1, FALLING);

void WIEGAND::ReadD0()
    Serial.println("Interrupted D0");
	// original codes...

void WIEGAND::ReadD1()
    Serial.println("Interrupted D1");
	// original codes...

And my CLI will print out these lines:

Interrupted D0
Interrupted D1
Interrupted D1
Interrupted D0
Interrupted D1
Interrupted D0
Interrupted D1

Any idea why? This RFID can read card (display the card’s number on Notepad++) just fine if connected directly to a computer via an USB cable.

If I changed pinMode(pinD0, INPUT) to pinMode(pinD0, INPUT_PULLUP)
And I pulled out the pin D2 and D3 cables, the “Interrupted DX” stopped.

Moving from breadboard to protoboard

First, make sure you don’t use INPUT_PULLUP. There’s a good chance you can permanently damage the Photon using INPUT_PULLUP with 5V signals, which Wiegand is.

However, you were saved because it looks like you didn’t connect GND on your reader to the Photon. You need to connect the two Wiegand data lines and GND for it to work.

Without GND the signals were just floating around, which is why they were triggering all the time.


Yuck. Yes, I am still newbie and still learning.

The available connections on the Wiegand are 12V, GND, WG0, WG1.
12V and GND are connected to the external 12V power source.
WG0 and WG1 are connected to the Photon as seen.

So how do I “connect the two wiegand data lines and GND” again? Sorry for such a newbie question. And thank you.


GND on the reader should be connected to both the 12V adapter ground or - connector and GND on the Photon.

Leave the Wiegand data lines connected as they are.


Got it. It is working now. And thanks again!