Go Down

Topic: DIY Arduino-driven FSK RFID reader (Read 6791 times) previous topic - next topic

aleza


If by "pcb" you mean "printed circuit board", I am puzzled why you'd want to start with that before building the circuit and proving to yourself it works.
It might make more sense for you to build this circuit first on a breadboard, then on a perfboard, and only then, after all versions work OK and you know exactly what you want, do it on a pcb.
If you mean something else, please explain.

Thanks,

edude



Edude:

Yes I meant that... I wanted to jump right to prototyping but what say makes perfect sense.
I just finish de breaboard model. I am having software issues, I used the code from the playground to test it.
I added a println at setup to debug, simple "lets start" once, everything is loaded in the arduino (UNO and pro mini) I opened the serial monitor and just got "le"

After reseting the arduino, it only outputs "le" (from the whole lets start) Any idea what this can be?

edude

Yes, I noticed the same thing in the more recent Arduino IDE versions.
I think with the newer software there is some conflict between the "callback" interrupt service routine (ISR) and the serial communication, which in this sketch is only used for debugging and diagnostic output.
As a workaround, try the following:
Take the latest version posted in the playground, and simply comment out *all* serial output.
Because all this serial output is for diagnostics only, it should have no effect on the functionality, assuming all is working.
With this workaround, you fall back on the flashing red LED, steady red and steady green for diagnostics.
(Obviously more such steady or flashing LED-based outputs can be added as needed.)
If you get the green LED to turn on when an FSK card is placed close to the inductor coil, then the circuit is working.
Note that this circuit specifically handles FSK encoding, and not ASK, so the RFID card you test *must* be FSK type.
Also, make sure your inductor coil resonance is maximized. Even though the coil is driven by Arduino's 5V ptp (square wave) output, at resonance the coil should have 35V ptp or greater (sine wave). The lower that voltage the lower the sensitivity, so this is a crucial requirement for this circuit to work.
Please let us know your results.


aleza


Yes, I noticed the same thing in the more recent Arduino IDE versions.
I think with the newer software there is some conflict between the "callback" interrupt service routine (ISR) and the serial communication, which in this sketch is only used for debugging and diagnostic output.
As a workaround, try the following:
Take the latest version posted in the playground, and simply comment out *all* serial output.
Because all this serial output is for diagnostics only, it should have no effect on the functionality, assuming all is working.
With this workaround, you fall back on the flashing red LED, steady red and steady green for diagnostics.
(Obviously more such steady or flashing LED-based outputs can be added as needed.)
If you get the green LED to turn on when an FSK card is placed close to the inductor coil, then the circuit is working.
Note that this circuit specifically handles FSK encoding, and not ASK, so the RFID card you test *must* be FSK type.
Also, make sure your inductor coil resonance is maximized. Even though the coil is driven by Arduino's 5V ptp (square wave) output, at resonance the coil should have 35V ptp or greater (sine wave). The lower that voltage the lower the sensitivity, so this is a crucial requirement for this circuit to work.
Please let us know your results.



Edude:

Unfortunately it didnt work, still getting nothing.

  • I have a (elctro-newbie) question: Why if the circuit is proven to work, shouldnt I build the printed circuit at once? (I know the process of "tunning" a coil into a certain frequency is no easy thing)

  • Never herad of this serial issue.... in fact, on other sketches works perfect.



Thanks for all the assistance, find me at #arduino IRC @freenode

edude

#18
May 03, 2014, 04:26 am Last Edit: May 03, 2014, 04:43 am by edude Reason: 1
When you say you are getting "nothing", what do you mean exactly? Are you not even getting a steady red LED?
Obviously you'd get no diagnostic serial output if that's been disabled.
And how do you know which kind of RFID tag you have? The encoding type is not normally printed on the tag, so if you have random one, it could easily be ASK (instead of FSK), or a higher frequency one.
For example, I have a batch of sample tags from Parallax, and all of them are ASK (because last time I checked it was the only kind their circuit supported - might be different now).
As far as tuning, what kind of ptp peak voltage are you getting now? If it's not peaked properly, and if you are not getting 35V ptp or thereabouts, you will not get a proper detected signal.
As far as building the circuit as a pcb, sure, I would do that, but *after* you test it and get it to work as a breadboard. The reason is that it's very easy to make a few small mistakes while laying out the pcb, and the pcb looks very ugly if you need to patch it later (and the patching process may damage other traces causing more problems).
The correct process is to get the "prototype" or breadboard working, and only then, once you feel confident you know what you are doing, to lay out the pcb, if you want to go that way.
I guess the part I am missing is if you have already built a breadboard version, why not get that to work before proceeding with the pcb?
BTW, I am not on irc, but you can pm me if you want.

