- Home >> News >> Blog articles >> Internet of things
Ultrasonic distance meter program development
Aiming at the fact that industrial ranging sensors cannot be used in the special environment of coal mines, a design scheme of intrinsically safe ultrasonic rangefinder for mining is proposed, and its working principle and hardware design are introduced in detail. Adopt 430 single-chip microcomputer to process data, display through lcd1602, support modbus-rtu protocol.
1. Principle
The traditional mining ranging sensor uses infrared and laser ranging, but infrared and laser can only be used in open spaces, and the environment must not have dust, otherwise it will affect the test data. When there are large particles of dust reflecting light, it will be Out of the test distance. Ultrasonic ranging is a non-contact detection technology, which is not affected by light, the color of the measured object, etc., and is more resistant to harsh environments such as humidity, dust, high temperature, and corrosive gases than other instruments. It has less maintenance, no pollution, and high reliability. , long life and other characteristics, and the ultrasonic rangefinder I developed is based on a plane as the reflecting surface, and the reflecting surface must be greater than 0.5m2, which avoids the interference of large particles in the wind and dust environment, and the effect is obvious in practical applications. In addition, the upper and lower limit alarm settings are added. If the set value is exceeded, a closed node will be output through the solid state relay. At the same time, there is a 485 interface to the outside world, which supports data remote transmission. It is more suitable for the construction of digital modern mines. It is very convenient to collect data, upload and schedule cloud center.
2. Hardware Design
The main control uses MSP430F5418 single-chip microcomputer, the ultrasonic distance measuring module adopts, the main control chip adopts 16-bit low-power consumption MSP430 single-chip microcomputer, with strong processing ability, fast operation speed, rich internal resources, convenient and efficient development environment, ultra-low power consumption and stable performance . It can ensure that the distance measured by the rangefinder is accurate and stable.
2.1. Main control design
The main control chip adopts 16-bit low-power MSP430 single-chip microcomputer, which has strong processing ability, fast operation speed, rich internal resources, convenient and efficient development environment, ultra-low power consumption and stable performance. It can ensure that the distance measured by the rangefinder is accurate and stable.
2.2. RS485 isolation circuit
In order to meet the requirements of intrinsically safe circuits in coal mines, the ISO1176 isolation chip is used to process RS485 signals. The reliability and life cycle of this chip are more than twice that of magnetic or optical isolation technology. Achieve 2500Vrms isolation, which reduces the risk of data corruption and avoids damage to expensive control circuits on ultra-long transmission lines, and operates at a rate of up to 40Mbps, which is more than twice as fast as the closest competing solution, achieving more High data transfer speed.
2.3 Button settings
Key setting
This ultrasonic sensor has three buttons, which are temporarily defined as A, B, and C. Through these three buttons, you can set the upper and lower limits of the distance alarm, the selection of the distance measurement output (analog output and relay switch output) and the address of the RS485 slave. The A key is responsible for the entry and exit of the setting, the B key is responsible for the selection of the median during the setting process, and the C key is responsible for the flipping of the current menu and the increment of the data during the setting process. Among them, after A and B are pressed at the same time, the default settings will be restored, namely: the upper and lower alarm limits are 450 and 002cm; select 485 output; the modbus slave address is 001.
3. End
The design scheme of the corresponding hardware is given. The rangefinder has fast reflection speed, simple control, high precision, strong anti-interference ability, etc. The range of distance measurement is 2cm to 500cm. Intrinsic safety parameters are considered in the circuit design, and it can be used in coal mines. Experiments have proved that within the range of 0 to 5 meters, the error of the sensor is less than 0.02m, and the sensor has upper and lower limit alarm settings and data remote transmission functions, supports modbus-rtu protocol, stable and reliable performance, and can adapt to coal mines Underground harsh environment.
Shenzhen Zuchuang Microelectronics Co., Ltd. has 20 years of electronic and electrical program development and design and chip agency company. It is the earliest company in China to develop point-reading pen solutions. It can provide Bluetooth Wifi point-reading pen OID program development, smart point-reading pen program development, wifi Reading pen project development and other services. The development capabilities cover PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development and other hardware and software design.
Proposal recommendation
- TOP