Energy Efficient Home Automation Using Python Programming - V1.8
Energy Efficient Home Automation Using Python Programming - V1.8
Home Automation system has become a career objective, popular and drawn attention
from the students to Industry researchers over a decade. There many industries penetrated
in the field of IoT and developed many sophisticated system. The researchers published
many papers on Automation. This has been discussed in the chapter-2 in detail. Few of
the monitoring activities beyond the human involvement. The machine will continue its
activities throughout its life time and serves for the purpose.
The available Sensors such as temperature sensor, humidity sensor, pressure sensor, water
level indicator, smoke detectors and actuators like light, fan air conditioning, motor are
inter connected to control from different location. The type of Wi-Fi network may be vary
system to system, for example it may be blue tooth, GSM/GPRS, Wi-Fi, ZigBee or
WLAN etc.
The basic idea behind Home Automation is to control and monitor all home appliances
and its functions from different locations taking Internet as an advantage.
Temperature Control
Electronic Locking System
Lights and Fans
Motor and Water Level Control
Fire Alarms
Camera
Smoke Detectors
Health Monitoring Systems
PIR Motion Sensor and Light Sensors
The developed systems are monitoring the situation using sensors and collecting
the huge data. The collected data in turn storing using cloud computing process. The
collected data is using for future requirement analysis. The human replacement is
impossible in some areas the Automation process is one among them.
PROJECT OBJECTIVES
The available Automation systems have their own merits and demerits. Few are
having drawbacks in Monitoring activities, few are facing interconnection issues, few are
with energy requirement issues and also network related issues. Few systems does not
have provision for the future expansion means dedicated to serve the current purpose.
The automation systems available in the market are expensive and bulk in size.
Few automation systems are consuming too much power even though they have enough
electronic devices built on the devices.
APPLICATIONS
The proposed system has variety of sensors and actuators. The Future system has
different applications and few of them are:
Main application is to save the energy utilization along with the control and & Monitoring
of Home Appliances.
The automation system has few limitations on the other side. The main and
important factor is “Data Storage & Security”. The monitored and processed data should
be stored for future purpose securely. This is very critical we may need to take third
parties support it may added cost to the system. Another major factor is “Hacking”,
controlling someone’s Home network without any authorization.
INTRODUCTION
The advancements in miniaturization of electronic devices, reduced power
consumption and increased network capabilities gives more sophisticated Home
automation systems day by day.
The proposed project is using current technologies and devices to control home
appliances. ZigBee selected as a wireless source. Raspberry Pi selected as a computer for
data processing and storage. Relay board is used for controlling various devices which are
operating at different voltage levels. Each of these explained in details.
ARCHITECTURE DESCRIPTION .
The technological improvements in Automation system is changing drastically day to
day. As the ASIC and CMOS process techniques evolved which in turn integrated most
of the components into a single chip and converted in the form of single boards. These
single boards are competed with standard buses which are fit into engineering
workstations cabinets and like computer systems. In this Project ZigBee is used as a
wireless device and the Raspberry Pi as a Central Processing Unit and are connected to a
home gateway. This project is developed by using Python programing. The proposed
system eliminates the cumbersome wiring and it is easy to expand based on the network
size and capacity.
Generally most of the Homo Automation Systems contains two types of Devices and
controlled and monitored using Single Board Computer.
• Sensor and
• Actuators
The first physical device is so sensitive to the energy that can be radiated by object.
Depends on the energy level differences of the object the sensor sends the response to the
processing unit. Temperature sensor is a best example for Sensor device. The second
element is an elect mechanical device or electronic device works based on the user input.
Now a days many traditional systems are not focusing on cost and Energy
saving. Some Home Automation Systems are using their own proprietary tools which in
turn increases the dependency on the particular manufacture. This problem was
improving quickly with open source tools and locally available electromechanically parts.
INTERCONNECTIVITY
The Proposed Automation System having following components.
Raspberry Pi 3
ZigBee Module
PIR Motion Sensor
Light sensor
Relay Board
Mechanical Switches
LEDs and Wiring
The ZigBee has been used as a wireless device between the sensors and actuators
which are controlled by a Central Processing Unit. The Central Processing unit is
programmed using Python Scripting Language. A simple network is developed using
ZigBee using its one of the feature of interoperability. The Raspberry Pi 3 single board
computer is selected as master device to control the network which is running at
maximum speed of 1.2GHz. An important feature of the Raspberry Pi is the Gigabit
Ethernet over USB 2.0, and Power over Ethernet and also real-time tasks can be executed
without any interruption from the Linux kernel. The Raspberry Pi 3 boot up and run using
Linux which is free and open source. The programming language using to develop logic
“Python” is also an open source programming language.
The light sensor connected to this system is minimizes the unnecessary power
wastages such as turning light on day time. The use of PIR Infrared Proximity Motion
Sensor also have similar application it turns on the devices when there is a requirement.
The ZigBee and Wi-Fi network are integrated through a common home gateway. The
gateway provides network interoperability, a simple and flexible user interface, and
remote access to the Home Automation system. The devices selected for this project are
available in the market at lower cost and the designed in such way that to enhance the
system with new devices as per the advances in technology.
ZigBee
There are many areas different Home Automation systems depending upon the
requirement and application.
• Home: Controlling electrical appliances, Safety and Security.
• Industrial Automation: Process control, Power management and to reduce time
lines.
• Transportation: Tracking, identifying the location in case of emergency
• Cities: Traffic light control, Water Control and Public safety
• Work Environment: Fire management systems, Water and Energy saving
appliances.
Whatever be the location or environment the main goal is to reduce human interference,
time delays and to increase safety.
ZigBee Devices
It is a Full Function Devices (FFD)
Works in any Topology ( Mesh or Star)
Capability as a Network Co-Ordinator
Communicates to any other Device
The ZigBee has a capability of configure as a coordinator, router and end device.
It operates at 3.3Volts level. The current required for normal operation is 40mAmperes @
3.3V. There are different high efficiency modules which supports at a line of sight range
of 1000 meters. The ZigBee supports analog inputs directly. The PIR sensor and or any
other analog sensors operating at 3.3V can be connected directly to ZigBee.
PROCESSING UNIT
The Raspberry Pi 3 Model B is the earliest model of the third-generation Raspberry Pi.
The Features of Raspberry Pi 3 are mentioned here.
The Raspberry pi 3 Board works on Open source operating System. There will not
be any development or Tools required. Easy to program and easy to debug. Plenty of
sources are available for beginners. One of the best programming language it supports is
“Python”. Python Programming Language is a scripting language mostly using in
Artificial Intelligence. It is an open source Programming Language.
The Raspberry pi is a very small form factor computer. The Raspberry Pi contains quad
core Broadcom BCM 2835 SoC. The Figure 3.2 shows the Top and Bottom view of the
Raspberry Pi. This Board is using as a control device and is running of Linux Operating
System,
RASPBERRY PI 3
Relay Board
RELAY BOARD WITH ZIGBEE BASE
The Raspberry Pi 3 operates at 3.3V range and the Relay operates at 5V Voltage level.
Whereas the Controlling circuit is 230V. The Relay board takes 3.3V input from ZigBee
board and operates Relays based on the Logic. The Logic is performed by the Raspberry
Pi 3 Single Board Computer. The Relay outputs NC (Normally Contact) and NO
(Normally Open) Terminals are connected to 230V or any home appliances. Other than
3.3V and 5V operating voltage Relay driver board is required to drive the different higher
operating voltages. The Relay board has a provision for ZigBee with base. The UlN2803
mounted on the Relay board takes 3.3V input and provides 5V output signal connected to
the Relay coil. All the components used on this board are very low cost and available in
the local market at lower cost. The Relay board requires 5V as Input thru corresponding
DC Jack.
Mechanical Switches
Keeping in mind some special cases a mechanical switch provided for each appliance. It
is Double Pole Single Throw (DPST) Switch.
3.7 Summary
This chapter explained about the components used in the Home Automation and
its features along with the flow which is to be carried out in controlling and monitoring
the devices. The prosed system is implemented using open source scripting language
called “Python”.
PROJECT DESIGN AND IMPLEMENTATION
This project mainly depends on Sensor inputs and Actuator outputs.
The Raspberry Pi 3, ZigBee and Relay board configurations are explained.
DESIGN
Raspberry Pi 3 is using as a Single Board Computer running on linux Kernel with
Python Programming Language.
ZigBee Module one is acts as a End Device and another ZigBee Module works as
a Co-coordinator. Both of these configured for Mesh network.
Relay Board is used to control the devices whose operating voltage is greater than
5V.
RASPBERRY Pi 3
Single Board Computer
ZigBee
Quad Core 1.2GHz
Wireless Module
Broadcom
Coordinator
3.3V Operating Voltage
WLAN Enabled
LAPTOP
The Figure 4.2 shown above is having Raspberry Pi and ZigBee. The Raspberry Pi is
powered up using USB Cable from Laptop. The ZigBee is connected to the Raspberry Pi.
All the ZigBee modules are interconnected in mesh network. ZigBee can be configured as
a Coordinator, router and end device. Coordinator establishes the network and stores the
data such as security keys. Routers act as a intermediate nodes and relay on other devices.
.Logic Processing Unit with ZigBee
The power LED blinks once after connected to the computer. The standard USB port
provides 500mA of current at 5V. This power is enough to operate both Raspberry Pi and
ZigBee.
Power Supply 9V
Power Supply
5V to 3.3V
Connector
CONTROL EXPRESSION
The Logic expression is derived for the output generated by a Single board Computer.
The Same output is executed through Relay Board.
The Default Status of Relay -1 and Relay -2 is “OFF”. The Mechanical switch status is
being read at initial state.
The experimental set up is shown below is the ZigBee as a end device configuration.
This complete module replaces the traditional switch board in the home.
The only difference is Relay board with ZigBee module. With the simple architecture
making automation using home network.
Relay and Mechanical Switch Assembly-1
INITIAL STATE
1. The SBC will take Mechanical Switch position status before operating the any of the
Relays.
RESULTS
As Per the Test Cases the Hardware is functioning and the Control over the
network executed successfully.
Switch = OFF
Case – 2: Switch = ON
Y = ~ (A+ B), Turned OFF the Light
The Controlling of bulb through manual switch and through network is proven with
results. By using PIR Motion sensor the usage of electrical appliances reducing
drastically.
The motion sensor allows the device to turn on whenever required. The light sensor never
turns on during day time so that the appliances turning on and off in a controlled manner.
the modules have been designed to meet the requirements. Specifications and
Functionality of each module had verified according to the project requirement. The
Linux is used as an operating system and the program implemented using Python
scripting language.
SUMMARY
The Output and input to the system has been explained also derived Boolean
expression for logic implementation. It is true for any device whose operating voltage is
above 5V.