Share this

Smart IC Card Energy Meter Design

2026-04-06 05:45:02 · · #1
Abstract: To reduce the waste of manpower and resources in electricity billing management and minimize safety risks, this paper studies the design of a smart IC energy meter. Through various technical means, the power consumption of the meter is reduced, the measurement accuracy is improved, and the meter has high reliability. It scientifically calculates electricity consumption, providing accurate billing basis for electricity users and power companies. The smart energy meter has prepayment and password protection functions, fundamentally solving the problem of difficult billing for power companies. Introduction The use of IC cards is closely related to their application systems. On the one hand, adopting IC cards can make the system operation more innovative; on the other hand, application systems will constantly put forward new requirements for IC cards, prompting them to be more functionally complete. Therefore, how to organically combine IC cards with practical applications and give full play to the advantages of IC cards has always been an important topic in IC card technology. The smart IC card energy meter is a practical application of IC card technology. 1. Structure and Working Principle of Smart IC Card Energy Meters Smart IC card energy meters integrate the traditional energy meter's mechanism and high-level measurement and control circuitry into a single casing, maintaining metering accuracy while providing automated management of the meter's operating status. They also prevent control malfunctions caused by human intervention or unauthorized activation of the IC card control system. Based on the working principle of electronic metering, the smart IC card energy meter incorporates a Siemens SLE4442 IC card controller and a PIC16C62B microcontroller to form a smart IC card control function. When the metering module sends a pulse signal or the user inserts an IC card, the meter enters the corresponding working state. First, the arithmetic control module retrieves the user's remaining energy consumption value stored in the energy meter's data storage module and displays it on the LCD screen. Next, it determines whether a metering pulse has arrived; if so, it initiates the counting and calculation function to calculate the current energy consumption. After certain calculations, it obtains the user's energy consumption during this period. Then, the user's new remaining pre-purchased energy consumption value is obtained by subtracting the current consumption value from the previous pre-purchased energy consumption value. If the value is less than a certain threshold, the meter outputs a command to turn off the switch, stopping the power supply to the user, and the meter enters a low-power standby state. At this time, the user can use their IC card to purchase electricity from the power supplier. When the user inserts the IC card containing the purchased electricity into the meter's IC card interface, the meter is activated. If the IC card is valid, the meter decrypts the pre-purchased electricity data stored on the IC card and adds it to the original remaining pre-purchased electricity value to obtain a new remaining electricity value for the user. Simultaneously, it erases the pre-purchased electricity data stored on the IC card, turns on the relay switch, and thus restores the power supply to the user. The meter then resumes metering. The remaining pre-purchased electricity value and accumulated electricity can be viewed using buttons. If the user's remaining pre-purchased electricity value is too low, the meter will prompt the user to purchase more electricity. 1.1 Operation and Control Module The smart IC card electricity meter uses the PIC16C74 as its control module. The PIC series microcontrollers were first introduced by Microchip Technology, Inc. of the United States, using a Reduced Instruction Set Computing (RISC) computer. This is a high-performance, cost-effective 8-bit embedded controller with a Harvard dual-bus and two-level instruction stream hot-wire architecture, based on the tion Set Computer. It features high speed (up to 160ns per instruction), low operating voltage (minimum 3V), low power consumption (151µA at 3V, 32kHz), and a large I/O direct LED driving capability (sinking current up to 25mA). The low price, small size, simple and easy-to-learn instructions (35-37 instructions), and excellent anti-interference capabilities of the chip all reflect the new trend in the development of the microcontroller industry. Among them, the PIC16C74 microcontroller features a static low-power sleep function and the ability to wake up and return to normal operation via internal or external interrupts. Considering economy and practicality, the ultraviolet-erasable dual in-line package (DIP) chip was used during the development and debugging phase of the smart IC card energy meter. The final product used in the field was a one-time user-programmable device (OTP). As the core component of the smart IC card energy meter, the PIC16C74 uses serial communication to connect and communicate with peripheral devices such as the IC card, EEPROM, and DS1302, simplifying the circuitry and thus reducing costs. 1.2 Metering Module The earliest electronic energy meters could only be implemented using discrete components. However, with the development of microelectronics technology, new technologies and products for energy metering have emerged continuously. Currently, dedicated integrated circuits (ICs) for various energy metering applications have been developed, such as the BL0931 for single-phase electronic energy meters, the BLo932 for single-phase fully electronic energy meters, and the GW6832PA for static electronic energy meters. Although these circuits integrate energy detection circuits internally, the design and adjustment of their peripheral circuits are relatively complex. Therefore, the HDB6 thick-film circuit, specifically designed for energy meters, was used as the energy measurement chip in this design. The HDB6 thick-film circuit for electricity meters is a modular unit circuit that integrates the metering IC and its related resistive and capacitive components onto a ceramic substrate using thick-film technology. Due to the use of thick-film technology, the circuit's insulation performance, resistance accuracy, temperature characteristics, and adaptability to external environments are significantly improved compared to conventional discrete soldered circuits. Furthermore, the high integration of the peripheral chips in the metering circuit reduces the number of surface-mount (insertion-mount) components and solder joints, improving efficiency, increasing product reliability, and increasing production capacity. The HDB6 also uses a single-row through-hole pin configuration, simplifying the internal structure of the electricity meter and facilitating assembly, debugging, and maintenance. The actual operating circuit of the HDB6 is shown below. Among them, AC— OUT1 is the live wire input of 220V AC voltage; AC_OUT is the live wire output of 220V AC voltage; DATA1 is the power pulse output after optocoupler isolation. Since 220V AC voltage cannot be directly applied to the input of the metering IC inside the chip, the required voltage and current sampling values ​​in the metering IC are obtained by voltage division using a resistor network and sampling the load current on the manganese copper alloy. The obtained voltage and current sampling values ​​are fed into a multiplier in the metering IC. The multiplier output is converted into a pulse sequence output with duty cycle reflecting transient power by a converter. R3 is a small manganese copper sheet current sampling resistor. The current sampled from R3 passes through R2 and R5 and is input to the sampling current input terminal of the metering IC. Adjustment can be made to ensure output linearity when there is a positive or negative deviation in the linearity of the small current of the energy meter. Its value depends on the position of the two terminals on R3. Current sampling resistor R3 The selection of the appropriate current sampling resistor size generally presents the following problems: if the selected current sampling resistor is too small, the chip's processing of small signals will be poor, especially the nonlinear error and starting current performance under small signals will easily deteriorate; if the current sampling resistor is too large, the over-range performance of the energy meter will be reduced due to the limitation of the dynamic range of the current input terminal. Therefore, in this design, a 370µΩ current sampling resistor was purchased along with the HDB6, so directly selecting 100µΩ R2 and R5 can basically achieve output linearity. Here, the output pulse is 3750P/kWh. C3 and C5 are used for power supply filtering. The metering IC inside the HDB6 requires +5V and -5V input voltages, so the HDB6 uses RC voltage divider, half-wave rectification, and voltage leveling to achieve power supply. By connecting C3 and C5, high-frequency signals carried by the AC power can be filtered out. In the HDB6 circuit, a high-precision watch crystal resonator is used as the clock reference source. This crystal must operate stably and reliably during normal operation of the energy meter. That is, during long-term operation, the crystal must maintain a certain oscillation amplitude range. If the crystal ages, it will cause frequency drift or stop oscillating, affecting the normal operation of the energy meter. A crystal oscillator with a resonant frequency of 32768Hz is used in the design. R, connected to pin 11, is used to adjust the relative error of the energy meter output. By selecting an appropriate resistance value, the relative error of this circuit can be controlled within the specified range. Before practical application, the accuracy of the measurement module is achieved by manually adjusting R by comparing the power meter reading with the measured power value. 1.3 IC Card Reading and Writing Interface Module The IC card reading and writing interface circuit mainly consists of an IC card slot and a protection circuit. When the card is inserted into the slot, each pin is connected, realizing serial communication between the PIC microcontroller and the IC card, and protecting the inserted card. The hardware circuit diagram is shown in Figure 3. Three I/O pins are connected to the SLE4442. All I/O ports (RST, CLK, t/o) require pull-up resistors. If the selected microcontroller's I/O ports have built-in pull-up resistors, these can be omitted. Alternatively, clamping protection diodes can be added to suppress transient overvoltages caused by line interference and edge jitter due to logic level changes. These are not necessary when the voltage is stable and interference is minimal. The smart IC card energy meter's plug-in card slot uses sliding contacts, offering advantages such as good circuit contact and reliable communication. Its card insertion detection switch K2 is high when no card is inserted; when the card is inserted, this pin is low (short-circuited with K1), allowing the microcontroller to detect the IC card insertion. The IC card's power supply Vcc should be controlled by the microcontroller; that is, power is only supplied to the IC card after it is inserted into the slot, and no power is supplied after the card is removed. Specifically, a controlled tri-state gate or transistor capable of providing the required 10mA current to the IC card is used. This effectively prevents hot-plugging and extends the IC card's lifespan. If a metal piece is inserted, the microcontroller can detect a short circuit and will prevent RAO from outputting a low level, thus de-energizing the IC card. 1.4 LCD Display Module For display control, a segment LCD display SMSO868 was selected to establish a good human-machine interface. The display module displays the current system time, user-set time, pre-stored amount, flow rate, temperature, pressure, and error messages according to different button operations. The display section uses a segment LCD module capable of displaying 8 digits and 6 sets of prompts. This module is a reflective display and communicates with the computer via a three-wire serial connection (1:1). During power-on initialization, "100" should be entered sequentially, followed by an 8-bit instruction code. The LCD is then configured accordingly. After sending the instruction code, a blank pulse needs to be sent to the CLK pin. Next, the user can convert the data to be displayed into corresponding binary display codes according to the image bit order and store them in a fixed data storage address for display. In this system, this is stored in data registers BCD0 to BCD7. When both CS and CLK are low, "101" is first input from the DI pin. Then, the code of the data to be displayed is sequentially shifted and input to the DI pin according to the timing sequence. A CS transition latches the input data for display. 2 Software Design The functions of the smart IC card energy meter are implemented with software support. Its software is written in assembly language for the PIC series microcontroller. Because programs written in assembly language are compact and efficient, the entire program is stored in the 2KB program memory of the PIC16C62B microcontroller. 2.1 Main Program The main program flow, after power-on initialization, enters the main loop: First, button detection. Then, power supply voltage detection, used to detect power failure and insufficient battery voltage. IC card detection is used to determine if a card is inserted. If the card is correctly inserted, it is identified and read/written. The energy meter pulse detection program determines whether electricity is being used normally based on the presence or absence of pulses. Appropriate processing is performed based on different detection results. After the above detections, the relevant information of the energy meter control circuit and the electricity consumption are displayed on the LCD. 2.2 The IC card detection process adopts a modular design. First, it checks if an IC card is inserted. If correctly inserted, it performs password verification on the IC card. After reading the contents of the IC card's storage unit, it identifies the card type, including initialization cards, quantitative cards, zeroing cards, and user cards. Appropriate processing is performed based on the identification results. 2.3 Power Detection The pulse detection of the power meter is essentially sampling of digital quantities. To prevent external interference, the power meter's power is sampled by detecting two pulses to determine a valid pulse. When a pulse is present, the current power is reduced by 1. When the power reaches the alarm value, a buzzer sounds an alarm, prompting the user to purchase more electricity. 3. Data Encryption Data encryption in this smart IC card power meter is achieved through operations on the password storage. The input password is verified to match the password stored in the chip. If they match, write operations to the main memory and read/write operations to the password storage are enabled; if an error occurs, a counter records the number of failed verifications. To prevent the possibility of obtaining the password through multiple verifications, a self-locking function is designed for three consecutive incorrect verifications. Meanwhile, as the information transmission carrier of prepaid electricity meters, the security of the encryption card password of the IC card is related to the confidentiality of its encrypted data. Newly purchased batches of IC cards generally have the same universal password GP. Therefore, one password per card is implemented. At the same time, how the electricity meter can securely and conveniently obtain the new IC card password NP is also a concern. The implementation steps are as follows: (1) The toll station computer system installs and initializes the toll station feature number, such as CH, ZH. The system stores the data in the encryption key module. (2) When opening a new user account, a unique ID is assigned in sequence, the intermediate password value MP=f1(CH, ZH, ID) is calculated, MP is written in the application storage area of ​​the IC card, ID is written in the protection storage area of ​​the IC card, and a new password FP=f2(MP) is generated to replace the original universal password GP. (3) When the electricity meter inserts the card for the first time, the electricity meter reads the user ID and MP, generates the new IC card key FP=f2(MP), stores the user ID and FP, and erases MP. (4) When purchasing electricity again, the system software will read the card's user ID and the CH and ZH keys in the encryption key to generate a new key FP=f2(f1(CH,ZH,ID)). After verification, the system will perform the electricity purchase and card writing operation. (5) When the electricity meter inserts the card again, the meter will first verify the FP value stored in the meter against the IC card password. Only after verification can the system read the purchased electricity amount and perform other operations. Using the above operations, the IC card electricity meter will have a new IC card password, which will remain unchanged. A one-to-one correspondence will be established between the electricity meter and the IC card stored value card. The biggest advantage of this IC card password security scheme is that the system does not store the new password for each new card. Each time electricity is purchased, a non-public algorithm can be used to generate the password based on the public user ID. This ensures that the IC card password is not leaked at every stage, thereby preventing illegal electricity use and protecting the interests of both the supply and demand sides. 4 Experimental Results Experiments show that this electricity meter features high accuracy, strong anti-interference capability, and is unaffected by power factor. Its metering accuracy reaches 0.5 class, while similar electricity meters on the market have an accuracy of 1.0 class or lower. This electricity meter did not experience any malfunctions or crashes during long-term practical use testing. Furthermore, this electricity meter is characterized by its small size, low cost, reliable operation, ease of installation and debugging, and low power consumption. It fully meets the requirements of industrial and residential use. 5. Conclusion The smart IC card electricity meter solves the problem of payment difficulties by using pulse scanning, protecting the interests of both the power company and consumers. This is a major feature of the meter's design. The hardware circuit design of this electricity meter keeps pace with the trends in the electronics market, employing a powerful PIC series microcontroller, bus architecture technology, an SLE4442 logic encryption memory card, and an LCD display circuit. Simultaneously, it addresses IC card password security, card data encryption, and data verification, proposing a new comprehensive data security scheme of "one card, one password; data encryption; two-way authentication." This scheme is simple, practical, safe, and reliable, providing a new approach for IC card prepaid meters.
Read next

CATDOLL 123CM Olivia (TPE Body with Soft Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 133CM Nanako Shota Doll

CATDOLL 133CM Nanako Shota Doll

Articles
2026-02-22
CATDOLL Q 108cm Tan Tone

CATDOLL Q 108cm Tan Tone

Articles
2026-02-22