After seeing some people create their own discrete (well, OP-AMPs are discrete nowadays, right?) RFID readers, I wanted to give it a try.

I first started by creating a simple, non-filtered, non-processed reader. I’ve used a coil of about 1mH for both sides. Since my chosen frequency was 125 KHz, my capacitor should be 1.62nF according to the following equation; I picked 1n5 standard value.

Equation 1

So this configuration is probably one of the simplest forms of an RFID reader-tag pair:

RFID Reader-Tag Pair

Figure 1

L1 is driven via a low-impedance 125 KHz oscillator, can be a sine or a square wave since the LC circuit will filter out the unwanted harmonics that are presented in a square wave. If the Q of the inductor is high, then a voltage that is greater than the oscillator’s output is going to be present in the “Out”. I’ve seen 100 Vpp when I fed the LC circuit with 5Vpp!

So, the “Out” waveform at the top of the C1 is a sine wave of a 125 KHz frequency. Now, the fun thing begins when we put the tag near the reader. L2, C2 pair picks up the 125KHz waveform via L2. So, if you scope C2, you will see 125 KHz sine wave. Now, if you scope “Out”, you will see that Vpp at C1 will drop when we close the switch SW1. That is because we load L1′s magnetic field via L2. Now, push the button like you are sending a Morse code and watch the “Output” waveform on the scope. Aha, modulation!

Simple! That is how real RFID passive tags work. However, instead of sending Morse code, they modulate the signal with their specific modulation scheme. I am going to work with EM4100 protocol since it is widely used.

Okay, let’s bring some real circuitry here.

Figure 2

Ignore those jumpers (JP1 and JP2) since they are PCB  jumpers that I needed when making a single-sided PCB.

OK, L1 and C6 are our main guys. They are the components that are mentioned before as “L1″ and “C1″ in Figure 1. The circuitry on the left side of L1 is used to drive this LC circuit, and right side of C6 is used to read the changes in the signal.

C1 AC couples the clock signal of 125KHz to the circuit. R1 and R2 biases the transistor Q1. R4 limits its base current. Q1 drives the input of push-pull follower formed by Q2 and Q3. A push-pull follower will drive the signal at low output impedance. D2 and D3 prevents distortions at the cross-overs from zero level.

Now, our signal at “TP1″ is something like this, with no processing and modulation:

Scope Shot 1

We are going to use an “envelope detector” formed by D4, C8 and R13. After the recovery, this is how our “modulated” signal looks like:

Scope Shot 2

Of course, these measurements are made with the tag almost touching the reader. If we move the tag away about 5 cm from the reader, we may not be able to see the signal even with the oscilloscope. So, we have to filter and amplify this signal and make it ready to be processed by a microcontroller later on.

As you can see above, the signal we are dealing with is an AC signal. To deal with AC signals with the OP-AMPs, you need either a dual supply which goes to negative (for example -12V, +12V), or you need a virtual ground. We are going to assume that half point of our supply voltage is ground. So, if we are using a 5V single supply, our half point is +2.5V. If +2.5V is ground, then +5V is our new +2.5V and 0V is our new -2.5V. There you have it, a dual supply. We need the output impedance of this supply low, so we use an OP-AMP to buffer the +2.5V point which is high impedance due to R15 and R16, and we get a low impedance output as shown:

Figure 3

OK, now that we have solved that problem, let’s go back to our filter design. We have a square wave at certain frequency that we want to boost. While boosting the desired frequency we want to kill the other frequencies. But we see a bump there; square wave. A square wave is a signal that includes lots of harmonics (theoretically; infinity) of its actual frequency. These harmonics are hidden in the rise and fall waves, sharper the rise and fall, more the harmonics count. So, that means, if you low pass filter a square wave -that is not letting higher frequencies to pass a filter, you delete those harmonics and remember, those harmonics are in rise and fall times. Thus, you end up with a sine wave. We do not want that, that’s why we are going to let these frequencies pass as the way they are, however we are going to boost the original frequency. To do this, we have a filter design like follows:

Figure 4

