Development And Control Of An Automatic Blind System

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

by

Chatura Jagadeesh Manamperi

A capstone project report submitted in partial fulfillment of the requirements for the

degree of Bachelor of Science in

Mechatronics Engineering

Examination Committee:

Dr. Manukid Parnichkun (Chairperson)

Dr. Mongkol Ekpanyapong

Assoc.Prof. Erik L. J. Bohez

Nationality:

Sri Lankan

Asian Institute of Technology

School of Engineering Technology

Thailand

May 2013

i

Acknowledgment

I would like to express my sincere gratitude towards Dr Manukid Parnichkun Associate professor Mechatronics; Robotics; Control Theory; Sensing & Measurements ,Asian Institute of Technology, for his supervising guidance and encouragement given throughout the final year Capstone project. My gratitude also goes to all faculty members and staff of ISE department to helping me in completing the project.

Furthermore, I would like to thank all friends and my members of family for encouragement given to me at all times.

Chatura Jagadeesh Manamperi

ii

ABSTRACT

Automatic blind systems are an emerging technology used in modern automated households. It has now used in many houses and officers to provide convenient automated control of sun light exposure to a space depending on user preference on given conditions. This system consists with five light dependent resistors to determine the sunlight intensity and adjust the angle of the blind accordingly. System also facilitates manual control. This study focus on controlling DC motor position using a optical encoder. Arduino microcontroller was used to execute the system. PID controller is used to minimize the error by adjusting the process input control signals. Main focus of this work is to apply the theoretical knowledge in to practical engineering applications and make a user friendly automatic blind prototype.

iii

Table of Content

Chapter Title Page

Title i

Acknowledgment ii

Abstract iii

Table of Contents iv

List of figures v

List of tables vi

1 Introduction 1

1.1 Background 1

1.2 Problem Statement 1

1.3 Objectives 1

1.4 Limitations and Scope 1

2 Literature Review 2

2.1 Information 2

2.2 Dc motor Control 4 2.3 PID Controller 5

3 Methodology 7

3.1 Make physical prototype model, make necessary

Circuitry and Implement Hardware 8

3.2 Develop program using Arduino IDE 13

3.3 Final Testing and trouble shooting 16

4 Results and Discussion 17

5 Conclusion and Recommendations 19

References 20

Appendices

Appendix1: Motor specification 21

Appendix2: Solid works Drawings 22

Appendix3: Arduino Sketch 24

iv

List of Figures

Figure Title Page

2.1 Window blind 2

2.2 CIE standard sky representations 2

2.3 Light intensity variation 4

2.4 PID Controller 5

2.5 Arduino Duemilanove Board 6

2.6 Reading Encoder readings 7

3.1 Basic Outline of the system 8

3.2 System flow chat 12

3.3 LDR circuit 13

3.4 Light intensity variation 15

4.1 Results for flap angles measured for manual control 18

4.2 Results for flap angles measured for Automatic control 18

v

List of Tables

Table Title Page

2.1 Dc motor controller (Logic table) 4

2.2 Condition/state 7

3.1 Observed values for Analog in 14

4.1 Results for flap angles measured for manual control 17

4.2 Results for flap angles measured for Automatic control 17

vi

Chapter 1

Introduction

1.1Background

The purpose of the Automatic blind system is to provide convenient automated control of sunlight exposure to a room depending on the light intensity and user preference. Conventional windows need to be manually adjusted throughout the working time and it consumes more time and effort. Automated blind system is a microcontroller - embedded system that automatically adjusts itself in real time depending on the environment conditions and user preferences. The main core of the system is an arduino microcontroller. The arduino can read input values from the environment and using these inputs values it will be able to manipulate the system to change the settings of the blinds accordingly. Photo resistors were used to determine the light intensity and accordingly blinds flaps were controlled by a DC motor with a simple gear setting.

1.2 Problem Statement

Automatic blinds are promising solution for normal windows which need to be manually adjusted throughout the day, which consumes more time and effort. This system will be innovative ingress existing product that enhances comfort of living. DC motor with an optical encoder is used to accurately control the position of the blinds. PID controller is implemented to minimize the error. Sunlight illumination inside a room based on many undesirable factors hence it is essential to develop methods to control the window blinds.

