As we all know, China's pesticide production technology is at the international advanced level, but the current situation of China's plant protection machinery and pesticide use technology is seriously
backward and is extremely disproportionate to China's rapidly developing pesticide level. It has seriously hindered the prevention and control of crop diseases and insect pests, and brought
negative
effects best pesticide utilization rate is less than 30%, and the amount of pesticide loss is as high as 60%~70%, which not only causes great economic losses, but also
causes serious "pesticide residue problems" and environmental pollution. The use of automatic target spraying technology can save 50%~80% of pesticides,
so the research on target spraying technology will become the next important research direction of China's plant protection machinery. To this end, this paper proposes
a control system that uses the ATmega16 microcontroller of the AVR series as the CPU, the PC as the host computer, and the signal collected by the camera
as the trigger signal, combined with the microcontroller control technology and digital image processing technology to realize automatic target spraying.
2. System Working Principle
The system structure diagram is shown in Figure 1. The experimental device uses a PC as the host computer, and the rotation of the turntable simulates the movement of
the tractor The turntable is placed with simulated weeds as targets. The PC
processes the signal collected by the CCD camera, and the collected color image is segmented using the green dominance method. When the green component is greater than a certain threshold, it is
determined that there is a target under the camera. After the target is identified, the control signal is sent to the microcontroller through the serial port. According to
the different , the corresponding delay time is set to delay the signal. When the weeds reach the bottom of the nozzle, the actuator is controlled
to perform spraying, thereby realizing automatic target spraying.
3. Hardware structure design
The hardware system is mainly used to achieve the following functions: (1) realize serial communication with the host computer; (2) provide a human-machine interface,
which can set different delay times according to different speeds; (3) output control signals to control the opening and closing of the solenoid valve. Based on the functional requirements, reliability, product cost, and ease of use
of ,
the hardware schematic diagram of the automatic target controller is designed as shown in Figure 2.
3.1 MCU Selection
The system uses the AVR series MCU ATmega16 as the system CPU. AVR is a
high-performance, low-power 8-bit new MCU produced by Atmel. It adopts advanced RISC instruction structure, has fast execution speed, can reach
1MIPS/MHZ, strong port drive capability (20~40mA), and all have online download function. ATmega16 belongs to
the AVR mega series high-end MCU, with 16K bytes of system programmable Flash, and a general synchronization and
The USART can provide clock synchronization for the host or slave, which can greatly simplify the serial port communication between
the microcontroller and the PC. In addition, the ATmega16 microcontroller also has a JTAG interface, through
which online program download and on-chip debugging can be performed. This system uses the JTAG interface for online program download and on-chip debugging
.
3.2 Data display and button settings
Considering the actual target delay time, a 2-bit common cathode super bright LED is used, the delay time range is 0.0~9.9 seconds, and
IN74HCX245 is used as the LED display driver. Among them, pin 1 is the direction selection bit, pin 19 is the output enable bit,
pin 1 is connected to a high level, and pin 19 is grounded, indicating that the data output direction is from A to B. The system has a total of 4 buttons,
including 2 plus buttons and 2 minus buttons. S2 and S3 are plus buttons, and each press adds 0.1s and 1.0s respectively. S4 and
S5 are minus buttons, and each press subtracts 0.1s and 1.0s respectively. The buttons adopt a scanning mode. During initialization, the PB0,
PB1, PD4, and PD5 bits are set to input, high level, and internal resistor pull-up enable. By scanning the above four bits to see if
they are low level, it is determined whether the button is pressed. After pressing, the corresponding plus and minus flag position is set to 1, and then the delay
time is changed accordingly, and sent to the digital tube for display.
3.3 Communication Design
The communication between the lower computer and the upper computer adopts the RS232 bus standard, and
the communication circuit with the upper computer is composed of MAX232 and the USART serial port of the ATmega16 microcontroller. TXD and RXD are the sending pin and receiving pin of the USART serial port of ATmega16
. [page]
3.4 Output Control
The control signal of the microcontroller is output through the PC0 pin. PC0 is connected to a solid-state relay (SSR), which
controls the opening and closing of the solenoid valve. When PC0 is at a high level, the relay closes the switch, turns on the power, and opens the solenoid valve for spraying;
when PC0 is at a low level, the switch is disconnected, the solenoid valve is closed, and no spraying is performed.
4. Software structure design
The automatic target control system running program is written in C language, with modular design, and the whole program is
composed of functional module subroutines. The host computer software is developed based on Visual C++6.0.
4.1 Lower computer software structure
The main software modules of the lower computer software include initialization, delay, display, keyboard scanning, interrupt processing and other functional modules.
The delay function uses the loop counting method. The crystal frequency of the microcontroller is 7.3728MHZ, and the number of counting cycles is 1832.
Under the simulation of AVR Studio, the error of 1ms is 0.44us, so it can fully meet the actual requirements. The delay
time , the serial port is in asynchronous communication mode, 8 data bits, 2 stop bits, and the baud rate is set to 9600. The main program
flow chart is shown in Figure 3.
4.2 Host computer software structure
The host computer software was developed based on Visual C++6.0. The host computer software mainly consists of two parts: (1) serial port communication
part, (2) image processing part.
The serial port communication is implemented through the serial port class CSerialPort [3]. The image processing part uses a capture card to capture images in real time.
The image capture card of this system is the OK_C30A capture card of Jiaheng Zhongzi Company. This card is based on the PCI bus and can capture both
color and black and white images. It is suitable for research
and development and engineering application fields such as image processing, industrial monitoring and multimedia compression and processing [8]. Image acquisition and display are realized through the API provided by the company. Real-time image acquisition
is realized by responding to the WM_TIMER message in VC, that is, the image is captured and displayed by calling the capture card
API in the OnTimer function at regular intervals. Since weeds are green, the 2g-rb component is used to segment the image [4]. When
its value is greater than a certain threshold, the pixel is considered green. When the green pixel occupies more than a certain proportion of the entire image, it is determined that
there are weeds under the camera, and then the signal is sent to the lower computer through the serial port.
5. Experimental Results
This experiment was conducted on a turntable with a diameter of 67 cm, and the rotation of the turntable simulated the movement of a tractor. This experiment measured the actual target delay time at
different speeds, and a stopwatch was used to measure 20 times at each speed. The experimental data are shown in Table 1.
The set delay time is the delay time T in the software, and the actual delay time is the actual time from the camera collecting the target image to the
actuator spraying. The maximum speed that can achieve automatic target alignment is 38r/min, that is, 1.33m/s.
And from the data in Table 1, it can be seen that the delay time error is less than 0.2s, which can meet the requirements of automatic target alignment.
6. Conclusion
This system realizes automatic targeting of pesticide spraying by controlling the solenoid valve, and has been successfully debugged under laboratory conditions.
The system runs stably, has accurate delay, and can achieve precise targeting within a certain speed range, which greatly improves
the utilization rate The hardware implementation is simple, laying a good foundation for further promotion in the field. If the image
processing algorithm can be further optimized, the image processing time can be reduced, and the response speed of the hardware can be improved, the walking
speed , and the ability of the image processing algorithm to handle weed recognition under complex backgrounds can be improved,
automatic targeting spraying can be realized in complex field environments.
Previous article:Remote keyless entry solution
Next article:Design of wireless sound amplification system based on ATmega8
Recommended ReadingLatest update time:2024-11-16 16:32
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
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
- I would like to ask if the 8255A chip can only select one port at a time. After defining the address for the port, such as Q8255A XBYTE...
- Power supplies with digital control
- Please advise, brothers.
- One year's work equals three years' work? TSMC engineer shows off 2.5 million yuan bonus
- Evaluation summary: Mil based on NXP's first NPU kit MYC-JX8MPQ
- How to choose a suitable water level sensor?
- Can someone help me think of a microcontroller project?
- Development of User Graphical Interface (GUI) for Digital Oscilloscope Based on DSP
- [Xianji HPM6750 Review] + Software simulation IIC reads the temperature and humidity sensor values
- In fact, Valentine's Day 20200214 was cancelled