Controlling Mechanical Processes in a Modern House (Smart House)

Comfort, Security and safety are very important factors to consider during design of a modern house. In fact, automated houses (smart houses) have great impact in maintaining healthy lifestyle and minimize energy usages. Maintaining all house processes in preciseness, accurately, and repeatedly manner are very crucial to achieve our goal. Human comforts and safety require monitoring each sub-dynamic system that is in a daily routine and during 24-hours. As an example of common domestic controlled processes are watering garden, opening/closing doors, lighting, fire-alarms, safety-alarms, and air-condition. Without automation these processes that will require a responsible person to accomplish each task in a reputable schedule- time. The fact is that rarely one has time to do all of his/her house work or maybe another case where a disable resident needs help to maintain these mentioned processes. This research paper covers an available and easy way for everyone to automate his/her house using an affordable technique which makes use of small microcontroller called Arduino. The development of smart house, which can automatically open/close doors, watering garden, maintain security (alarm from dangerous), lighting during dark-time, controlling air-condition and display the results in an LCD screen. Feedback signals from each of the mentioned five close-loop control system are collected by the corresponding sensing methods. Soil-wetness, Ultrasonic-distance, Photocells, electronic thermometer are used as feedback measurement instruments, which were used to control each of the home-process. All the controlling processes and steps were coded and uploaded to Arduino- UNO.


INTRODUCTION
The process of maintaining complete control of a dynamic system requires feedback (signal from a sensors) to direct the system toward doing its required functions. In this paper, the dynamic system under study is going to be five dynamic processes. A feedback signals are collected from ultrasonic, photocells, soil-wetness, and electronic thermometer sensors. Then the system will try to maintain five design parameters by comparing feedback signals versus the specified operation points. One of the feedback carriers of the five close-loop control system was the piezoelectric ultrasonic transducer (HC-SR04). The project was zoomed down to a level of 1 m: 1 cm scale, to allow us to visualize the system, but we still can have the same result, when we built the system in actual scale. The automated house model is expected to smooth the controlling process and make it easier to reduce the efforts required to maintain the controlling process during 24 hours.
In this project, an Arduino-microcontroller was used to control all needed activities. Arduino microcontroller has been used in controlling many mechanical and medical devices. Arduino has been used to control automatic parking lots [1], gas valve [2], pulse signal detection [3], heart rate monitoring [4], and other controlling projects.
This project is designed to demonstrate an optimal way to automate a house and to reduce the energy consumption required to run the house's activities. The goal of the present research is to evaluate mechanism of the automated smart house system. The system control, measurements, and instruments are all tested during operation and a report of their preciseness, sensitivity, and repeatability was documented in this paper.

ARDUINO MICROCONTROLLER
The Arduino is name of a company which produces open-source small (microcontroller boards) hardware and Software. Arduino applications can be seen in many fields, such as; industrial controllers to control many industrial production processes, or as part of an instrument to measure specific physical quantity (Temperature, Pressure, etc.). These systems (controller) consist of sensors which transfer feedback signal (digital-or analog-signals) to an Arduino-board. Arduino boards are primarily programmed using the C and C++ programming languages [7]. The only limitation of an Arduino boards is that the sensed voltage range is designed to be between 0 and +5 V which will require extra work in case a feedback-sensed voltage was negative.

Programming
All Arduino boards can be programmed with the (Arduino Software (IDE)) using C and C++ programming languages [8-9].

Arduino Uno Hardware
Arduino Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an ACto-DC adapter or battery to get started [9]. In this project, sensors-structure was built for each sensing method. As an example, for HC-SR04 sensors, to get an optimal way to transfer input/output data from/to Arduino-pins , we introduce the structure as:

DISTANCE MEASUREMENT WITH ULTRASONIC TECHNIQUES
Ultrasonic measurement instrument is compound of a transmitter (transmits an ultrasound wave) and a receiver (receives the wave). As an example of an ultrasonic transducer is the model of HC-RS04 ultrasonic transducer. Each HC-SR04 module has an ultrasonic transmitter, a receiver and a control circuit. The four transducer's pins are VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground). The basic principles of an ultrasonic transducer are to measure the time between transmission of an ultrasonic energy from transmitter and receipt of that energy by a receiver. Then, the distance d can be calculated from the following equation [6]: where v is ultrasound velocity and t is the time consumed for the signal to travel between transmitter and receiver of the sensor. An important systematic error associated with this instrument is the variability of the ultrasound velocity with environment temperature according to equation (1).

