This is an old revision of the document!
Table of Contents
Intrusion Detection System
Introduction
Microcontrollers have spread everywhere sometimes even without us realizing that. Fridges, kettles, toys, smart sockets and switches, automatic gates — all of them are operated with the help of microcontrollers. That to for a good reason. They can reduce the cost and size of the system by integrating most of the functions on a single chip. They can be programmed and reused for different applications, making them flexible and versatile. They can operate with low power and heat consumption, making them suitable for battery-powered or energy-efficient devices. They can interface with various sensors, actuators, and communication modules, making them capable of performing complex tasks. In this project we are going to creating a DIY intrusion detection system. One might ask why they need a system like that. Here are some reason that might make you interested in this project :
- Preventing theft: Theft detection systems can deter theft by making it more difficult for thieves to steal items.
- Reducing losses: Theft detection systems can also help to reduce losses by identifying and apprehending thieves.
- Protecting assets: Theft detection systems can help to protect assets by providing a layer of security.
- Enhancing security: Theft detection systems can also help to enhance security by providing information about potential threats.
Materials used
ESP32-CAM
The ESP32-CAM is a versatile and powerful camera module that can be used for a variety of applications. It is small, low-power, and easy to use. The ESP32-CAM is a great choice for anyone looking for a wireless camera module for their IoT project. Here are some of the key features of the ESP32-CAM:
- * ESP32 microcontroller: The ESP32-CAM is based on the ESP32 microcontroller, which is a powerful and versatile chip.
- * OV2640 camera: The ESP32-CAM comes with an OV2640 camera, which is a 2-megapixel camera.
- * Onboard TF card slot: The ESP32-CAM has an onboard TF card slot, which can be used to store images and videos.
- * Wi-Fi and Bluetooth connectivity: The ESP32-CAM has Wi-Fi and Bluetooth connectivity, which allows it to connect to a network or to a mobile device.
- Low power consumption: The ESP32-CAM is a low-power device, which means that it can be used for battery-powered applications.
- If you are looking for a small, low-power, and versatile camera module for your IoT project, then the ESP32-CAM is a great option.
PIR sensor
A passive infrared (PIR) sensor is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. PIR sensors are commonly used in security alarms and automatic lighting applications. PIR sensors work by detecting changes in infrared radiation. When an object moves in front of a PIR sensor, it blocks some of the infrared radiation that is being emitted by the object. This change in infrared radiation is detected by the PIR sensor and is used to trigger an alarm or turn on a light. PIR sensors are a type of passive sensor, which means that they do not emit any radiation. This makes them ideal for security applications, as they cannot be detected by intruders. PIR sensors are also relatively inexpensive and easy to use.
UartSBee programmer
UartSBee v5 is a USB to serial adapter that is compatible with FTDI cables. It has a 20-pin 2.0mm BEE socket and an integrated FT232RL chip. The FT232RL chip can be used for programming or communicating with MCUs. UartSBee can also be used to connect a PC to various wireless applications via a Bee compatible module. In addition, UartSBee provides breakouts for the bit-bang mode pins of the FT232RL chip. These bit-bang mode pins (8 I/O pins) can be used as a replacement for applications that involve the PC parallel port, which is becoming increasingly rare. Usb cable The usb cable is need to connect the programmer to the PC when the ESP32 cam is connected to flash the code. Later on, it is also used to power the ESP32 cam and the whole circuit.
Breadboard
A breadboard is a prototyping tool that allows you to build electronic circuits without soldering. It is a rectangular board with a grid of holes that are connected together electrically. The holes are typically arranged in rows of five, and each row is connected to a common bus. This allows you to easily connect components together without having to solder them.
Jumper Wires
These are used to connect components with each other.
Tasks
The scenario we would like to implement is as follows:
- The ESP32-CAM module connects to Wi-Fi and falls into deep sleep
- The PIR motion sensor serves as an “alarm” that wakes the board when the motion is detected
- The board connects to flespi via MQTT, takes a shot, publishes the shot as an MQTT message and falls asleep again.
- The message is sent to the phone as well through Telegram
I would be using Arduino IDE for this project to flash the code
Methods
First we would install the board for the ESP32-Cam in Arduino.
Then download the code from the following link https://github.com/flespi-software/ESP32-CAM
To make the code work you need to specify your personalized data for some parameters:
Upload the firmware to the ESP32-Cam by connecting it to the UartSBee using the connections given below.
UartSBee | ESP32 Cam |
---|---|
5V | VCC(5V) |
UOR | TX |
UOT | RX |
GND | GND |
GPIO 0 to GND |