Microcontroller Data Collection - Engineering 103

C
Analog
Embedded Systems

This was the final and culminating project of engineering 103 course in C language coding. The intended outcome of the project was to design a system that utilizes an embedded device (ESP32 Microcontroller) to collect temperature data and transmit this data via Wi-Fi to an online database for further analysis and processing. The program that runs on the microcontroller takes inputs from both the sensor and over the serial port which it may be connected to. It also has outputs over both the serial port and via Wi-Fi to an online database (Google Sheet). The main input for the device is a voltage across one of the analog pins of the microcontroller. The program utilizes multiple mathematical functions including the Steinhart-hart equation for relating resistance to temperature through a thermistor, to convert this analog signal into a temperature reading. The program collects a temperature data point every second and stores it in an array of fixed size. Once this array is full, the program complies this data into a string and sends this batch of data to a spreadsheet. When the embedded device is communicating over the serial port, the user can input the character "r" to get a report of the data collected including the maximum value recorded, the minimum value recorded and a list of the two-minute averages. In addition to temperature data, a timestamp, the two-minute averages, a rolling average and a loop count are also sent to the google sheet. Once the data arrives at the apps script associated with the google sheet, it is processed by another program which indexes the data and appends it to the last row filled. The code itself is very adaptable and can be updated for different circuit characteristics, sample sizes and data destinations by changing just one variable per parameter.

1 Lifts 

Artifacts

Name Description
Source Code This file is the code which was uploaded to the ESP32 for this project. This code utilizes the analog pins of the ESP32 microcontroller to measure the voltage across a thermistor using a voltage divider circuit. This data is collected once per second and transmitted via Wi-Fi to an online google sheet after two minutes of data collection. The code also calculates and stores a rolling average of the data collected, individual averages of each two-minute upload period and a time stamp associated with each data point.   Download
Google Sheets App Scripts Code This portion of the project is the code which processes the data received by google sheets from the ESP32. It indexes sorts and appends the data to the last row of added data.   Download
Video Description In-depth description of the programs behind the operation, hardware description, live data collection and data analysis over a 24hr period.   Link