Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 01:27:18 pm
Thanks
but still cant make it work..

Im at the brink of quitting but I have no choice but to finish this

hell of a week for me..
2  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 12:52:48 pm
bump
3  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 12:40:05 pm
I already changed that

without the 0x

but still its two digits each byte

I am wondering why the other RFID tags have one digit bytes..
4  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 12:30:40 pm
hi sir,

it won't work..

I was able to read the bytes using this code:

Code:
}

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, HEX);
}
}

but when I try to use the code i made which is this
Code:
int  val = 0;
char code[12];
int bytesread = 0;
char tagArray[12];     // the array for the tags
char Valid1[12] = {
  '0x41', '0x84', '0xFF', '0x91', '0xDA', '0xB9', '0xFC', '0x17', '0xF8', '0x42','/0'};
char Valid2[12] = {
  '0x41', '0x84', '0xFF', '0x91', '0xD5', '0xC0', '0xD', '0xE7', '0xF8', '0x42','/0'};
#define PowPin 11
#define NoPin 12
#define YesPin 13



void setup() {

  Serial.begin(9600); // RFID reader SOUT pin connected to Serial RX pin at 2400bps
  pinMode(PowPin,OUTPUT);
  digitalWrite(PowPin,HIGH);
  pinMode(NoPin,OUTPUT);
  pinMode(YesPin,OUTPUT);
}


void loop() {


  if(Serial.available() > 0) {     // if data available from reader
    if((val = Serial.read()) == 10) {   // check for header
      bytesread = 0;
      while(bytesread<10) {   // read 10 digit code
        if( Serial.available() > 0) {
          val = Serial.read();
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading
            break;      // stop reading
          }
          code[bytesread] = val;    // add the digit
          bytesread++; // ready to read next digit
        }
      }

      if(bytesread == 10) {   // if 10 digit read is complete
        Serial.print("TAG code is: ");   // possibly a good TAG
        Serial.println(code);     // print the TAG code
        {
          if(strcmp(code,Valid1) == 0) {
            Serial.println("Gwapo, you're in");
            digitalWrite(YesPin,HIGH);
          }
          if(strcmp(code,Valid2) == 0) {
            Serial.println("Pogi, you're in.");
            digitalWrite(YesPin,HIGH);
          }
         
          if((strcmp(code,Valid1) !=0) && (strcmp(code,Valid2) != 0))  {
            Serial.println("Panget Bawal Pumasok");
            digitalWrite(NoPin,HIGH);
            Serial.println(code);
            {

            }
          }
        }
      }


      bytesread = 0;
      delay(1000);      // wait for a second
    }
  }
}



Nothing happens,, only the powerpin is on..

It wont read or nothing would appear at the serial monitor..
5  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 12:06:16 pm
T_T

Unfortunately I did that..

I used the tx rx of arduino

but by using the program above I was able to get bytes from the RFID reader..

I just had to remove the tx rx connection when uploading sketches..

was the Ascii coded hex the correct tag data?
if not how will I know the correct data?

Thanks sir paul
6  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 11:53:57 am
hi sir Paul

thanks, Ive read some of your replies in the old forum
in similar topics

Sorry I wasn't able to see the code button.

Anyway..

I have this reading
using this code
Code:
int incomingByte = 0; // for incoming serial data

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, HEX);
}
}

I received:41
I received:84
I received:FF
I received:91
I received:DA
I received:B9
I received:FC
I received:17
I received:F8
I received:42

As I said I was wondering why the RFID tag codes in the similar topics are using digits like '0DF1244278'

Thanks
7  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 11:07:29 am
T_T

i am really having a problem with those hex values

I used this code to know what data the RFID reader is reading from the tag..

Quote
int incomingByte = 0;   // for incoming serial data

void setup() {
   Serial.begin(9600);   // opens serial port, sets data rate to 9600 bps
}

void loop() {

   // send data only when you receive data:
   if (Serial.available() > 0) {
      // read the incoming byte:
      incomingByte = Serial.read();

      // say what you got:
      Serial.print("I received: ");
      Serial.println(incomingByte, HEX);
   }
}

I know it was a Ascii coded Hex code shown in the serial monitor..
I am wondering why other RFID tags in the forum s do have 10 digit codes only
8  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 10:43:57 am
sorry wasn't able to read that properly

can i just add a '/0' to the array?
i read it was the null ascii char
9  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 10:39:52 am
I was able to Light it up now, just minor problems the ground not properly connected to the breadboard..

