top of page

IoT Device Documentation

Wed Dec 18, 2024


Prompt

Create an Internet-connected device using at least 2 sensors. The choice of sensors is up to you, it can be anything from a button or a potentiometer to .... This device will collect data in your house for a week. Create a sketch that will access the data and represent it visually.


 

Project Goal + IoT Device Setup


My goal was collecting data on the heat and light levels received by the plant on my windowsill over a 24-hour period. To do this, I would need to rig a TMP36 temperature sensor and a light sensor on my breadboard and place it by the windowsill.


Arduino Setup Reference
Initial Bread Board Test
















After coding the data collection in Arduino, I found that the bread board had errors collecting the proper reading for the temperature and the photocell wasn't collecting any data.


Arduino Code First Version for Data Collection

I went back to the drawing board to troubleshoot the issue and found that there was a big issue with the way the bread board was wired. I addressed the issue of wiring the two sensors to A2 & A3 rather than A0 & A1 necessary for using wifi connection.


Through many tests, I found that the code was working properly but the photo sensor was still not reacting so through an additional voltage test, I was able to troubleshoot that the sensor itself was broken and replaced it with a new one.


Bread Board Version 2
Voltage Test for Sensors

















 

Data Collection Phase


I started collecting data over 24-hours from 12/9 - 12/10 starting at 6pm. I coded in a 5-second delay so that the device would save 12 data points every minute to the feed. I also added in a range for the light to denote what its value represented.


Photo Value Range in Arduino Code

I began to collect data after placing my IoT device by the windowsill next to my plant, and connecting the device to a laptop.


IoT device placed next to windowsill & plant for data collection

Reviewing the feed after the 24-hour period, I found that the temperature readings were relatively accurate ranging at the lowest of 50F in the late night to around 72F in the daytime. There was a period from 3am - 6am and 2pm - 3pm where the bread board was getting inaccurate readings in the 20-30F range.


Temperature 24-Hr Feed on Adafruit

For the light feed, I found that the light readings showed an average around 250-350 from 6-6pm - 9pm which correlates to the values from dim to light (200-500) on my code. The light shows 0 when I turned off all lights and picked back up at 9:30am when I turned on the light again. However, the sensor did not pick up the natural sun light which I wanted to collect in my data, so the sensor may not have been working properly or sensitive enough to collect it.


Light 24-Hr Feed on Adafruit

 

Visualization


For the final piece of the project, I created a sketch on p5js to access the data collected from my IoT device and create a live sketch that would represent the data as it is collected in visual imagery.


My sketch uses the collected light value to represent the size of each flower as it updates every 5 seconds. Above each flower is the light value represented in text. The rotation speed of each flower is dictated by the temperature value.






bottom of page