1.3 Objective

Objective of this project is to make a prototype Automatic blind system which automatically control daylight which enters the room while maintain room privacy of the user. Projects include design and make a prototype model, derive functions and compile a program to control the blinds for automatic and manual modes using collected data analysis and make necessary circuitry and controlling the position of a DC motor with a PID controller.

1.4 Scope and Limitations

The system only consider about the light intensity not consider about temperature variations. This project can be developed in to a solar powered smart blind system by installing simple circuitry to recharge the batteries in day time. Smart blind system can be developed in to a more advanced device by making switch inputs to automate light bulbs, HVAC systems and advanced security systems.

1

Chapter 2

Literature Review

2.1 Information

Window is a common domestic feature for years. In the past before heating, ventilation, and air conditioning systems invented people uses their windows as a way to standardize temperature inside the rooms as well as to utilize natural light.

https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSAUULANZVIpLm8asTifXGhXtmWGBWYdlJvCpn0Ody7qUCn2EOPhg

Figure: 2.1 Window blind

Window blinding is pattern of window covering. There are many distinct ways to do it using different kind of materials and techniques. Other than homes window blinds also used in automobiles.

Advantages of a smart blind system

Auto adjust based on user input parameters

Manual override to obtain the privacy

Enhance the comfort of living

Day light factor

The daylight inside a room is only a small fraction of that available from the sky and reflections. The quantity of daylight inside a room varies with the brightness distribution of the sky and is often mentioned in terms of a daylight factor.

2

Definition

Daylight factor (DF) is defined as the ratio of the actual luminance at a point in a room (lux) and the luminance available from an identical unobstructed sky.

Day light factor and luminance inside a room consist with three components.

Sky component: light arriving directly from the sky

Externally reflected component: light reflected from atmosphere obstacles

Internally reflected component: light reflected inside the room surfaces (floor, walls, ceiling, and furniture)

Average day light factor in a room can be calculated by following equation

DF =MWQT / A (1-R2) (2.1)

M=glazing obstruction coefficient

W=Area of the window

Q=angle of the visible sky

T=glazing transmission factor

A=Total internal area of the room

R =area weighted average reflectance of the room surfaces

CIE standard sky representation was used as a model to represent sun’s position with the time.

Figure 2.2 CIE standard sky representations

3

According to this model Max intensity will occur around 12.30(at the Zenith angle).

Figure 2.3: Light intensity variation

2.2DC Motor control

DC motor control is very important topic in this project. There are mainly two controllable parameters in a Dc motor.

Direction

Speed

Direction can be controlled by polarity of the motor. It can be done using a H bridge switching arrangement. Integrated H bridge motor driver was used in this project. Dc motor position control was done using the interrupts.

ET-OPTO dc motor driver was used to control the motor direction and the speed, direction of the motor controlled by changing the polarity of the motor and speed is controlled by varying the input voltage using pulse with modulation.

PWM

DIR1

DIR 2

Function

High

Low

High

Rotate right

High

High

Low

Rotate left

High

High

High

Fast stop

Table 2.1: Dc motor controller (Logic table)

Dc motor driver also facilitate for manual control. Jumper pin configuration need to be change before controller connect to micro-controller.

4

2.3 PID Controller

For many Engineering applications accurate control is required more than in open loop systems. Sensor is used to determine the condition of the load and adjust the system output. The comparison between command signal and measured signal produces an error signal and if either the command signal is changed or the measurement feedback signal is changed due to load condition, the control will produce a different error signal. The result will be that the actuator will automatically be controlled to make the relevant adjustment to reach the desired condition.

Controller

Amplifier

Actuator

Set point

Sensor

Measured signal Feedback loop

(Process variable)

Figure 2.4: Block Diagram of a Closed-loop system, reproduced from Terry Bartelt, Industrial Control Electronics: Devices, Systems & Application

