Introduction
The health and alcohol monitoring IoT system is a smart project that tracks a person’s vital signs and alcohol presence in real-time. It integrates health monitoring and alcohol assessment into a device with advanced IoT capabilities. This system uses sensors to measure body temperature, heart rate, and alcohol levels. If a person has consumed alcohol or their vital signs are abnormal, the system sends a notification. The MQ-3 detects the presence of alcohol through breath. Pulse sensors monitor heart rate, and temperature sensors track body temperature. The data is sent to IoT platforms like ThingSpeak or Blynk for live monitoring. This device can be used for safety and health in vehicles, offices, or schools. An LCD display or a mobile application shows real-time readings. It prevents accidents by alerting if someone is drunk or physically unstable. NodeMCU ESP8266 provides Wi-Fi connectivity for IoT functionalities. This system is low-cost, portable, and easy to build. It can integrate with alarms, mailboxes, or notifications for alerts. This project supports safety, health, and responsible behavior. It is a great innovation for public safety, healthcare, and smart vehicles. This project combines sensors, IoT, and health technology in real-world applications.
🧰 Hardware Components (Written Form)
Component | Quantity | Description |
NodeMCU ESP8266 | 1 | Wi-Fi-enabled microcontroller for IoT |
MQ-3 Alcohol Sensor | 1 | Detects alcohol in breath |
Pulse Sensor (KY-039) | 1 | Measures heart rate |
LM35 Temperature Sensor | 1 | Detects body temperature |
16×2 LCD Display (I2C) | 1 | Displays live vitals (optional) |
I2C Module | 1 | Interface for LCD with NodeMCU |
Breadboard + Jumper Wires | Several | For wiring all components |
Buzzer (optional) | 1 | Alert if alcohol or abnormal vitals detected |
USB Cable | 1 | To power NodeMCU and upload code |
NodeMCU ESP8266:
|
MQ-3 Alcohol Sensor:
|
Pulse Sensor (KY-039): |
LM35 Temperature Sensor:
|
16×2 LCD Display (I2C):
|
I2C Module:
|
Breadboard:
Jumper Wires:
|
Buzzer (optional):
|
🔌 Wiring Components (Written Form)
🔸 MQ-3 Alcohol Sensor
- VCC→ NodeMCU 3V
- GND→ NodeMCU GND
- A0→ NodeMCU A0
🔸 Pulse Sensor
- VCC→ 3.3V
- GND→ GND
- Signal→ D1
🔸 LM35 Temperature Sensor
- VCC→ 3.3V
- GND→ GND
- Output→ D2
🔸 LCD with I2C
- SDA→ D3
- SCL→ D4
- VCC→ 3.3V
- GND→ GND
🔸 Buzzer (optional)
- +ve→ D5
- -ve→ GND
💻 IoT Code for NodeMCU + ThingSpeak
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <ESP8266HTTPClient.h>
// LCD config
LiquidCrystal_I2C lcd(0x27, 16, 2);
// WiFi Credentials
const char* ssid = “Your_SSID”;
const char* password = “Your_PASSWORD”;
// ThingSpeak API
String apiKey = “YOUR_THINGSPEAK_API_KEY”;
// Sensor Pins
#define MQ3_PIN A0
#define PULSE_PIN D1
#define TEMP_PIN D2
#define BUZZER_PIN D5
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
lcd.begin();
lcd.backlight();
pinMode(BUZZER_PIN, OUTPUT);
digitalWrite(BUZZER_PIN, LOW);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
lcd.setCursor(0, 0);
lcd.print(“Connecting WiFi”);
}
lcd.clear();
lcd.print(“Connected!”);
}
void loop() {
int alcoholVal = analogRead(MQ3_PIN);
int pulseVal = analogRead(PULSE_PIN);
int tempRaw = analogRead(TEMP_PIN);
float temperature = (tempRaw * 3.3 / 1024.0) * 100.0;
lcd.setCursor(0, 0);
lcd.print(“Alc:”);
lcd.print(alcoholVal);
lcd.print(” H:”);
lcd.print(pulseVal);
lcd.setCursor(0, 1);
lcd.print(“Temp:”);
lcd.print(temperature);
// Alert if alcohol or abnormal vitals
if (alcoholVal > 300 || pulseVal < 200 || temperature > 38) {
digitalWrite(BUZZER_PIN, HIGH);
} else {
digitalWrite(BUZZER_PIN, LOW);
}
// Send to ThingSpeak
if (WiFi.status() == WL_CONNECTED) {
WiFiClient client;
HTTPClient http;
String url = “http://api.thingspeak.com/update?api_key=” + apiKey +
“&field1=” + String(alcoholVal) +
“&field2=” + String(pulseVal) +
“&field3=” + String(temperature);
http.begin(client, url);
http.GET();
http.end();
}
delay(15000); // 15s delay
}