aleza


When you say you are getting "nothing", what do you mean exactly? Are you not even getting a steady red LED?
Obviously you'd get no diagnostic serial output if that's been disabled.
And how do you know which kind of RFID tag you have? The encoding type is not normally printed on the tag, so if you have random one, it could easily be ASK (instead of FSK), or a higher frequency one.
For example, I have a batch of sample tags from Parallax, and all of them are ASK (because last time I checked it was the only kind their circuit supported - might be different now).
As far as tuning, what kind of ptp peak voltage are you getting now? If it's not peaked properly, and if you are not getting 35V ptp or thereabouts, you will not get a proper detected signal.
As far as building the circuit as a pcb, sure, I would do that, but *after* you test it and get it to work as a breadboard. The reason is that it's very easy to make a few small mistakes while laying out the pcb, and the pcb looks very ugly if you need to patch it later (and the patching process may damage other traces causing more problems).
The correct process is to get the "prototype" or breadboard working, and only then, once you feel confident you know what you are doing, to lay out the pcb, if you want to go that way.
I guess the part I am missing is if you have already built a breadboard version, why not get that to work before proceeding with the pcb?
BTW, I am not on irc, but you can pm me if you want.



Edude: thanks for the reply. I need to get the osciloscope and get some readings as to better reply.

Regarding the PCB, I draw the schematic on Kicad and got the pcb, I still havent built it. The question was more oriented, since this isnt a complete experimental circuit (you tested it, and it worked fine) thats why i suggested going right into pcb.

When I am experimenting with my circuits I go with the procedure as you say.

Let me get back with more data for propper debuging.

edude

I have removed my previous post which said that, in lieu of a scope, you can use a DVM in AC voltage mode to measure the ptp voltage across the coil and peak its resonance. This is true in theory, but not in practice. AFAICT, typical DVMs cannot measure voltage or current at frequencies above a few KHz, at most, and some are limited to as low as 400Hz. Therefore, since the typical operating frequency of this circuit is around 140kHz (~7 uS per cycle), you'd need a scope to actually measure the coil's ptp voltage.
And of course, as previously mentioned, actual debugging would necessitate a scope in any case.

edude

aleza

Edude: one basic question, I am investigating with this circuit, for a project to read 134.2khz tags (animal tags) .... HDX are fsk, but is there a special tunning then to do?

edude

No, I think anything close to 140kHz should be fine, and 134 is certainly close enough.
The most important (and critical) requirement for this particular circuit is FSK encoding, since FSK and ASK encodings are very different from each other and require different decoding circuits (analogous to AM and FM radios). The exact frequency OTOH is much less critical, since (I believe) the tag is designed to work within a relatively wide frequency window (which is dictated by the reader circuit).


jordanb

Elude,
Forgive me but I'm trying to build a rfid reader just as you discussed, but I can't see any parts list or step by step. Am I missing something?

ulzii

Dear Edude, This software could not work because 7us timeroverflow service routine could not work so fast. ..
How did you test it?

chrichri101

Good day

I am having a couple of challenges with this design.

1: I had issues with the coil/cap matching, but finally managed to get a combination that yielded a 32V p-p signal.

2. I then enable debug mode so that i can get detailed info via serial, and this is where my problems are now.


2.1 I am unable to get a valid reading, here is my debug info Some bits masked with "?" to anonymize data