The controller calculates an error value as the difference between a measuring signal and the command signal or set point value. The controller consists of three terms: the proportional, integral and derivative. Relationship between Kp, Ki and Kd is important response characteristics Proportional term refer to the rise time, of which these three parameters are most useful.

KP to decrease the rise time.

KD to reduce the overshoot and settling time.

KI to eliminate the steady-state error.

5

2.4 Arduino Platform

Arduino is consisting with two main parts, hardware and software, arduino board is a part of hardware and arduino IDE used to create the sketch (relevant program) and upload it to the hardware part to do the work.

The Arduino Hardware

The Arduino board is a small microcontroller board; which is much less power full than a personal computer. But it’s a much cheaper and very useful to build interesting devices.

There are many versions of this board; the one I used in this project is the Arduino Duemilanove, which is simplest one to use and the best one for learning on. Also there are more sophisticated arduino boards available in the market.

C:\Users\chatura\Desktop\images.jpg

Figure 2.5: Arduino Duemilanove Board

The Duemilanove board features an Atmel ATmega328 microcontroller operating at 5 V with 2

Kb of RAM, 32 Kb of flash memory for storing programs and 1 Kb of EEPROM for storing

Parameters, the clock speed is 16 MHz, which translates to about executing about 300,000 lines

of C source code per second. The board has 14 digital I/O pins and 6 analog input pins.

The board can be powered from by a computer’s USB port; also it can be done by an AC adapter (9 volts recommended).

The Software (IDE)

The IDE (Integrated Development Environment) is a special program that runs in computer that allows user to write programs for the Arduino board in a simple language which based on c, c ++,by written program (sketch) can be uploaded to the board very easily. Then written code passed to the avr-gcc compiler, an important piece of open source software that makes the final translation into the language understood by the microcontroller. It helps to minimize the complexity of programming.

6

2.5 Reading Encoder readings

Encoder consists of two channels which named as A &B which is 90 degrees out of phase Quadrature signal enables the direction of rotation to be determined by checking the signal level on one channel when a rising edge occurs on the other channel. As explained in Figure 2.6, if the motor is rotate clockwise, the voltage level of channel A will be low when a rising edge appear on channel B. When the motor rotate counterclockwise, the voltage level of channel A will be high when a rising edge occurs on channel B. This particular encoder produces 768 pulses per revolution.

.

Figure2.6: Encoder readings

The Arduino can listen for 4 types of condition changes. Those changers listed below

Condition

State

LOW

LOW

RISING

Changes from LOW -HIGH

FALLING

Changes from HIGH - LOW

CHANGE

Change from HIGH to LOW or LOW to HIGH

Table 2.2 Condition/state

Interrupts have been used to update the motor position to the microcontroller. Digital pin 2,3 which is inbuilt pins provided for reading interrupts in the Arduino used to track the interrupts.

7

Chapter 3

Methodology

Main stages of the proposed work can be stated as follows.

Make physical prototype model, make necessary circuitry and Implement Hardware

Develop required program using Arduino IDE based on corresponding information

Testing and trouble shooting

3.1Make physical prototype model, make necessary circuitry and

Implement Hardware

Prototype model window blind structure was built using a two wooden stands with steel supports. Flaps are selected from existing window blind which is made by very light weight plastic material in order to reduce the weight of the system.

Most import parts of the mechanical design is to design required parts using solid works software and machining, selecting a suitable DC motor and implementing them in the selected wooden platform was done later. System consists with two shafts, Primary and secondary, primary shaft was connected to the strings which control the movement of the blinds. Secondary shaft connected to the motor through a gear setting. Suitable gear ratio is selected to system to reduce the speed of the motor depending upon the market availability of the gears. Gear mounted secondary shaft then connected to the primary shaft which holds blinds. When motor turns in clockwise direction strings will intertwine around the shaft pulling the blinds one direction. When the motor turns in other direction blinds will turn inversely.

Based on the following calculations suitable Dc motor was selected

Figure3.1: Gear setting in the system

8

Based on the designed system following parameters were noted

Gear 1 (m2) =200 g

Radius of Gear1 (r2) =1.5cm

