Introduction: How to Code "A Hiker's Scrapbook"
People tend to be nostalgic about hobbies that are important to them, such as hiking.
But how do you keep memory of a hike?
Pictures are an option, yes. This device would allow another option to be data archives from the trip. The person would have a graph plotting the time the hike took compared to the altitude they hiked. In addition, it would tell them the max, min, and average pressure they were exposed to throughout the length of the hike.
This uses Internet of Things Altitude and Pressure sensor to monitor and record data about the hike. MATLAB is then used to analyzed the data to output key pressure readings and a graph of time vs. altitude.
Step 1: Parts and Materials
Compatible altitude/pressure sensor
USB to micro-USB cable
MATLAB software and ThingSpeak tool box
Step 2: Setting Up Software
Create an account
Create a "New Channel"
Label Field 1 as Altitude and Field 2 as Pressure
Go to "Sharing" and select "Share channel view with everyone"
Paste code from [https://ef.engr.utk.edu/ef230-2017-08/projects/ard...] into Arduino
Change WiFi network "ssid" and password
Change "streamID" and "privateKey" to match API Keys on ThingSpeak
Step 3: Setting Up Hardware
Wire hardware according to the above picture
Plug USB into laptop and ESP8266
Step 4: Connecting to Your Device
Look for and flip the small, black switch on the ESP8266 to turn on
Click the right-facing arrow at the upper left corner of Arduino program to upload code (this may take a few minutes)
Now the sensor readings should be outputting data to the ThingSpeak website, which is represented graphically
Step 5: MATLAB Coding
Copy the following code for the function "microcontroller_project" into MATLAB
Alter the bold text to fit the specific ThingSpeak channel
(The "90" in bold refers to the minutes worth of data taken into account from the channel. Change this manually according to how long the channel has been running.)
Call the function by typing "microcontroller_project" into the Command Window
function [graph Pressures_Pa] = microcontroller_project ()
data = thingSpeakRead(364102,'Fields',[1,2],'NumMinutes',90,'OutputFormat','table');
title('Hiking Trail Data: Time vs. Altitude')
We have a be nice policy.
Please be positive and constructive.