With the development of science and technology, economy and the adjustment of national energy policy, the mode of "central heating and household metering" has become the preferred mode in urban heating systems, so heat meters have been widely used in heating systems. However, since the heat metering and charging of this mode involves the direct interests of thousands of households and the heating situation is complicated, it is difficult for heating companies to charge. MFRC522 is a contactless IC card reader and writer base station chip newly launched by Philips, which is used in 13.56 MHz contactless communication systems. The heat meter prepayment module based on MF RC522 designed in this paper uses radio frequency IC card as the carrier of information to store the purchased heat. After the heat meter reads the data in the card, it clears the data in the card, realizing the consumption mode of "buy heat first, use heat later", creating conditions for solving the difficulty of heating charging, improving residents' awareness of saving and improving resource utilization.
1 Composition and working principle of prepaid module
The heat meter is used to measure and display the energy released or absorbed by water flowing through the heat exchange system. It calculates the heat released by the system by collecting the temperature of the water inlet and outlet and the water flow rate. The prepayment module is set up to achieve "buy heat first, use heat later". The prepayment module based on MFRC522 is shown in Figure 1.
System working principle: When a card reading operation is required, the key circuit first wakes up the single-chip microcomputer from the low-power mode. After receiving the valid card reading information, the single-chip microcomputer turns on the power of the radio frequency card reading and writing circuit, responds to the IC card request entering the radio frequency field, and communicates after determining that there is an IC card of this system, reads the calorific value in the card, adds it to the original calorific value of the heat meter, stores the purchased calorific value and the existing calorific value, and clears the calorific value in the IC card. At the same time, the LCD display shows the IC card number, the calorific value purchased this time, and the calorific value of the heat meter. If the calorific value in the heat meter is 0 before reading the IC card, and the existing calorific value is greater than 0 after reading, the power of the valve control circuit is turned on, and the operation of opening the water inlet of the heating pipe is executed. When the microprocessor detects that the valve is effectively opened, the power of the valve control circuit is turned off. After the system scans the radio frequency field for a period of time, it turns off the power of the radio frequency reading and writing module.
When the existing calorific value in the heat meter is equal to 0 KJ, the system will turn on the power of the valve control circuit and execute the operation of closing the water inlet valve of the heating pipe. When the microprocessor detects that the valve is effectively closed, it will turn off the power of the valve control circuit.
2 Hardware Design
The hardware of the heat meter prepayment module is mainly composed of a microprocessor, an IC card reading and writing circuit, a valve driving circuit, a button and a display circuit.
2.1 Microprocessor
Since the heat meter is a battery-powered instrument, one battery needs to work for more than 5 years, which places strict requirements on the low power performance of the microprocessor. MSP430F149 is a 16-bit ultra-low power microcontroller launched by TI. Its power supply voltage range is 1.8~3.6 V. The working current is only 0.8 μA under sleep conditions, and it only takes 6 μs to wake up from sleep mode. It has 6 data ports, P1 and P2 ports can all be used for external interrupt processing, 2 serial port communication modules, and these two serial ports can be set to UART mode or SPI mode through software. The 5 energy-saving modes are very suitable for use in ultra-low power products. Therefore, MSP430F149 is selected as the microprocessor of this system.
2.2 RF IC card reading and writing circuit
The main function of the radio frequency IC card reader circuit is to complete the identification of IC cards, read the data in the card, clear the data in the card, etc. The circuit is mainly composed of the MFRC522 base station chip and its matching antenna. MFRC522 is a contactless low-power reader-writer base station chip newly launched by Philips. The card reader chip fully integrates all types of passive contactless communication methods and protocols under 13.56 MHz, supports all layers of ISO14443A, can easily read Mifare 1 S50, S70 and other cards, has three interface modes: SPI mode, UART mode, I2C mode, and can communicate with various types of MCUs.
MSP430F149 has an SPI interface, so the communication between the RF base station chip and the microprocessor in this system adopts the SPI method, and the typical application circuit shown in Figure 2 is used. The circuit is mainly composed of a power control circuit, a low-pass filter circuit, a receiving circuit and an antenna matching circuit. The antenna in this design adopts a direct matching antenna method. The power control circuit (R15, R16, R17, Q5, Q12) makes the on and off of the RF circuit power supply in a controllable state. The RF IC card circuit is powered only when the card needs to be read. When the card is not needed, the power supply of the RF IC card circuit is disconnected to reduce the power consumption of the system. The low-pass filter circuit (L1, C17; L2, C20) is set to suppress the high-order harmonics generated by the quartz oscillator in the system circuit. The receiving circuit (R25, R26, C13, C14) is used to receive the return signal, and the values of the resistor, inductor and capacitor are recommended. The function of the antenna matching circuit (C15, C18, C19; C23, C22, C21) is to tune the antenna to the optimal value. When selecting the specific value, the value of the capacitor should be comprehensively considered based on the length and width of the designed antenna and the inductance of the antenna.
2.3 Valve drive interface circuit
The valve control circuit and low-voltage electric valve cooperate with the IC card reading and writing circuit to realize the prepayment function. It is the actuator of the prepayment system and completes the opening and closing control operation of the heating pipe. The circuit is powered by a separate power supply, and the single-chip microcomputer only needs to provide relevant operation signals. It is mainly composed of a power supply circuit, a drive circuit and a low-voltage electric valve, as shown in Figure 3. [page]
The low-voltage electric valve uses the electric copper ball valve of Tianjin Zhufeng Valve Factory. Its hot water working temperature is 0~100 ℃, the working voltage is DC 3V~6V, and the valve control leads to 4 wires, namely the valve opening wire, valve closing wire, ground wire and feedback wire, which is very suitable for this system. The working process is as follows: when the valve opening wire and the ground wire are connected to the power supply, the valve automatically rotates to the fully open position and the internal power is automatically cut off; when the valve closing wire and the ground wire are connected to the power supply, the valve automatically rotates to the fully closed position and the internal power is automatically cut off; when the valve is opened or closed, the feedback line will output a high level; when the valve is opened or closed, the feedback line outputs a low level, so it is very simple and efficient to control with a single-chip microcomputer.
The power supply of the valve control circuit is mainly composed of a battery and a power supply voltage detection circuit. The power supply is a 3.6 V battery. Since the minimum operating voltage of the motor is 3 V, a 3.1 V voltage detection chip is used. When the power supply voltage is lower than 3.1 V, the microcontroller interrupt is triggered, the system will close the water inlet valve, and prompt the user to replace the power supply of the valve control circuit.
The driving circuit mainly controls the rotation direction of the valve motor. When the valve needs to be opened or closed, the corresponding circuit can be turned on. When it is detected that the valve has been opened or closed, the power supply of the circuit is turned off to reduce power consumption. As shown in Figure 3, the valve closing circuit (Q2, Q7, Q11) is controlled by the CLO_M terminal. When CLO_M is at a high level, Q2, Q7, and Q11 are turned on, the valve closing terminal is at a high level, and the valve opening terminal is at a low level, and the valve closing operation is performed. When it is detected that the level of the feedback terminal becomes low, the CLO_M terminal is low and the power supply is cut off; the valve opening circuit (Q9, Q10, Q3) is controlled by the OPEN_M terminal, and the working process is similar to the valve closing process.
2.4 Button and LCD display circuit
The main function of the key circuit is to wake up the microprocessor from low power mode and perform card reading. The key circuit of this system uses a simple keyboard composed of 1 resistor, 1 capacitor and 1 key. The output end of the key circuit is connected to the port with edge interrupt function of the microprocessor. When the key is pressed, the microcontroller interrupt is triggered to perform the card reading operation. The resistor in the circuit is a current limiting resistor to prevent the current in the circuit from being too large to damage the port of the microcontroller. The function of the capacitor is to eliminate key jitter.
The LCD display module displays information such as the card number, current heat, and the heat purchased this time. Considering the low power consumption of the system, the LCD12864 chip is selected, and its circuit is shown in Figure 4. It can work at a voltage of 3 V and can display not only English characters but also Chinese characters, achieving full Chinese display of information. Without turning on the backlight, the typical value of the working current is only 1.2 mA. When the module power is turned off when not displaying, the display module consumes very little energy, which is completely suitable for battery-powered low-power systems.
3 Software Design
The software adopts modular design, including main program and interrupt service program. The interrupt service program is shown in Figure 5.
After the main program completes the initialization of the system and other operations, it enters the low-power mode and waits for interruption. The key interrupt service program completes the card reading function, valve switching and other operations. For this prepaid module, the design of the key interrupt service program is mainly the key interrupt service program. In this key interrupt program, the timer is used to control the opening time of the radio frequency card, so that the software operation is more reasonable, the power consumption is small, and the execution efficiency is high.
The heat meter prepayment module designed in this paper takes MFRC522 as the core and realizes the prepayment function in combination with electric valves. By using the interrupt method in software and adding the power control terminal in the hardware circuit, the power supply is controllable, thereby reducing the power consumption of the system, achieving low cost and high efficiency of the system, and realizing the full Chinese and standard dimension display of information. The module has the characteristics of low power consumption and stable operation. It can be easily transplanted to other systems, thereby improving the performance of the product and has a high reference value in practical applications.
Previous article:High Power Factor Power Supply Based on MSP430
Next article:Design of portable terminal for wireless ward call system based on ZigBee
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Download Keysight Technologies' e-book "X-Apps Treasure Map: Essential Measurement Apps for Signal Analyzers That Accelerate Tests" and receive a gift!
- ELEXCON 2022 Shenzhen International Electronics Exhibition will open on November 6 (new schedule), hurry up and get your tickets! There are also many gifts waiting for you!
- Registration reminder: In the last few hours, 100 sets of Pingtouge RISC-V ecological development boards worth 390 yuan will be given away for free~
- Python Learning Handbook (4th Edition)
- Small Automotive Front-End 16W Power Supply Reference Design
- What is stray capacitance
- Autodesk EAGLE Trial Record
- Wireless and RF Design Guide: Spread Spectrum Communications Overview
- I have a question about the voltage regulator.
- GigaDevice GD32E231 DIY Competition Finalists