Prakatheesh Waran R
Published

ESP8266-Based Alcohol Detection with Live IoT Dashboard

Build an alcohol-vapour monitoring prototype using the MQ-3 sensor and NodeMCU ESP8266, and visualize readings KiwisIoT on dashboard

BeginnerWork in progress13
ESP8266-Based Alcohol Detection with Live IoT Dashboard

Things used in this project

Story

Read more

Code

Untitled file

C/C++
#include <KiwisIoT.h>

const int alcoholSensorPin = A0;

const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
const char* topicId = "YOUR_TOPIC_ID";

int alcoholReading = 0;

void setup() {
  Serial.begin(115200);

  pinMode(alcoholSensorPin, INPUT);

  // Initialize KiwisIoT using your configured credentials.
  kiwisiot.begin(ssid, password, topicId);

  Serial.println("Alcohol Vapour Monitoring Started");
}

void loop() {
  kiwisiot.run();

  alcoholReading = analogRead(alcoholSensorPin);

  Serial.print("Raw Sensor Reading: ");
  Serial.println(alcoholReading);

  // Send the raw reading to dashboard Channel 1.
  kiwisiot.send("1", alcoholReading);

  delay(2000);
}

Credits

Prakatheesh Waran R
22 projects • 0 followers

Comments