Difference between revisions of "Smarter Blinds"

From ESE205 Wiki
Jump to navigation Jump to search
Line 91: Line 91:
 
=== Programming ===
 
=== Programming ===
 
==== Detecting Temperature of Room ====
 
==== Detecting Temperature of Room ====
*Used an LM35DX temperature sensor to take in temperature values of the room in which the blinds are located
+
An LM35DX temperature sensor measures the temperature of the room in which the blinds are located. The voltage is detected from the temperature pin, and this value is converted into degrees Celsius and then into degrees Fahrenheit, as seen in lines 7 through 9 of the code.
*Values read from temperature sensor are converted into degrees Fahrenheit, which can be seen in further detail under Code section
 
  
 
[[File:tempsensor.png|thumb|right|Temperature Sensor Code]]
 
[[File:tempsensor.png|thumb|right|Temperature Sensor Code]]
  
 
==== Detecting Luminosity of Room ====
 
==== Detecting Luminosity of Room ====
*Used CdS photocell (photoresistor) to detect the amount of light in the room in which the blinds are located
+
The CdS photocell (photoresistor) detects the amount of light in the room in which the blinds are located. Values read from the photocell are converted to brightness on a scale of 1-5, which was done to prevent user confusion with unfamiliar brightness values.
*Values read from photocell are converted to brightness on a scale of 1-10, which was done to prevent user confusion with unfamiliar brightness values
 
  
 
[[File:photoresistor.png|thumb|right|Photoresistor Code]]
 
[[File:photoresistor.png|thumb|right|Photoresistor Code]]
Line 107: Line 105:
  
 
==== Setting Initial Position of Blinds ====
 
==== Setting Initial Position of Blinds ====
*Mounted strong magnet on one flap of blinds
+
The Hall Effect sensor determines when the blinds are closed. A strong magnet is mounted on the blinds so the blinds are completely closed when the magnet is detected. While the magnet is not detected, the motor is directed to continue rotating the blinds in the counterclockwise direction. Once the magnet is detected the blinds will be closed, which is the desired initial position for calling other functions.
*Hall Effect sensor used to determine when blinds are closed - when magnet is detected, blinds should be completely closed
 
  
 
[[File:halleffect.png|thumb|right|Hall Effect Sensor Code]]
 
[[File:halleffect.png|thumb|right|Hall Effect Sensor Code]]
  
 
==== Opening and Closing the Blinds ====
 
==== Opening and Closing the Blinds ====
*5VDC Stepper Motor used to  rotate position of blinds in both clockwise and counterclockwise directions
+
A 5VDC Stepper Motor is used to  rotate the position of the blinds in both clockwise and counterclockwise directions. The stepper motor opens from 0 degrees, letting in no light, to 90 degrees, letting in the maximum amount of light. The stepper motor code directs the motor to move in increments of blind-degrees; therefore, the stepper motor takes ### steps in order to move one degree.
*Stepper Motor opens 0 degrees (minimum light) to 90 degrees (maximum light)
 
  
 
===Formulas===
 
===Formulas===

Revision as of 19:58, 12 April 2019

Smarter Blinds

Proposal

Team Members

  • Elizabeth Saliba
  • Liza Kaniewski
  • Michael Williams (TA)

Links

Smarter_Blinds_Log

Budget: Nite Light & Smarter Blinds

Presentation

GitHub

Stepper Motor Tutorial

Overview

New technology has allowed society to make improvements to daily items including thermostats and other objects around the home. Fascinated with this idea of do-it-yourself home improvement projects and the wide breadth of tasks that can be accomplished we have decided to make Smarter Blinds. We will be creating blinds that move according to user input. By incorporating aspects that allow the blinds to move according to sunlight and temperature in the room to eliminate the use of air conditioning or heating we hope to make our blinds energy efficient. This way, our hope is that energy consumption in the home will be reduced through our creation of Smarter Blinds.

Objectives and Goals

  • Have the blinds open from being completely closed to open over a period of time set by the user
  • Make the design efficient and compact so that it could work for all blinds that utilize rotating rod to open/close
  • Have a user inputted preferred light intensity so that the blinds move throughout the day according to desired intensity.
  • Make eco-friendly functions that increase/decrease the amount of light let in, which lessens the need for air conditioning/heating
  • Find a suitable power source for the blinds such as lithium batteries or potentially solar power
  • If time allows, develop a way for the blinds to be controlled on your mobile device via Adafruit App

Challenges

  • Learning and effectively using Arduino
  • Learning CAD and 3D printing skills with the goal of printing as many parts as possible to be cost effective
  • Generating enough power to operate the blinds
  • Determining the relationship between temperature, luminous intensity and blind angle
  • Making sure the motor is strong enough to turn the blinds
  • Creating a design that can be used on various blinds
  • Designing a user-friendly app that connects to the blinds via Bluetooth
  • Finding a way to determine position of blinds when initially turned on
  • Transferring system from Arduino Uno to Feather

Budget

Current Parts Purchased / Have:

Current Amount Spent: $49.44 + $7.15 = $56.59

Gantt Chart

https://docs.google.com/spreadsheets/d/10uzT7YQ7MJU3zTquifuFkcKUptFDYlntzzncpx78SI4/edit?usp=sharing

Design and Solutions

Mechanics

Construction of Circuit

