Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home IoT & Smart Home

Grafana + InfluxDB: IoT Data Visualization Stack

Grafana + InfluxDB: IoT Data Visualization Stack

April 1, 2026 /Posted by / 0

Table of Contents

  • Why Grafana and InfluxDB for IoT
  • Installing InfluxDB on Ubuntu
  • Setting Up Grafana
  • Designing Your Data Schema
  • Sending ESP32 Data to InfluxDB
  • Building Grafana Dashboards
  • Alerting and Notifications
  • Frequently Asked Questions

The Grafana + InfluxDB stack is the gold standard for IoT data visualisation. InfluxDB handles time-series data storage with built-in downsampling and retention policies, while Grafana transforms that data into beautiful, interactive dashboards. This combination is used by thousands of IoT deployments worldwide and runs entirely on your own hardware.

Why Grafana and InfluxDB for IoT

Time-series databases like InfluxDB are purpose-built for IoT sensor data:

  • InfluxDB: Stores billions of timestamped data points efficiently with automatic compression
  • Grafana: Visualises data from any source with 50+ panel types and templating
  • Together: Query weeks of sensor data and render it in milliseconds
  • Cost: Both are open-source. Run on a ₹500/month VPS or a Raspberry Pi

Installing InfluxDB on Ubuntu

# Add InfluxDB repository (Ubuntu/Debian)
wget -q https://repos.influxdata.com/influxdata-archive_compat.key
echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list

sudo apt update && sudo apt install -y influxdb2

# Start and enable
sudo systemctl start influxdb
sudo systemctl enable influxdb

# Access setup at http://localhost:8086
# Create org: 'zbotic', bucket: 'iot_sensors', retention: 30d

Setting Up Grafana

# Add Grafana repository
sudo apt install -y apt-transport-https software-properties-common
wget -q -O - https://apt.grafana.com/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/grafana.gpg
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list

sudo apt update && sudo apt install -y grafana

# Start and enable
sudo systemctl start grafana-server
sudo systemctl enable grafana-server

# Access at http://localhost:3000
# Default login: admin / admin

Sensors for Data Visualisation

  • DHT22 Digital Temperature and Humidity Sensor Module
  • BME280 Environmental Sensor (Temperature, Humidity, Barometric Pressure)
  • DS18B20 Waterproof Temperature Sensor Probe 1m

Designing Your Data Schema

Design your InfluxDB schema for efficient querying:

// InfluxDB line protocol format:
// measurement,tag1=val1,tag2=val2 field1=val1,field2=val2 timestamp

// Example data points:
sensors,device=esp32-01,location=mumbai temperature=32.5,humidity=65.2 1711900800000000000
sensors,device=esp32-02,location=pune temperature=28.1,humidity=72.8 1711900800000000000

// Best practices:
// - Tags: device_id, location, sensor_type (indexed, for filtering)
// - Fields: temperature, humidity, pressure (not indexed, for values)
// - Measurement: group related sensors (sensors, energy, air_quality)

Sending ESP32 Data to InfluxDB

Send data from ESP32 to InfluxDB using HTTP POST:

#include 
#include 
#include 

const char* ssid = "YOUR_WIFI";
const char* password = "YOUR_PASSWORD";
const char* influxUrl = "http://YOUR_SERVER:8086/api/v2/write?org=zbotic&bucket=iot_sensors&precision=s";
const char* influxToken = "YOUR_INFLUXDB_TOKEN";

#define DHT_PIN 4
DHT dht(DHT_PIN, DHT22);

void sendToInflux() {
  float temp = dht.readTemperature();
  float hum = dht.readHumidity();
  if (isnan(temp) || isnan(hum)) return;

  HTTPClient http;
  http.begin(influxUrl);
  http.addHeader("Authorization", String("Token ") + influxToken);
  http.addHeader("Content-Type", "text/plain");

  // Line protocol format
  String payload = "sensors,device=esp32-01,location=mumbai ";
  payload += "temperature=" + String(temp, 1);
  payload += ",humidity=" + String(hum, 1);

  int httpCode = http.POST(payload);
  Serial.printf("InfluxDB response: %dn", httpCode);
  http.end();
}

void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
  Serial.println("Connected!");
}

void loop() {
  sendToInflux();
  delay(30000); // Every 30 seconds
}

Recommended Product

DHT22 Digital Temperature and Humidity Sensor Module

Buy on Zbotic.in

Building Grafana Dashboards

Create powerful dashboards in Grafana:

  1. Add InfluxDB as a data source (Settings → Data Sources → InfluxDB)
  2. Use Flux query language for InfluxDB 2.x
  3. Create panels: time series for trends, stat for current values, gauge for limits
  4. Use variables for dynamic device selection