whats wrong with that one sir?
thanks sorry for being such a newb.
10  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 10:19:57 am
Thanks Guys..

I did some reading and ended up with this code..

I used some of the codes used in the old forums..

unfortunately it won't work

the PowerLED won't even light up..

here's the code:

the logging mechanism was not yet included.

Quote
int  val = 0;
char code[12];
int bytesread = 0;
char tagArray[12];     // the array for the tags
char Valid1[12] = {
  '0x41', '0x84', '0xFF', '0x91', '0xDA', '0xB9', '0xFC', '0x17', '0xF8', '0x42'};
char Valid2[12] = {
  '0x41', '0x84', '0xFF', '0x91', '0xD5', '0xC0', '0xD', '0xE7', '0xF8', '0x42'};
#define PowPin 11
#define NoPin 12
#define YesPin 13



void setup() {

  Serial.begin(9600); // RFID reader SOUT pin connected to Serial RX pin at 2400bps
  digitalWrite(PowPin,HIGH);
}


void loop() {


  if(Serial.available() > 0) {       // if data available from reader
    if((val = Serial.read()) == 10) {   // check for header
      bytesread = 0;
      while(bytesread<10) {        // read 10 digit code
        if( Serial.available() > 0) {
          val = Serial.read();
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading
            break;              // stop reading
          }
          code[bytesread] = val;      // add the digit
          bytesread++;          // ready to read next digit
        }
      }

      if(bytesread == 10) {        // if 10 digit read is complete
        Serial.print("TAG code is: ");   // possibly a good TAG
        Serial.println(code);     // print the TAG code
        {
          if(strcmp(code,Valid1) == 0) {
            Serial.println("Gwapo, you're in");
            digitalWrite(YesPin,HIGH);
          }
          if(strcmp(code,Valid2) == 0) {
            Serial.println("Pogi, you're in.");
            digitalWrite(YesPin,HIGH);
          }
          
          if((strcmp(code,Valid1) !=0) && (strcmp(code,Valid2) != 0))  {
            Serial.println("Invalid Tag");
            digitalWrite(NoPin,HIGH);
            Serial.println(code);
            {

            }
          }
        }
      }


      bytesread = 0;
      delay(1000);              // wait for a second
    }
  }
}


11  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 06:04:30 am
bump
12  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 04, 2011, 02:24:07 am
Quote
int incomingByte = 0;
char code[12];
char tag[12] = {'41', '84', 'FF', '91', 'D5', 'C0', 'D', 'E7', 'F8','42'};
#define PowPin 11
#define NoPin 12
#define YesPin 13

void setup()
{
Serial.begin(9600);
pinMode(PowPin,OUTPUT);
digitalWrite(PowPin,HIGH);
pinMode(NoPin,OUTPUT);
pinMode(YesPin,OUTPUT);
}

void loop()
{

   // send data only when you receive data:
   if (Serial.available() > 0) {
      // read the incoming byte:
      incomingByte = Serial.read();

      code[12] = (incomingByte, HEX);
if (strcmp(code,tag)==0)
{
Serial.println("GOOD");
}
else
{

Serial.println("BAD");
}
}
}









I tried this code i made and it doesn't recognize the valid tag..

Thanks in advance for your help.
13  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 03, 2011, 11:18:09 pm
I tried to read the data the RFID tag sends,
and got a reading like this

I received: 255
I received: 145
I received: 218
I received: 185
I received: 252
I received: 23
I received: 248
I received: 66

can anyone teach me how to compare this string to valid ones..

I'm having a hard time comparing array of strings
14  Using Arduino / Programming Questions / Re: RFID DOOR LOCK with DATA LOGGING on: March 02, 2011, 03:16:48 am
Thanks nice idea..
forgot that one smiley-grin
15  Using Arduino / Programming Questions / RFID DOOR LOCK with DATA LOGGING on: March 02, 2011, 01:05:29 am
Hi guys,

Im trying to develop a code for a RFID DOOR LOCK with data logging.
Hope you can help me out.
This is one of my undergrad projects and I'm totally new to arduino.
I'll close my old topic since I decided to start the code from scratch..

This is the flow chart:



Btw, the RFID reader sends data in format like this
0x41 0x7d 0xff 0xdc 0xe8 0xe7 0x1b 0x87 0xfb 0x42

Thanks for those who will help. I'll owe you guys a lot if I am able to finish this project.
Pages: [1] 2