Skip to content

Commit efc1f0d

Browse files
committed
Add images + gifs
1 parent 83e6f20 commit efc1f0d

File tree

6 files changed

+101
-13
lines changed

6 files changed

+101
-13
lines changed

content/arduino-cloud/02.features/09.advanced-chart/advanced-chart.md

Lines changed: 101 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ author: Karl Söderby
55
tags: [IoT Cloud, Charts, Data Plotting]
66
---
77

8-
## Overview
8+
The **advanced chart widget** is used to display data from several IoT Cloud variables in a single chart. You can track the data in both real time, select from a specific time period while selecting the variables you want to display.
99

10-
The **advanced chart widget** is used to display the data from several IoT Cloud variables in a single chart. You can track the data in both real time, or select from a specific time period.
10+
![The advanced chart widget.](assets/advanced-chart.gif)
1111

12-
This widget can very easily be added onto existing projects (if you are already tracking data), and is particularly interesting to use in projects such as:
13-
- Weather station
14-
- Environmental data
15-
- Energy consumption
16-
- Various science projects where data comparison is needed
12+
This widget can be added onto existing projects (if you are already tracking data), and is particularly interesting to use in projects such as:
13+
- Weather stations,
14+
- Environmental data tracking,
15+
- Energy consumption,
16+
- Various science projects where data comparison is needed.
1717

18-
What is particularly interesting is that this new widget can use variables from **multiple things.** So you can monitor data from various devices and plot it all in one place.
18+
This widget can use variables from **different Things**, so you can monitor data from various devices and plot it all in one place.
1919

20-
For example, you could set up a series of sensors around a city, and measure the CO2 emissions from your phone or laptop!
20+
For example, you could set up a series of sensors around a city, and measure the CO2 emissions from your phone or laptop in a single chart!
2121

2222
## Hardware & Software Needed
2323

2424
- [Arduino IoT Cloud](https://create.arduino.cc/iot/).
2525
- Cloud compatible boards, [see full list](https://docs.arduino.cc/arduino-cloud/getting-started/iot-cloud-getting-started#compatible-hardware).
2626

27-
***In this tutorial, we use the [MKR WiFi 1010]() and [MKR ENV Shield]() for environmental values. This is not a requirement, you can use any board for this tutorial.***
27+
***In this tutorial, we use the [MKR WiFi 1010](/hardware/mkr-wifi-1010) and [MKR ENV Shield](/hardware/mkr-env-shield) for recording environmental values. This is not a requirement, you can use any board for this tutorial.***
2828

2929
## Setup & Configuration
3030

@@ -42,7 +42,7 @@ To use the advanced widget, you will need to set up a Thing and some variables t
4242

4343
**3.** Link the variables you want to compare. In this case, we are using `temperature`, `humidity`, `pressure` and `light`.
4444

45-
![Link variables.]()
45+
![Link variables.](assets/select-variables.png)
4646

4747
>You can use up to a maximum of 5 variables.
4848
@@ -52,12 +52,100 @@ To use the advanced widget, you will need to set up a Thing and some variables t
5252

5353
**5.** Click on **"Done"** when finished selecting the variables. If your board is connected and is sending data to the cloud, you will see the widget's data update frequently.
5454

55+
## Example Code
56+
57+
The sketch of your project does not require much complexity. In your automatically generated code, simply add the sensor reading code inside of the loop. We are using the [Arduino_MKRENV](https://www.arduino.cc/reference/en/libraries/arduino_mkrenv/) library, and we only needed to add these following lines to the loop to read all sensors:
58+
59+
```arduino
60+
temperature = ENV.readTemperature();
61+
humidity = ENV.readHumidity();
62+
pressure = ENV.readPressure();
63+
light = ENV.readIlluminance();
64+
```
65+
66+
The full sketch used is found below:
67+
68+
```arduino
69+
#include <Arduino_MKRENV.h>
70+
71+
#include "thingProperties.h"
72+
73+
void setup() {
74+
// Initialize serial and wait for port to open:
75+
Serial.begin(9600);
76+
77+
if (!ENV.begin()) {
78+
while (1);
79+
}
80+
81+
delay(1500);
82+
83+
initProperties();
84+
85+
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
86+
87+
setDebugMessageLevel(2);
88+
ArduinoCloud.printDebugInfo();
89+
}
90+
91+
void loop() {
92+
ArduinoCloud.update();
93+
94+
temperature = ENV.readTemperature();
95+
humidity = ENV.readHumidity();
96+
pressure = ENV.readPressure();
97+
light = ENV.readIlluminance();
98+
99+
}
100+
```
101+
55102
## Usage
56103

57-
With the widget set up, let's explore some cool features.
104+
With the widget set up, let's explore some of its features.
58105

59106
### Toggle Variables
60107

61108
You can enable or disable to variables you want to display by simply clicking the name of the variable.
62109

63-
![Toggle variables.](assets/advanced-chart-toggle.gif)
110+
![Toggle variables.](assets/advanced-chart-toggle.gif)
111+
112+
### Value Tracking
113+
114+
Hover over a line to see what the value of a variable was in a specific point in time. In this case, we choose to check only the temperature and the humidity.
115+
116+
![View values.](assets/advanced-chart.gif)
117+
118+
### Specific Time Period
119+
120+
To see a specific time period, click on the calendar icon, where you can select the starting & end time & date.
121+
122+
![Select time & date.](assets/select-time-date.png)
123+
124+
As an example, the widget below shows the illuminance (LUX) recorded via the **MKR ENV Shield**, the `light` variable.
125+
126+
Here, we can see that sunset occured around 18.00 (6PM), and sunrise sometime around 07.00 (7AM).
127+
128+
![Light tracking.](assets/light-tracking.png)
129+
130+
## Limitations
131+
132+
The following variables are not supported in the advanced chart widget.
133+
134+
- Character String
135+
- Schedule
136+
- Location
137+
- Color
138+
- Custom Variable
139+
- Colored Light
140+
- Dimmed Light
141+
- Contact Sensor
142+
- Motion Sensor
143+
- Television
144+
- Boolean
145+
- Light
146+
- Smart Plug
147+
- Switch
148+
149+
## Summary
150+
151+
The advanced chart widget can be used for **any** project that includes data monitoring. It is perfect for scientific projects when monitoring & comparing data over time is needed.
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)