Automated Nightlight

Final Report

Project Team: May 06-19

Client

IowaStateUniversity – Senior Design

Faculty Advisor

Dr. Degang J. Chen

Team Members

Wesley AdreonKong-Wei Soon

Andrew Cook Dantrayl Smith

Disclaimer Notice:

This document was developed as a part of the requirements of an electrical and computer engineering course at IowaStateUniversity, Ames, Iowa. This document does not constitute a professional engineering design or a professional land surveying document. Although the information is intended to be accurate, the associated students, faculty, and IowaStateUniversity make no claims, promises, or guarantees about the accuracy, completeness, quality, or adequacy of the information. The user of this document shall ensure that any such use does not violate any laws with regard to professional licensing and certification requirements. This use includes any work resulting from this student-prepared document that is required to be under the responsible charge of a licensed engineer or surveyor. This document is copyrighted by the students who produced this document and the associated faculty advisors. No part may be reproduced without the written permission of the senior design course coordinator.

Date Submitted

May 3, 2006

1

Table of Contents

List of Figures ...... iv

List of Tables ...... v

List of Definitions...... vi

1.Introductory Material ...... 1

1.1Executive Summary...... 1

1.2 Acknowledgement ...... 2

1.3 Problem Statement ...... 2

1.3.1 Problem Statement ...... 2

1.3.2 Problem Solution ...... 2

1.4 Operating Enviornment ...... 2

1.5 Intended User(s) and Intended Use(s) ...... 3

1.5.1 Intended User(s) ...... 3

1.5.2 Intended Use(s) ...... 3

1.6 Assumptions and Limitations ...... 3

1.6.1 List of Assumptions ...... 4

1.6.2 List of Assumptions ...... 4

1.7 Expected End-Product and Other Deliverables ...... 4

2. Project Approach and Results ...... 5

2.1 Functional Requirements ...... 5

2.1.1 Ambient Light Detection ...... 5

2.1.2 Movement Detection...... 5

2.1.3 Back-up Power Supply ...... 6

2.1.4 Illumination ...... 6

2.1.5 Control Circuit ...... 6

2.2 Functional Design Constraints...... 6

2.2.1 Size...... 6

2.2.2 Power Consumption ...... 8

2.2.3 RoHS compliant and Pb Free...... 8

2.2.4 Ease of Use...... 8

2.2.5 Maintenance...... 8

2.3Technical Approach Considerations...... 8

2.3.1 Motion Detection ...... 8

2.3.1.1Infrared Detection...... 8

2.3.1.2 Sound Detection...... 9

2.3.1.3 Body Heat Detection...... 9

2.3.2 Illumination...... 9

2.3.2.1 Fluorescent ...... 10

2.3.2.2 SolidState Devices ...... 10

2.3.2.3 Incandescent Light Bulbs ...... 10

2.3.3 Control Circuit...... 10

2.3.3.1 Circuits...... 10

2.3.3.2 Microcontroller...... 11

2.3.4 Power Supply...... 11

2.3.4.1 Battery Back-up...... 11

2.3.4.2 Power Source ...... 12

2.3.5 Daytime Operation ...... 12

2.3.5.1 Internal Timer...... 12

2.3.5.2 Phototransistor ...... 12

2.3.5.3 Photoresistor ...... 13

2.3.6 Approach Selected ...... 13

2.3.6.1 Motion Detection...... 13

2.3.6.2 Illumination ...... 13

2.3.6.3 Control Circuit...... 14

2.3.6.4 Power Source...... 14

2.3.6.5 Daytime Operation...... 14

2.4Technical Approach Considerations...... 15

2.4.1 Power Supply...... 16

2.4.2 Ambient Light Sensor...... 18

2.4.3 Infrared Transmission and Detection...... 19

2.4.3.1 Transmitter ...... 19

2.4.3.2 Detector ...... 19

2.4.4 Illumination LED’s...... 20

2.4.5 Microcontroller...... 21

2.4.6 Circuit Layout...... 22

2.4.7 Completed Parts List...... 23

2.5Implementation Process...... 25

2.6End-Product Testing...... 25

2.6.1 Testing Environment...... 25

2.6.1.1 Narrow Width Hallway...... 25

2.6.1.2 Wide Width Hallway...... 26

2.6.1.3 Battery Back-up Testing...... 26

2.6.1.4 Illumination Testing...... 26

3. Resources and Scheduling...... 27

3.1Task Definition ...... 27

3.1.1Project Definition ...... 27

3.1.2Technical Consideration ...... 27

