Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Micro controller Programming

Status
Not open for further replies.
What kind of problems are you having? Code? Circuit? what?
What kind of NFC card reader you have? Any links to a datasheet, specs etc.?
 
Last edited:
PN532
How to write our own data into the NFC card using its reader and how to retrieve the stored data from the card using arduino board
 
Check out the Adafruit site, there's some tutorials and libraries there too :)

There are various suppliers of NFC modules on ebay, most supply documentation and libraries etc. Here's one that looks interesting: **broken link removed**
 
The whole point of authentication and encryption is to keep data and systems secure that use NFC, so I won't be helping you to perform a hack. Most new cards as far as I know will allow full access to the data blocks using Key A. However, to answer your question, yes the MiFare chipsets have been compromised by some less scrupulous types, so it is possible :)
 
we planned to use the NFC card for some applications...After completion of it we need to encrypt it with our own access bits and keys....
 
I assume that you are sending ascii text. Compare the incoming data value to the ascii table values. Number characters have values from 48 to 57.

If you are sending raw number values (integers, floats etc.) mixed with ascii text. Then you need to define a simple protocol that sends well defined datapackets.

"Using Arduino" means that you are probably coding in C.

It is very difficult to give more advice without knowing the details of the serial data. Can you give an example of incoming data and what you need to do with it.
 
ya....i want to send serial data for example : Get0100300

it should print in serial monitor as
Ge
t0
10
03
00

My thanks in advance for your valuable solution.....!!!
 
I still don't understand what exactly is the problem. You do not know how to send data, or you do not know how to convert numbers to strings, or you do not know how to split the string in 2 character groups.. what is it?
 
One simple solution is (using Arduino sketch):

C:
char buf[] = "Get0100300";

Serial.write(&buf[0], 2);
Serial.write(&buf[2], 2);
Serial.write(&buf[4], 2);
Serial.write(&buf[6], 2);
Serial.write(&buf[8], 2);

that should print:
Ge
t0
10
03
00

If that does not print the newlines properly, then you need to write:
C:
char buf[] = "Get0100300";

Serial.write(&buf[0], 2);
Serial.write("\n\r");
Serial.write(&buf[2], 2);
Serial.write("\n\r");
Serial.write(&buf[4], 2);
Serial.write("\n\r");
Serial.write(&buf[6], 2);
Serial.write("\n\r");
Serial.write(&buf[8], 2);
Serial.write("\n\r");

That code adds newlines "manually". The bad documentation of Arduino sketch functions didn't say if those lines are needed or not.
 
Last edited:
After we execute the code...we have to give "Get0100300" as input in serial monitor and press enter... it should print in serial monitor as
Ge
t0
10
03
00
 
i want to compare the 4 byte UID of multiple NFC tags using arduino....i bought nfc reader from elechouse.com

To use single NFC tag as admin card...
 
It is impossible to help you when you give out small pieces of information here and there. Why don't you describe the whole system and also tell us what you have done so far. Post all the code working code you have so far. And detailed info what you are trying to accomplish.
 
Hold on!!!! When did you shift to Arduino!!! It started as mikroC on a pic18f14k50..

String manipulation in C is one of the easiest to perform..

First you use strtok() to split the string.... then use strncpy() to get the Alpha / numeric parts..

As MrT has already stated..... Show me the string that you receive and tell me what needs splitting!!
 
Status
Not open for further replies.

Latest threads

Back
Top