// Flux query for temperature over last 24 hours
from(bucket: "iot_sensors")
  |> range(start: -24h)
  |> filter(fn: (r) => r._measurement == "sensors")
  |> filter(fn: (r) => r._field == "temperature")
  |> filter(fn: (r) => r.location == "mumbai")
  |> aggregateWindow(every: 5m, fn: mean)

Alerting and Notifications

Set up alerts for critical conditions:

  • Grafana Alerting: Set thresholds on any panel — alert when temperature exceeds 50 degrees Celsius
  • Notification channels: Email, Telegram, Slack, PagerDuty, webhooks
  • InfluxDB tasks: Run scheduled Flux scripts for data processing and anomaly detection

Recommended Product

BME280 Environmental Sensor (Temperature, Humidity, Barometric Pressure)

Buy on Zbotic.in

Frequently Asked Questions

Can Grafana and InfluxDB run on Raspberry Pi?

Yes, both run on Raspberry Pi 4 (4 GB recommended). Performance is adequate for up to 50 devices with moderate data rates. For larger deployments, use a dedicated server.

How much storage does InfluxDB need for IoT?

A single sensor sending data every 30 seconds uses approximately 50 MB per year in InfluxDB. With 20 sensors, expect 1 GB per year. InfluxDB compresses time-series data very efficiently.

Is there a cloud-hosted option?

Yes, InfluxDB Cloud offers a free tier with 30-day retention. Grafana Cloud offers a free tier with 10,000 metrics. Both have servers in multiple regions, though not yet in India.

What is the difference between InfluxDB and Prometheus?

InfluxDB uses push-based ingestion (devices send data). Prometheus uses pull-based collection (server scrapes endpoints). For IoT with ESP32 devices, InfluxDB’s push model is more natural and easier to implement.

{“@context”: “https://schema.org”, “@type”: “FAQPage”, “mainEntity”: [{“@type”: “Question”, “name”: “Can Grafana and InfluxDB run on Raspberry Pi?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Yes, both run on Raspberry Pi 4 (4 GB recommended). Performance is adequate for up to 50 devices with moderate data rates. For larger deployments, use a dedicated server.”}}, {“@type”: “Question”, “name”: “How much storage does InfluxDB need for IoT?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “A single sensor sending data every 30 seconds uses approximately 50 MB per year in InfluxDB. With 20 sensors, expect 1 GB per year. InfluxDB compresses time-series data very efficiently.”}}, {“@type”: “Question”, “name”: “Is there a cloud-hosted option?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Yes, InfluxDB Cloud offers a free tier with 30-day retention. Grafana Cloud offers a free tier with 10,000 metrics. Both have servers in multiple regions, though not yet in India.”}}, {“@type”: “Question”, “name”: “What is the difference between InfluxDB and Prometheus?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “InfluxDB uses push-based ingestion (devices send data). Prometheus uses pull-based collection (server scrapes endpoints). For IoT with ESP32 devices, InfluxDB’s push model is more natural and easier to implement.”}}]}

Ready to Build Your IoT Project?

Browse our complete collection of ESP32 boards, sensors, and IoT components. Fast shipping across India with technical support.

Shop IoT Components on Zbotic.in

Tags: Cloud, India, iot, Iot Smart Home
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Construction Site Monitor: Cam...
blog construction site monitor camera and motion detection 613392
blog esp32 smart scale hx711 with wifi weight tracking 613400
ESP32 Smart Scale: HX711 with ...

Related posts

Svg%3E
Read more

IoT Home Insurance Sensor Kit: Leak, Smoke, and Motion

April 1, 2026 0
Table of Contents IoT and Home Insurance Water Leak Detection Smoke and Fire Detection Motion and Intrusion Sensing Building the... Continue reading
Svg%3E
Read more

IoT Pet Tracker: GPS Collar with Geofencing Alerts

April 1, 2026 0
Table of Contents Introduction and Overview Hardware Components Required GPS Module Integration with ESP32 Cloud Platform Setup Real-Time Tracking Dashboard... Continue reading
Svg%3E
Read more

IoT Aquaponics Controller: Fish and Plant Automation

April 1, 2026 0
Table of Contents The Water Monitoring Challenge in India Sensor Technologies for Water Building the Sensor Node Data Transmission and... Continue reading
Svg%3E
Read more

IoT Composting Monitor: Temperature and Moisture Tracking

April 1, 2026 0
Table of Contents Why Temperature Monitoring Matters Sensor Selection Guide Hardware Assembly and Wiring Firmware Development Cloud Data Logging Alert... Continue reading
Svg%3E
Read more

IoT Beehive Monitor: Weight, Temperature, and Humidity

April 1, 2026 0
Table of Contents Why Monitor Beehives Weight Measurement System Temperature and Humidity Sensing Building the Monitor Data Analysis for Bee... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now