Giter Site home page Giter Site logo

esp32_door_sensor_reed_switch's Introduction

Project Description

Demonstrates how to use a magnetic door/window sensor which is based on a reed switch.

This app is developed for a door sensor which contains a MC-38 N.O. Normally Opened magnetic reed switch. This means that the switch is open (and no current flowing) when the 2 plastic blocks are away from each other. The GPIO interrupt handler contains de-bounce logic.

When the sensor is closed (the 2 blocks are close to each other) then the LED of the dev board will light up and the interrupt event (Positive Edge) will be logged in the UART Logger.

When the sensor is open (the 2 blocks are away from each other) then nothing happens.

The app uses either the GPIO ISR handler service or a simple pooling loop. The mode can be set with the variable mjd_app_mode.

The board's LED will light up when the GPIO input pin is HIGH. This gives you an indication of what is going on.

What are the HW SW requirements of the ESP32 MJD Starter Kit?

Hardware

  • A decent ESP development board. I suggest to buy a popular development board with good technical documentation and a significant user base. Examples: Adafruit HUZZAH32, Espressif ESP32-DevKitC, Pycom WiPy, Wemos D32.
  • The peripherals that are used in the project. @tip The README of each component contains a section "Shop Products". @example A Bosch BME280 meteo sensor breakout board.

Software: ESP-IDF v3.2

mkdir ~/esp
cd    ~/esp
git clone -b v3.3 --recursive https://github.com/espressif/esp-idf.git esp-idf-v3.2

Shop Product.

MC-38 Wired Door Window Sensor Magnetic Switch for Home Alarm System, NO (Normally Open).

Check the image "_doc/MC-38 Door Sensor - product.jpg"

WIRING INSTRUCTIONS

The reed switch has 2 wires.

  • Connect one wire to VCC 3.3V
  • Connect one wire to digital input pin GPIO#27 of the ESP32 development board (or any other GPIO input pin which is free on your dev board).
  • The internal pulldown resistor of GPIO#27 is enabled by the app.

Sensor FAQ

Running the app

cd ~/esp32_door_sensor_reed_switch
make menuconfig
make flash monitor

Related Projects

my_deep_sleep_wakeup

Reference: the ESP32 MJD Starter Kit SDK

Do you also want to create innovative IoT projects that use the ESP32 chip, or ESP32-based modules, of the popular company Espressif? Well, I did and still do. And I hope you do too.

The objective of this well documented Starter Kit is to accelerate the development of your IoT projects for ESP32 hardware using the ESP-IDF framework from Espressif and get inspired what kind of apps you can build for ESP32 using various hardware modules.

Go to https://github.com/pantaluna/esp32-mjd-starter-kit

esp32_door_sensor_reed_switch's People

Contributors

pantaluna avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.