🎯 Objective
To develop an IoT-based Tire Pressure and Temperature Monitoring System using sensors and the FAVORIOT IoT platform, allowing:
- Real-time data streaming from each tire
- Visualization on a dashboard
- Automated alerts via Telegram if temperature or pressure exceeds safe limits
🧰 Components Needed
Hardware
| Component | Description |
|---|
| ESP8266 (NodeMCU) | Wi-Fi-enabled microcontroller |
| DHT22 | Temperature sensor |
| MPX5700AP (or TPMS analog) | Tire pressure sensor |
| Breadboard, Jumper Wires | For circuit assembly |
| Power Bank / Battery | For powering ESP8266 |
Software
🛠️ Step 1: Set Up FAVORIOT
- Sign up or login to https://platform.favoriot.com
- Go to
Device Management > Devices > Add Device
- Device Name:
tireMonitor01
- Device Type:
General
- Save and copy the Device Developer ID
- Navigate to
Settings > Account, and copy your API Key
🔌 Step 2: Connect Your Sensors
DHT22 (Temperature Sensor)
| Pin | NodeMCU |
|---|
| VCC | 3.3V |
| GND | GND |
| DATA | D4 (GPIO2) |
MPX5700AP (Analog Pressure Sensor)
| Pin | NodeMCU |
|---|
| VCC | 5V |
| GND | GND |
| OUT | A0 |
🧠 Step 3: Upload the Arduino Code
✅ Corrected and Favoriot-Ready Code
#include <ESP8266WiFi.h>
#include <DHT.h>
#include <ESP8266HTTPClient.h>
#define DHTPIN D4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
const String apiKey = "YOUR_FAVORIOT_API_KEY";
const String deviceDeveloperId = "tireMonitor01";
void setup() {
Serial.begin(115200);
delay(100);
dht.begin();
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi...");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nConnected to WiFi!");
}
void loop() {
float temperature = dht.readTemperature();
int pressureRaw = analogRead(A0);
float pressure = map(pressureRaw, 0, 1023, 0, 100); // Simulate PSI
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin("http://apiv2.favoriot.com/v2/streams");
http.addHeader("Content-Type", "application/json");
http.addHeader("apikey", apiKey);
String payload = "{";
payload += "\"device_developer_id\":\"" + deviceDeveloperId + "\",";
payload += "\"data\":{";
payload += "\"temperature\":" + String(temperature, 2) + ",";
payload += "\"pressure\":" + String(pressure, 2);
payload += "}}";
int httpCode = http.POST(payload);
Serial.print("FAVORIOT HTTP Response Code: ");
Serial.println(httpCode);
http.end();
} else {
Serial.println("WiFi not connected!");
}
delay(10000); // 10-second interval
}
📊 Step 4: Set Up FAVORIOT Dashboard
Sample Dashboard Layout:
| Widget | Type | Data Field | Notes |
|---|
| Tire Temp Gauge | Gauge | temperature | Show live temp reading |
| Tire Pressure Gauge | Gauge | pressure | Show live pressure |
| Trend Chart | Line Chart | temperature & pressure | Visualize history |
| Alert Indicator | Text | status | Show ALERT if out-of-range |
You can create these by:
- Going to
Dashboard > Add Widget
- Select your device, choose data fields, and customize ranges
🚨 Step 5: Alert Notification via Telegram
Step-by-Step Telegram Webhook Integration
- Create Telegram Bot
Search @BotFather in Telegram → /newbot
- Give it a name and username
- Note the bot token
- Get Your Chat ID
Start chat with your bot, then go to:
https://api.telegram.org/bot<your_bot_token>/getUpdates
You’ll see your chat_id
- Setup Webhook in FAVORIOT
- Go to
Rules Engine > Add Rule
- Condition:
"pressure < 30 OR pressure > 40 OR temperature > 60"
- Action: Webhook
- URL:
https://api.telegram.org/bot<your_bot_token>/sendMessage?chat_id=<your_chat_id>&text=⚠️ Tire Alert! Pressure or Temp out of range!
Now, whenever tire conditions are unsafe, the driver gets a Telegram notification!
🌱 Optional Enhancements
- Add GPS module (Neo6M) to send geolocation with alerts
- Store historical data using Favoriot’s REST API v2
- Create mobile app using FAVORIOT’s open APIs
🔗 Reference
Leave a Reply