Agricultural greenhouse intelligent detection environment system

Publisher:Serene123Latest update time:2012-10-30 Source: 现代电子技术 Keywords:STC89C52  DS18B20  TSL2561 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
With the continuous development of science and technology, people's production requirements for the surrounding environment are getting higher and higher. For example, crop greenhouses, factories and some large-scale mechanical equipment all need to grasp the temperature and light of working conditions in real time. Traditional manual measurement methods waste manpower and material resources, are inefficient and have poor safety. With the development of single-chip microcomputer technology, people have increasingly adopted single-chip microcomputers to detect and control some industrial control system parameters. At the same time, PCs have powerful monitoring and management functions, while single-chip microcomputers have simple, flexible and fast control characteristics. Communicating with external devices through the RS 232 serial interface of the PC is a commonly used communication solution in measurement and control, so the communication between the PC and the single-chip microcomputer has very important practical significance.

1 Overall design of system hardware
The overall design of the system is based on the design of the upper computer using serial port communication and the single-chip microcomputer environment monitoring system, which consists of three parts: the upper computer, the communication interface and the lower computer. The microcontroller uses STC89 C52; the light sensor uses TSL2561; the temperature sensor uses DS18B20 produced by DALLAS. The single chip microcomputer transmits the data collected by the sensor to the PC through serial communication. The PC displays the acquired data in real time on the monitoring screen, and also displays the temperature curve and light curve in real time. The overall structure of the system is shown in Figure 1.

d.JPG


1.1 Control module function
The main control board uses a STC89C52 as the controller. STC89C52 is a high-performance CMOS 8-bit single-chip microcomputer, which contains 8 KB of repeatedly erasable FLASH ROM and 256 B of RAM.
STC89C52 has excellent performance and low cost, and is very suitable for this system. The main function of the core control module STC89C52 is to process the data collected by the sensor, transmit it to the host computer through the RS 232 serial communication interface, and display the data in real time on the LCM12864 LCD screen. When it is automatically determined that the collected data is higher than the set value, the relevant buzzer is immediately activated to complete the alarm function.
1.2 Serial communication module
This module uses RS 232, which is a serial physical interface standard formulated by the American Electronic Industry Association EIA (Electronic Industry Association). It uses asynchronous transmission and is characterized by simple use and low price. It transmits the data collected by the single-chip microcomputer to the host computer to realize remote monitoring. [page]

1.3 Light acquisition module
TSL2561 is a high-speed, low-power, wide-range, programmable, and flexible light intensity digital conversion chip launched by TAOS. It is a light-to-digital converter. The microcontroller obtains the values ​​of CH0 and CH1 channels from the TSL2561 through the I2C bus, converts the collected digital signals into optical units of lux through software calculation, and finally converts the light intensity into a digital signal for output. The light intensity algorithm is as follows:
e.JPG
1.4 Temperature acquisition module
DS18B20 is a digital temperature sensor that provides 9-bit binary temperature readings. It has a single-line structure, and the information is sent to or output from DS18B20 via a single-line interface. In this design, the upper limit of the high temperature alarm value can be set by yourself. When the temperature is higher than the set value, the buzzer is activated to prompt the user to take appropriate measures.
1.5 Display module
The display module uses LCM12864 liquid crystal display. The module has a built-in font library, which is easy to connect, has high display quality, and is low cost. It mainly displays the collection of system light intensity information and temperature information, as well as the timer count value, for overall debugging and on-site viewing of the system.
1.6 Serial port software module
Under VC 6.0, the built-in MSComm control can be used to realize serial port communication between the microcontroller and the PC, and RS 232 can be used to receive data. Here, select com1 port, the baud rate is 9 600 b/s, and the data is retrieved in binary mode. The main code is as follows:
f.JPG
1.7 Data storage module
After completing data reception, the data must be stored in the Access database. The variables in the database completely correspond to the received data. Create a database bia o. Mdb in Access 2000, add support for ODBC database, add #include in the project stdafx. h file, and complete the addition of ODBC class. Using ODBC to access the Access 2000 database has fast storage speed, low memory consumption, and simple operation.
1.8 Host computer data reading and curve display module
Through software VC 6.0 programming, the collected data is displayed on the PC as a curve. This module is written using the teechart8 control that comes with VC 6.0. This control has a good function of drawing real-time curves and is easy to operate. The host computer detection interface is shown in Figure 2.

b.JPG

[page]

