Project for class 12770: Autonomous Sustainable Buildings at Carnegie Mellon University taught by Professor Mario Berges.
- Adwoa Asare (Electrical & Computer Engineering M.S.)
- Barbara Castro-Schell (Civil Engineering M.S.)
- Ziyuan Ma (Civil Engineering M.S.)
Install micropython firmware on your Raspberry Pi Picos.
Make a file called wifi_config.py in the /lib folder and put the following lines:
# Wi-Fi credentials (DO NOT SHARE THIS FILE)
WIFI_SSID = "YourWiFiSSID"
WIFI_PASSWORD = "YourWiFiPassword"If you are running this experiment on campus you will need to connect the pico to CMU-DEVICE not CMU-SECURE. Your SSID will be "CMUE-SECURE" and the password will be "" (an empty string). You will need to submit the MAC address. I'll add instructions about this later.
-
Download Thonny IDE for easy file transfer to the pico. Transfer the entire lib folder to the pico.
-
Depending on which sensing region the pico is for (radiator, room, or outside) choose the appropriate file frome /src, rename it to main.py and transfer it to the root directory of the pico so it will run automatically on startup.
-
Give the sensor a unique topic in datastream.py in the format
TOPIC = "cmu/retrofit_radiator/unique_topic" -
Save everything and run main.py. If yoour pico is plugged into a laptop you should see it print out the first data point and successful connection to the mqtt broker you are using.
-
Run /data_receive/subscribe.py on a PC you are comfortable leaving runnig for a long time
-
The line
TOPICS = "cmu/retrofit_radiator/+"allows you to see all topics that are part of cmu/retrofit_radiator/+ If you want to subscribe only to specific topics you can comment out this line and uncomment the line right above. In this case format the topics you want in a list:TOPICS = [("cmu/retrofit_radiator/sensor1", 0), ("cmu/retrofit_radiator/sensor2", 0), ("cmu/retrofit_radiator/sensor3", 0)]
-
Data will be saved to data_receive/data_[CURRENT DATE/TIME].json
-
Convert the data from json to csv using data_receive/jsonToCSV.py. You can put an API key for OpenWeather API to get the outside weather data, otherwise that collumn will be blank. We ended up updating the we Crowdsourced data from PurpleAir to fill in our outdoor data.
-
If you want to remotely turn the fan on and off you can use data_receive/fan_setting.py. When you run it, it will prompt you to enter which fan mode you want on the command line.
-
Cut and tape rigid foam boardinsulation to fit around your radiator.
-
Cut a hole for your small DC fan in one of the walls of the foam insulation and insert the fan in there. Make sure you secure the pico outside of the box so it doesn't overheat, but keep the dht sensor inside the box.
-
Secure the other picos and their sensors to the wall or set them on the table. The main.py file on each pico will start collecting and transmitting data immediately after being turned on, then once every ten minutes.
Our data analysis is available in /analysis/modeling1.ipynb