<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ian Shei &#8211; Making Things Interactive, Fall 2019</title>
	<atom:link href="https://courses.ideate.cmu.edu/48-339/f2019/?feed=rss2&#038;author=14" rel="self" type="application/rss+xml" />
	<link>https://courses.ideate.cmu.edu/48-339/f2019</link>
	<description>Making Things Interactive</description>
	<lastBuildDate>Tue, 03 Sep 2019 03:17:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.20</generator>
	<item>
		<title>Assignment 2: Smart Entrance Lighting</title>
		<link>https://courses.ideate.cmu.edu/48-339/f2019/?p=140</link>
				<comments>https://courses.ideate.cmu.edu/48-339/f2019/?p=140#respond</comments>
				<pubDate>Tue, 03 Sep 2019 03:16:19 +0000</pubDate>
		<dc:creator><![CDATA[Ian Shei]]></dc:creator>
				<category><![CDATA[Assignment 2]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/f2019/?p=140</guid>
				<description><![CDATA[Issue Returning home after a long day is a great feeling, but for those with less-sensitive vision, it may be difficult to locate a light switch in a dimly-lit or dark environment.  General solution Ideally, the house should be able to sense when someone has returned, whether through the motion of the person, the opening &#8230; <a href="https://courses.ideate.cmu.edu/48-339/f2019/?p=140" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 2: Smart Entrance Lighting"</span></a>]]></description>
								<content:encoded><![CDATA[<h5>Issue</h5>
<p>Returning home after a long day is a great feeling, but for those with less-sensitive vision, it may be difficult to locate a light switch in a dimly-lit or dark environment.<span class="Apple-converted-space"> </span></p>
<h5>General solution</h5>
<p>Ideally, the house should be able to sense when someone has returned, whether through the motion of the person, the opening of the door, or the location of one’s smartphone. Combining this input with a reading of the ambient light level (i.e. if it’s still bright enough outside that light coming in through windows make the house sufficiently navigable without artificial lighting), the system should determine whether it is necessary to turn on the lights. Then, once an individual has found their way past the foyer, the system could automatically turn off the lights that it had turned on earlier based on motion in other areas of the house, the turning on of other lights, or the location of a person’s smart device (using Bluetooth beacons, for example).</p>
<p>This solution would aid those with vision impairments and older people, whose eyes adjust slower to different lighting conditions. However, such an implementation could conceivably improve the life of a perfectly-sighted person by eliminating the need of hunting for a light switch in the dark, especially if both hands are full.</p>
<h5>Proof of concept</h5>
<p>An Arduino connected to an IR proximity sensor detects when a person has entered a zone and turns on an LED. A second IR proximity sensor detects movement in another zone, and another LED is connected to a switch. If motion is detect in the second zone or if the second LED is turned on via the switch, the first LED is turned off by the controller.</p>
<p>Initially, I wanted to use the RCWL-0516 Doppler radar motion sensor available in the physical computing inventory, but the documentation seems thin (a GitHub project page depicts oscilloscope scans), so I decided to use a simple IR proximity sensor instead.</p>
<h5>Fritzing sketch</h5>
<figure id="attachment_142" aria-describedby="caption-attachment-142" style="width: 840px" class="wp-caption aligncenter"><img class="wp-image-142 size-large" src="https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/Assignment-2-schematic-1024x944.png" alt="" width="840" height="774" srcset="https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/Assignment-2-schematic-1024x944.png 1024w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/Assignment-2-schematic-300x277.png 300w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/Assignment-2-schematic-768x708.png 768w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/Assignment-2-schematic-1200x1107.png 1200w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /><figcaption id="caption-attachment-142" class="wp-caption-text">Proof of concept schematic for a smart entrance lighting system.</figcaption></figure>
<h5>Arduino sketch (untested)</h5>
<pre>const int SWITCHPIN = 9; // controls interior light
const int DOORLIGHT = 3; // LED near entrance
const int INTERIORLIGHT = 6; // LED inside house
const int DOORMOTION = A0; // IR proximity sensor near entrance
const int INTERIORMOTION = A1; // IR proximity sensor inside house
const int motionThreshold = 30; // set motion threshold here

void setup() {
  pinMode(DOORMOTION, INPUT);
  pinMode(INTERIORMOTION, INPUT);
  pinMode(SWITCHPIN, INPUT);
  pinMode(DOORLIGHT, OUTPUT);
  pinMode(INTERIORLIGHT, OUTPUT);
  
  Serial.begin(9600);
}

void loop() {
  int switchVal;
  switchVal = digitalRead(SWITCHPIN);

  int doorRead;
  doorRead = analogRead(DOORMOTION);

  int intRead;
  intRead = analogRead(INTERIORMOTION);

  if(doorRead &gt; motionThreshold) {
    digitalWrite(DOORLIGHT, HIGH);
  }
  
  if(intRead &gt; motionThreshold || switchVal == HIGH) {
    digitalWrite(DOORLIGHT, LOW);
    digitalWrite(INTERIORLIGHT, HIGH);
  }
}</pre>
<h5>Visual sketch</h5>
<figure id="attachment_145" aria-describedby="caption-attachment-145" style="width: 840px" class="wp-caption aligncenter"><img class="wp-image-145 size-large" src="https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/assignment-2-drawing-1024x683.png" alt="" width="840" height="560" srcset="https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/assignment-2-drawing-1024x683.png 1024w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/assignment-2-drawing-300x200.png 300w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/assignment-2-drawing-768x512.png 768w, https://courses.ideate.cmu.edu/48-339/f2019/wp-content/uploads/2019/09/assignment-2-drawing-1200x800.png 1200w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /><figcaption id="caption-attachment-145" class="wp-caption-text">A simple floorpan showing locations for IR proximity sensors and lights.</figcaption></figure>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/f2019/?feed=rss2&#038;p=140</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
