File | Date | Author | Commit |
---|---|---|---|
components | 2019-04-20 | dannybackx | [r214] Remove components/espmqtt, this is now part of ... |
libraries | 2020-10-19 | dannybackx | [r338] Remove Arduino String from Oled as well. |
main | 2020-10-24 | dannybackx | [r347] Reduce some verbosity, get FTP server to report... |
mobile | 2020-04-10 | dannybackx | [r300] Add directory |
pcb | 2018-08-19 | dannybackx | [r49] Add v1 of the PCB |
LICENSE | 2018-08-19 | dannybackx | [r47] Add license file, remove pubsubclient |
Makefile | 2020-09-27 | dannybackx | [r330] Decrease dependency on Arduino libraries. |
Readme.md | 2020-10-24 | dannybackx | [r346] Doc update |
config.json.sample | 2020-10-24 | dannybackx | [r348] Add sample json configuration file (to be uploa... |
House alarm system based on ESP32
Copyright (c) 2017, 2018, 2019, 2020 by Danny Backx
This alarm system is designed to work with a bunch of similar controllers.
You can choose which hardware and capabilities go in each individual controller, and configure them accordingly.
The software needs a small amount of configuration to talk to the hardware.
With no configuration, the software will format a LittleFS partition, start an FTP server,
and you can use that to upload a file into /fs/config.json .
A sample content :
{ "name" : "prototype",
"haveOled" : true, "oledLedPin" : 5, "oledCSPin" : 17, "oledDCPin" : 16,
"run_ftp" : true, "ftp_user" : "me", "ftp_pass" : "myself",
"radioPin" : 22,
"sensors" :
{ "name" : "Hall motion", "id" : 0x00CD4FAA, "zone" : "secure" },
{ "name" : "Kitchen smoke", "id" : 0x004F55E8, "zone" : "always" },
{ "name" : "Upstairs smoke", "id" : 0x007DF9E8, "zone" : "always" }
}
It's obviously possible to turn off FTP to make the system less hackable, the flip side is that
recovery is harder.
This software can be built with ESP-IDF, the build environment recommended by Espressif.
Components required (you need to put these in components/) :
- arduino (https://github.com/espressif/arduino-esp32.git)
- littlefs (a simple filesystem superior to the well known spiffs, https://github.com/ARMmbed/littlefs.git)
- esp_littlefs (esp-idf integration for littlefs https://github.com/joltwallet/esp_littlefs.git)
Arduino libraries (these are already copied in libraries/) :
- TFT_eSPI (Bodmer's stuff with small changes)
- arduinojson
- rcswitch (optional, needed for radio hardware, e.g. for 433MHz sensors)
- rfid (optional)
- my own acmeclient (https://esp32-acme-client.sourceforge.io) (optional)
- QR code generation with the C version of https://www.nayuki.io/page/qr-code-generator-library (optional)
In the "make menuconfig -> Arduino", only the Arduino libraries Wire and SPI are currently needed.
Hardware platform :
- ESP8266 and/or ESP32
Choose what you like, have, or need. Most importantly : the ESP32 has more pins.
An ESP8266 with an OLED and a radio is out of pins, if you need to put more hardware in one box, you need an ESP32.
An ESP8266 with OLED and PN532 card reader also has just enough pins.
- Some sensors with wireless RF communication
* https://www.aliexpress.com/item/Kerui-433MHz-Wireless-Intelligent-PIR-Sensor-Motion-Detector-For-GSM-PSTN-Security-Alarm-System-Auto-Dial/32566190623.html?spm=a2g0
s.9042311.0.0.04PnSB
* https://www.aliexpress.com/item/433MHz-Portable-Alarm-Sensors-Wireless-Fire-Smoke-Detector/32593947430.html?spm=a2g0s.9042311.0.0.04PnSB
- Keypads with touch displays
* https://www.aliexpress.com/item/1pcs-J34-F85-240x320-2-8-SPI-TFT-LCD-Touch-Panel-Serial-Port-Module-with-PCB/32795636902.html?spm=a2g0s.9042311.0.0.04PnSB
- RF receivers
* https://www.aliexpress.com/item/1set-2pcs-RF-wireless-receiver-module-transmitter-module-board-Ordinary-super-regeneration-433MHZ-DC5V-ASK-OOK/32606396563.html?spm
=a2g0s.9042311.0.0.04PnSB
- RFID card readers
* https://www.aliexpress.com/item/2pcs-lot-MFRC-522-RC522-RFID-Kits-S50-13-56-Mhz-With-Tags-SPI-Write-Read/32620671237.html?spm=a2g0s.9042311.0.0.tm7J7e
* https://www.aliexpress.com/item/PN532-NFC-RFID-Module-V3-Kits-Reader-Writer/32452824672.html?spm=a2g0s.9042311.0.0.XugjzW
I have a PCB design that can be used to build a controller module with minimal wiring.
See my project on easyeda.com, or the copy in pcb .
The v1 has one known bug : the radio data line should go to esp32 pin 27 instead of pin 22.
Note : you may need to set some parameters in "make menuconfig" to make this work
- CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4304 (was 2304)
to prevent eventTask from running out of stack space
- CONFIG_FREERTOS_USE_TRACE_FACILITY=y if you want to be able to list the ESP32 tasks,
or their memory/stack usage
(menuconfig->Component config->FreeRTOS->Enable FreeRTOS trace facility)