Motion detector with light, esp32 and telegram notifications

In this tutorial we will see how to make a motion detector system, with a PIR sensor, a relay module, to connect a 110V/220V focus, an esp32 that will connect to our Wifi network and send alert notifications, by messages through the telegram messaging service, when the PIR sensor detects a movement.


You may be interested in projects in Arduino, pic, robotics, telecommunications, subscribe http://www.youtube.com/user/carlosvolt?sub_confirmation=1 videos with full source code and diagrams

SUSCRIBETE A NUESTRO CANAL DE YOUTUBE, TUTORIALES GRATIS

Circuit

Electronic components


Cables dupont


ESP32

Features of the ESP32-T module

Connectivity


The ESP32 module has all the wiFi variants:

  • 802.11 b/g/n/e/i/n
  • Wi-Fi Direct (P2P), P2P Discovery, P2P Group Owner mode and P2P Power Management

This new version includes low-power Bluethoot connectivity

  • Bluetooth v4.2 BR/EDR and BLE
  • BLE Beacon

In addition, you can communicate using SPI, I2C, UART, MAC Ethernet, Host SD protocols

Microcontroller features


The CPU consists of a Tensilica LX6 Model SoC with the following features and memory

  • Dual 32-bit core with 160MHz speed
  • 448 kBytes ROM
  • 520kByteS SRAM

Have 48 Pins

  • 18 12-bit ADC
  • 2 8-bit DAC
  • 10 pin contact sensors
  • 16 PWM
  • 20 Digital inputs/outputs

Power and consumption modes

For proper operation of the ESP32 it is necessary to supply a voltage between 2.8V and 3.6V. The energy you consume depends on the mode of operation. It contains a mode, the Ultra Low Power Solution (ULP),in which basic tasks (ADC, PSTN…) continue to be performed in Sleep mode.


A focus


Sensor PIR

Electric pyro devices such as pir have elements made of a crystalline material that generates an electrical charge when exposed to infrared radiation. Changes in the amount of radiation produce voltage changes which are measured by an amplifier. The sensor contains special filters called Fresnel lenses that focus infrared signals on the sensor element. When infrared signals from the environment where the sensor is located change rapidly, the amplifier activates the output to indicate movement. This output remains active for a few seconds allowing the micro controller to know if there was movement.

Calibration When the pir sensor is energized requires a preparation time to start operating properly. This is because adaptation to the conditions of operation of the environment where it was installed has to occur. During this moment the sensor learns to recognize the state of rest or non-movement of the environment. The duration of this calibration can be between 10 and 60 seconds and the absence of people in the sensor neighborhood while calibrating is highly recommended.

Features:

  • Infrared sensor with control circuit board.
  • Sensitivity and retention time can be adjusted.
  • Small and light, it is easy to use.
  • Detection distance is up to 6 meters.
  • Suitable for security field, toy, control automation, etc.

PIR ROBOX IR sensor features

March Robox
Model RTHW
Color White + Green
Material PCB + Plastic board
Features Static power: 50uA; Detection distance: 7m; Detection angle: 110 degrees; Wide voltage range: DC 4.5 20V
Application Detect motion
Dimensions: 1.26 x 0.94 in x 0.94 in (3.2 cm x 2.4 cm x 2.4 cm)

Weight: 0.25 oz (7 g)

PinOut PIR ROBOX AND
pir-pinputpir

Pines macho


Socket


Relay Module

TECHNICAL SPECIFICATIONS

  • Operating Voltage: 5V DC
  • Control Signal: TTL (3.3V or 5V)
  • Number of Relays (channels): 1 CH
  • Max capacity: 10A/250VAC, 10A/30VDC
  • Max current: 10A (NO), 5A (NC)
  • Action time: 10 ms / 5 ms
  • To activate output NO: 0 Volts

Printed Circuit

Gerber file

Gerber_PCB__ESP32


Source

Download Library –> Universal-Arduino-Telegram-Bot-master


Create Bot on Telegram

In telegram we look for BotFather


We write /start and something similar to this will appear to us


Escribimos /newbot


I will see the name of the bot, and we invent a name for our bot, it must be in the format «usuario_bot»


We’ll get a token that we’re going to use in the source code


Now we’ll look for IDBot, and we’ll start it


We write /getid and it will give us user_id that we should place in the source code


SUBSCRIBE TO OUR NEWSLETTERS, RECEIVE IN YOUR EMAIL THE MOST OUTSTANDING NEWS, JUST BY ENTERING YOUR EMAIL

[wysija_form id=»1″]



RECOMMENDED PROJECT

Deja una respuesta