AI Smart Security Camera with Suspicious Activity Detection

AI Smart Security Camera with Suspicious Activity Detection ESP32 + AI Agent + IoT Web Dashboard + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud
<?php echo $title; ?>

AI Smart Security Camera with Suspicious Activity Detection

Project Overview

This project is an advanced IoT security system using ESP32-CAM, AI detection, n8n automation, Telegram voice alerts, Google Sheets logging and ThingSpeak cloud dashboard. The system detects suspicious activities and sends instant alerts.

System Architecture


Camera / Motion Sensor

        |
        v

ESP32-CAM

        |
        v

AI Activity Detection

        |
        v

n8n Automation

   /        |        \

Telegram  Sheets  ThingSpeak

Features

  • AI suspicious activity detection
  • Motion monitoring
  • ESP32-CAM surveillance
  • Telegram voice alerts
  • Google Sheets logging
  • ThingSpeak dashboard
  • IoT Web Control Panel

Components List

Component Quantity
ESP32-CAM 1
PIR Motion Sensor 1
Buzzer 1
LED 2
Relay Module 1
Power Supply 1

Circuit Connection


PIR Sensor

VCC  -> ESP32 5V

GND  -> ESP32 GND

OUT  -> GPIO13


Buzzer

GPIO12 -> Buzzer

LED

GPIO4 -> LED


Working Flowchart



START

 |

Initialize ESP32

 |

Connect WiFi

 |

Start Camera

 |

Motion Detected?

 |

YES

 |

Capture Image

 |

AI Analysis

 |

Suspicious?

 |

YES

 |

Activate Alarm

 |

Telegram Voice Alert

 |

Google Sheet Log

 |

ThingSpeak Update


ESP32 Source Code


#include WiFi.h

#define PIR 13
#define BUZZER 12


void setup()
{

pinMode(PIR,INPUT);

pinMode(BUZZER,OUTPUT);

WiFi.begin(
"SSID",
"PASSWORD"
);

}



void loop()
{

if(digitalRead(PIR))
{

digitalWrite(
BUZZER,
HIGH
);


// Send n8n alert


}

}


n8n Workflow



ESP32 Webhook

       |

AI Agent

       |

Decision Node

       |

Telegram Alert

       |

Google Sheets

       |

ThingSpeak


Telegram Bot Setup

  1. Open Telegram
  2. Search BotFather
  3. Create New Bot
  4. Copy Bot Token
  5. Add token in n8n

Google Sheets Integration

Date Event Status
25-06-2026 Suspicious Movement Alert

ThingSpeak Dashboard

Cloud fields:

  • Motion Count
  • Alert Count
  • Power Usage
  • Temperature

AI Power Prediction



Power =

Camera Usage
+
WiFi Usage
+
Alarm Usage


AI predicts remaining battery time.


Voice Notification Automation



Detection

 |

AI Decision

 |

Text Generation

 |

Voice Conversion

 |

Telegram Voice Message


Future Enhancements

  • Face Recognition
  • Night Vision Camera
  • YOLO AI Detection
  • Smart Door Lock
  • Cloud AI Analytics

Deployment Steps

  1. Upload ESP32 Program
  2. Connect WiFi
  3. Create n8n Workflow
  4. Configure Telegram
  5. Connect Google Sheets
  6. Create ThingSpeak Channel
  7. Test Security Alerts

AI Powered ESP32 Agentic IoT Security System

AI + IoT + Automation based next-generation security system.

Comments