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.
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]
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.
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 moduleThe 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.
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.
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.
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
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
- Analysis of the types of pads and design standards in PCB design
- Why should the power supply be set to +3.3V?
- Analysis of the composition and working principle of the radio frequency identification system
- Arduino Bluetooth Obstacle Avoidance Car
- The control motor is found to have insufficient stroke. Please provide a solution.
- Failed to import brd file into AD
- Confirm that your personal information is correct
- [Raspberry Pi 3B+ Review] Burning System & Locking Static IP & SSH Login & SFTP Login
- STM32F407VET6 Another question about PWM wave
- Want to exchange, use TI LM3S8962EVALUATION KIT for an NXP Rapid IoT