Design of Intelligent Water Level Meter Based on MSP430 Single Chip Microcomputer

Publisher:创新火箭Latest update time:2011-10-28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the continuous development of microelectronics and computer technology, the instrument structure has undergone a fundamental change. With microcomputers as the main body, computer technology and detection technology are organically combined to form a new generation of "intelligent instruments". Compared with the conventional measurement circuits of traditional instruments, great progress has been made in terms of measurement process automation, measurement data processing and functional diversification. Intelligent instruments can not only solve problems that are difficult or impossible to solve with traditional instruments, but also simplify instrument circuits, improve the reliability of instruments, and more easily achieve the goals of high precision, high performance and multi-functions. Water level monitoring is widely used in many fields such as water conservancy, electricity, urban water supply, and flood control. However, the current water level observation method is not accurate enough and cannot be fully automatic and real-time dynamic monitoring. Therefore, based on a comprehensive study of the actual situation and characteristics of current water level monitoring, it is of great practical significance to design and develop a multi-mode intelligent water level meter with good versatility, high reliability, and convenient maintenance, which can be applied to a variety of monitoring environments, using modern electronic technology, especially single-chip microcomputer technology and sensor technology.

1 Intelligent water level meter system composition
The intelligent water level meter is based on a single-chip microcomputer and consists of a main control system, a water level acquisition module, a data storage module, a control display module, and a host computer communication module. It completes functions such as water level measurement, storage, control, and real-time display. It can also be used as a terminal to communicate with the host computer through the serial port of the single-chip microcomputer to achieve terminal remote control and water level telemetry. The block diagram is shown in Figure 1.

a.JPG


The main control system controls each module and is the basis for the normal operation of each module. It is mainly completed by the single-chip microcomputer.
The water level information acquisition module is the core part of the water level meter. The accuracy of the collected water level information is an important parameter for measuring the quality of the water level meter. It is completed by sensors, analog-to-digital conversion, and single-chip microcomputers. The data storage module is completed by external non-volatile memory and single-chip microcomputers. The water level meter collects water level information regularly and saves it in the external memory. The records can be read out through the LCD screen.
The control and display module is completed by the keyboard and LCD screen to provide a human-machine interface.
The communication part with the host computer is a necessary condition for the intelligent instrument, which is mainly realized by the serial port part of the MAX3485 and MSP430 single-chip microcomputers.

2 Implementation of the functions of each module
2.1 Main control system
The main control system controls the power supply, enablement, and operation of each module. It is the basis for the normal operation of each module and is mainly completed by the MSP430 single-chip microcomputer. Compared with
the MCS and PIC series, the MSP430 series single-chip microcomputer is an ultra-low power, powerful 16-bit single-chip microcomputer. This system uses MSP430F435, with an operating voltage range of 1.8 to 3.6 V; 5 power-saving modes, power consumption current of 0.1 to 400 μA per 1 MHz, and only 0.8 μA when LCD display is realized. In addition, the MSP430 microcontroller has rich on-chip resources and high integration, which can meet the volume power consumption requirements of intelligent telemetry terminals.
2.2 Data acquisition module
The water level information acquisition module is the core part of the water level meter, and the accuracy of the collected water level information is an important parameter for measuring the quality of the water level meter. The water level acquisition module is mainly completed by ADS1110 and sensors. ADS1110 is a precise, continuously self-calibrated serial A/D converter with differential input and up to 16-bit resolution. The measured voltage error is 0.001 V with high accuracy. Its serial interface is the I2C bus. The microcontroller can be connected to the ADS1110 through software simulation of the I2C bus. The specific method is to connect the I/O interface of the microcontroller to the data line SDA and clock line SCL of I2C. The transmission of clock and data is controlled by software. The water level acquisition process is shown in Figure 2. [page]

b.JPG


2.3 Data storage module
The water level data storage module and reset circuit are implemented through X4043. X4043 also uses I2C interface, and the SDA and SCL connection methods are the same as ADS1110.
The water level meter records once an hour, and the buffer can retain 24 records a day, and the new information overwrites the old information. Each record consists of the water level value and the sampling time.
The water level information saving program flow chart is shown in Figure 3.

c.JPG


When saving data, save the water level value first, then save the time. When determining the save address, add the offset to the initial address. The offset is the data length multiplied by the number.
In the timer interrupt, every hour, the timer will set the flag variable for saving data to be valid. In the main loop, if the flag is valid, call the function to save the water level information.

[page]

2.4 Control and display module
The control and display module is completed by keyboard, LCD12232 and SD2300, providing human-machine interface. The keyboard can set water level meter parameters, installation height, error, range, etc. When a key is pressed, the water level meter displays the corresponding menu. When not in the setting state, the water level meter terminal displays the main interface: the upper line displays the current water level, and the lower line displays the real-time time. The intelligent water level meter reads the SD 2300 time at startup, and then ensures the time update through the timer interrupt.
2.5 Communication module with the host computer
When working, a host computer and multiple water level meters can be connected on a bus to realize multi-point water level collection, as shown in Figure 4. The water level meter communicates with the host computer through the serial port of the single-chip microcomputer. The host computer can obtain the real-time water level data of the water level meter to realize telemetry, which can provide fast and accurate analysis data and scientific decision-making basis for water and rainfall monitoring, forecasting, flood reporting, reservoir dam flood diversion and discharge, resistance to natural disasters, and water resources management and scheduling. At the same time, the host computer can also obtain and modify the working parameters of the water level meter to realize remote control without the need for special personnel on duty.

d.JPG


The intelligent water level meter uses MAX3485 and the microcontroller serial port to implement this function, and the protocol uses the MODBUS protocol.
The data packet receiving and sending program is placed in the microcontroller interrupt service program. After receiving, the flag position is valid. The flag position is continuously scanned in the main loop. If the flag position is valid, the data packet processing function will be called. The water level meter protocol packet format is shown in Table 1.

e.JPG


The function codes are mainly:
Function code 0x03: Read Holding Registers reads register data (system time or configuration). Function code 0x04: Read Input Register reads input register (telemetry). Function code 0x10: Write Multiple Registers writes multiple registers (system time, parameters).
There are 3 working modes: real-time, time-sharing, and variable amplitude reporting.
In real-time mode, the water level meter always turns on the serial port power supply, ready to receive information from the host computer and make processing. In
time-sharing mode, the serial port power supply is turned on only when the timing time is reached, waiting for information from the host computer.
In variable amplitude mode, the serial port power supply is turned on when the absolute value of the difference between the water level value collected by the water level meter and the previous one is greater than a threshold.
Since the entire network adopts a bus topology and there is no conflict avoidance algorithm, the response method is used when communicating with the host computer. Regardless of whether the water level meter works in real-time, time-sharing, or variable amplitude mode, the data packet is returned only when information from the host computer is received.

3 Conclusion
The water level meter can be flexibly connected to water level sensors such as float water level meter or pressure water level meter during operation. It can flexibly adapt to the needs of measuring reservoir water level, power plant trash rack pressure difference, river and other slowly or violently changing water levels, adapt to different monitoring environments, and is suitable for occasions without power supply. The working mode of the water level acquisition station can be flexibly programmed, with good versatility, high reliability and easy maintenance. It is a multi-mode water level automatic monitoring system that can be applied to a variety of monitoring environments.

Reference address:Design of Intelligent Water Level Meter Based on MSP430 Single Chip Microcomputer

Previous article:Design of serial communication interface based on FPGA and single chip microcomputer
Next article:Research on SPWM variable frequency speed regulation system based on 8098 single chip microcomputer

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号