Not sure what you mean by 'dig3' and 'dig4'.
Read up on interrupts: http://www.arduino.cc/en/Reference/AttachInterrupt
Figure out which model you got (Weigand or data&clock). If you make a guess and get it wrong, nothing will work. Google found me a manual for the "HID ProxPoint Plus 6005" and it indicated that the model number was slightly different for the two protocols.
system
May 21, 2011, 11:11pm
8
I think it's a weigand because on the green wire it says data0/data, and on the white wire it says data1/clock. What are the difference? And dig3 it digital 3 on the Arduino. Oh, thanks for the replies.
Does you unit have any model number information on it?
system
May 21, 2011, 11:47pm
10
Let's see... Where's my camera...
Ah. These pictures are of all for corners of the device. Can you get anything out of them?
OK. The 6006B2B00 makes me think that you do have the Weigand model.
Connect 'data0' to pin 2 (interrupt 0) and 'data1' to pin 3 (interrupt 1).
volatile unsigned long tagID = 0;
volatile int bitCount = 0;
void ISRone(void)
{
bitCount++;
tagID <<= 1;
tagID |= 1;
}
void ISRzero(void)
{
bitCount++;
tagID <<= 1;
}
void setup()
{
Serial.begin(57600);
pinMode(2, INPUT);
digitalWrite(2, HIGH); // Enable pull-up resistor
attachInterrupt(0, ISRzero, FALLING);
pinMode(3, INPUT);
digitalWrite(3, HIGH); // Enable pull-up resistor
attachInterrupt(1, ISRone, FALLING);
tagID = 0;
bitCount = 0;
}
void loop()
{
if(bitCount >= 26)
{
Serial.println(tagID, HEX);
tagID = 0;
bitCount = 0;
}
}
system
May 22, 2011, 12:44am
12
Alright. The serial port is all random. No two codes are alike. But it reads them. Now what?
system
May 22, 2011, 12:45am
13
But if you scan the card and hit reset, it has the same code every time.
Could be the code is not 26 bits. Try this version:
volatile unsigned long tagID = 0;
volatile unsigned long lastBitArrivalTime;
volatile int bitCount = 0;
void ISRone(void)
{
lastBitArrivalTime = millis();
bitCount++;
tagID <<= 1;
tagID |= 1;
}
void ISRzero(void)
{
lastBitArrivalTime = millis();
bitCount++;
tagID <<= 1;
}
void setup()
{
Serial.begin(57600);
pinMode(2, INPUT);
digitalWrite(2, HIGH); // Enable pull-up resistor
attachInterrupt(0, ISRzero, FALLING);
pinMode(3, INPUT);
digitalWrite(3, HIGH); // Enable pull-up resistor
attachInterrupt(1, ISRone, FALLING);
tagID = 0;
bitCount = 0;
}
void loop()
{
// See if it has been more than 1/4 second since the last bit arrived
if(bitCount > 0 && millis() - lastBitArrivalTime > 250)
{
Serial.print(bitCount, DEC);
Serial.print(" bits: ");
Serial.println(tagID, HEX);
tagID = 0;
bitCount = 0;
}
}
system
May 22, 2011, 1:54am
15
It also be me using power via USB. I'll try an altronix 12v power supply. My dad who works for VTI security suggested that.
system
May 22, 2011, 3:21am
16
I'm wrong. The code works, but how do I simplify it so a noob like me can add some stuff?
system
May 22, 2011, 3:29am
17
Like how would I make it say something like
if (tagID==tag code here){
Serial.print("Accepted");
do something else here;
}
else{
Serial.print("Denied")
}
etc
Soapy29:
Oh and it's 37 bits.
The unsigned long is only going to hold the last 32 bits of the 37-bit value. That should probably still be enough to uniquely identify each tag.
system
May 22, 2011, 1:56pm
20
Well the if statement I posted above didn't work. How do I find only one tag?
system
May 22, 2011, 4:04pm
21
Sweet! I hooked a relay up to my arduino, and when I scan the card, it clicks on the relay for 2 seconds!
AWOL:
Oh this is actually cool man..I liked it
Smells...spammy.
At least it's subtle. You have to go to the profile to find the link to the website.
system
May 23, 2011, 10:44pm
24
I'm going to make a video and a website explaining how to make my setup. Might not be till next week, but I do have some Arduino videos on my Youtube channel: AKSoapy29 - YouTube
I have a similar situation with a RFID reader from HID.
The reader has pins for the LED's and Buzzer. How would I go about controlling those with an arduino?