3.1.3Design Process ...... 27

3.1.4Product Construction and Limitation ...... 28

3.1.5Product Testing ...... 28

3.1.6Product Documentation ...... 28

3.1.7Product Demonstration ...... 28

3.1.8Product Reporting ...... 28

3.2Personal Effort Requirements ...... 28

3.3 Other Resource Requirements ...... 29

3.4Financial Requirements ...... 31

3.5Schedule ...... 33

4. Closure Material...... 35

4.1Project Proposed Milestones and Evaluation Criteria...... 35

4.1.1Problem Definition ...... 35

4.1.2Research and Technology...... 35

4.1.3Design ...... 35

4.1.4Implementation ...... 36

4.1.5Testing ...... 36

4.1.6Documentation ...... 36

4.1.7Demonstration ...... 36

4.2 Commercialization...... 37

4.2.1End Product Cost...... 37

4.2.2Market Selling Price...... 38

4.2.3Potential Market...... 39

4.3Recommendations for Additional Work...... 39

4.3.1Battery Charger...... 39

4.3.2Layout...... 40

4.3.3Fabrication...... 40

4.3.4Personalization...... 40

4.4Lessons Learned...... 40

4.4.1What Went Well...... 40

4.4.2What Did Not Go Well...... 41

4.4.3Technical Knowledge Gained...... 41

4.4.4Changes...... 41

4.5Possible Risks and Risk Management...... 41

4.5.1Equipment Damage...... 42

4.5.2Human Injuries...... 42

5. Project Team Information ...... 42

5.1Client ...... 42

5.2 Faculty Advisor ...... 42

5.3Team Members ...... 43

5.4Summary ...... 43

5.5References ...... 44

Appendix A – Tested Source Code ...... 45

Appendix B – Instruction Manual ...... 49

Appendix C – Narrow Width Hallway Testing...... 50

Appendix D – Wide Width Hallway Testing ...... 51

Appendix E – Batter Back-up Testing ...... 52

Appendix F – Disclaimer...... 53

Appendix G – Illumination Testing ...... 54

List of Figures

Figure 1: The frontal view of the nightlight...... 7

Figure 2: The top down view of the nightlight ...... 7

Figure 3: The basic flow diagram of the nightlight circuit ...... 15

Figure 4: General interpretation of a transformer ...... 16

Figure 5: AC to DC power conversion ...... 16

Figure 6: Complete power supply circuit...... 17

Figure 7: LDR ambient light detection circuit...... 18

Figure 8: The basic layout of the sensing circuit that will be used ...... 20

Figure 9: Pin layout of a PIC microcontroller...... 21

Figure 10: Complete PSpice layout of the nightlight ...... 23

Figure 11: Project tasksGantt chart ...... 34

Figure 12: Deliverables Gantt chart ...... 35

List of Tables

Table 1: Basic input/output of a PIC microcontroller...... 22

Table 2: Complete component listing of the automated nightlight...... 24

Table 3: Original personal effort requirement in terms of time ...... 29

Table 4: Revised personal effort requirement in terms of time ...... 29

Table 5: Actual personal effort requirement in terms of time ...... 29

Table 6: Original required other resources...... 30

Table 7: Revised required other resources...... 30

Table 8: Actual required other resources ...... 31

Table 9: Original project cost with and without labor cost...... 32

Table 10: Revised project cost with and without labor cost...... 32

Table 11: Actual project cost with and without labor cost...... 33

Table 12: Project milestones and overall importance...... 36

Table 13: Milestone evaluation criteria...... 37

Table 14: Complete component listing of the automated nightlight...... 38

Table 15: Estimated selling price of the nightlight...... 39

Terms and Definitions

120 V AC – Refers to 120 volts alternating current. This is the standard voltage for household outlets.

BJT – Bi-polar junction transistor.

Cadence – A circuit layout design program.

IrED – Infrared light emitting diodes.

LED – Refers to light emitting diodes. A device that emits light at the presence of current.

mA – Milliamperes.

PCB – Printed circuit board. Refers to what the circuit will be placed on at time of production.

NiMH – Nickel metal hydride.

PICmicro® - Brand of microcontroller.

PSpice – A circuit design program.

RoHS compliant and Pb free – Restriction of use of hazardous substances and lead free.

MOSFETs – Metal oxide semiconductor field effect transistors.

DC – Direct current.

AC – Alternating current.

mAh – Milliamp hour.

Foundry – Location where semiconductor devices are made.

Cadence® - Circuit simulation program.

1

1.Introduction Materials

