Lab 5: Automated Temperature Measurements - Writing data to the cloud, and sending alerts to cell phone
We will be conducting this lab over the course of several weeks:
Purpose
The purpose of this laboratory exercise is to further our understanding of controlling sensors with a computer and using the computer for data acquisition, processing, and control of physical systems.
In this lab you will use thermocouple to measure and record temperature under the control of a Raspberry Pi computer interfaced through the General Purpose Input and Output (GPIO) pins. You will construct the circuit on a breadboard and write a Python script to control the sensor and record data locally. Then, you will connect to the JMU WiFi and construct additional Python code to write data to the cloud where it can be accessed by any device at any time. This will require several cyber security authentication protocols. Finally, you will use the thermocouple sensing system to activate an LED if a critical temperature is reached and send an alert to your cell phone via SMS text messaging.
Learning Goals
The goals of this Lab (all weeks together) are to:
- Review circuit concepts to physically connect measurement hardware to a computer
- Gain experience with General Purpose Input and Output pins (GPIO)
- Become familiar with Python programming used to control sensors and physical systems
- Investigate and evaluate measurement capabilities of a measurement instrument
- Calibrate the instrument
- Control sampling rate
- Calibrate the instrument (and estimate Type B calibration error)
- Determine an estimate of Type A (random) measurement uncertainty
- Write data to a local host computer
- Write data to the Cloud
- Use real-time automated decision making to control physical systems based on incoming data
- Send alerts wirelessly via WiFi and SMS communication protocols
- Report your findings in a formal lab report
Weekly Activities
Lab 5: Week 1 - Building an LED temperature alarm:
This lab builds on the material and code developed during Lab 3: Temperature Sensor Characteristics. You will
During this week, you modify the Python software to write data to a file and create an LED alarm if the measured temperature leaves the desired range (similar to Lab 4).
Lab 5: Week 2 - Prep: Establishing Google Cloud Access:
During this week, we will start writing data to the cloud. But first, we have to do some preparations in order to be able to access the Google Cloud. Completing these steps, will result in having a
credentials.JSON
file, that we can use to access the google sheets API.Lab 5: Week 2 - Writing Data to the Cloud:
We will now start writing data to the cloud. To do so, we have to connect the RPI to the google sheets API and update our program to write data to the cloud via the API.
Lab 5: Week 3 - Sending a Push Notification to Your Cell Phone:
As a final addition to our temperature alert system, we will use another API to send a push notification alert to your cell phone if a critical temperature is reached.
Resources
The resources page for this lab contains the starter programs, techincal details about the sensor, information about the google sheets API as well as python tutorials for important concepts.
Testing the Alert System
After completing the lab activities, we will conduct a final test of your alert system.
- Each lab group will select on system that they think is most reliable.
- At a designated station, you will set up your alert system and place the thermocouple into a bucket with ice water.
- Start the measurement program to record temperatures over the weekend
- Make sure to remotely monitor, whether you are receiving data
Final Deliverable
We will not be doing a regular lab report for this lab.
You developed and assembled a remote temperature monitoring system. Continuous and reliable temperature monitoring is important in a wide variety of industrial and scientific applications.
The final group deliverables for this lab will be:
As a group, brainstorm a potential application of such a system that is related to an ISAT concentration or industry that you are interested in. What problem would such a system solve?
If you cannot think of an application, you can also consult the Sensor Technologies book (see readings posted to Canvas). Chapters 9, 10, 11 show some applications for sensor technologies.
Prepare a 2-page (max) sales brochure (including a spec. sheet) that that highlights your monitoring system to solve that problem.
The brochure should clearly state the performance capabilities of your Automated Temperature Monitoring and Alert system.
ImportantSome of the measurement capabilities can be estimated from the specification sheet of the thermocouple (see resources). Some others, you can calculate from data that you have already collected. Finally, there are some capabilities that you have to estimate by conducting some additional experiments on your final alert-system.
Think about which of these belong into the final category and plan accordingly!
Make sure to check out the information provided on the resources page
Include at least the following:
- Measurement range
- Type A Uncertainty
- Type B Uncertainty
- Combined Uncertainty
- Max Sampling Rate
- Delay time for online readings
- Automated messaging
- Include photos
A supporting document your calculations and providing justification and assumption for your choices regarding measurement range, sampling rate, delay time (include sources where appropriate).
The final code you used to run your system.
A link to the google doc with the data measured.