Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project Description Title: Room temperature monitoring based on ambient light level threshold Overview: An Arduino monitors the ambient light in a room.

Similar presentations


Presentation on theme: "Project Description Title: Room temperature monitoring based on ambient light level threshold Overview: An Arduino monitors the ambient light in a room."— Presentation transcript:

1 Project Description Title: Room temperature monitoring based on ambient light level threshold Overview: An Arduino monitors the ambient light in a room. When the light exceeds a certain threshold (for example, when someone turns on the light in the room), the temperature of the room is sampled, averaged, and logged. This continues until the ambient light falls below the threshold (for example, when the person leaves the room and turns off the light). The system then resets and terminates temperature monitoring until the light threshold is again exceeded. Data Stream Queries: Ambient light streaming from Arduino at (10) times per second. Query checks to see if the light exceeds an established threshold. The query will check that multiple light readings have exceeded the threshold within some window. This will prevent “false positives” where momentary light changes are caused by something other than the lights being turned on by a person. Ambient temperature is sampled throughout window. A 1-minute average will be computed and logged to MySQL. Graphic next slide shows process flow and logic

2 1. Arduino monitors ambient light Is light level > “on” threshold no 2b. Monitor temperature MySQL log average temp 2a. Continue monitoring ambient light Is light level < “off” threshold yes (person enters room and turns light on) 3. Calculate average temperature over 30 minute interval 4. Exit temperature monitoring loop yes (person leaves room and turns light off) Terminate temperature monitoring received? no yes

3 Project Setup Arduino with temperature and photovoltaic sensor placed in a box with the lid open/ closed to simulate lights off/ on USB connection to laptop Box lid closed (simulate “lights off”) light level is above threshold. Box lid open (simulate “lights on”) light level is below threshold. Note for testing purposes I illuminated the sensor with a flashlight (light level ~360). Realistic light change went from 980 (lights off) to 940 (lights on).

4 Python Code Monitors serial feed from Arduino. Streams data at 10 times / second Checks if lightLevel drops below threshold (1) that indicates lights have been “turned on”. Played with various levels Settled on 970 as the most reliable indicator for lights being “on” If lightLevel is not below threshold, nothing is logged. Program continues to monitor the stream (2) Once lights are “on”, the temperature readings for the last minute are averaged and output to MySQL database 1. Threshold for “lights on” 2. Threshold is not met. Output just sent to pyCharm console, not logged to MySQL

5 “Lights On” With threshold met (1), temperature is averaged for the last minute (2) and logged to database (3). 1. Threshold met 2. Average temperature calculated 3. Logged to database

6 Data Logged to MySQL Database From screenshot of MySQL database on right: One minute intervals Temperature is average over the last minute lightLevel is also average over last minute. All entries are less than the threshold (lights are “on”) Average temperature over last minute

7 Conclusions and Lessons Learned Needed to clear Arduino serial input buffer in Python code Light threshold varied and would need to be stabilized I intended to implement this in Spark to compare performance but unfortunately I never had a chance to complete this implementation and run comparisons This is a very interesting topic and the work associated with implementing data stream processing provides some interesting possibilities for research.


Download ppt "Project Description Title: Room temperature monitoring based on ambient light level threshold Overview: An Arduino monitors the ambient light in a room."

Similar presentations


Ads by Google