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

ComponentDescription
ESP8266 (NodeMCU)Wi-Fi-enabled microcontroller
DHT22Temperature sensor
MPX5700AP (or TPMS analog)Tire pressure sensor
Breadboard, Jumper WiresFor circuit assembly
Power Bank / BatteryFor powering ESP8266

Software

Step 1: Set Up FAVORIOT

  1. Sign up or login to https://platform.favoriot.com
  2. Go to Device Management > Devices > Add Device
    • Device Name: tireMonitor01
    • Device Type: General
    • Save and copy the Device Developer ID
  3. Navigate to Settings > Account, and copy your API Key

Step 2: Connect Your Sensors

DHT22 (Temperature Sensor)

PinNodeMCU
VCC3.3V
GNDGND
DATAD4 (GPIO2)

MPX5700AP (Analog Pressure Sensor)

PinNodeMCU
VCC5V
GNDGND
OUTA0

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:

WidgetTypeData FieldNotes
Tire Temp GaugeGaugetemperatureShow live temp reading
Tire Pressure GaugeGaugepressureShow live pressure
Trend ChartLine Charttemperature & pressureVisualize history
Alert IndicatorTextstatusShow 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

  1. Create Telegram Bot
    Search @BotFather in Telegram → /newbot
    • Give it a name and username
    • Note the bot token
  2. 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
  3. 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


Podcast also available on PocketCasts, SoundCloud, Spotify, Google Podcasts, Apple Podcasts, and RSS.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share This

Share this post with your friends!