Gear 2 (m3) =300 g

Radius of Gear2 (r3)= 3cm

Secondary Shaft (m1) =250g

Radius of Secondary Shaft (r1) =0.4 mm

Primary shaft =weight negligible

Weight of the flaps (m4) =250 g

Moment of inertia in secondary shaft= 1/2 mr2 (r=radius)

Moment of inertia of gears =1/2 mr2

Gravitatianal acceleration= 9.81 ms-2

n1=30

n2=60

ω1=angular velocity in gear1

ω2= angular velocity in gear2

Gear ratio equation = n1/ n2 = ω2/ ω1 (3.1)

Motor speed = 120 rpm= 120× 2× 3.14/60

ω1 = 12.567 rads-1

Apply to the gear ratio equation w2 can be calculated

ω2 = 6.283 rads-1

Assume that angular acceleration is 3600 degrees per minute in secondary shaft

Angular acceleration = α3

α3=1× π× 360/180 (3.2)

α3 = 2× π

=6.28 rads-2

Tangential acceleration (aT) =rα (3.3)

Tangential acceleration is equal in both gears

  α3r3 = α2 r 2

α2 = α3r3/r 2 (3.4)

=6.28× 3/1.5

= 12.56 rads-2

9

Moment of inertia of Gear 1(J1)= 1/2 m2 × r22 (3.5)

= 1/2 × 0.2× (1.5× 10-2)2

= 2.25 × 10-5Kgm2

Moment of inertia of Gear 2(J2)= 1/2 m3 *r32 (3.6)

=1/2 × 0.3× (3× 10-2)2

=1.35× 10-4 Kgm2

Moment of inertia of Secondary Shaft (J3)= 1/2 m1 r12 (3.7)

= 1/2 × 0.25× (0.4× 10-2)2

=2× 10-6kgm2

Torqe =Moment of inertia * angular accleration

= Jα (3.8)

J= J3+ J2

= (2× 10-6Kgm2 + 1.35× 10-4 Kgm2)

= 1.37 × 10-4 Kgm2 × 6.28 rads-2

= 8.6036*10-4 Kgm2 rads-2

Power (P1) = Torqe* Angular velosity

(3.9)

=8.6036× 10-4 Kgm2 rads-2 × 6.283 rads-1

=5.40 × 10-3W

Using equation (3.8) for Gear 1

= J1× α2

=2.25 × 10-5Kgm2× 12.56 rads-2

=2.826 × 10-4 Kgm2 rads-2

Power (P2) = Torqe× Angular velosity(applying to the Equation 3.9 )

= 2.826 × 10-4 Kgm2 rads-2 × 12.567 rads-1

=3.551× 10-3 W

To determine the torqe producced by the flaps following equation was used

Torqe= force ×distance

T = F × r (3.10)

= Weight of the flaps (m4) ×Radius of Gear2 (r3)

=0.250× 9.81× 3× 10-2

= 0.0735 Nm

10

Power (P3) = Torqe×Angular velosity(using Equation 3.9)

= 0.0735 Nm *6.283 rads-1

=0.461 W

Total Power required = P1+ P2 +P3

= 5.40 × 10-3W +3.551× 10-3 W+0.461 W

= 0.469 W

Applying safety factor value as 4

Total power required from the motor > 4× 0.469 W

> 1.878W

Based on the calculations 17W Dc motor was selected. Motor specification Appendix 1:

The light dependent resistors have a changing resistance based on the amount of sunlight intensity shining on them. Five LDR sensors used to sense the intensity of the light. Sensor panel provides a varying voltage drop across the light dependent resistors. This voltage drop can be read by arduino analog input pin through serial communication and it is translated to integer between 0-1023.Then light intensity values are collected for 12 hours in day time for five days. This average light intensity was used to derive functions and control the blinds movements accordingly.

System mainly consists with four circuits. Interface circuit between the optical encoder and the microcontroller, switch board circuit and the LDR, LED array circuits.

