5 comments on “RFID Reader, Day 6: Analyzing the Raw Data Part 2

  1. Hi.
    Before receive the correctly tag, I am receiving many time the mesage:

    “Errors in binary stream (a few of these messages are fine):”

    Why I am receiving this?

    • The error you get is in the code around line 225. The previous section (starting around line 127) takes recorded delta-time stamps of up and down events (raw and rawZ) and converts them into a number 1 or 2 depending on a variety of circumstances (determined via some protocol). If you look at that section, you see the following (note that I am overwriting the raw value just to save microprocessor memory)(the following bounds are in units of clock cycles):

      10 < raw[i] raw[i] = 1
      21 < raw[i] raw[i] = previous number, raw[i – 1]
      26 < raw[i] raw[i] = 2
      anything else -> raw[i] = 101, an error code

      You are getting the error code. Therefore, the signals you are getting are either too fast (less than 10 clock cycles) or too slow (greater than 50 clock cycles). I’m not sure WHY you are getting massively different times in your clock cycles. Investigate the following:

      Are you looking at a 13.56 MHz tag? This project is for ~125 kHz tags and can’t deal with them.
      Are you picking up random noise?
      Is your tag actually using the EM4100 protocol? If not, the delta-times wouldn’t necessarily be the same. And if you don’t know, then you need to debug it, learn the times you ARE getting, then investigate a variety of different protocols (in my next post, “day 7,” check out another protocol I found, the HID Corporate 1000 series protocol).
      Are you using a tag with ASK modulation? In the next post, “day 7,” I go over how to deal with FSK and PSK modulation.

      If you have access to an oscilloscope, check the timing between pulses. If not, put “Serial.print((int)v[i]);” in each if statement in lines 131-147, and “Serial.print((int)vZ[i]);” in each if statement in lines 149-165. You may be able to read out how fast your signal is that way.

      Good luck!

      • Many, many thank in help me. I am really desperate in fix my problem.

        I am using a card of 125khz but I don’t know the model. The card information tag is 0006535350 099,47286.
        Now, I will verify in osciloscope and send to you the image in your e-mail: comment-reply@wordpress.com

        The most interst is taht after some time with the erros, the cad is read.

        Again,
        Thank you helping me!!!

      • Hi.
        My reply in red below:
        I am not using your circuit because I have a other that was working with a other microcontroller but I don’t know what has inside the microcontroller.

        Samuel Oliveira.
        Skype: soliveirabrasil

      • Hi I am here again. Now with some idea where is the problem.
        Every time when I turn on the circuit with the card close of the bobine, I not receve the mesage error (Errors in binary stream (a few of these messages are fine):).

        Looking the input signal arraving to the microcontroler after the RFID circuit, if the RFID card is not close of the bobine is coming a noise with spikes.

        Do you think what I can eliminate this problem (using the software or some hardware)?
        Do you think that is possible some error in bobine calc?

        Thanks,
        Samuel Oliveira.

Leave a comment