Learn / IoT and AI at the edge / Dashboards and logging

Your First Sensor Chart and IoT Dashboard

ReviewedBeginnerFreeAbout 6 min
23.4°CSSD1306
In short

Your First Sensor Chart and IoT Dashboard: the short answer

Before building anything connected, learn to see your data. The Arduino IDE's Serial Plotter draws a live graph of numbers you print. Example: About 4,300 updates a day. Sending every 20 s instead of every 5 s keeps you inside free limits and still shows the trend clearly.

Level
Beginner
Time
About 6 min
Topic
IoT and AI at the edge
You will learn to

Plot live readings with the Serial Plotter, save them as CSV, and send them to a simple online dashboard.

Before this: Connected Embedded Devices, Interpreting Sensor Data

Before building anything connected, learn to see your data. The Arduino IDE's Serial Plotter draws a live graph of numbers you print. Print values separated by commas on one line, with labels such as Serial.print("temp:"); Serial.print(t); Serial.print(",hum:"); Serial.println(h); and each label becomes a line on the chart. Seeing a reading jump or drift tells you more about a sensor than a page of numbers.

To keep the data, print it as CSV (comma-separated values): one line per reading with a timestamp, for example millis()/1000, then each value. Copy it from a serial terminal into a file, or write it to an SD card, and open it in a spreadsheet to make charts, find the average and spot outliers. This simple habit makes lab records and project reports much easier.

When you want to see readings from your phone, send them to a cloud dashboard. Services such as ThingSpeak accept readings with one HTTP request; the free tier allows an update every 15 seconds per channel, which suits temperature, humidity or soil moisture. Arduino IoT Cloud, Blynk and Adafruit IO work in similar ways. Keep the API key out of shared code, send only what you need, and remember that free services can change their limits. Later lessons cover your own MQTT broker and database for more control.

Look at the data before you send it anywhere

A plot reveals things a stream of numbers hides: a sensor that is drifting, a reading that jumps whenever a motor starts, a periodic dip at the moment Wi-Fi switches on. Spend ten minutes with the Serial Plotter before you build a dashboard, and you will often fix a wiring or power problem that would otherwise show up as a mystery later.

Plot related values on the same axes only when their ranges are similar. A temperature of 25 and a humidity of 60 share a plot reasonably well, but a battery voltage of 3.9 will look like a flat line next to them.

A good log file

Write a header line first (time, temp, humidity), then one line per reading. Use a real timestamp when you can: an ESP32 can read the time from the internet (NTP), and a Pi has a clock. If you only have millis(), note the start time yourself. Use a dot for decimals and a comma between values, avoiding commas inside numbers.

In a spreadsheet, a line chart of one column against time, an average, a minimum and a maximum already answer most questions. Mark gaps instead of deleting them: a missing hour tells you something.

Choosing a cloud service

Services differ in what the free tier gives: how often you may update, how long data is kept, how many channels you can have and whether the charts can be public. Read the limits first, since a free plan that stores only a month will not serve a year-long experiment.

The cost of convenience is control. Your data lives on someone else's server, the service can change or close, and an API key stored in code can be copied by anyone who sees it. For something you care about, keep a local CSV copy too.

What to send and how often

Send what you will use, not everything you can measure, and no faster than the value changes. A room temperature every minute is plenty. Sending less saves battery, data and the service's limits. Add the device's name and, now and then, its battery voltage and signal strength, so you can tell a dead sensor from a dead battery.

When a send fails, keep the reading and try again later, instead of losing it or blocking the sensor loop.

Common mistakes
  • Printing text and numbers mixed in one line so the plotter cannot read it.
  • Posting an API key to GitHub in a shared sketch.
  • Sending every second to a service that allows one update every 15 seconds.
Worked example

How many readings fit in a free dashboard?

  1. One update every 20 seconds is 3 per minute, 180 per hour, 4,320 per day.
  2. Each update carries temperature and humidity as two fields.
  3. Over a 30-day month that is about 130,000 updates.
  4. Check this against the free tier's yearly or daily message limit before you start.

Result. About 4,300 updates a day. Sending every 20 s instead of every 5 s keeps you inside free limits and still shows the trend clearly.

Try it

Print temperature and humidity from a DHT22 in Serial Plotter format and watch the chart while you breathe on the sensor. Then log 30 minutes of CSV to a file, make a chart in a spreadsheet, and finally send the readings to a ThingSpeak channel from an ESP32 every 20 seconds.

Check yourself

3 quick questions

  1. How do you get two lines on the Serial Plotter?

  2. Why save readings as CSV?

  3. Why keep the dashboard API key out of shared code?

Common questions

What will I learn in "Your First Sensor Chart and IoT Dashboard"?

Plot live readings with the Serial Plotter, save them as CSV, and send them to a simple online dashboard.

How many readings fit in a free dashboard?

One update every 20 seconds is 3 per minute, 180 per hour, 4,320 per day. Each update carries temperature and humidity as two fields. Over a 30-day month that is about 130,000 updates. Check this against the free tier's yearly or daily message limit before you start. About 4,300 updates a day. Sending every 20 s instead of every 5 s keeps you inside free limits and still shows the trend clearly.

How do you get two lines on the Serial Plotter?

Print two values separated by a comma on one line. Each value on a line becomes its own trace.

Why save readings as CSV?

Spreadsheets and tools open it directly for charts and analysis. CSV is the simplest universal data format.

Why keep the dashboard API key out of shared code?

Anyone with it can write to your channel. Keys are passwords for your data.