Master Toggle switch switches ON/OFF functionality; While State switch controls the automatic and manual modes. Readings from the light dependent resistor panel are taken in to consideration when in Auto mode and readings from the variable resistor (potentiometer) is taken in manual mode. System also consists with 3 LED’s (light emitting diodes) panel which changes its brightness according to the light intensity which was detected from the light dependent resisters.

11

System flow chart

Figure 3.2; System flow chat

12

3.2 Develop required program using Arduino IDE based on corresponding

Information

Initially studies were conducted about Arduino Duemilanove microcontroller which use as the main core of the system. Under this section thorough understanding about Arduino Duemilanove Microcontroller is essential. Main program for the system was written using the Arduino IDE which is a based on C and C++ languages. Coding according to the prototype model objectives is the main task under this section.

Then light intensity values were taken for 12 hours in day time for five days to work out average light intensity. This was used to derive functions and control the blinds movements.

A simple circuit was used to get the analog input from the light dependent resistors and used array of LDR’s in order to get a more sensitive and accurate value, as one sensor sometimes tense to give incorrect values.

cdsanasch.gif

Figure 3.3: LDR circuit

This voltage drop can be read by arduino analog input pin through serial communication and it is translated to integer between 0-1023.

13

Observed values for five days are listed in the table

Time/analog read

Day 1

Day 2

Day 3

Day 4

Day 5

Average

6.30 AM

300-320

290-310

300-310

320-350

330-350

318

7.30 AM

425-450

430-460

400-420

450-470

385-400

429

8.30 AM

550-580

555-570

525-540

560-575

510-530

550

9.30 AM

645-660

680-690

665-680

630-660

650-680

664

10.30 AM

690-710

710-730

725-745

720-760

750-780

732

11.30 AM

780-790

760-780

780-790

800-810

805-810

790

12.30 PM

880-900

850-890

920-970

900-920

935-950

912

1.30 PM

900-910

880-900

865-880

895-900

870-890

886

2.30 PM

865-880

850-860

820-840

850-860

820-860

847

3.30 PM

765-800

780-810

765-800

800-810

750-770

785

4.30 PM

650-660

625-640

660-680

645-655

620-630

646

5.30 PM

400-420

440-460

400-420

380-400

390-400

411

6.30 PM

120-150

90-110

100-130

110-120

100-110

114

Table 3.1: Observed values for Analog in

14

Light intensity plotted with respect to the time of the day

Figure 3.4: Light intensity variation

At the beginning, optical encoder readings were used to set the specific set points and derived a function to rotate the shaft to the measured set points. Potentiometer was used as a user interface which is able to enter specific position preferred, and then program could be written to do the specific task.

Main program have two modes, which are specified as Automatic mode and Manual mode. Automatic mode triggers to close the blind proportionally according to amount of sunlight intensity which occurred in the time. Manual mode facilitate user to control the blinds according to user preference, potentiometer was used to control the blinds direction. Also manual mode facilitates the user privacy.

In this program, rising edge signal was used to take the position of the motor. It triggers when the pin goes from low to high. Interrupts handling function was called when an interrupt occurs, as a result main program stops and executes the interrupt handler function. After the interrupt handler function has finished, control returns to the exact point in the main program.

Two output set points using the encoder counts readings, corresponding blinds positioning were set up. After taking the output limits, a function was derived to turn the motor shaft to desired positions.

ENCS, ENCR represents the encoder set point limits (ENCR refers to 0 degree position and ENCS refers to 90 degree positioning of the blinds), and LDRHIGH(1000), LDRLOW(100) denotes the minimum and maximum light intensity values based on the collected data.

15

Manual mode function

Counts to go =CTG

(3.21)

Similar function could be used with slight changes for Automatic control

Counts to go=CTG

(3.22)

Inside the Automatic mode, function was derived to control the LED panel’s brightness; map function which available in arduino was used to re-map the analog input values to another range.

Derived function

Led Brightness = map (LDR value, 0, 1023, 255, 0) after this mapping LED’s brightness vary inversely to the light intensity. This indicates higher brightness when the flaps are closed, and lower brightness at flaps are opened. PWM pin was used in arduino board to control the output. This application can be developed to make switch inputs to AC bulbs inside the room.

