smart lighting system final presentation - bradley...

39
Smart Lighting System Final Presentation Bradley University Department of Electrical and Computer Engineering Authors: Alexander Berian, Dustin McCart Project Advisor: Aleksander Malinowski Date: 3/21/2016

Upload: others

Post on 03-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Smart Lighting SystemFinal Presentation

Bradley University Department of Electrical and Computer Engineering

Authors: Alexander Berian, Dustin McCartProject Advisor: Aleksander Malinowski

Date: 3/21/2016

Page 2: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Overview● Background● Work Completed

○ Alex Berian○ Dustin McCart

2

Page 3: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Background

3

● Smart Light Systems

● Smart Light Switch

● Specifications

Page 4: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Modern Smart Lighting Systems

4

● Pricey

● Complicating

● Bulb + more

Screebshot of Google

Page 5: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Smart Light Switch

5

● We Make The Switch○ Not the bulb

● Building/Home Automation

● Save Energy

● Smart Phones

● Light Usage Pattern Prediction

● Preset Events

Page 6: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Requirements and Constraints

6

Page 7: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Glass Box Diagram

7

Page 8: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Alex Berian● Light Control Circuit● User Interface● Android Application● System

Communication

8

Page 9: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Light Control Circuit

9

Page 10: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Relay Drive Circuit ● Relay Switch● Transistor● Flyback Diode● Raspberry Pi 5V● Raspberry Pi

output Pin

10

Page 11: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Light Control Circuit

11

Page 12: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Light Control Circuit Testing

12

● Safety● Lamp● Old and unused

Raspberry Pi● Button

Page 13: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Motion Sensor

13

Page 14: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Motion Sensor

14

● Motion Detected○ 3.3V out○ 6 seconds

● No Motion Detected○ 0V out

Page 15: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

User Interface Circuit

15

Page 16: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

User Interface Circuit

16

● Bluetooth Toggle● Motion Sensor Toggle● Light Switch● Mode Selection● Indicator LED

○ Bluetooth○ Motion Sensor○ Mode

Page 17: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

User Interface Circuit Testing

17

● Simple input & output program

Page 18: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Android Application

18

Page 19: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Android Application

19

● Android Studio● Commands over Bluetooth● Syncs to system status● Wifi setup

○ Date and Time

Page 20: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

System Communication

20

Page 21: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

System Communication

21

● Raspbian● Pipes● C++

○ Control Hardware○ Prediction Algorithm○ Data Storage

● Python○ Bluetooth

■ Reconnection issue

■ ~$ sdptool add sp○ Wifi setup

Page 22: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Dustin McCart

22

Page 23: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Schedule

Task Planned start Completion Date Status

Basic Programming 9/15/2015 9/22/2015 Complete

Pin Setup 9/24/2015 10/20/2015 Complete

Prediction Algorithm 10/22/2015 11/17/2015 Complete

Data storage 1st and 2nd log 11/19/2015 12/8/2015 Complete

Data storage 3rd log added later Unknown 65%

Mode Programming 1/21/2016 Unknown 40%

Communication Between programs added later 3/8/2016 Complete

Merging Programs 2/11/2016 Unknown 30%

23

Page 24: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

8 INPUTS

● 3 Switches

○ Light switch

○ Bluetooth toggle

○ Motion sensor toggle

● 4 Push Buttons

○ Modes

● Motion Sensor

7 Outputs

● 6 LEDs

○ Indicator LEDs

● Signal to Light Control Circuit

24

Input/output pins

The pin set program uses the wiringPi library for working with the pins

Page 25: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Bluetooth communication

25

● C++ to Python

○ Pipes

○ ASCII strings

○ Terminate with “!”

● Specific commands sent over

pipe to communicate

○ “turn off lights!”

Page 26: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Data storage Programs

•3 Logs: date information, transition information, and preset event information•Date log

Mostly background91 entries(month,day) date format

•preset log (incomplete)Variable length

•Each has basic functions designed for communication with main program.

26

Page 27: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Data storage continued

Transition log

Variable length

Needed for prediction

Entries are made of special variable class made of 6 unsigned short ints

(month,day,hour,minute,previous state,new state)

Has function need to work prediction

27

Page 28: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Prediction Algorithm

•Transition probability •Originally created by Rolf Heukels and published in his Master thesis•Based on the transition for one state to the next•Has three stages

•Stage one initial point assignment•Stage two point redistribution•Stage three prediction creation

28

Page 29: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Stage one: point assignment

•Points given determined by total number of times a state occurs•Every state given multiplier based on similarity to current state

•In our case 1 for no similarity 2 for same state and everything inbetween got a mixed number between 1 and 2 depending on how many aspects where the same

•Run every time the prediction is run

29

Page 30: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Stage two: point redistribution •Finds every transition occurring within a set range of the

desired time for the prediction

•All transitions summed with weight given based on how

close they are to the desired time

•Points transferred according to number of transitions for one

state to another

30

Page 31: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Stage three: prediction

•Desired state of an item is chosen

•In our case it was if the light was on

•Point for all state where this occurs are summed

•This summation is then divided by the total number of points

•If the result is higher then a set threshold the prediction is

confirmed

31

Page 32: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Mode creation and program merging

••••

32

Page 33: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Questions

33

? ??? ?

?? ?

? ??

??

?

? ?

Page 34: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Extra Slides

34

Page 35: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Light Control Circuit Calculations

35

Page 36: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Light Control Circuit Test

36

Page 37: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Full Circuit Diagram + Calculations

37

Page 38: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

Prediction phase 1 example

38

Page 39: Smart Lighting System Final Presentation - Bradley Universityee.bradley.edu/projects/proj2016/lights/deliverables... · 2016-05-13 · Smart Lighting System Final Presentation Bradley

System Flow Chart

39