Help with Wiegand to ASCII conversion

Hi all, I'm working on a Weigand to ASCII converter to replace some deprecated hardware but I'm experiencing trying to get the Wiegand device to communicate with the Arduino. My project tools are as follows:

I have everything connected correctly, my code compiles, and the code is uploaded to the Arduino just fine but I get no output when using the following code:

#include <Wiegand.h>

WIEGAND wg;

void setup() {
	Serial.begin(9600);
	wg.begin();
}

void loop() {
	if(wg.available()) {
		Serial.print("Wiegand HEX = ");
		Serial.print(wg.getCode(),HEX);
		Serial.print(", DECIMAL = ");
		Serial.print(wg.getCode());
		Serial.print(", Type W");
		Serial.println(wg.getWiegandType());    
	}
}

I verified a few things before I turned to this forum:

  • Serial monitor prints data if I do something like void setup() { Serial.println("Foo"); }
  • Wiegand device works
  • Everything is plugged in

I'm aware the wg.available() method fails which is causing the information inside to not print. Normally, I would step through the program using a debugger to see where it actually fails but I have no idea how to do this or if it's even possible in this environment.

Does the problem lie with my wiring? How do I know the Arduino is actually receiving any signal?

I'm terribly new to the Arduino world so I apologize in advance for my noob questions.

Everything is plugged in

Except that I don't see a ground connection.

djthoms did you have any luck getting it to work? I am also trying to work on a Schlage Handkey II.

hi djthoms, any update for your project? how did you solve the issue in the end?
I'm facing same issue as you.

TomYamMee:
hi djthoms, any update for your project? how did you solve the issue in the end?
I'm facing same issue as you.

In case you didn't notice, this is a 5 year old thread and the OP didn't have the courtesy to reply to previous responses - I wouldn't expect anything more from him now.

Looking at the HK-II manual, have you already set the output mode in the setup menu to card reader emulation mode?

Have you tried using a simple sketch to read the state of the digital pins and print them to serial?