got buf num: 0
1/16/29/5/5/4/5/6/29/5/5/5/4/6/6/24/5/5/5/4/6/6/15/6/6/6/6/6/
5/5/5/5/5/4/5/5/5/5/5/4/5/6/6/6/5/6/9/5/5/5/5/5/6/6/5/6/6/5/
4/5/5/5/5/6/6/6/5/6/5/5/5/4/5/5/6/5/6/6/6/9/5/5/5/4/6/6/6/6/
5/10/4/5/5/5/5/6/6/6/5/6/5/5/4/5/5/5/6/6/6/6/5/5/5/5/4/5/5/6/
6/5/6/6/9/5/5/5/5/5/6/6/6/6/5/4/5/5/5/5/5/6/6/5/6/6/6/6/6/5/
6/5/5/5/4/5/5/5/5/4/5/5/5/6/5/6/6/6/6/6/5/6/6/5/5/5/5/5/4/6/
6/6/5/6/9/5/5/5/5/5/6/5/6/6/6/5/4/5/5/5/5/6/6/5/6/6/5/5/5/4/
5/5/5/5/4/5/5/5/6/5/6/6/6/6/6/5/6/6/5/5/5/5/5/4/6/5/6/6/6/5/
5/5/5/5/5/5/6/5/6/6/6/5/4/5/5/5/5/4/5/5/5/5/5/5/6/6/6/6/5/4/
?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/
?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/
5/4/5/5/5/5/5/4/5/5/5/5/5/6/6/6/6/5/6/6/6/6/5/5/5/5/4/5/5/5/
5/4/5/5/5/6/6/6/5/6/6/6/6/6/5/5/5/5/5/5/5/5/6/6/6/6/5/4/5/5/
5/5/4/5/5/5/5/4/6/6/6/6/5/10/4/5/5/5/5/6/6/5/6/6/5/5/4/5/5/5/
6/6/6/6/5/6/6/6/6/5/5/5/5/5/5/4/6/6/6/5/6/10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5/6/6/5/6/6/5/5/4/5/5/5/6/6/
6/5/6/6/6/6/6/5/5/5/5/5/4/5/6/6/5/6/6/5/5/5/5/5/4/5/5/5/5/4/
5/5/5/5/5/5/4/5/5/5/5/4/5////raw data
got a valid prefix, processing data buffer...
****got bad bit pattern in buffer, count: 0, value: 0
0/101/101/101/101/0/0/1/101/101/101/101/0/1/1/101/101/101/101/
0/1/1/101/1/1/1/1/1/1/1/1/1/1/0/0/0/0/0/0/0/0/1/1/1/1/1/
101/101/101/101/101/101/1/1/1/1/1/1/0/0/0/0/0/1/1/1/1/1/1/1/1/
0/0/0/1/1/1/1/1/101/101/101/101/0/1/1/1/1/1/101/0/0/0/0/0/1/1/
1/1/1/1/1/0/0/0/0/1/1/1/1/1/1/1/1/0/0/0/1/1/1/1/1/101/101/101/
101/101/101/1/1/1/1/1/0/0/0/0/0/0/1/1/1/1/1/1/1/1/1/1/1/1/1/0/
0/0/0/0/0/0/0/0/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/0/1/1/1/1/1/101/
101/101/101/101/101/1/1/1/1/1/1/0/0/0/0/0/1/1/1/1/1/1/1/1/0/0/
0/0/0/0/0/0/0/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/0/1/1/1/1/1/1/1/1/
1/1/1/1/1/1/1/1/1/1/0/0/0/0/0/0/0/0/0/0/0/0/1/1/1/1/1/?/?/?/?/
?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/
?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/?/
0/0/0/0/0/0/0/0/1/1/1/1/1/1/1/1/1/1/1/1/1/0/0/0/0/0/0/0/0/0/1/
1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/0/0/0/0/0/0/0/0/0/0/
0/1/1/1/1/1/101/0/0/0/0/0/1/1/1/1/1/1/1/0/0/0/0/1/1/1/1/1/1/1/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/0/0/0/0/1/1/1/1/1/1/0/0/0/0/0/1/
1/1/1/1/1/1/0/0/0/0/1/1/1/1/1/1/1/1/1/1/1/1/1/1/0/0/1/1/1/1/1/
1/1/1/1/1/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0////
buffer stats: zeroes:86/ones:355/prevs:544/errs:14




I know for a fact that i am reading the right type of rfid tag.

Attached is also some photos of scope readings for data as it goes in on the Arduino pin


Any suggestions/recommendations on what might be wrong??


chrichri101

Ok I manage to get my design working.

Firstly my digitized data posted in my prv post was completely incorrect. I managed to fix my circuit and unfortunately had to completely change the code from the interrupt driven counter to a pulse length loop. once working, I also modified the circuit and code and now I am able to detect and read FSK, ASK and PSK tags.

The code is not optimal yet, and still needs tweaking but at present I can decode all the tags I have. I did a complete write up on my project site, I have included example scope signals, my code and my circuit.

http://www.gizmolab.co.za/universal-rfid-reader/



chrichri101

My rfid reader is working, i have made some spare pcb's and have package them as diy kits with the arduino preprogramed and all the relevant components.

If anyone is interested, they can order the kits from my site
Www.gizmoshop.co.za

There is the multipass kit that can read hid and em tags, and then the petpass kit that can read animal fdx-b tags, lastly there is also a assembled petpass reader

Thanks

perasperaadastra

I want to say many thanks to edude for this awesome design! I built this circuit last summer, and it worked with an HID door fob. The trick was to tune the circuit for 125 kHz. I didn't have an oscilloscope, so I resorted to measuring V with a multimeter on a coil placed over the reader. I tried various C1 values, and eventually settled on two caps in series to get as close as possible to the desired value. I could've tuned the coil instead, but it was from a different reader, so I didn't want to modify it. I also installed a couple of trim pots for signal level adjustment, and added an LCD display to make the reader portable. It sometimes takes a few passes to read a fob, but it works in the end.

Go Up