Timing diagram
The distance through the time interval between sending trig-signal and receiving echo-signal can be calculated from the following Formula: μS / 58 = centimeters; or: the range = maximum time * velocity (340 m/sec at 20 C o ) / 2; It is recommended to use 60ms measurement cycle [1].

CHARACTERIZING ULTERASONIC SENSOR
The ultrasonic wave speed changes depending in the medium through which the wave travels.
Transmission speeds in common media are given in Table 1. When the media is air, the speed of ultrasound is affected by environmental factors such as temperature, humidity and air turbulence. Of these, temperature has the largest effect. The velocity of sound through air varies with temperature according to: where T is the temperature in °C. Thus, even for a relatively small temperature change of 20 degrees from 0°C to 20°C, the velocity changes from 331.6m/s to 343.6m/s.
Humidity changes have negligible effect. When the relative humidity increases by 20%, the corresponding increase in the sound velocity is 0.07% (corresponding to an increase from 331.6m/s to 331.8m/s at 0°C). Changes in air pressure itself have also negligible effect on the velocity. Similarly, air turbulence normally has no effect (though note that air turbulence may deflect waves away from their traveling direction). However, if turbulence involves currents of air at different temperatures, then random changes in ultrasound velocity occur according to equation (3). Wind also can alter the traveling direction of the waves. For an air flow with speed of 10 km/h, the deflection of the traveling wave can be by 8mm over a distance of 1m.

meters
The calibration process of the soil-moisture transducer was made by reading an analog signal from Arduino-analog pin A0 for four simulated signal inputs which are generated by introducing the soilmoisture transducer to four simulated soil conditions. The first condition represents a case of 0% water (dry soil). While the second simulates a case of %100 water (Soil saturated with water), and then come the rest of two cases which are %20 and %50 water in the soil. The signal output was about 5 volts for dry soil, 0.5 volts for %100 water (soil saturated with water represents uneconomic case). From the curve in figure 3, we can see that an economic choice is going to be the case of soil with %20 water which provides output of 4 volts. This optimal signal output is going to be used as the feedback control signal to run the pump. Above 820 units (4 volts), the pump is going to be called to run. It has been stated in TMP36-datasheet that the calibration factor is10 mV/°C, and the accuracy is ±2°C. The operating range is from −40°C until +125°C [7]. When you calibrate a TMP36 sensor, you will notice that 3.3v reference has precise results among the 5v and less noise. To convert the number from 0 until 1023 from Analog Digital Converter to 5v, we use the following formula: V out  Figure 4 illustrates components which were used to build the simulated automated smart house. The system consists of an I2C serial LCD 1602 module, one HC-SR04 Ultrasonic transducers, one Parallax servo, one photo-resistor, one electronic thermometer TMP36 and two Arduino boards (Uno and Mega). Figures 5 & 6 illustrate the final sitting of the control system drawing with Fritzing-software. The number of sensors was used here, are only for simulation proposes, that means for using this system in controlling real house scale, the number will be proportional to the house's size.

SYSTEM CONTROL USING ARDUINO
A close control system was built as illustrated in figure 7 & 8. The HC-SR04 Ultrasonic, photoresistor, TMP36 and SEN13322 transducers provide necessarily feedback signals to adjust entry/exit gates depending on our design control parameters, which are the availability of water in the soil, appearance of a person in front door, lightness or darkness of outdoor, etc. As an example of these control processes, is that the door will not open if the available space was less than {Measured Distance >= 10 cm}. A resident must stand in a distance less than or equal to 10 cm from the door, in order to send feedback signal to the servo-motor to open the door. Figure 8 illustrates one of usage of Serial Plotter, which describes simulation of opening/closing a door. The gates rotate 90 degree to allow a resident to enter to, or exit from, the door. The unit-pulse signal is illustrated in figure 8

RESULTS
The house automation using Arduino, appear clearly to have precise and accurate functionality, where series of accurate transducers were used. The arrangement was designed and positioned carefully to avoid any disturbance from another objects during each control process. The accuracy of where the transducer was calibrated to test the measurement range. The measurement range was from 3 cm until 5 m. The effect of changing environmental condition (Ambient temperature) was carefully tested, and confirmed that the optimal environmental temperature was 20 C o and also there will be some error corresponding to the change of the ambient temperatures, since speed of sound varies when ambient temperature was changed. Moreover, a carefully calibration of the SEN-13322 sensors are carried out and the results show good repeatability and perfect accuracy.

CONCLUSIONS
In this paper we presented detailed design process of the simulated automated smart home