" . htmlspecialchars($title) . "
"; } ?>AI + ESP32 + IoT + n8n Automation + Telegram Voice Alerts
Google Sheets + ThingSpeak Cloud Dashboard + AI Power Prediction
The wheelchair is controlled through natural voice commands. The AI Agent understands the user's spoken command and converts it into an appropriate wheelchair movement command.
The ESP32 acts as the main controller. It communicates with motors, sensors, cloud platforms and automation services.
Project Working
- Control wheelchair using voice commands.
- Improve mobility for disabled persons.
- Detect obstacles automatically.
- Monitor battery voltage and percentage.
- Measure motor current and power consumption.
- Send emergency notifications.
- Use AI for intelligent decision making.
- Store IoT data in Google Sheets.
- Visualize data using ThingSpeak.
- Use n8n for automation.
| Device | ESP32 Pin |
|---|---|
| Voice Command | AI Intent |
|---|---|
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
const char* n8nWebhook =
"https://YOUR-N8N-DOMAIN/webhook/wheelchair-data";
#define LEFT_IN1 26
#define LEFT_IN2 27
#define RIGHT_IN1 14
#define RIGHT_IN2 12
#define TRIG_PIN 5
#define ECHO_PIN 18
#define EMERGENCY_PIN 4
#define BUZZER_PIN 2
String movement = "STOP";
void setup() {
Serial.begin(115200);
pinMode(LEFT_IN1, OUTPUT);
pinMode(LEFT_IN2, OUTPUT);
pinMode(RIGHT_IN1, OUTPUT);
pinMode(RIGHT_IN2, OUTPUT);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(EMERGENCY_PIN, INPUT_PULLUP);
pinMode(BUZZER_PIN, OUTPUT);
stopMotors();
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Connecting to WiFi...");
}
Serial.println("WiFi Connected");
}
void loop() {
bool emergency =
digitalRead(EMERGENCY_PIN) == LOW;
float distance = readDistance();
if (emergency) {
stopMotors();
digitalWrite(BUZZER_PIN, HIGH);
movement = "EMERGENCY_STOP";
}
else if (distance > 0 && distance < 30) {
stopMotors();
digitalWrite(BUZZER_PIN, HIGH);
movement = "OBSTACLE_STOP";
}
else {
digitalWrite(BUZZER_PIN, LOW);
}
delay(5000);
}
void moveForward() {
digitalWrite(LEFT_IN1, HIGH);
digitalWrite(LEFT_IN2, LOW);
digitalWrite(RIGHT_IN1, HIGH);
digitalWrite(RIGHT_IN2, LOW);
movement = "FORWARD";
}
void moveBackward() {
digitalWrite(LEFT_IN1, LOW);
digitalWrite(LEFT_IN2, HIGH);
digitalWrite(RIGHT_IN1, LOW);
digitalWrite(RIGHT_IN2, HIGH);
movement = "BACKWARD";
}
void turnLeft() {
digitalWrite(LEFT_IN1, LOW);
digitalWrite(LEFT_IN2, HIGH);
digitalWrite(RIGHT_IN1, HIGH);
digitalWrite(RIGHT_IN2, LOW);
movement = "LEFT";
}
void turnRight() {
digitalWrite(LEFT_IN1, HIGH);
digitalWrite(LEFT_IN2, LOW);
digitalWrite(RIGHT_IN1, LOW);
digitalWrite(RIGHT_IN2, HIGH);
movement = "RIGHT";
}
void stopMotors() {
digitalWrite(LEFT_IN1, LOW);
digitalWrite(LEFT_IN2, LOW);
digitalWrite(RIGHT_IN1, LOW);
digitalWrite(RIGHT_IN2, LOW);
movement = "STOP";
}
float readDistance() {
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
long duration =
pulseIn(ECHO_PIN, HIGH);
float distance =
duration * 0.034 / 2;
return distance;
}
Example n8n JavaScript Code
const data = $json;
let alert = "NORMAL";
let message = "";
if (data.emergency === true) {
alert = "EMERGENCY";
message =
"Emergency stop activated.";
}
else if (data.distance < 30) {
alert = "OBSTACLE";
message =
"Obstacle detected. Wheelchair stopped.";
}
else if (data.battery_percentage < 20) {
alert = "LOW_BATTERY";
message =
"Battery level is low.";
}
return [
{
json: {
...data,
alert: alert,
message: message,
timestamp:
new Date().toISOString()
}
}
];
- Open Telegram.
- Search for BotFather.
- Use the command /newbot.
- Create a bot name.
- Copy the Telegram Bot Token.
- Add Telegram credentials to n8n.
- Use Telegram Send Message node.
- Use Text-to-Speech for voice alerts.
🚨 AI SMART WHEELCHAIR ALERT
Status: EMERGENCY STOP
Battery: 62%
Distance: 18 cm
Movement: STOP
| Timestamp | Battery | Current | Power | Distance | Movement | Alert |
|---|---|---|---|---|---|---|
| 10:00 | 78% | 3.8 A | 47 W | 145 cm | FORWARD | NORMAL |
| 10:05 | 65% | 5.1 A | 62 W | 20 cm | STOP | OBSTACLE |
ThingSpeak can be used to display real-time sensor information.
- Field 1: Battery Voltage
- Field 2: Battery Percentage
- Field 3: Current
- Field 4: Power Consumption
- Field 5: Distance
- Field 6: Temperature
- Field 7: Movement Status
- Field 8: Emergency Status
The system calculates electrical power using:
Historical data from Google Sheets and ThingSpeak can be analyzed to predict future energy consumption.
Emergency Button → Immediate Motor Stop
Obstacle Detected → Automatic Motor Stop
Wi-Fi Failure → Safe Stop Mode
Low Battery → Warning Alert
Invalid AI Command → No Movement
- AI Camera-Based Object Detection
- GPS Tracking
- Fall Detection
- Offline Voice Recognition
- Advanced AI Power Prediction
- Health Monitoring Sensors
- Mobile Application
- Autonomous Navigation
- Obstacle Avoidance Using AI Vision
- Assemble the wheelchair motors.
- Connect motor driver to ESP32.
- Install ultrasonic and safety sensors.
- Install emergency stop button.
- Upload ESP32 firmware.
- Connect ESP32 to Wi-Fi.
- Create n8n webhook.
- Configure Telegram Bot.
- Connect Google Sheets.
- Create ThingSpeak channel.
- Configure AI Agent.
- Test voice commands.
- Test obstacle detection.
- Test emergency stop.
- Perform complete safety testing.
The AI Smart Voice-Controlled Wheelchair combines artificial intelligence, IoT, ESP32, voice recognition, n8n automation, Telegram notifications, Google Sheets and ThingSpeak Cloud.
The system follows an Agentic IoT architecture:
This project is intended for prototype and educational development. A real human-carrying wheelchair requires high-current electrical protection, mechanical braking, emergency-stop redundancy, battery protection, professional engineering validation and extensive supervised testing.

No comments:
Post a Comment