Skip to content

Commit 66eaf9c

Browse files
committed
Add Instructions on Converting CSV to a Spreadsheet
1 parent cad806f commit 66eaf9c

15 files changed

+118
-2
lines changed

docs/assets/Google_Sheets_Logo.png

1.81 KB
Loading
Loading
Loading
378 KB
Loading
1.62 MB
Loading
Loading
448 KB
Loading
Loading
Loading
Loading
Loading
Loading

docs/example_CSV_to_spreadsheet.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
The DataLogger IoT is great at displaying real time data with an IoT service whenever there is an Internet connection available. For those that want to use the DataLogger IoT without a WiFi connection and/or you just want to save data to a microSD card, you can import the comma separated values (CSV) from the text file into a spreadsheet to graph the values.
2+
3+
There are a few spreadsheet programs available that can take text files with CSV but for the scope of this tutorial, we will be using Google Sheets™ to convert the CSV output to a graph.
4+
5+
<div style="text-align: center">
6+
<a href="https://www.google.com/sheets/about/"><img src="../assets/Google_Sheets_Logo.png" width="100" length="100" alt="Google Sheets Logo"></a>
7+
<br />
8+
<i>Image Courtesy of <a href="https://www.google.com/sheets/about/">Google Sheets</a>. </i>
9+
</div>
10+
11+
!!! note
12+
Google and Google Sheets are trademarks of Google LLC. This tutorial is not endorsed by or affiliated with Google in any way. We just thought it was a sweet tool to visualize all the data that was collected by your snazzy DataLogger IoT. 😉
13+
14+
15+
16+
### Log Some Data!
17+
18+
At this point, we will assume that you have configured connected your devices to the DataLogger IoT and configured its settings. Insert the microSD card into it's socket. Power the DataLogger IoT up and start logging some data! In this case, we were using the DataLogger IoT using the Qwiic Environmental Combo Breakout - ENS160/BME280. of course, you could have other compatible Qwiic-enabled devices connected depending on your setup. For simplicity, a WiFi connection was used to synchronize the clock to the NTP server and a computer's USB port was used to power everything.
19+
20+
!!! tip
21+
For users without an Internet connection to sync the clock to the NTP server, you may want to consider using a compatible Qwiic-enabled device like the Qwiic Real Time Clock (RTC) Module - RV-8803 or a Qwiic-enabled u-blox GNSS module. Note that you will need to configure the time to your area before logging any data. U-blox GNSS modules would also need to be able to view a few satellites before being able to synchronize to the UTC.
22+
23+
!!! note
24+
For users that require a timestamp with their datasets, make sure to [enable timestamp](https://docs.sparkfun.com/SparkFun_DataLogger/example_timestamp/).
25+
26+
When ready, remove power from the DataLogger IoT and eject the microSD card from the socket. Insert the microSD card into an adapter and connect to your computer.
27+
28+
<div style="text-align: center">
29+
<a href="https://cdn.sparkfun.com//assets/parts/7/6/3/6/11609-Action.jpg">
30+
<img src="https://cdn.sparkfun.com//assets/parts/7/6/3/6/11609-Action.jpg" width="500" height="500" alt="Memory Card Adapter and USB Reader for microSD cards"></a>
31+
</div>
32+
33+
34+
35+
### Importing CSV to a Spreadsheet
36+
37+
Log into your Google account and [open Google Sheets to create a new spreadsheet](https://www.google.com/sheets/about/).
38+
39+
<div style="text-align: center"><a href="https://docs.google.com/spreadsheets/create" target="google_sheets" class="md-button">Click Here to Create a New Google Spreadsheet</a></div>
40+
41+
Head to the menu and select: **File** > **Import**.
42+
43+
<div style="text-align: center">
44+
<a href="../assets/csv_to_spreadsheet_imported.JPG"><img src="../assets/csv_to_spreadsheet_imported.JPG" width="600" height="600" alt="Importing Google Sheets"></a>
45+
</div>
46+
47+
A window will pop up with some options to import a file. Click the **Upload** tab. Click on the **Browse** button to choose the file. Or drag and drop the file into the upload area. In this case, the DataLogger IoT saved the comma separated values to a text file called **sfe0003.txt**.
48+
49+
<div style="text-align: center">
50+
<a href="../assets/csv_to_spreadsheet_select_file.JPG"><img src="../assets/csv_to_spreadsheet_select_file.JPG" width="600" height="600" alt="Select CSV File"></a>
51+
</div>
52+
53+
!!! note
54+
Not seeing any data in the file or even a text file saved in the root directory? Make sure that the microSD card is formatted correctly and the DataLogger is configured properly. In the menu, make sure to have the [**SD Card Format** enabled and set to the correct format](../configuration/#logging-logger). In this case, we are using the default CSV format.
55+
56+
Another window will pop up asking how to import the file. From the drop down menu, select: **Import location** > **Create new spreadsheet** and **Separator Type** > **Detect automatically**. Since the file will include commas to separate each reading, Google Sheets should automatically separate text and values into each cell. Otherwise, you can select **comma** as the separator type.
57+
58+
<div style="text-align: center">
59+
<a href="../assets/csv_to_spreadsheet_separator_type.JPG"><img src="../assets/csv_to_spreadsheet_separator_type.JPG" width="600" height="600" alt="Separator Type"></a>
60+
</div>
61+
62+
!!! note
63+
If you have the file open, you can also manually paste the CSV data into the spreadsheet. Select all the contents of the text file and copy the contents onto your clipboard. Right click the cell closest to the top and farthest to the left of the spreadsheet (i.e. A1). Then paste the data. One caveat is that Google Sheets may have problems where it only pastes the title of each column.
64+
65+
<div style="text-align: center">
66+
<a href="../assets/csv_to_spreadsheet_title_header_row.JPG"><img src="../assets/csv_to_spreadsheet_title_header_row.JPG" width="600" height="600" alt="Titles of Each Header Rows Only Pasted"></a>
67+
</div>
68+
69+
If you see this happen, you will need to select all but the header row from the text file. Then copy the contents onto your clipboard again. Right click on the next row the titles (i.e. A2) and paste the data.
70+
71+
<div style="text-align: center">
72+
<a href="../assets/csv_to_spreadsheet_manual_paste.JPG"><img src="../assets/csv_to_spreadsheet_manual_paste.JPG" width="600" height="600" alt="Manual Paste"></a>
73+
</div>
74+
75+
!!! tip
76+
To separate the values to each column, highlight everything in the column. Then head to the menu and select: **Data** > **Split text into columns**
77+
78+
<div style="text-align: center">
79+
<a href="../assets/csv_to_spreadsheet_split_text_to_columns.JPG"><img src="../assets/csv_to_spreadsheet_split_text_to_columns.JPG" width="600" height="600" alt="Splitting Text to Columns"></a>
80+
</div>
81+
82+
83+
84+
### Graphing Your Datasets
85+
86+
Hold down the <kbd>Shift</kbd> button on your keyboard and select the columns that you would like to graph using your mouse. Once the data is highlighted, head to the menu and select: **Insert** > **Chart**.
87+
88+
<div style="text-align: center">
89+
<a href="../assets/csv_to_spreadsheet_select_columns_to_graph.JPG"><img src="../assets/csv_to_spreadsheet_select_columns_to_graph.JPG" width="600" height="600" alt="Select Datasets to Graph and then select Insert > Chart from menu"></a>
90+
</div>
91+
92+
The values that were selected will be graphed. You will want to be careful about including too many datasets on the graph as it can be hard to read when they are not in the same range.
93+
94+
<div style="text-align: center">
95+
<a href="../assets/csv_to_spreadsheet_select_unformatted_chart.JPG"><img src="../assets/csv_to_spreadsheet_select_unformatted_chart.JPG" width="600" height="600" alt="Unformatted Chart"></a>
96+
</div>
97+
98+
At this point, try formatting the data based on your preferences and export the graph. The graph below was formatted and exported to a PNG. Note that the values for the AQI were moved to the right of the graph for a better viewing since they were smaller than the datasets for TVOC and eCO<sub>2</sub>.
99+
100+
<div style="text-align: center">
101+
<a href="../assets/csv_to_spreadsheet_datalogger_iot_environment_dataset.png"><img src="../assets/csv_to_spreadsheet_datalogger_iot_environment_dataset.png" width="600" height="600" alt="Exported and Formatted Chart"></a>
102+
</div>
103+
104+
!!! note
105+
There are additional features to help format your data based on your personal preferences! Select the column that you would like to format. Then head to the menu: **Format** > **Number**. Select the format that you would like to apply to the dataset. In this case, we adjusted the General Time with **Custom Date and Time** to show a 12-hour format before creating a new graph.
106+
107+
<div style="text-align: center">
108+
<a href="../assets/csv_to_spreadsheet_datalogger_iot_environment_dataset_12-hour_format.png"><img src="../assets/csv_to_spreadsheet_datalogger_iot_environment_dataset_12-hour_format.png" width="600" height="600" alt="Exported and Formatted Chart with 12-hour Format"></a>
109+
</div>

docs/single_page.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ icon: fontawesome/solid/scroll
2020
# Configuration
2121
--8<-- "./docs/configuration.md"
2222

23-
# Connecting to a WiFi Network
23+
# Example - Connecting to a WiFi Network
2424
--8<-- "./docs/wifi_network.md"
2525

26-
# Adding a Timestamp to Data
26+
# Example - Adding a Timestamp to Data
2727
--8<-- "./docs/example_timestamp.md"
2828

2929
# Example - Factory Reset
@@ -47,6 +47,12 @@ icon: fontawesome/solid/scroll
4747
# Example - HTTP
4848
--8<-- "./docs/example_http.md"
4949

50+
# Example - Arduino IoT Cloud
51+
--8<-- "./docs/example_arduino_iot_cloud.md"
52+
53+
# Example - How to Convert Comma Separated Values (CSV) to a Spreadsheet
54+
--8<-- "./docs/example_CSV_to_spreadsheet.md"
55+
5056
# Appendix - Supported Qwiic Devices
5157
--8<-- "./docs/supported_devices.md"
5258

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ nav:
252252
- Azure: example_azure.md
253253
- HTTP: example_http.md
254254
- Arduino IoT Cloud: example_arduino_iot_cloud.md
255+
- How to Convert Comma Separated Values (CSV) to a Spreadsheet: example_CSV_to_spreadsheet.md
255256
- Appendix - Supported Qwiic Devices: supported_devices.md
256257
- Resources: resources.md
257258
- Support:

0 commit comments

Comments
 (0)