Behind The Screen
We implemented an IoT by Arduino, Firebase and Android Studio. For Arduino, we use temperature sensor (DS18B20)、pH meter and CO2 sensor (MG811) to monitor our device. Also we use LCD to print data and use Wi-Fi sensor (NodeMcu) to upload our records to database (Firebase) as well. We use Wi-Fi sensor to get current time and we send it to the Arduino so that it can print it out on Arduino. Also we send the temperature, pH and temperature data, which is on the Arduino, to the NodeMcu. Then we use the NodeMcu to send the data to firebase.
For user-friendly, user can read the data easily from the App. When the data is abnormal, the App would have a caution to let the user know, so that the user can adjust the device in time.
We use temperature sensor (DS18B20), pH meter and CO2 sensor (MG811) to monitor our device. Besides, we use LCD to print datum and use Wi-Fi sensor (ESP8266) to upload our records to database as well. (You can see more information about Arduino in hardware)
Temperature experimental curve fitting
- Given a set of data (including input and output), create a mathematical model to approximate the input and output characteristics of this data.
- If the data contains one-dimensional inputs and outputs, the mathematical model can be expressed as a curve, which in this case is also called curve fitting.
Therefore, we use the temperature of the thermostat (incubation) on the market and the analog signal sensed by Arduino as the basis for the temperature calibration curve.
Since the error value of the temperature sensing device is not necessarily, we use multiple sampling methods, and then average the values measured in each temperature interval to reduce the error value without excessive error. We use the above method to take 150 strokes as training data, and use the basic accessories of MATLAB to find the appropriate nine temperature model formulas.
From the graph we can see that the more parameters the model contains, the smaller the square error will be. Therefore, if the number of parameters is equal to the number of data points, the squared error will be equal to zero, but this does not mean that the prediction will be the most accurate, because the data points contain noise. The model that completely matches the data also means that the model is most affected by noise. The accuracy will also be poor. In addition, the more model parameters, the higher the time complexity, so we use the last image (cubic) as the curve of analog signal and temperature conversion. Because the instantaneous temperature does not only contain the exact value of the time complexity can not be too high.
Why we need to use database?
Save data from our device, including carbon dioxide concentration, pH value and temperature obtained by sensors in our device. Besides, the App can fetch the information from our database.
What database we use?
We use Firebase to be our database. Because it is a realtime database and a 3rd party Authentication (Google Signin, Facebook Login, Github, Twitter). Last but not least, its cloud messaging can send push messages to any device, so we can easily send it to our App. Based on above reason, we choose Firebase.
How to create a Firebase?
We divide the following instructions into two parts, register firebase and create Firebase project.
- The quickest way to use Firebase is to sign in with your old
Google Account and get started.
Sign up and then go to the website.
Register Firebase account
Go to the Firebase homepage: http://firebase.google.com and find the "Login" link registered with Google as shown below in the homepage.
- After signing in to your Google Account, you will be prompted to confirm your permissions. Click "Allow" to complete the registration of Firebase, then click "GET STARTED" on the page to start using Firebase, as shown below:
Create Firebase project
- The first thing to enter the Firebase console is to create a Firebase project and try out the free program. After entering the console, please click on “Add Project” to create a new project, as shown below:
- Enter the project name of the App, such as “project”, and then select the country/region, then click “Create Project” as shown below:
Finally, you can wait for Arduino to send data by Wi-Fi to the database.
To make our device more user-friendly, we designed an App to get data from our database. The manager of the factory can easily see the data immediately. Besides, we set up a notification system. As long as users connect their smart phone to the internet, they can immediately get the warning notification from the device if the data goes wrong.
This is our homepage, with our lovely logo. You can click “START” button to start monitor the CO2, pH and temperature data. Also, you can click “SWITCH” button to control the input of the collection tank or output of medium tank. Furthermore, you can click “ABOUT US” button to learn more about our project. Last but not least, clicking the footprint, you can visit our wiki.
This is the picture when you click ” START”. There are three buttons, which is CO2, pH and temperature respectively. You can click any of the buttons to look at the changes with line chart within ten hours.
This is the picture when you press “ABOUT US”. It is a brief description about our project. You can choose whether you want to receive an exception warning notification or not. Also, you can click the green arrow to go back to the main page.
Take the pH value for instance, the current value will be displayed above, and the line chart will display the last ten hours of data, which fetching data from the database.
When the data is abnormal, it will give a warning notice to let the user knows.
We aim to simulate the situation in the factory. First of all, we put the electromagnetic valves to the input of collection tank and output of medium tank, so that we can control the switches easier by app. In reality, they can be controlled automatically. Therefore, this is what we want to achieve.
See the code on Github
NCKU Bike Festival Interactive Game
NCKU Bike Festival is a famous activity for NCKU to exhibit and introduce every college department to south Taiwan senior high students. We take this opportunity to promote synthetic biology, promote iGEM and introduce our three candidate topics, hoping to get different opinions. We designed a bio-related game quiz about synthetic biology, iGEM, and high school basic biology. The system will randomly generate five questions. After the answer, the questions will be displayed correctly and incorrectly. At this time, we will tell them why they made a mistake. After the explanation, they can choose “re-challenge” or “all know” to enter the next step. Before the end of the game, there will be a vote for our three candidate projects, which will be used to calculate which topics are generally of high interest to high school students.
Click “start” to start playing the game.
There are five questions about synthetic biology and iGEM. After finishing the five questions, click “finish” to see where’s wrong.
Click “re-challenge” to go back to the main page and start again, or click “all know” to go to vote for our three candidate projects.
This is our three candidate projects. After choosing it, click “finish” to go back to the main page.
See the code on the Github