Green House Parameters Monitoring Using Can Bus And System On Chip

DOI : 10.17577/IJERTV2IS50695

Download Full-Text PDF Cite this Publication

Text Only Version

Green House Parameters Monitoring Using Can Bus And System On Chip

S. B. Puri1, Prof. S. P. Nayse2

1G. H. Raisoni College of engineering & management,Ahmednagar 414008

2RMD Sinhgad School of Engineering, Warje

Abstract According to the need of irrigation control of modern agriculture facility, monitoring soil moisture of large greenhouse group based on CAN bus is designed. The paper describes the steps required to implement and program (PSOC) system-on- chip microcontroller to utilize CAN controller. Basic information about CAN bus theory will be presented, and then step by step of implementing CAN bus is described. The system consists of host (PC), outside CAN bus, slave unit, inside CAN bus, and sub-slave unit. The system adopts a master-slave way of working, in which, PC host accomplished centralized monitoring of all greenhouses, the slave unit accomplished cycle display, parameters setting of soil moisture of all blocks of one greenhouse, and the sub-slave unit is responsible for the soil moisture measurement and irrigation control of one block. The master and slave, slave and sub-slave, are linked respectively by outside CAN bus and inside CAN bus. By using the system combined with the agricultural expert system, not only centralized control and management, but also measurement and control in partition according to need can be achieved, so the crops get a timely, on-demand precise irrigation, it can not only improve the utilization ratio of equipment and water, but also favour the high yield and quality.

  1. STRUCTURE AND PRINCIPLE

    Structure of the system is shown in figure 1. The system consists of host, outside CAN bus and many slave units. Each slave unit. Each slave unit consists of a signal chip, keyboard, display, inside CAN bus and many sub-slave units. Each sub-slave unit consists of system on chip, soil moisture sensors, solenoid valve control circuit etc. the system adopts way of master-slave, in which a host PC is used to display and manage the data of all greenhouses centrally; each slave unit completes soil moisture cycle display, parameter setting of all blocks of a greenhouse, each sub-slave is responsible for monitoring all greenhouse parameter. The host slaves, the slave and sub-slave are linked by outside CAN bus and inside CAN bus.

    Transmitter:

    Light

    Temperature

    Light

    Temperature

    Relay

    Relay

    PSOC

    PSOC

    LCD

    Relay

    Relay

    CAN Tx/Rx

    Keywordssoil moisture; CAN bus; large green house group

    ;slave unit; sub slave unit

    1. INTRODUCTION

      Greenhouse is the important component of facility agriculture, is one of the keys in current agriculture in our country. In greenhouse production, measurement and control of soil moisture is of great importance to crop growth. Especially the water waste is serious

      NNO.OF CAN BUS

      CAN Tx/Rx

      Humidity Sensor

      Humidity Sensor

      Soil Moisture Sensor

      Soil Moisture Sensor

      Receiver:

      LCD

      LCD

      PSOC

      PSOC

      P C

      problem in agriculture in our country, water is utilised in low rate. Water efficiency of irrigation is about 0.4 only half of that in developed country. But on the other hand there is a serious shortage of agriculture water [1].Many greenhouse are furnished with tiny- irrigation equipment in our country at present, but in automatic irrigation control, it is still of blank[2].

      In recent years, large greenhouse area increases, design of wiring is difficult. The analog signal attenuated seriously during transmission because of long distance, finally resulting in accurate control. For the

      need of irrigation control in modern agriculture, while reducing cost and increasing efficiency, for monitoring of soil moisture of greenhouse based on CAN bus is designed. Using the system, a centralised control of soil moisture of greenhouse group can be achieved, and it can give the crop timely, This can not only improve the utilisation of equipment and water , but also contribute to a high yield and quality.

      Figure1 Structure of CAN bus using PSOC for monitoring greenhouse parameter.

  2. HARDWARE DESIGN

      1. AN Communication System

        CAN bus is used to achieve a highly a long distance, one to many communication in the system, and twisted-pair is taken as transmission medium. For a unified standard, Philips SJA1000 is chosen as CAN controller and 82C250 as transceiver in every module. the interface between PC and outside CAN bus adopts the intelligent CAN interface of PSOC produced by cypress semiconductor company , in which controller is SJA100 and transceiver is 82C250,and it can be directly inserted in extended port of computer ,meet spec PC2.1, support protocol CAN2.0A and CAN2.0B etc.

        CAN bus belong to field-bus, and it is serial communication network of effectively supporting for distributed or real-time control. Comparing with other general bus, such as RS-485,

        monitoring greenhouse is based on CAN bus has following advantages [5].

        1. CAN controller works in multi-master mode, each node can visit the priority under the bus, by using a bitwise arbitration with non-destructive structure to complete in sending data to the bus initiatively in mode of broadcast, real-time performance of data communication is strong.

        2. Node of CAN bus close out automatically under serious mistake, so that the operation of other nodes on bus are not affected.

        3. The direct transmission distance of CAN bus is up to 10km/5kbps, the number of devices can be joined is up to 110.

        4. The message has a shortframe structure and hardware CRC, so the transfer time is short, the probability of being

    CAN Interface Sub-Slave computer No.n

    Sensor of soil moisture1

    Sensor of soil moisture1

    Driver

    Driver

    SSR

    SSR

    Sensor of soil moisture2

    Sensor of temperature and Humidity

    Sensor of soil moisture2

    Sensor of temperature and Humidity

    Figure 2. Structure of Sub-slave Unit

    1) Sub-slave Machine

    Solenoid Valve

    interrupted is small, and the error rate is very low.

    5) CAN bus adopt differential transmission technology, by which the anti-interferences ability of system is enhanced.

    1. Design of Slave Unit

      Slave unit consists of single chip, keyboard, display, alarm, inside CAN bus and many sub-slave units. It is located at the door of greenhouse and installed with sealed moisture proof. through outside CAN, it receives instructions from host or data from other slaves, and receives data to the host; through outside CAN, it receives instructions from host or data from other slaves, and reports data to host; through the inside CAN, it receives the measurement results from each sub-slave and sends out commands to each sub- slave to control irrigation .At the same time, it is responsible for parameters setting, display and communication module of the slave unit.

      1. Slave Machine

        To complete the double CAN interfaces, greenhouse addresses setting, keyboard and LCD display, it needs more I/O ports, so a PDIp40 packaged MCU of STC12C5A60S2 is adopted. This MCU has 62k flash program memory, up to 36 I/O, which can meet the design needs.

      2. Interface between MCU and bus

        To strength the anti-jamming ability of CAN node , TXD and RD of SJA100 are connected to TXD and RXD of 82c250 through opt-coupler 6N137.moreever, CANH and CANL of 82C250 are connected.

      3. Keyboard, Display and Alarm

    A 4×4 keyboard is expanded, including key 0-9, setting, choosing, running etc. LCD display adopts liquid crystal module, which has strong function, simple control and interface. In addition, when soil moisture of a block is over-limited, and alarm of MCU by driving piezoelectric buzzer and LED.

    C .Design of Sub-Slave Unit

    The sub-slave unit is responsible for management and irrigation control of one block in greenhouse. Each unit consists of a chip, two soil moisture sensors, and a solenoid valve control circuit. Also, there are two pieces of MCU being joined up temperature and humidity sensor in each greenhouse. Structure of sub-slave unit is shown in figure

    For simple function, chip of STC12C5612AD is chosen, and it

    has12kB flash,1-line general full-duplex asynchronous serial port, and PSOC-3 kit which includes 10 bit ADC , multiple PWM output, a reset circuit and watchdog.

    1. Soil Moisture Sensor

      SWR2 produced by Beijing Huizenong Science and Technology Limited Company is chosen to measure soil moisture. It has following features: high accuracy, quick speed, small soil-texture influence, multi-probe structure easy to exchange, and entire sealed design. The measuring range is of 0-100%, output 0-2.5V DC voltage, and the accuracy within 0-50% (m3/m3) is up to 2%. It has high

      performance to price ratio and is very suitable for massive use in greenhouse control.

      To measure the moisture of the whole block correctly, two soil moisture sensors are used in each block, one is placed in central place with much water, and another placed nearby the edge. The data will be processed through a method of weighted averaging to get the soil moisture value finally. Its weight is decided according to the actual.

    2. Driving control of solenoid Valve

      Control signal from the single chip, through 74LS04 and a solid state relay SSR, finally drives the solenoid valve to control irrigation.

    3. Temperature and Humidity Sensor

    Temperature and humidity are also important effect factor in irrigation control in the greenhouse, so two pieces of sub-slave machine whose position are representative in each greenhouse , are increased a sensor to measure temperature and humidity.

  3. SOFTWARE DESIGN OF THE SYSTEM.

    Module structure is adopted in software design ,and it consist of monitor program, measurement and control program of the slave, communication program, measurement and control program of the sub-slave etc.

    1. Design of Monitor Program

      The software of PC is developed, This software has high reliability, shorter development cycle, and friendly human-computer interface. It can create dynamic images and charts in accordance with the layout of equipment in the scene: can visually display the changes of parameters, control status , and can give an alarm when over limited. By using the history curve stored in the specific database and adopting the agriculture expert system, it can get the best parameters setting in irrigation control. So we can not only use agronomists experience, but also make the system suitable for more kinds of crops, thus the generality of system is enhanced.

    2. Design of slave program

      The software of the slave is developed by Embedded C to achieve soil moisture display, processing alarm when over- limited and communication with the CAN bus. The structure of main program is shown in Figure 3.

    3. Program Design of Communication

      The program of communication taking SJA1000-as the core. It can complete information exchange with the host and other nodes (other greenhouse), communicate with the sub-slave. CAN communication includes . CAN controller initialization, node message sending and message receiving, handling of other situation etc. Considering the real-time requirement, the system receives and transmits data by way of interruption. Flow chart of CAN communication is shown in Figure 4.

    4. Program Design of the Sub-slave

      Program of the sub-slave only completes the real-time collecting of soil moisture of corresponding bloc, solenoid valve control and communication with inside CAN bus.

    5. Why Use PSoC?

    The PSoC family consists of many Programmable System-on-Chip controller devices. These devices are designed to replace multiple traditional microcontroller unit (MCU)-based system components with one, low-cost single-chip programmable device. PSoC devices include configurable blocks of analog and digital logic, as well as programmable interconnects. This architecture allows you to create customized peripheral configurations that match the requirements of each individual application. Additionally, a fast central processing unit (CPU), flash program memory, SRAM data memory, and configurable I/O are included in a range of convenient pin outs and packages.

    PSoC 3 and PSoC 5LP integrate CAN functionality along with configurable analog, programmable digital, memory, and a central processor on a single chip. PSoC Creator provides built-in APIs (Application Programming Interfaces) to abstract common tasks.

    Moreover, all PSoC Creator components, including the CAN component, can be easily configured using a GUI.on-chip devices is part of the scalable 8-bit PSoC 3 is a true programmable embedded system-on-chip integrating configurable analog and digital peripherial functions, memory and a microcontroller on a single chip, and now PSoC 3 architecture boosts; Integrated high precision 20- bit resolution analog ultra low power voltage range Programmable PLD-based Logic, Easy to use development tools enable designers to select configurable library elements to provide analog functions such as amplifiers, ADCs, DACs, filters and comparators and digital functions such as timers, counters, PWMs, SPI and universal asynchronous receiver/transmitter (UART). The PSoC family's analog features include rail-to-rail inputs, programmable gain amplifiers and up to 14-bit ADCs with exceptionally low noise, input leakage and voltage offset. PSoC devices include up to 32kb of Flash memory, 2kb of SRAM, an 8×8 multiplier with 32-bit accumulator, power and sleep monitoring circuits, and hardware I2C communications. All PSoC devices are dynamically reconfigurable, enabling designers to create new system functions on-the-fly. Software and Support PSoC Designer (TM), the traditional software development environment for PSoC, is a full-featured, GUI-based design tool suite that enables the user to configure design-in silicon with simple point and click options. With PSoC Designer, users can code the MCU in either C or assembly language.

    Start

    Initialization, open break

    Initialization, open break

    Get Revised

    Get Revised

    Read temperature and Humidity of Greenhouse.

    Read temperature and Humidity of Greenhouse.

    Read the data from the first sub-slave machine

    Read the data from the first sub-slave machine

    Read the data from the

    next sub-slave machine

    Read the data from the

    next sub-slave machine

    Accepting the control instructions from the host

    Accepting the control instructions from the host

    The last one ? N Y

    Sending the control state to sub slave machines

    Sending the control state to sub slave machines

    Refresh LCD and control status display

    Refresh LCD and control status display

    Figure 3 Main program structure of slave

    CAN interface cofigration

    CAN interface cofigration

    Baud rate setting

    Baud rate setting

    Start

    Clear RAM

    Clear RAM

    Receiving and sending initialization

    Receiving and sending initialization

    Interruption allowing

    Start up of CAN communication

    Start up of CAN communication

    N Receiving RTS?

    Writing TXD to RAM

    Writing TXD to RAM

    Data frame sending

    Data frame sending

    Y

    Successful ?

    N

    REFERENCES

    1. Li Xiuchun. the research of automatic measurement and control system of water-efficient [j] Water saving irrigation.2002(2).

    2. Luo Jinyao, Research progress of water saving irrigation theory and technique of facility agriculture in china[j].WAter Saving Irrigation,2003(3).

    3. Li Xiaojing, Zhang Kanyu. Design and implementation of control system of greenhouse group based on CAN bus [j].Computer Engineering,2010,36(1).

    4. Wang Dahong, application of CAN bus in a distributed Aluminum Electrolysis monitoring system[j]. process Computer ,2007,20(3). [5]Rao Yuntao, Zou Jijun ,Zheng Yongyun. the principle and application of CAn field-bus[M]. Beihang university press,2003. [6]Xu Zhiru, cui Jiren. Design of intelligent measurement and control system of greenhouse based on MCU[J].sensor and Micro- system,2006,25(5).

    1. Wang Qingzhu, Lin Hongiu, Bao Changehun etc. A Measurement and control system of greenhouse group based on double master slave structure[J}. Journal of Agriculture Machinery,2008.39(9).

    2. www.datasheetcatalog.com/datasheets…/-/LCD-016M002B. [9]Implementing CAN Bus Communication using PSoC® 3 and

    Figure 4 Flow chart of CAN communication.

  4. CONCLUSION

The monitoring of soil moisture of large green house group based on can bus and system on chip is studied, and has following characteristics;

  1. CAN bus is used to establish a communication with multi-master structure in the system, it is convenient for data exchange and management, suitable in large greenhouse group, not only control centrally, but also control on partition or block.

  2. In the system, each module is relatively independent, type and number of the modules can increased or decreased freely, and new module can be joined up anywhere in communication line, thus the flexibility is improved and the cost is reduced.

  3. Using the system can give an automatic, timely, on-demand precise irrigation to crops in greenhouse group, by which not only can improve the utilization of equipment and water, but also contribute to a high yield and quality. So it is significant to the development of modem agriculture and conservation of limited water resource.

PSoC 5 – AN52701, http://www.cypress.com/?rID=37766 (retrieved on 14.01.2011).

Leave a Reply