Your First VwireIOT Project
Build a complete temperature and humidity monitor with a live dashboard in under 10 minutes.
What you'll build
ESP32 + DHT22 ──MQTT/TLS──▶ VwireIOT ──▶ Dashboard
├── Value Display: Temperature (V0)
├── Value Display: Humidity (V1)
├── Gauge: Humidity % (V1)
└── Graph: 24h temperature trend (V0)
Hardware needed
- ESP32 development board (any variant)
- DHT22 temperature/humidity sensor
- 10 kΩ pull-up resistor
- Breadboard + jumper wires
Wiring:
| DHT22 pin | ESP32 pin |
|---|---|
| VCC | 3.3 V |
| DATA | GPIO 4 (with 10 kΩ pull-up to 3.3 V) |
| GND | GND |
Step 1: Create a device
- Log in to the VwireIOT Dashboard
- Go to Devices → Add Device, name it
ESP32 DHT22, and click Create - Open the device and copy both:
- Auth Token — secret key embedded in firmware
- Device ID — the device's identifier (e.g.
VU-XXXXXX)
Step 2: Flash the firmware
Install the required libraries in Arduino IDE (Library Manager):
- Vwire — search
Vwire - DHT sensor library — search
DHT sensor library by Adafruit - PubSubClient and ArduinoJson (Vwire dependencies)
Create a new sketch:
#include <Vwire.h>
#include <DHT.h>
// WiFi credentials
const char* WIFI_SSID = "YOUR_WIFI_SSID";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";
// From device settings in the dashboard
const char* AUTH_TOKEN = "YOUR_AUTH_TOKEN";
const char* DEVICE_ID = "YOUR_DEVICE_ID"; // e.g. VU-ABC123
// DHT sensor
#define DHT_PIN 4
#define DHT_TYPE DHT22
DHT dht(DHT_PIN, DHT_TYPE);
// Called when connected to Vwire cloud
VWIRE_CONNECTED() {
Serial.println("Connected to VwireIOT!");
Vwire.sync(V0, V1); // Request last stored values from cloud
}
void setup() {
Serial.begin(115200);
dht.begin();
// Configure Vwire (uses mqtt.vwire.io:8883 TLS by default)
Vwire.config(AUTH_TOKEN);
Vwire.setDeviceId(DEVICE_ID);
// Connect to WiFi and Vwire cloud
Vwire.begin(WIFI_SSID, WIFI_PASSWORD);
}
void loop() {
Vwire.run(); // Must be called every iteration
static unsigned long lastRead = 0;
if (Vwire.connected() && millis() - lastRead >= 5000) {
lastRead = millis();
float temp = dht.readTemperature();
float hum = dht.readHumidity();
if (!isnan(temp) && !isnan(hum)) {
Vwire.virtualSend(V0, temp); // V0 = Temperature
Vwire.virtualSend(V1, hum); // V1 = Humidity
Serial.printf("Temp: %.1f°C Hum: %.1f%%\n", temp, hum);
}
}
}
Flash to your ESP32. Open Serial Monitor at 115200 baud and wait for:
Connected to VwireIOT!
Temp: 23.5°C Hum: 58.2%
Step 3: Create a project
- In the dashboard, go to Projects → New Project, name it
Home Monitor, and click Create - Click Edit Dashboard to enter edit mode
Step 4: Build the dashboard
Temperature display (V0)
- + Add Widget → Value Display
- Device:
ESP32 DHT22, Pin:V0 - Suffix:
°C, Label:Temperature - Click Save — live temperature appears immediately
Humidity display (V1)
- + Add Widget → Value Display
- Device:
ESP32 DHT22, Pin:V1 - Suffix:
%, Label:Humidity
Humidity gauge
- + Add Widget → Gauge
- Device:
ESP32 DHT22, Pin:V1 - Min:
0, Max:100, Label:Humidity
Temperature history chart
- + Add Widget → Graph
- Device:
ESP32 DHT22, Pin:V0 - Duration:
24h, Label:Temperature trend
Step 5: Set up an alert
Get notified when temperature exceeds a threshold:
- Go to Alerts in the project
- Click + Add Alert
- Set: Device
ESP32 DHT22, PinV0, Conditiongreater than, Value30 - Choose delivery: Push notification, Email, or both
The alert triggers automatically when the device pushes a reading above 30 °C.
Result
Your dashboard now shows live temperature and humidity readings and a 24-hour trend chart. Data is stored per your plan's retention period and available for graphing and export.
Next steps
Result
Your dashboard now shows live temperature, humidity, a gauge, and a historical chart. All data is stored and available for up to 30 days on the free plan.
Next steps
- Add an LED widget toggled by a Button to control a relay
- Set up notifications to alert you when temperature exceeds a threshold
- Graph widget options for multi-series overlays
- Connecting from Python to add a Raspberry Pi sensor node