Skip to content

mharkess/EcoSwitch

Repository files navigation

EcoSwitch

EcoSwitch is an automated, energy-saving system for brownstone fan coil units (FCUs). It provides a BU-specific solution for maintaining comfortable dorm temperatures. Our product is simple, cost-effective, and meets the needs of BU's students and employees alike.

Table of Contents

  1. Engineering Addendum
  2. Software Reports
  3. Hardware Report
  4. Previous Reports
  5. Contact Us

Engineering Addendum

Hardware

Circuit

All relevant details about the connection of the circuit and its components is described in the circuit_README . It lists all the electronics specifications and steps to construct the circuit from scratch. Also, the reasons for selecting the electronics are listed there.

The next steps for the circuit are:

- Add a LCD screen to display the temperature reading of the sensor

Attachment

All relevant details about the attachment is mentioned in the attachment README. All the desinging concepts 3D models are listed there.

It is important to note that inserting a thin rubber strip in between the dial and the attachment allows the attachment to fit tighter on the switch.

Installation and casing

All relevant description for the device casing and installation is described in the installation README. It contains 3D models for the casing and instructions for installation.

Software

Database and Server

All relevant details about the EC2 server and MySQL database is described in the backend README. Everything that is needed to create instances in AWS and populate those instances with the necessary files is documented there.

The next steps for the server and the database are:

  • Add another column could be added to the database to keep track of previous temperatures and humidities to be displayed for administrators.
  • Add error checking for API requests (for wrong data types)
  • Make SQL queries from the API to the database more secure (ex. checking the query before submitting to the database)

As a note, some of the PHP API calls have trouble working, even when they are set up correctly. This happens namely to tha API calls that take in arguments from the packet body and are adding/subracting rows in the database. The only work around that seemed to resolve it was to redirect the call through a API service (like AWS API Gateway), so that the request first goes to the API service, then the server (the response goes from the server to the API service).

EcoSwitch Device

All relevant details about the EcoSwitch Device are described in the ESP32 README. Everything needed to upload the project and run it is documented in there.

The next steps for the EcoSwitch Device are:

  • Polish UI interface for users
  • Add extra items to Administration page (Like locking device locally)

As a note, if the device is unable to connect to the network when it first boots, the device will reset itself on every attempt. If internet connection is lost during normal operation, then the device will continue operating normally with the exception of uploading sensor data to the database and retrieving the user's target temperature from the databae.

Mobile Application

To begin development, please follow the instructions outlined in the mobile application README. Everything needed to initially build the project and run it is documented there. Note that some of the tools used for development were not the latest version (i.e. Expo) and updating to the latest version may cause problems with running the application.

Website

All relevant details on the website's current status can be found in its corresponding website README.

Next steps for the website:

  • Authentication checking to ensure the user is logged in before being able to access the dashboard and its other linked pages
  • An interactive graph that plots the average temperatures and humidity levels for each location
  • Error checking for the various inputs that are allowed
    • location-related inputs: ensure the building is a valid BU brownstone location
    • room number-related inputs: ensure the room exists in the specified location
    • student email-related inputs: ensure the student email exists and is from BU
    • device registration: ensure the device does not already exist in the database
    • location locking: ensure the location is not already locked
    • location unlocking: ensure the location is not already unlocked
    • student assignment: ensure the student has not already been assigned to the specified device
    • student removal: ensure the student has not already been removed from the specified device or has never been assigned to it
  • Confirmation messages for form submissions

It is worth keeping in mind that the React JS version the website has been built with is newer and therefore, older articles online that provide React JS tutorials may no longer be applicable. For example, the useHistory function has been replaced with useNavigate. Additionally, for forms, it is important to prevent the page from refreshing before the API call has been completed. Using the preventDefault method achieves this. Finally, to view console outputs, use the Developer Tools Console rather than the terminal that is being used to run the server.

(back to top)

Software Reports

(back to top)

Hardware Report

(back to top)

Previous Reports

(back to top)

Contact Us

If there are any further questions about this project, please contact the lead developers via email.

(back to top)