3.3 Final Testing and trouble shooting

After implementing the Hardware, software components prototype testing was done. Trial and error method was used to configure the PID controller since the transfer function is unknown for the system. Ac light bulb was used as the inside light source for demonstrate.

There are three steps of tuning:

Kp is selected in order to fulfill the transient response expected while setting Ki and Kd to zero.

Then Ki is adjusted in order to achieve any steady state error requirements.

The transient response can be restored by selecting a suitable Kd.

Initially Kp value was set to 5 while other values assigned to 0, but there was considerable overshoot and oscillation effected to the system. Later the Kp value was gradually changed from 5-1, overshoot and oscillation became less impact to the system. But it reduces the response time of the system. System works smoothly for 1-0.5 Kp values. Since final Kp value for the controller was 0.75 with other controlling parameters set to 0. KI, KD values not made a significant impact on the system since system can be represent as P controller.

Final Set values for the PID controller was

KP=0.75 KI=0 KD=0

16

Chapter 4

Results and Discussion

Flaps angles was measured for manual control and automatic control after tuning the PID controller, and noted in following tables. Serial monitor was used to record the analog in value and protractor was used to measure the blind angles.

Potentiometer value(Analog in)

Theoretical value

Practical value

0

00

00

255

22.50

230

512

450

450

768

67.50

670

1023

900

910

Table4.1: Results for flap angles measured for manual control

LDR value (Analog in)

Theoretical value

Practical value

100

00

00

325

22.50

220

550

450

460

775

67.50

680

1000

900

910

Table 4.2: Results for flap angles measured for Automatic control

17

Figure 4.1: Results for flap angles measured for manual control

Figure 4.2: Results for flap angles measured for Automatic control

18

Chapter 5

Conclusion and recommendations

5.1 Conclusion

Final year capstone project is a great opportunity for the undergraduate to apply theoretical knowledge in to practical applications and also gives good machine shop experience. Developed Smart blinds system prototype will be a promising solution for conventional windows which need to be manually adjusted throughout the day, which consumes more time and effort. This system will be innovative ingress existing product that enhances comfort of living.

Advantages of Automatic blind system

Auto adjust based on light intensity

Manual override to obtain the privacy

Enhance the comfort and lifestyle

Save time

System can be further developed to control the HVAC systems and Ac lighting inside the room and advanced security systems. It also can be developed as a solar powered smart blind system which is an environment-friendly and energy efficient smart device. Using a Dc motor instead of servo or stepper motor enables system to withstand more robust environments.

19

REFERANCES

[1] Massimo Banzi, first edition. Getting started with Arduino

https://www.google.co.th/#hl=en&sclient=psyab&q=getting+started+with+arduino+pdf&oq

[2] W. Durfee, Arduino Microcontroller guide, University of Minnesota.

https://docs.google.com/viewer?a=v&q=cache:mXvdG1lFrmIJ:www.me.umn.edu/courses/me2011/arduino/arduinoGuide.pdf

[3] Lindsey Joseph, Eun Sun Lee, Sarah Masters and Carolina Tejada(2008) .Engineering

Smart Windows Using Arduino, Governor’s School of Engineering and Technology at

Rutgers University.

https://docs.google.com/viewer?a=v&q=cache:bW2fA8j7NrsJ:soe.rutgers.edu/sites/default/files/gset/Windows.pdf

[4] Arduino Basic Input Output Circuits (2010)

http://www.dave-auld.net/index.php?option=com_content&view=article&id=107:arduino-

interrupts&catid=53:arduino-input-output-basics&Itemid=107

[5] Arduino PID Library (2013)

http://playground.arduino.cc/Code/PIDLibrary

[6] Finding equivalent mass moment of inertia for gear system

http://www.physicsforums.com/showthread.php?t=465851

[7] Arduino playground, Attached interrupts

http://arduino.cc/en/Reference/AttachInterrupt

[8] Reading optical encoder incremental encoder

http://arduino.cc/forum/index.php?topic=93824.0

20



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now