We know that it is important to operate the machines in a suitable environment in a factory or any manufacturing unit. There have been many cases of fire at various factories. We thought of creating something using which, one can monitor the operating temperature of the machines and take necessary actions if necessary!
What it does
This is an IoT-based project. This project's hardware component can fit into any factory or any place where it is important to keep a check on the temperature. The user can keep a check on the machine's temperature using a simple Android App or a React Website. If the user feels that the temperature is rising uncontrollably, they have the option to immediately turn off the machines right from the App/Website to prevent damage. If the temperature rises above a certain threshold (Set to 40°C in this demo), our app will automatically send an SMS alert to the operator (Preconfigured Phone Number) so that necessary actions can be taken.
Temperature Data Flow:
NodeMCU(ESP8266) ----> Firebase Realtime Database ----> React Website / Android App
How we built it
There are 3 different components:
1. Hardware: NodeMCU (ESP8266) + LM35 Temperature Sensor
We used the ESP8266 Microcontroller board with the LM35 sensor and configured it to read and calculate the temperature value in °C. This value is then being stored in a Firebase Realtime Database. (Thanks to the Generous Free Tier of Google Cloud Services). We used Firebase Arduino Library to connect to firebase. We've added an LED which can be considered as an indicator of the machine's running status. Since this is a prototype, LED ON means the machines are running and vice-versa.
2. Android App
The android app is build using Kotlin. There is a minimal UI that contains a temperature gauge and has a toggle button that can be used to switch OFF / ON the machines in case the user detects abnormal temperature. Firebase SDK and a 3rd Party Library for the temperature gauge (UI) have been used.
3. ReactJS Website
The Web Dashboard does the same thing as the android app but overcomes the limitations of having an Android Device. Provides minimal UI so that any person can understand the usage. In case the temperature rises above a certain threshold (40˚C here for demo), an SMS alert is being sent to the user using Twilio.
We created and deployed a serverless function that is being called as an API any time the temperature rises above 40˚C.
The React Website has been hosted on a Linode VPS (Thanks to MLH and Linode for the $100 credit). The domain http://myfactorymonitor.co/ points to our react app. (Thanks to the GoDaddy registry for the free domain).
Challenges we ran into
There were many challenges, such as coding the ESP8266 module to connect to firebase (Had to read a lot of documentation and examples), Hosting the React Website on the Linode VPS (Setting up SSH Keys, Installing Node, NGINX, etc on the Ubuntu server, Configuring NGINX to serve the react website build, all this was very difficult as a beginner with no prior knowledge of DevOps!).
Accomplishments that we're proud of
- We're proud that we participated in our first hackathon and had such an amazing experience!
- We're proud that turned the MOST SIMPLE IDEA that we could think of into such an amazing project with actual Real-Life applications!
- We built everything from scratch and stretched ourselves from Development to Deployment!
- We set up our own Linux Server for the first time and configured a domain with the server.
- We completed three different modules (Hardware, Android, React) within such a short span of time and learned a lot!
What we learned
- How to connect Arduino/ESP266 with Firebase.
- How to use Firebase in real-life projects
- How to Deploy a React Website (Or any Web App) to a cloud platform such as Linode.
- How to work with Linux via SSH
- Learned a lot about NGINX and what it is used for
- Read a lot of documentation about NGINX and Webhosting
- Read a lot about the Hardware connections
- Read a lot about DevOps
- Team Work
What's next for My Factory Monitor
- We're thinking of adding more sensors to it such as DHT Humidity Sensor, Gas Sensor, A buzzer alarm, and much more so that we can turn it into a full-fledged monitoring system for all needs.
- We'll work more on the User Interface and make it more attractive.
- We'll create a NodeJS backend and set up MongoDB to store historic temperature data so that one can identify at what time the temperature started rising (Or moving out of the acceptable range).
- We might make use of Data Analysis and Machine Learning to predict temperature abnormalities.
- We're thinking of creating more such monitoring systems for differnt purposes, such as Heart Rate and SpO2 monitor, Soil Moisture Monitor, etc.
- We'll try to make the system bug-free.