Assignment 6

Embedded Programming

A. Individual assignment

My final project will be an Alarm System and in this assignament I will develop the Program for the selected ESP32 microcontroller.

1. INTRODUCTION

The selected microcontroller is the ESP32, used for projects, prototypes and the Internet of Things (IoT). The program will be developed using the Arduino IDE.

2. INITIAL CONCEPTS

ESP32 is the name of a family of low-cost, low-power SoC (System on a Chip) chips, with WiFi and Bluetooth technology. The ESP32 was created and developed by Espressif Systems and is the successor to the ESP8266 family.

3. ESP32 FAMILY

The ESP32 Dev Kit V4.0 is part of this extended family; This card is a low-cost and low-power consumption microcontroller, it has integrated dual-mode Wi-Fi and Bluetooth technology that allows you to control all types of sensors, modules and actuators. It is a module that has WIFI+BT+BLE for applications with low power sensors to demanding tasks such as voice encoding, music streaming and MP3 decoding. It also contains a 5uA quiescent current, speed of up to 150 Mbps and 20dBm output power.

4. Functionality

The Intrusion Detection System will work using motion sensors and high-resolution surveillance cameras; fire detection and a real-time notification system to keep users informed. The activation and deactivation of the alarm will be carried out with a delay of 20 seconds locally using a keyboard to enter a security code or remotely via the Internet. The alarm output will activate a relay that will connect a siren. Simultaneously, the sending of an intrusion or fire notice via the Internet to a cell phone will be enhanced. Include the development of the code for the cell phone interface in Java language.

5. Code development

Developing a system as complex as the one described involves a significant amount of code and specific details. For this reason, a basic code outline for the ESP32 in the Arduino environment is provided. This will be improved and expanded in the development of the project according to specific needs. The development of the mobile application interface in Java will be carried out in the future. First, the necessary libraries for the ESP32 and other sensors are installed:

a) For ESP32, the Arduino development environment for ESP32 is installed. b) For the motion sensor (PIR), the library "Adafruit_Sensor" and "Adafruit_PIR" are used. c) For the camera, the "esp32-camera" library is used. d) For the keyboard, the "Keypad" library is used.

These libraries were installed before executing the code. The code for the ESP32 is as follows:

This is the rest of the code:

A. Group assignment

The data sheet of the microcontroller to explore is that of the ESP32. A comparison of performance and development workflows for other architectures is made in the following paragraphs. The ESP32 Dev Kit V4. 0 is part of this extended family; This card is a low-cost and low-power consumption microcontroller, it has integrated dual-mode Wi-Fi and Bluetooth technology that allows you to control all types of sensors, modules and actuators. ESP32 is the name of a family of low-cost, low-power SoC chips, with integrated dual-mode Wi-Fi and Bluetooth technology. The ESP32 employs a Tensilica The ESP32 was created and developed by Espressif Systems and is manufactured by TSMC using their 40nm process.1 It is a successor to another SoC, the ESP8266. /

ESP32 Features

1. Processor:

a) CPU: 32-bit Xtensa LX6 dual-core (or single-core) microprocessor, operating at 160 or 240 MHz and performing up to 600 DMIPS b) Ultra Low Power Co-processor (ULP)

2. Memory: 520 KiB SRAM

3. Wireless Connectivity:

a) Wi-Fi: 802.11 b/g/n b) Bluetooth: v4.2 BR/EDR and BLE

4. Peripheral interfaces:

a) 12-bit SAR ADC up to 18 channels b) 2 × 8-bit DACs c) 10 × touch sensors (GPIOs capacitive sensors) d) 4 × SPI e) 2 × I²S interfaces f) 2 × I²C interfaces g) 3 × UART h) SD/SDIO/CE-ATA/MMC/eMMC host controller i) SDIO/SPI slave controller j) Ethernet MAC interface with dedicated DMA and support for the IEEE 1588 Precision Time Protocol k) CAN Bus 2.0 l) Infrared remote controller (TX/RX, up to 8 channels) m) PWM motor n) PWM LEDs (up to 16 channels) o) Hall effect sensor p) Ultra-low power analog pre-amplifier

5. Security:

a) Supports all standard IEEE 802.11 security features, including WFA, WPA/WPA2 and WAPI b) Safe boot c) Flash encryption d) 1024-bit OTP, up to 768-bit for clients e) Hardware accelerated cryptography: AES, SHA-2, RSA, Elliptic Curve Cryptography (ECC), Random Number Generator (RNG)

6. Power Management:

a) Internal low drop regulator b) Individual power domain for RTC c) 5μA current in deep sleep mode

d) Wake up by GPIO interrupt, timer, ADC measurements, capacitive touch sensor interrupt

7. Technical Data Sheet

Type System on a chip Espressif Systems Developer Manufacturer Espressif Tensilica Xtensa LX6 160 MHz processor (240 MHz overclock.) Power 3.3 VDC Tensilica Xtensa LX6 160 MHz processor (240 MHz overclock.)