Explore non-contact IC card smart water controller design issues

introduction

With the development of the social economy, the national economy has become more and more dependent on water resources, and the shortage of water resources has become increasingly serious. On campus, the majority of contemporary students lack the ability to live independently. They do not have enough awareness of energy conservation, and there is often a waste of public water. Therefore, how to protect students' normal water use while avoiding unnecessary waste has become the focus of school logistics management services. The non-contact IC card intelligent water controller studied in this paper can not only effectively improve students' water-saving awareness, but also adapt to the current trend of campus intelligent management.

1, the principle of intelligent water controller

The non-contact IC card intelligent water controller is based on radio frequency identification technology. Here, the non-contact IC card uses the Mifare1 card from PHILIPS. When the system is working, the antenna coil connected to the internal dedicated card reader chip of the intelligent water controller will continuously emit a set of electromagnetic waves with a fixed frequency of 13.56MHz. When the Mifare1 card approaches, the LC series resonant circuit in the card will generate resonance. This causes the capacitor to charge and generate charge. When the capacitor is charged to 2V, the capacitor provides the operating voltage for the other circuits on the card as a power source, so that the data in the card can be transmitted or the water controller data can be received and saved.

Smart water controllers are used in schools that have adopted a campus card system and are installed in places where there are taps. When the user places the card in the sensing area of ​​the water controller card, the card reader chip will obtain the information on the card, and send the relevant data back to the microcontroller. The MCU controls the digital tube to display the user balance, and then judges whether the balance is greater than the unit. The deduction amount, if the balance is enough, then the control solenoid valve opens, and the water flow sensor converts the flowing water into an electric pulse signal and inputs the single-chip microcomputer. After that, the single-chip microcomputer converts the amount of water into the amount and deducts the charge by the preset rate. Dynamic real-time display of the user's current amount. When the card is taken away, the SCM automatically closes the solenoid valve and stops the water supply. The water controller then enters the standby state, displaying only the current time and the water temperature. The card consumption information can be queried by the upper computer software.

2, intelligent water controller hardware design

According to functional design requirements, the intelligent water controller hardware circuit mainly includes a main control module, a radio frequency module, a solenoid valve control module, a flow measurement module, a display module, and the like. Intelligent water controller hardware block diagram shown in Figure 1.

2.1 main control module

The main control module consists of a single-chip microcomputer and its peripheral circuits. By comprehensively considering factors such as memory capacity, I/O port number, and development cost, the 8-bit microprocessor STC11F16XE developed by Hongjing Technology Corporation was selected as the single-chip chip in this design. STC11F16XE instruction code is fully compatible with the traditional 8051, its speed is 8-12 times faster, and the price is low. This processor has 16kbytes of FLASH read-only program memory that can be erased and written more than 100,000 times on-chip, enough to load the program, without expansion. Containing 1280 bytes of RAM and 32 kbytes of EEPROM, the specific parameters required by the system can be saved, and data can be manipulated even after the power is turned off, thereby greatly reducing circuit complexity and reducing development costs. There are up to 40 I/Os on the chip, and each I/O port drive capability can reach 20mA, which can meet the requirements of the system's multi-module interface. Its internal circuit also introduces the watchdog function, strong anti-interference ability.

The STC11F16XE chip is connected with RF, electromagnetic valve control, flow measurement, temperature sensing, clock, display, and communication function modules. It is the control core of the entire water control system circuit. Interface circuit of the port of the one-chip computer and other module are shown as in Fig. 2.

2.2 RF Module

The corresponding reading and writing device matched with the Mifare1 card includes a card reading and writing component and a special reading card chip. Due to the miniaturization design requirements of products, only reader chips are considered. Since the design uses a parallel interface for data transmission, the RF module reader chip is determined to be MFRC500.

The MFRC500 is a small Mifare card RF base station with a maximum operating distance of 10 cm. Its functions include modulation, demodulation, RF signal generation, security management and anti-collision mechanisms. The internal structure of the MFRC500 can be divided into RF area and interface area. The RF area includes a modem and power supply circuit and is directly connected to the antenna. The interface area has a port connected to the MCU and also includes a transceiver connected to the RF area, and the 64B. Data buffer, EEPROM for storing three sets of register initialization files, write-only memory for storing 16 sets of keys, password mechanism with three verifications and data encryption, anti-collision prevention anti-collision module and control unit.

The MFRC 500 modulates the transmission data according to the setting of its register, and first obtains the transmission signal, and then transmits it in the form of an electromagnetic wave of 13.56 MHz through the antenna driven by the antenna driving pins TX1 and TX2. At the same time, Mifare cards in their RF range respond with load modulation of the RF field. After receiving the card's response signal, the antenna is sent to the receiving pin RX of the MFRC500 through the antenna matching circuit. Finally, the receiver inside the chip demodulates and decodes the received signal and processes the data according to the setting of the register. Sending data to the parallel interface D0-D7 is read by the microcontroller.

2.3 solenoid valve control module