This section will introduce the project, including the executive summary, acknowledgements, problem statement and solution, operating environment, intended users and uses, limitations and assumptions, expected end-product and other deliverables.

1.1Executive Summary

The objective of this project was to design a low cost, high efficiency automated nightlight. Although there are many nightlights that are already on the market, that require frequent user interaction, the team has enhanced the nightlights characteristics therefore, creating a more efficient nightlight for the hallway of a home or apartment.

This nightlight needs very little user interaction and thus making it easy on the user. The nightlight has the ability to detect motion on a 180 degree plane. The nightlight also has the ability to determine whether a person is moving closer or further away; therefore adjusting the light intensity accordingly, and the ability to distinguish between daytime and nighttime. Finally the nightlight provides a delay before shutting off in case of a person returning to the room.

After the team defined the set of limitations to follow, research was conducted to look for anything available that would aid in the creation of this project. The team found many sources that proved to be very helpful. Upon completion of the research, the team selected the best approach and best products available to complete the project.

Following the decision of what is to be used, the building and the testing of the sub-circuits was done. This was done to limit the number of errors that may have occurred in building the final circuit. Also, this allowed for more extensive testing in that if each circuit functioned properly alone, it would then be placed into the main circuit and tested along with the rest of the design.

The final result is a nightlight that does what is expected. During the day hours when ambient light is present, the nightlight is off. As soon as this light source becomes non-existent, three lights come on at a very low level to illuminate a very small area. As soon someone approaches the nightlight, all lights will come on and be at a higher level producing light to illuminate a hallway.

The suggested follow-on work is that the design be simplified and made smaller. There may be some parts of the nightlight that does may not need to be included in a future model. Also, a more modular design that could be taken to different countries on moments notice and operate correctly. The final recommendation is making the nightlight smaller. The dimensions mentioned in this report may be larger that what some people may want. By doing this, it will be more appealing to the potential buyer.

1.2Acknowledgement

The design team would like to personally thank our faculty advisor, Dr. Degang Chen and IowaStateUniversity for giving us the opportunity to create the product. The team would also like to thank Dr. Chen for his technical advice, time, and effort in overseeing the project. The design team would also like to thank Dr. Jacobson and Dr. Tuttle for their technical advice involving microcontrollers, MOSFET’s, and circuit analysis.

1.3Problem Statement

The problem statement is broken up into two separate sections; one that defines the general problem area and another that describes the proposed approach to the solution.

1.3.1Problem Statement

Many nightlights offer a small amount of light which are used in many rooms of a house. Nightlights that are presently available are very simple but require frequent user interaction. However, there may be cases where interaction is not available but a light source is needed.

1.3.2Problem Solution

The solution to the problem was creating a nightlight that automatically turned on and off as a person approached the nightlight; thus creating an illumination that provided the person with increased visibility. The project team developed a nightlight that needed very little personal contact.

1.4Operating Environment

The end product will be installed in the hallway of a house or apartment. The nightlight should be kept at room temperature which is seventy degrees Fahrenheit; however, it can also be operated for a range of 45-90 degrees Fahrenheit. A high moisture environment can be hazardous for the nightlight causing the sensor within the nightlight to not be able to distinguish if a person is coming or going. Also, little children should not be allowed to play with the nightlight because any outside stress could cause the sensor to become damaged. Finally the nightlight should be cleaned from time to time because of dust collecting on or around it. The nightlight is not required to work in instances of catastrophic events.

1.5Intended User(s) and Intended Use(s)

This section is divided into two parts, one to cover the intended user(s), and the second is to cover the intended use(s).

1.5.1Intended User(s)

The automated nightlight is intended for any people of any age who owns, rents or lives in his/her own form of housing.

1.5.2Intended Use(s)

This automated nightlight is intended to be low cost and highly efficient. The nightlight stays on bright as the user enters the hallway and slowly go to dim as the user is leaving in an optimizing manner; therefore creating an environment where the user does not have to worry about turning on/off the light. The nightlight is not intended to be used as a main light source for a room such as a ceiling illumination. Also the nightlight is not intended to be used on the outside of the house; therefore increasing its chances of being damaged by outside sources. This nightlight is built for the hallway of the home or apartment.

1.6Assumptions and Limitations

This section contains the assumptions and limitations of the project.

1.6.1List of Assumptions

The following is a list of assumptions that the team developed as a guideline for completing the project.

  • The end product could be used all over the world, thus allowing

