Introduction: GSM CONTROLLED GREENHOUSE FOR RURAL AFRICA
DESIGN AND FABRICATION OF A GSM CONTROLLED GREENHOUSE SYSTEM
Technology has redefined communication and more so in many advantageous ways. Mobile technology has led to the coining of the term “global village” which can be seen through the fact that almost every adult nowadays owns a mobile phone and also the decreasing cost of such devices over the years. An individual can be contacted at any time by the use of a mobile phone. The use of mobile phones cannot be restricted to just making calls and sending messages. The door to many innovations and discoveries lie on most people’s hands. Exploiting the phone’s capabilities can lead to new and profitable masterpieces. Short Message System (SMSs) are a very popular means of communication. They can be delivered in real time depending on the phone’s network reception. This concept of instant messaging is what was used in the study to design a system that acts as a platform to receive messages which in fact are commands sent to control different greenhouse parameters connected to the platform. This study sought to design a control system based on the Global System for Mobile communications (GSM) technology that effectively allows control from a remote area to the greenhouse.
Agriculture has been viewed over many years as the least technologically advanced sector in Africa and around the world generally. This is despite it being the backbone of the country’s economy. But with technological trends such as GSM, a new platform to get rid of the tag has emerged. The application of the proposed system in the agricultural sector is immense in the ever changing technological world. It is a major move in the right direction in automating agricultural practices with the aim of better efficiency and also with minimal labour requirement. The need to be physically present in order to regulate common greenhouse parameters for example soil moisture content and temperature is eliminated with the use of this system.
This is the technology that underpins most of the world's mobile phone networks. The GSM platform is a hugely successful wireless technology and an unprecedented story of global achievement and cooperation. GSM has become the world's fastest growing communications technology of all time and the leading global mobile standard, spanning 218 countries. GSM is an open, digital cellular technology used for transmitting mobile voice and data services. GSM operates in the 900MHz and 1.8GHz bands and supports data transfer speeds of up to 9.6 kbps, allowing the transmission of basic data services such as SMS. It reigns as the world’s most widely used cell phone technology. Cell phones use a service carrier’s GSM network by searching for cell phone towers nearby. SMS is a text messaging service component of phone, web, or mobile communication systems. It uses standardized communications protocols to allow fixed line or mobile phone devices to exchange short text messages. SMS is the most widely used data application, with an estimated 3.5 billion active users daily, or about 80% of all mobile phone subscribers at the end of 2010. The term "SMS" is used for all types of short text messaging and the user activity itself in many parts of the world. SMS is also employed in direct marketing, known as SMS marketing. The term SMS as used on modern handsets originated from radio telegraphy in radio memo pagers using standardized phone protocols. These were defined in 1985 as part of the GSM series of standards as a means of sending messages of up to 160 characters to and from GSM mobile handsets.
A microcontroller is a compact stand-alone computer on a single integrated circuit containing a processor core, memory and programmable input and out peripherals. Hence it can be easily optimized for control applications. The entire processor, memory and the I/O interfaces are located on a single piece of silicon so, it takes less time to read and write to external devices. This makes real time operations quite easy to achieve. There are various reasons why microcontrollers are used in control systems worldwide. Microcontrollers with the supplementary circuit components are much cheaper than a computer with analogue and digital inputs or outputs. They are small, compact and light compared to computers. A microcontroller is well suited to small applications where a few number of inputs and outputs are required, the code is relatively small and which do not require extended amount of memory and a simple LCD display is sufficient as a user interface. The architecture of a microcontroller is much simpler than a computer hence it is less likely to fail and thus cementing its reliability. 17 A microcontroller differs from a microprocessor in many ways. First is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it.
The Arduino Board
An Arduino is a single-board microcontroller, intended to make the application of interactive objects or environments more accessible. The hardware consists of an open-source hardware board designed around an 8-bit microcontroller. Pre-programmed into the on-board microcontroller chip is a boot loader that allows uploading programs into the microcontroller memory without needing a chip (device) programmer. The Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or Integrated Development Environment (IDE) that runs on a computer, used to write and upload computer code to the physical board. It was estimated in mid-2011 that over 300,000 official Arduinos had been commercially produced. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. The Arduino also provides a standard form factor that breaks out the functions of the microcontroller into a more accessible package.
A sensor is often defined as a device that receives and responds to a signal or stimulus. The purpose of a sensor is to respond to some kind of an input physical property (stimulus) and to convert it into an electrical signal which is compatible with electronic circuits. The sensor’s output signal may be in the form of voltage, current, or charge. A sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an electronic instrument. A sensor is a device, which responds to an input quantity by generating a functionally related output usually in the form of an electrical or optical signal. A sensor's sensitivity indicates how much the sensor's output changes when the measured quantity changes. Sensors need to be 18 designed to have a small effect on what is measured; making the sensor smaller often improves this and may introduce other advantages. Technological progress allows more and more sensors to be manufactured on a microscopic scale as microsensors using Micro-Electro-Mechanical technology. In most cases, a micro-sensor reaches a significantly higher speed and sensitivity compared with macroscopic approaches. A good sensor obeys some basic rules. It is sensitive to the measured property only, it is insensitive to any other property likely to be encountered in its application, it does not influence the measured property and ideally, they are designed to be linear or linear to some simple mathematical function of the measurement, typically logarithmic. The output of such a sensor is an analogue signal and linearly proportional to the value or simple function of the measured property. The sensitivity is then defined as the ratio between output signal and measured property. For example, if a sensor measures temperature and has a voltage output, the sensitivity is a constant with the unit [Voltage/Kelvin]; this sensor is linear because the ratio is constant at all points of measurement. For an analogue sensor signal to be processed, or used in digital equipment, it needs to be converted to a digital signal, using an Analogue-to-Digital Converter (ADC). 2.6.1 Temperature Sensor A temperature sensor is a device that gathers data concerning the temperature from a source and converts it to a form that can be understood either by an observer or another device. The two main types of semiconductor temperature sensors are temperature sensitive voltage sources and temperature-sensitive current sources. An example of the first type is the National LM35. The voltage output from this circuit increases by 10 mV for each degree centigrade that its temperature is increased. If the output is connected to a negative reference voltage Vs, the sensor gives a meaningful output for temperature range of -55 to +150 degree centigrade. The output is adjusted to 0 V for 0 degree centigrade. The output voltage can be amplified to give the voltage range needed for a particular application. The accuracy of this device is about 1 degree centigrade. A thermocouple junction made of iron and constantan, commonly called a J thermocouple, has a useful temperature range of about -184 to 760 degree centigrade. Thermocouples can be made small, rugged and stable, however, they have problems like the output is very small and must be amplified a great deal to bring it up into range where it can drive an ADC. So, the LM35 was used in this system. The LM35 is an integrated circuit sensor that 19 can be used to measure temperature with an electrical output proportional to the temperature (in degree Celsius). LM35 temperature sensor can measure more accurately than using a thermistor. The LM35 generates a higher output voltage than thermocouples and may not require that the output voltage be amplified. It has an output voltage that is proportional to the Celsius temperature. The scale factor is 0.01V/degree Celsius. Another important characteristic of LM35 is that it draws only 60 micro amps from its supply and possesses a low self-heating capability. The sensor self-heating causes less than 0.1 degree Celsius temperature rise in still air. For this project, temperature sensor to be used: LM35 with output accuracy of 10mV/oC.
Soil Moisture Content Sensor
Soil moisture sensors measure the water content in soil. A soil moisture probe is made up of multiple soil moisture sensors. Cheaper sensors -often for home use- are based on two electrodes measuring the resistance of the soil. Sometimes this simply consists of two bare (galvanized) wires, but there are also probes with wires embedded in gypsum. Electrical conductivity probes measure soil moisture in the soil by how well a current of electricity is passed between two probes. The more moisture in the soil the better the conductivity or the lower the electrical resistance. This method is LM35 Output Input (Voltage) Ground 20 very sensitive to the spacing of the probes as well as being influenced by soil type and salt concentrates in fertilizers.
A motion detector is a device that monitors a field of view and performs a function if motion is detected within that field. Motion sensors are commonly used in security systems as triggers for automatic lights or trips for remote alarms and similar applications. Motion sensors work based on a wide variety of principles and is used in a wide variety of applications. Typical usage could be in the exterior doorways or windows of a building for monitoring the area around the building. Upon detecting motion, they generate an electrical signal based on which some actions are taken. Some operate in much the same way as a military radar scanner, while others work based upon vibration, infrared radiation and even sound. Motion sensors are employed to detect different types of human movement. Some are intended for local event sensing, some for area sensing.
Three general steps can be followed to appropriately design and come up with the working prototype:
Step 1: Identify measurable variables important to production. It is very important to correctly identify the parameters that are going to be measured by the controller’s data acquisition interface, and how they are to be measured. Preliminarily, temperature and soil moisture content have been selected as the test parameters.
Step 2: Investigate the control strategies. An important element in considering a control system is the control strategy that is to be followed. The simplest strategy is to use threshold sensors that directly affect actuation of devices.
Step 3: Identify the software and the hardware to be used. Hardware must always follow the selection of software, with the hardware required being supported by the software selected. In addition to functional capabilities, the selection of the control hardware should include factors such as reliability, support, previous experiences with the equipment (successes and failures), and cost.
It is an illustration of how the project was implemented and the various parts involved in it. From the above representation, the user’s phone was used as a transmitting section from which the subscriber sends text messages that contain commands and instructions to the GSM modem which is based on a specific area where the control system is located. The received SMS message is stored in the SIM memory of the modem and then extracted by the microcontroller and processed accordingly to carry out specific operations.
Hardware Circuit Components
A microcontroller is a compact standalone computer, optimized for control applications. Entire processor, memory and the I/O interfaces are located on a single piece of silicon so, it takes less time to read and write to external devices. Why choose a microcontroller? Following are the reasons why microcontrollers are incorporated in the control system: 26 i. Cost: Microcontrollers with the supplementary circuit components are much cheaper than a computer with an analogue and digital I/O. ii. Size and Weight: Microcontrollers are compact and light compared to computers. iii. Simple applications: If the application requires very few number of I/O and the code is relatively small, which do not require extended amount of memory and a simple LCD display is sufficient as a user interface; a microcontroller would be suitable for this application. iv. Reliability: Since the architecture is much simpler than a computer it is less likely to fail. v. Speed: All the components on the microcontroller are located on a single piece of silicon. Hence, the applications run much faster than it does on a computer. A microcontroller differs from a microprocessor in many ways. First is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it.
i. Memory unit
Memory is part of the microcontroller whose function is to store data. For a certain input we, the contents of a certain addressed memory location is pinpointed. Memory consists of all memory locations, and addressing is nothing but selecting one of them. Besides reading from a memory location, memory must also provide for writing onto it. This is done by supplying an additional line called control line. 27 ii. Central Processing Unit It has a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another. Its memory locations are called registers whose role is to help with performing various mathematical operations or any other operations with data wherever data can be found. iii. Bus It represents a group of 8, 16, or more wires. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory needed to be addressed and the other one is as wide as data. iv. Input-output unit They are used to send data to, or take it from the microcontroller. The input and output ports acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller. v. Timer unit The basic unit of the timer is a free-run counter which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the basis of their difference, determine how much time has elapsed. This is a very important part of the microcontroller. 3.2.2. Analogue to Digital Converter As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a microcontroller. This task is performed by analogue to digital conversion or by an ADC which converts an information about some analogue value to a binary number and for follow it through to a CPU block so that CPU block can further process it. 3.2.3. Relay The relay driver is used to isolate both the controlling and the controlled device. The relay is an electromagnetic device, which consists of solenoid, moving contacts (switch) and restoring spring and consumes comparatively large amount of power. Hence it is possible for the interface IC to drive the relay satisfactorily. To enable this, a driver circuitry, which acted as a buffer circuit, is to be incorporated between them. The driver circuitry senses the presence of a “high” level at the input 28 and drives the relay from another voltage source. Hence the relay is used to switch the electrical supply to the appliances.
Liquid Crystal Display (LCD)
A liquid crystal display (LCD) is a thin, flat display device made up of any number of colour or monochrome pixels arrayed in front of a light source or reflector. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power.
Most GSM modems have F-Bus and M-Bus connections that can be used to connect a phone to a PC or in this case a microcontroller. The connection can be used for controlling just about all functions of the modem. This bus allowed us to send and receive SMS messages.
3.3.1. Programming Software The study used the Arduino development environment which is based on the C++ language. The Arduino software is published as open source tool, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. The Arduino development environment contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them. The open-source Arduino environment makes it easy to write code and upload it to the I/O board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing, avr-gcc, and other open source software. Software written using Arduino are called sketches. These sketches are written in the text editor. Sketches are saved with the file extension .ino. It has features for cutting/pasting and for Figure 4 : Liquid Crystal Display (LCD) 30 searching/replacing text. The message area gives feedback while saving and exporting and also displays errors. The console displays text output by the Arduino environment including complete error messages and other information. The bottom right-hand corner of the window displays the current board and serial port. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open the serial monitor. 3.3.2. System Flowchart The System flowcharts for the software program to be developed are shown in Figure 5 & 6. The system has several modules working together to achieve the system’s goals. Majorly, the system can be divided into two; manual control by the user and automated monitoring and control. If the user overrides the automated system by sending a command to the GSM module, the system obeys the command and carry out the action required by the user. The actions that can be commanded by the user via SMS commands include: i. Override command to stop the automated monitoring and control. ii. Switch on fan- the user can send a command to switch on the fan inside the greenhouse. iii. Switch on irrigation valve- the user can also trigger the valve via a command iv. Switch off fan v. Switch off irrigation valve vi. Request data of the greenhouse parameters at a particular time vii. Switch off override command- this hands back authority to the system to continue monitoring and automatic regulation. The flowchart as shown was the guide to developing the program in the Arduino software as shown in the sample codes in the Appendix of this document. The system automatically takes readings from the sensors at particular intervals as shown in Code Sample (ii) in the Appendix. It then compares these values with optimal values pre-set within the system and take corrective measures (switch on irrigation valve/ fan). This is a continuous looping process to check whether the parameters have fallen back within optimal levels and thus switch off the fans or valve. The motion sensor was continuously kept on and any movement to trigger it switches on the alarm and notifies the user immediately via SMS.
We have a be nice policy.
Please be positive and constructive.