In this design, a 5V bi-stable solenoid valve is used to control the water flow-off. Due to the limited drive capability of the microcontroller I/O port, and the fact that the solenoid valve will cause significant interference to the microcontroller, an additional drive circuit is required. Taking into account the use of a combination of transistors, but this circuit composed of discrete components is cumbersome, and the success rate is not high, so the use of integrated chip L9110, so that the cost of peripheral devices to reduce the overall reliability. The L9110 is a two-channel push-pull power amplification ASIC designed for controlling and driving motors. Its wide power supply voltage range is 2.5V-12V, each channel has a continuous current output capability of 800mA, and the peak current capability is Up to 1.5-2.0A. It is compatible with TTL/CMOS output levels and has good noise immunity, allowing direct connection to the microcontroller.

2.4 Flow Measurement Module

The design flow metering module is mainly to install sensor parts on the ordinary water meter, and collect and process the flow signal. By contrast, although photoelectric sensors and Hall sensors have high sensitivity and no contact, they all have high power consumption, increase system power supply complexity, and are susceptible to power interference. The reed sensor only consumes a small amount at the moment of contact, but its physical structure is flawed and affects the accuracy of data acquisition. Therefore, a double reed sensor is used, two reed pipes are installed at a certain angle near the meter counting dial, and the magnet is mounted on the meter counting plate. When the counter rotates and the magnet rotates close to the reed switch, the reed contact pulls in; when the magnet moves away, the reed contact opens and a pulse signal is sent out. When the counting plate rotates one revolution, both reed pipes have a pulse signal, and the phase difference of the two signals is the same as the angle of the two reed pipes installed. At this time, the single chip microcomputer registers the amount of water once. This design can effectively reduce the measurement error caused by the water supply pipe problem, and can prevent the strong magnetic interference intelligent water controller from working normally.

2.5 Display Module

The system displays the current time and water temperature in the standby state. When using swiping water, it is necessary to display the consumption balance and temperature, because these parameters only need to display the numbers. From the perspective of product cost, only the LED digital tube display can be used. The design adopts an eight-segment seven-segment digital tube display. The first two digits of the digital tube are used to display the current water temperature in standby mode, and the last six are used to display the time; the first two digits are used to display the current water temperature when the card is swiped, and the last six are the current IC cards. The balance can be exactly to the minute. In addition, four keys are needed to adjust the time to ensure accurate travel time. In order to save the port of the one-chip computer, adopt the serial communication way to drive the specialized digital tube chip HD7279 in the design. The chip is a chip with a serial interface, without the need for external components can be directly driven 8-bit common cathode digital tube and scanning 64-key matrix keyboard (or 64 independent LED) intelligent display driver chip. Its internal contains BCD decoder, can directly accept BCD code, and has the ability to identify a variety of instructions, such as blanking, blinking, left shift, right shift, segment addressing and so on.

2.6 Clock Module

The clock module selects a typical serial real-time clock chip DS1302. The temperature detection module uses a DS18B20 integrated temperature sensor. The communication module uses RS232 serial communication to achieve communication between the water controller and the host computer. The alarm module circuit is mainly composed of a PNP transistor and a buzzer. The composition of the device is not described in detail here due to limited space.

3, smart water controller software design

After the hardware circuit is determined, there must be software support to realize the function operation, and the design of the software directly affects the performance of the intelligent water controller. This design adopts C51 language to write the program, this program adopts the modular design method according to functional design requirements, including main program, card operation function program, data display function program, solenoid valve control function program, consumption processing function program, data storage function program , Data upload function program. Each function program consists of several functions. The main program includes the initialization of the SCM, the display cache, and the MFRC500 initialization system initialization program. The main program flow chart is shown in Figure 3.

4、Intelligent water controller technical parameters

According to the design of this paper, the prototype developed in addition to the realization of functions, but also refer to the CJ/T133-2001 "IC card cold water meter" of the People's Republic of China town construction industry, the prototype is placed at a temperature of 5 °C -110 °C, relative humidity is 5 The main parameters were tested in a test environment of %-75% and atmospheric pressure of 86kPa-106kPa.

Tests show that the non-contact IC card intelligent water controller can operate normally continuously with a normal operating voltage value of 9V, a static power consumption of approximately 0.5W, a maximum dynamic power consumption of approximately 1W, and a base-table display error of less than ±0. 5%.

5. Concluding remarks

This article mainly discusses the design of non-contact IC card intelligent water controller. According to the design requirements of the intelligent water controller, the STC11F16XE is used as the main control chip, and the integrated design of the peripheral interface circuit such as the radio frequency card reader MFRC500 and the solenoid valve control is completed. This kind of prototype can display the current time and water temperature normally, and can control water consumption normally. It can also save user's consumption information and upload it to the upper computer. The technical parameter test results show that this design scheme is feasible and the system is stable in operation and can meet the measurement accuracy requirements.

Abnormal Shape Graphite Pieces

Abnormal Shape Graphite Pieces,Liquid Graphite ,Carbon Graphite Powder ,Isostatic Graphite

Graphite & Products Co., Ltd. , http://www.nbgraphite.com