everyone to utilize this product.

  • The end product could be used for other rooms other than the hallway. This will create more features that will enhance the nightlight’s uses.
  • The nightlight could be used within office buildings
  • The final product could be built into homes.
  • The product could force some lights within a home to be designed the same way. More lights within the home will share the same features as the nightlight.

1.6.2List of Limitations

The following is a list of assumptions that the team developed as a guideline for completing the project.

  • The cost to purchase this product will not exceed twenty dollars, thus allowing the product to be competitive with the market.
  • The nightlight will only work in a certain range of temperatures (45-90 degrees Fahrenheit).
  • The sensor within the nightlight may not be able to sense small animals, due to the height of the wall socket.
  • The angle of detection is limited to only 180 degrees.
  • The nightlight will only be able to operate between eighteen and twenty-four hours without the AC power.
  • The nightlight is about 2”H x 3”L x 4”W in size and about two pounds in weight.

1.7Expected End-Product and Other Deliverables

The expected end product was a small automated nightlight used for the hallway of a home or apartment. The sensor within the nightlight sensed a person coming and going within the given area. The light brightened as a person walked closer to the light and dimmed slowly as a person walked away from the given area. The nightlight remains on dim during night time hours.

Along with the physical product, this project produced two written documents: a design document and an end-user operating manual. Upon the finalizations of the project, the final report encompasses the entire project.

The design document shall include system design rationale, functional description and mechanical design information. It has already been delivered to the intended user.

The end-user operation manual provides instructions of the operation of the device and its care and maintenance. It was written in a non-technical manner. It too was also delivered to the intended user.

The final report entails all details about the project description and how the nightlight operates.

2Project Approach and Results

The purpose of the project approach and results is to explain in detail the exact purpose of the project, functionality, approaches considered, detailed design, implementation, testing and the end product results of the project.

2.1Functional Requirements

This section sets the functional requirements of the automated nightlight. The items listed is what the end project is able to do.

2.1.1Ambient Light Detection

The nightlight will be able to detect ambient light. This feature will determine the initial operating state of the nightlight. If there is an external light source detected, the nightlight will remain off. The moment that an external light source is no longer present, the nightlight will shift operation states and the nightlight will become active.

2.1.2Movement Detection

In order for the nightlight to operate correctly, there needs to be movement within the range of the detectors. At the moment the detectors sense a moving object, the nightlight will slowly illuminate the area.

2.1.3Back-up Power Supply

For emergency situations, a back-up battery has been implemented into the nightlight. At the moment in which the 120V AC power supply is no longer present, the nightlight will switch to a battery supply. This supply will operate the nightlight for a period of time before the battery supply has been exhausted or the 120V AC supply has been returned to the nightlight.

At the moment that the 120V AC power supply is gone, the 9V battery will become the main power source for the circuit. This is the same type of battery used in household smoke detectors.

Upon switching to the battery supply, the nightlight will operate at approximately at 60% capacity. The nightlight will work, but illumination by the nightlight will decrease.

2.1.4Illumination

Upon detection of movement, the nightlight will increase the amount of light emitted. The nightlight will use a bank of light emitting devices to illuminate the area.

2.1.5Control Circuit

There are a series of different input and output signals that have to be manipulated and analyzed. The control circuit will be designed by the team to operate as specified in the project requirements.

2.2Functional Design Constraints

This section will list the constraints that the team recognized while designing the nightlight.

2.2.1Size

In order to make the nightlight competitive on the market, the nightlight must be comparable in size to those already available. This serves as the biggest constraint because the team requires a DC voltage sources for correct operation. The final project shall not exceed the following dimensions: 4”x3”x1 5/8”. Figure 1 shows the frontal view of the nightlight. Figure 2 shows the expected top down view of the nightlight. The side view of the nightlight will have no features worth showing.

Figure 1: The frontal view of the nightlight.

Figure 2: The top down view of the nightlight.

2.2.2Power Consumption

Another item to make the nightlight competitive in the market is to reduce power consumption. To make the nightlight competitive, the circuit will use components that require very low voltage consumption. Also, the nightlight when not active will move into a lower operating state consuming less energy.

2.2.3RoHS compliant and Pb Free

This requirement was set forth for safety reasons. Since there may be children present, all parts that will be used will be RoHS compliant and Pb free. This will reduce the chances of toxic fumes being emitted from the device in case of fire or over heating.

2.2.4Ease of Use

This nightlight is intended for use by anyone who inhabits in any living arrangement with little or no technical knowledge.

2.2.5Maintenance

The nightlight must require very little maintenance. The only maintenance that needs to be done is making sure the batteries work and occasional cleaning of the nightlight.