2 System software design
The MCU part of this design adopts modular design and is written in C language through the μVision 4 compiler developed by Keil. It mainly includes light intensity acquisition, temperature acquisition, LCD display, and serial port sending module programs. The host computer part is written in VC++ language under VC 6.0 environment, including serial port communication, database storage and curve drawing modules. The main program flow charts of the upper and lower computers are shown in Figures 3 and 4.

g.JPG

h.JPG



3 Conclusion
Based on STC89C52, this paper provides an agricultural greenhouse light and temperature detection system in the VC 6.0 environment. Its light sensor TSL2561 and temperature sensor DS18B20 are both high-precision measurement sensors, which is a detection system with high precision and remote monitoring. The upper computer interface is a friendly dynamic curve observation, which allows users to easily view and record data. At the same time, the lower computer of this design can also realize multi-point measurement and control, with strong expansion capabilities, high cost performance and strong practicality.

Keywords:STC89C52  DS18B20  TSL2561 Reference address:Agricultural greenhouse intelligent detection environment system

Previous article:Disable C51 compiler from compiling power-on clear code
Next article:Design scheme of intelligent cluster control fire emergency indicator light

Recommended ReadingLatest update time:2024-11-17 01:49

Intelligent temperature measurement device based on DS18B20
Author Email: jsmo739@yeah.net 1. Introduction Temperature is one of the most basic environmental parameters. People’s lives are closely related to the temperature of the environment. In the industrial production process, it is necessary to measure the temperature in real time. In agricultural production It is also i
[Microcontroller]
Design of automatic control device for ventilator and heater based on STC89C52 single chip microcomputer
   This paper aims to solve the problem that the ventilator and heater in the high-voltage room of the 330kV Luofu substation are manually switched on and off by the duty officer, and the temperature and humidity control effect is not ideal. An automatic control device based on the STC89C52 single-chip microcomputer i
[Microcontroller]
Design of automatic control device for ventilator and heater based on STC89C52 single chip microcomputer
Practical Analysis of 8051 MCU (Taking STC89C52RC as an Example) | 07 - Independent Key Driver
The button is a commonly used and simple human-computer interaction operation. The button is actually a non-self-locking touch switch. When pressed, the contacts will close, and when released, the contacts will open. 1 Independent button There are two forms of commonly used button circuits, independent buttons and
[Microcontroller]
Practical Analysis of 8051 MCU (Taking STC89C52RC as an Example) | 07 - Independent Key Driver
ATMEGA16 and DS18B20 digital tube display
A DS18B20 with a large error value caused me a lot of trouble. I always thought it was a program error, so I changed it and it worked! It took me three days to check the program /*This program is an eight-bit common cathode digital tube with two 573 controlled dynamic scans*/ #include iom16v.h #include macros.h #
[Microcontroller]
DS18B20 temperature wireless transmission microcontroller source code based on NRF24L01
The microcontroller model is stc12c5a60s2 The temperature sensor is DS18B20 Wireless transmission is NRF24L01 Temperature display LCD1602 The microcontroller source program is as follows: #include STC12C5A60S2.H #include stdio.h #include "DELAY.h" #include "NRF24L01.h" #include "LCD1602.h" #include "DS18B20.h"
[Microcontroller]
[51 MCU STC89C52] Comprehensive chapter on steering gear control
1. Project Overview 1. Function description Ultrasonic module, vibration sensor, button control SG90 servo When detecting the proximity, the trash can will automatically open the lid with a beep sound and close the lid after 2 seconds. When vibration occurs, the lid of the trash can will automatically open with a be
[Microcontroller]
[51 MCU STC89C52] Comprehensive chapter on steering gear control
STC89C52 MCU key experiment
///////////////////////////////////////////////////// ///////////////////////////   Function implemented:  Complete the test of independent buttons. When one of the four buttons key1-key4 is pressed,                         the specific value will be displayed on the first digital tube of the development board. For e
[Microcontroller]
PIC16F877A DS18B20 Digital Thermometer Experiment
main.c #include htc.h #include stdio.h #include "def.h" #include "ds18b20.h"   __CONFIG(0xFF32);   void Delay_ms(u16 xms) {   int i,j;   for(i=0;i xms;i++)   { for(j=0;j 71;j++) ; } }   void uart_init(void) {     TXSTA=0x24; //Turn on the transmit enable bit and high baud rate. The initial value of TRMT can be 0 o
[Microcontroller]
PIC16F877A DS18B20 Digital Thermometer Experiment
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号