Research on LF RFID Reader Based on STM32

Publisher:atech123Latest update time:2013-02-04 Source: 电子设计工程 Keywords:STM32  RFID  reader Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    Radio Frequency Identification (RFID) is an automatic identification technology that has matured since the 1980s. RFID uses radio frequency for non-contact two-way communication to achieve identification purposes and exchange data. It mainly realizes contactless information transmission through spatial coupling (alternating magnetic field or electromagnetic field) and achieves identification purposes through the transmitted information.
    RFID technology has made great progress in recent years. The widely used frequency bands are distributed in LF, HF, UHF and microwave bands. RFID systems in each frequency band have their own advantages and corresponding application scopes. For RFID systems in the LF frequency band, the most obvious advantage is that they have good penetration performance, such as penetrating liquid substances, buildings, human bodies, etc., and various animal cells and various gas molecules have little energy absorption in the LF frequency band.
    It can be seen that the LF RFID system can work well in places that require good penetration, need to work uninterruptedly for a long time, and have high dangers (such as mines containing explosive gases). Because of these important advantages, this paper proposes a LF RFID system based on STM32, and designs, manufactures and tests the system. The test results show that the system has the characteristics of simple implementation and high reliability.
    According to the principle of RFID system, LF system generally consists of the following three parts:
    1) Electronic tag: It should be placed on the object to be identified. In this design study, the standard 125 kHz electronic tag EM4100 in industrial production is mainly used. It has a built-in small ROM and rectifier circuit, which can realize the contactless operation of transponder and reader.
    2) Reader: It can be a read or write/read device, depending on the structure and technology used, and mainly plays the role of reading tags.
    3) Antenna: The antenna should be placed between the transponder and the reader. It mainly plays the role of a bridge for communication. Whether it is energy supply or information transmission, it must be achieved through coupling elements.

1 Overall design of the system
   
This design uses STM32 as the core of the control module. By outputting a 125 kHz square wave source, it provides a driving signal for the power amplifier circuit behind it. The power amplifier circuit provides an amplified 125 kHz square wave to the antenna load, so that the antenna load can provide enough energy for the tag and obtain the tag information at the same time. The detection circuit realizes the detection function of the tag information. After detection, it is converted by the square wave signal conversion circuit and transmitted to the STM32 for decoding. At the same time, the tag information is transmitted to the host computer through the STM32 serial port for subsequent processing. The whole system block diagram is shown in Figure 1.

e.JPG


    The difference between this system and the existing system is:
    1) It does not require a dedicated decoding chip for decoding, but directly uses the capture function of STM32 to decode the electronic tag signal after detection conversion.
    2) It uses the function of STM32 to output a pair of complementary square waves with dead zones to drive a pair of switch tubes, eliminating the need for complex analog electronic circuits to generate the same drive waveform.
    3) Drawing on the principle of the half-bridge inverter circuit in the switching power supply, the IC circuit forms a series resonance, thereby achieving power amplification.

2 Hardware Circuit Design
2.1 Power Amplifier Circuit Design
   
The power amplifier circuit is formed by two switch tubes and an LC oscillation circuit (antenna). After analysis, the power amplifier circuit design is shown in Figure 2.

f.JPG


    Among them, S1 and S2 are two PWM waves with dead zone control output by STM32 after driving chip IR2110, with a frequency of 125 kHz. In this way, the antenna L1 and capacitor C1 form a series resonant circuit with a resonant frequency of 125 kHz. The function of the resonant circuit is to enable the antenna to obtain the maximum current, thereby generating magnetic flux and obtaining a larger card reading distance.
    The antenna itself is a low-resistance device. Connecting the antenna coil to the power amplifier circuit requires estimating the antenna's equivalent circuit and quality factor to obtain the recommended capacitance value of the matching circuit.
    g.JPG
    Generally speaking, due to the magnetic field radiation of the antenna, the requirement for the Q value is about 20 to 40. Now the antenna inductance is determined according to the antenna's Q value. Some current industrial standards mainly use winding 50 Ω, Q value of 30, and fR of 125 kHz when the operating frequency is 125 kHz. From the above 3 data, the inductance of the RFID antenna can be obtained as 375 μH.
    Antenna winding: First, roughly wind a few turns, and then use an impedance analyzer to measure the inductance at an operating frequency of 125 kHz. In this design, the inductance is 89.03 μH after winding 10 turns. The calculation formula of inductance is:
    L=N2×L1(3) (L1 represents the inductance of a single turn, N represents the number of turns of the coil). From the above formula, we can get the single turn inductance of the antenna is 0.89 μH. That is, from the above inductance value, we can get the required number of turns of the antenna, which is about 21 turns. [page]

    After the antenna design is completed, the corresponding impedance matching circuit needs to be selected. Now this design mainly chooses to use CBB capacitors to achieve the purpose of impedance matching. The size of the capacitor is determined by the operating frequency of the system. The main purpose of impedance matching is to make the antenna work in the best state, that is, the antenna and the capacitor are in a resonant state.
    From the above analysis of the capacitor size calculation formula:
    h.JPG
    This formula can determine the size of the capacitor to be 4.7 μF, and the withstand voltage value of the CBB capacitor also needs to be determined based on the peak value of the oscillation waveform passing through the capacitor.
2. 2 Design of envelope detection circuit
   
The design of the envelope circuit largely determines the reading distance of the RFID reader. Its main working principle is that the low-pass filter and the diode arm work in series to filter out the high-frequency 125 kHz wave. The circuit design mainly uses series diode envelope detection, and its working principle is shown in Figure 3.