“SignalOut” is our input coming from the envelope detector. C2 and R3 form a high pass filter to AC couple the input, and D1 protects the non-inverting input of the U1:A from over-voltage. You may say that it is not needed as the capacitor C2 will not allow any DC voltage through, you are correct. But only in steady state, if the capacitor is discharged, then it will let DC until it is charged. By the way, think +2.5V point as a “ground” point, since it is a virtual ground. C5 and R10 AC couples the output from U1:A in case of any DC offset. Then, this signal is filtered again, resulting in more amplification. Here is a graph showing the transfer characteristics of these filters:

Graph 1

Here is the waveform at the output node, pin 7 of U1:

Scope Shot 3

Yay! We have a filtered, clean output! But not so fast, because we need logic output. This is done easily by a comparator. Normally, OP-AMP comparators compare the input with a reference voltage, generally half the supply voltage. However, this may not work well if the rise and fall times of the input waveform is not in symmetry or close enough. Let’s demonstrate that with a reference voltage of half the supply:

Graph 2

The input signal has a loooong fall time. It should fall down at 3ms point ideally, since this is a recovered, however badly distorted ~43% duty cycle square wave -well at least let’s assume. See how the output waveform is a ~56% duty cycle square wave. We do not want that.

What you have to do is simple, compare the input signal with its average. How do you find a signals average? That is simple too -put it into a low pass filter, and here is the output:

Graph 3

Now let’s look at our case and apply:

Figure 5

Again, ignore the jumper JP4, that is for PCB. Let’s look at R14 and C10, we have selected them so that we have a good averaging (should I say weighted?) level for both 1KHz and 2KHz outputs we will have. This is the final output, isn’t it great:

Scope Shot 4

Finished PCB:

Finished PCB

Front Side

Back Side

I have used KiCad to draw the schematics and PCB, and I am fascinated by the usability of it. Before, I was using Proteus from Labcenter Electronics UK, however, KiCad is cheap and more usable. I will use ISIS as my circuit simulator (not spice), though. Here are the design files:

  • Schematics in PDF form is here.
  • KiCad project files in zipped form is here.
  • KiCad project files are here.

I am going to cover the digital section, that is the decoding part of this signal, in an another post. One little hint; it is Manchester coding! Until then, feel free to comment and share.