Initially, the temperature sensor, photoresistor, hall effect sensor, and motor were set up individually on the breadboard and tested with the Arduino. After troubleshooting individual threads of code and making sure each component functioned properly in the circuit, the components were set up together on the breadboard. The three legs of the temperature sensor are connected to positive, A0, and ground, respectively. For the hall effect sensor, the left leg of the hall effect sensor connects to a 10k resistor and then to positive, the middle leg connects to the right leg of the temperature sensor and then to ground, and the right leg connects to the other end of the 10k resistor and then to pin 12. One leg of the photoresistor connects to positive, and the other leg connects to one end of another 10k resistor and then to A1. The other end of the most recently mentioned 10k resistor connects directly to negative. For the motor, the gray wire connects to positive, and the brown wire connects to negative. The positive end of the circuit is then connected to 5V, which is labeled as USB on the Feather, and the negative end is connected to ground. This explanation can be clearly seen in the perfboard sketch pictured below. After determining all of these connections, everything was soldered onto the perfboard, along with pins to easily connect to the headers of the feather with jumper wires.

Functioning of Blinds

Using the rotating device located at the top of the blinds, it takes approximately 11 revolutions to open the blinds from 0 degrees (with the flaps completely shut) to 90 degrees (with the flaps parallel to the ground). 11 revolutions is equal to 44,836 steps taken by the stepper motor; therefore, it takes approximately 498.2 steps to move the blinds 1 degree.

3D Printing

OnShape software was used to design the connector between the blinds and the stepper motor as well as the enclosure for the Feather, perfboard, and motor. The enclosure is designed to easily clamp on and off of the top of any blinds without any messy installation.


File:Connector
Connector between blinds and motor
  • Creation of enclosure to withhold and hide hardware towards the top of the blinds

Mounting Blinds

For presentation purposes, the blinds were attached to the bottom of the table using two pieces of plywood.

Programming

Detecting Temperature of Room

An LM35DX temperature sensor measures the temperature of the room in which the blinds are located. The voltage is detected from the temperature pin, and this value is converted into degrees Celsius and then into degrees Fahrenheit, as seen in lines 7 through 9 of the code.

Temperature Sensor Code

Detecting Luminosity of Room

The CdS photocell (photoresistor) detects the amount of light in the room in which the blinds are located. Values read from the photocell are converted to brightness on a scale of 1-5, which was done to prevent user confusion with unfamiliar brightness values.

Photoresistor Code

Receiving User Input

  • User is given option to have blinds adjust based off either room temperature or room luminosity
  • Text is displayed on Adafruit FeatherWing OLED, and user will utilize three buttons to set desired temperature/luminosity

Setting Initial Position of Blinds

The Hall Effect sensor determines when the blinds are closed. A strong magnet is mounted on the blinds so the blinds are completely closed when the magnet is detected. While the magnet is not detected, the motor is directed to continue rotating the blinds in the counterclockwise direction. Once the magnet is detected the blinds will be closed, which is the desired initial position for calling other functions.

Hall Effect Sensor Code

Opening and Closing the Blinds

A 5VDC Stepper Motor is used to rotate the position of the blinds in both clockwise and counterclockwise directions. The stepper motor opens from 0 degrees, letting in no light, to 90 degrees, letting in the maximum amount of light. The stepper motor code directs the motor to move in increments of blind-degrees; therefore, the stepper motor takes ### steps in order to move one degree.

Formulas

  • The user inputs a number from 1 to 5 indicating how bright they would like the room to be. The photoresistor has a max value of 1023. Therefore, the formula for converting the number inputted to a value that corresponds with the photoresistor values is 1023/5 multiplied by the user input value. 5 corresponds to very bright and 1 corresponds to a very dark room.
  • Another formula created was to correlate the position of the blinds to the brightness desired. The position of the blinds that correlates to the brightest setting is when the blinds are perpendicular to the window letting a maximum level of light pass through. The motor, after initialized moves the blinds 45 degrees then however many more degrees needed to position the blinds at the desired brightness. This formula is steps_needed = (4076 * 5.5) + (5 - bright_scale) * (4076);

Electronics

  • The ultimate goal for this project is to transfer the wiring from the Arduino Uno to the Feather. We choose to use the Feather because of its Bluetooth chip and builtin battery charging capabilities. Since identifying a power source is one of the challenging decisions we would need to address, using the Feather simplified the process for testing different power sources.
  • Schematic of parts
  • Pictures of everything soldered onto perfboard/feather
  • The reach goal for our project is to use the Bluetooth capabilities of the Feather and create an app using AdaFruit's BlueFruit App

Results

Next Steps

References

Resources

  • Past Projects

https://classes.engineering.wustl.edu/ese205/core/index.php?title=Smart_Blinds https://www.hackster.io/Froz3nArcher/smart-blinds-573548 https://www.hackster.io/rjacobo2/lane-tech-hs-pcl-iot-smart-blinds-42a68a (potential design idea)

  • Stepper Motor and Arduino

Arduino Modules - L298N Dual H-Bridge Motor Controller Controlling DC Motors with the L298N Dual H-Bridge and an Arduino

  • Bluetooth Connection

Adafruit Bluefruit LE UART Friend - Bluetooth Low Energy (BLE) Adafruit Feather 32u4 Bluefruit LE Adafruit Feather 32u4 Bluefruit Overview

  • Soldering

Soldering YouTube How to Solder

  • Temperature Sensor

Temperature Sensor

  • Photoresistor

Photoresistor