i.JPG


    The circuit is composed of a diode D and an RLC low-pass filter connected in series. When Us is input, the current i passing through D generates an average voltage UAV in the RLC circuit, which in turn reacts on D (called the average voltage negative feedback effect), affecting the current passing through the diode.
    If Us=Vcm(1+MacosΩt)cosωct, then vov=ηdVcm+ηdMaVcmcosΩ=VAV+Vov, where vov∝vΩ, so linear detection is achieved.

3 Software Design
   
The key problem to be solved by the terminal software is how to correctly receive and decode data. The electronic tag selected in this RFID system is Manchester decoding, and the output signal of the electronic tag signal after passing through the Manchester encoder is shown in Figure 4.

k.JPG


    The capture function of STM32 is used to capture the waveform after shaping. After each delay of 384μs, STM32 detects whether it is a high level. Then the previous and next levels are compared. If it is 01, it means data 0, and if it is 10, it means data 1.
    The 64-bit data in the electronic tag is sent to the comparator in NRZ serial. The so-called NRZ is baseband transmission, that is, the electrical pulse of the digital signal is directly transmitted in the line. This is the simplest transmission method. The local area network for short-distance communication uses baseband transmission. After the reverse comparator, the Manchester code waveform is output and then directly input into STM32 for Manchester decoding. Its working principle: in a data reading cycle, if the pin is high, the data read is 1; if the pin is low, the data read is 0. In general, the working process of the entire system is the Manchester decoding process.

4 Program flow chart
4.1 STM32 overall program flow chart
   
STM32 overall program flow chart, as shown in Figure 5.

b.JPG

[page]

4.2 STM32 decoding process flowchart
   
Through the analysis of Manchester decoding principle, the microcontroller mainly processes the square wave signal given by the envelope circuit to obtain the corresponding data. The following system flowchart can be obtained as shown in Figure 6.

b.JPG



5 Test results
   
The reading distance of the electronic tag is about 10 cm. Figure 7 is the measured diagram of the STM32 outputting a 125 kHz complementary square wave with dead zone, and Figure 8 is the waveform after detection and conversion. From the waveform in Figure 7, it can be seen that the output waveform frequency of the STM32 is 125 kHz, and the dead zone time is 0.9 μs, which meets the design requirements.

c.JPG

d.JPG



6 Conclusion
   
Some existing readers require a dedicated card reader chip for decoding, and the circuit is complex. This article mainly introduces an LF RFID reader that uses STM32 decoding, complementary output, and dead zone control. With STM32 as its control core, it can detect and identify electronic tag cards and process the identified information accordingly. The circuit structure is simple and has certain practical value for reading EM4100 ID cards.

Keywords:STM32  RFID  reader Reference address:Research on LF RFID Reader Based on STM32

Previous article:Design of LF RFID identification system based on STM32
Next article:Design of STM32 debugging platform based on LabVIEW

Recommended ReadingLatest update time:2024-11-16 20:47

Self-understanding of the function of reading status flag bits in stm32
In order to allow the program to read the status of multiple status flags, the firmware designs a general function RCC_GetStatus() to read the status of each flag. The following are all the RCC flags: *                       - RCC_FLAG_HSIRDY: HSI oscillator clock ready   *                       - RCC_FLAG_HSERDY:
[Microcontroller]
STM32 Series Part 7 - Basic Principles of Serial Communication
Two communication methods: 1. Serial communication Transmission principle: data is transmitted in bit order. Advantages: less pin resources Disadvantages: Relatively slow 2. Parallel communication Transmission principle: each bit of data is transmitted simultaneously. Advantages: Fast speed Disadvantages: Occup
[Microcontroller]
STM32 Series Part 7 - Basic Principles of Serial Communication
STM32's CubeMX about serial port interrupts
1. About the initialization function of the serial port:     MX_USART2_UART_Init() --- baud rate, parity and other configurations             HAL_UART_Init()---will huart- RxState = HAL_UART_STATE_READY;     HAL_UART_MspInit()---GPIO, interrupt priority and other configurations 2. When interrupt reception is n
[Microcontroller]
STM32's CubeMX about serial port interrupts
STM32 Advanced Development - Using printf to print serial port data in GCC and GNU
When you use Keil or IAR to develop STM32 and other ARM chips, you may be familiar with using print to output some data through the serial port for debugging or other purposes. However, it should be clear that although the standard C language library used by Keil, IAR and GCC follows the same standard, their underlyin
[Microcontroller]
STM32 key part
What is a pull-up resistor? Why is the pull-up resistor of a button 10k ohm? Answer: A pull-up resistor connects an uncertain signal to the power supply VCC through a resistor and fixes it at a high level. effect: 1) Increase the drive capability of the output pin (actually increase the current of the current wi
[Microcontroller]
Experience gained from microcontroller serial port processing (stm32)
       I recently developed a stm32 serial port data frame batch processing code and encountered many problems. As a new worker, I lack experience and really need to summarize it to avoid the same mistakes in the future.       The general situation is listed as follows:       1. Serial port receiving interrupt proce
[Microcontroller]
STM32 _I _0 _IO volatile const
What do __I, __O, and __IO mean? These are macro definitions in the ST library, and are defined as follows: #define __I volatile const /*! #define __O volatile /*! #define __IO volatile /*! Obviously, these three macro definitions are used to replace volatile and const, so we must first understand the role of
[Microcontroller]
STM32 uses DMA to read variable length data from the serial port to memory
First, we need to solve the problem of how DMA knows when the data to be received starts and ends. And each time the data is transmitted, the length of the next data needs to be changed. If you set DMA to circular mode, it will definitely not work, so set DMA to normal mode. The serial port of STM32 has the function o
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号