Be Sociable, Share!

    32 Thoughts on “Simple RFID Reader Module Design

    1. Genius

    2. djadameve on May 31, 2012 at 14:11 said:

      Lovely descriptive post, very nice. Was thinking about using a 555 in my circuit, filtered output, but couldn’t figure how to modulate properly. Don’t need to conform, just need a tag and receiver that interface, was thinking about maybe a frequency modulated carrier, something like 50mhz with 5 khz cw modulation. Then having a tuned receiver and demodulator. But you seem much more smart than Mr, so I await your next post!

    3. Thank you for showing that RFID is not as complicated as it may seem.

      Does your RFID reader work with AVRFID tags?
      AVRFID tags can be programmed to emulate EM4102 cards.
      (See http://scanlime.org/2011/05/duct-tape-rfid-tag-1/ ).

    4. Pingback: Scratch-built RFID reader - Hack a Day

    5. Pingback: Belgaum news | About Belgaum | Belgaum information | Belgaum district | Belgaum city | Belgaum Hotels | Belgaum People | Belgaum tourism | Belgaum entertainment | Belgaum students | Inside facebook | Hack | make use of | technical news | | Scratch-built R

    6. Great work! There are a couple things to point out though, you probably already have fixed these.
      The PNP Q3 is in the schematic backwards. Also, the op amp filters are not doing too much, a pair of RC high pass filters would do the same. The HF rolloff seen is the bandwidth of the amplifier. As your carrier is 125kHz, you would likely need to allow the third harmonic through to keep a “square-ish” signal, suitable for slicing into digital, so a 400kHz cutoff would work OK. The 1MHz BW of the LM324 does this effectively too, But the T networks in the feedback do nothing other than load the amplifier at high frequency. Try using TI filter pro or similar software to design a 2nd order MFB type LPF at 400kHz, use Bessel so the phases of the harmonics do not misalign.
      You could a a crystal oscillator. Use 16MHz crystal and a 74HC4060, Q9 out should give exactly 125kHz.
      Great job!

      • Thanks for the great info and the notice on the typo!

        I am going to try to improve my filter and really want to learn more about OP-AMP active filters.

        I do not understand one thing though; are you offering to amplify the input signal before envelope detection?

        Thank you so much for the comment!

    7. Agent24 on September 8, 2012 at 01:04 said:

      Great project, I might build one myself too – and good to see another KiCad user!

    8. I’ve made the same thing, but using parallel LC circuit. My schematic looks like this:

      I fed output of this circuit to the internal comparator of ATmega48. Carrier is generated using Timer0 in PWM mode.

      Schematic works fine with oscilloscope too, but I’m failing to decode manchester coded data…

      Here is the schematic:

      http://embedderslife.files.wordpress.com/2012/09/rfrdm.gif

      • I will post a tutorial and detailed information about decoding the modulated signal. It is going to be for PIC microcontroller, written in C, but I am sure you are going to be able to port it to AVR.

        However, it will take me a while to have some free time from the work.

        • It would be great to see a working example of such a decoder.

          But so far I think I have decoding problems mainly because of wrong setting of reference voltage for the comparator.

    9. Pingback: Scratch-built RFID reader | vis a vis | visual mind

    10. This is truly amazing, you’re obviously very clever!

      How did you get so good at electronics? Can you recommend any books where I could learn quickly and get cracking on some awesome projects, such as yours?

      Thanks in advance

    11. LEONIDAS BACHAS on September 17, 2012 at 11:43 said:

      Thank you for sharing this.
      Is it possible to post any information for the coil construction?
      coil diam or dimentions, wire thickness, no of turns.

      • It is not really that critical. However, my coil is 10cm*10cm. I don’t know the number of turns, but wire thickness is about 13 thou, that is 8AWG? Just wrap the coil until it reaches 10mH.

    12. Electron plumber on September 18, 2012 at 03:40 said:

      Excellent work, this is how a circuit walkthrough/explaination should be written and presented. It was clear, concise and didn’t try to bamboozle readers with excessive jargon and technobabble.

      It may be a simple circuit for the greybeards but for the rest of us mere mortals really do appreciate the effort made to explain exactly how each part works and why it’s in there.

    13. MURTHY B on November 10, 2012 at 14:33 said:

      I MUST THANK THE WRITER FOR UNRAVELING THE MYSTERY OF RFID TAG AND READER at one stroke IN A SIMPLE PRESENTATION AS THIS WITH THE VIVID DELINEATION OF A POET AND A CRISP FACTS OF AN ENGINEER COMBINED IN ONE.—–BEENA -INDIA

    14. Petus on January 9, 2013 at 14:21 said:

      Fantastic learning material! I am waiting for the rest. Please, I need this!

    15. Daniel Trivino on February 8, 2013 at 08:01 said:

      Nice project excellent explanation

      Can you guide me on how to implement a passive rfid system that reads a tag 1 meter away from the antenna?

      Daniel

    16. mopsiok on July 3, 2013 at 19:04 said:

      Hi
      I’m very impressed by what you’ve done and presented here! I designed an SMD version of PCB (in fact, high voltage caps are in THT) and it works quite good, but my antenna range is just ~1 cm (~0.4 inch). Of course its inductance is calculated to resonance with capacitor (I haven’t got any inductometer, unfortunately). I also tried with an RFID dedicated antenna (~736uH) with 2.2nF cap, but the range is the same.
      Could you tell me what’s your range? My supply is 5V from ATmega’s voltage regulator, but I tried 12V too – still the same range.

      Best regards and hope you answer soon :)

      • Hello mopsiok,

        Thanks for your feedback!

        My working distance is somewhere near 12 cm with the card and antenna shown in the above picture. Using a keyfob RFID tag, the range drops down to 5 cm.

        What is your peak to peak carrier voltage on the inductor(antenna)? As it can be seen by the scope shot above, mine is about 42 volts.

    17. pstrag on October 25, 2013 at 12:54 said:

      Hello Abdullah !
      Why You have used LC series resonance, not parallel? In series resonance LC tank is like short-cut, but if connected parallel, it has very high impedance (so most of time it is not using a lot of energy).
      Is there any reason, most of this kind of project use series resonance?
      Thanks!

      • Hello,

        Actually, I had no idea about this, I did not do this on purpose. I just copied the circuits on the web..

        Thank you for the info, and also, if you create and test a better circuit, please share with us!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Post Navigation