Git Product home page Git Product logo

esp8266-homekit-controlled-blinds's Introduction

ESP8266-HomeKit-Controlled-Blinds

README Español

This project uses a NodeMCU ESP8266 and Apple HomeKit to control an electric blind.

Motivation

The objective of this project is to control an electric blind through HomeKit, but also keeping the manual use of the blind with its old switch. All this with the lowest possible budget.

The components used were:

  • Nodemcu Wifi Esp8266 Board.
  • 2 Channel Relay Module (Songle).
  • AC (220v) to 5v Power Supply.
  • Famale-Famale cables and 1mm cables for the electric connections.

The next diagram shows the electric connections:

Arduino diagram

The logic pins used on the NodeMCU ESP8266 were:

  • D1 (GPIO5) working as OUTPUT and used to activate/desactivate the relay so that the blind goes down.
  • D2 (GPIO4) working as OUTPUT and used to activate/desactivate the relay so that the blind goes up.
  • D6 (GPIO12) working as INPUT_PULLUP and used to know when the physical switch is pulled down.
  • D7 (GPIO13) working as INPUT_PULLUP and used to know when the physical switch is pulled up.

Instalation

  1. Download and install the CH340 driver required for the computer to recognize the board in Windows 10/11.
  2. Download and install the Arduino IDE.
  3. Add the ESP8266 to the IDE Boards Manager, in Preferences/Additional-Boards-Manager-URLs. Pasting this link there: http://arduino.esp8266.com/stable/package_esp8266com_index.json.
  4. Download the ESP8266 from the IDE Boards Manager, in Tools/Board/Boards-Manager searching for ESP8266 and instaling the last version.
  5. Download the Library Arduino-HomeKit-ESP8266, and install it from the IDE in Sketch/IncludeLibrary selecting the .zip of the downloaded repository. For an explanation of why the fork is used go to the section: Clarification.

Code Editing

  1. Inside the file wifi_info.h change the variable ssid for the name of your WiFi and the variable password for your WiFi password.
  2. Modify the Serial.begin(9600) inside the file automatic_blinds.ino with the BPS that your device uses, in the case of the NodeMCU ESP8266 this is written on the back of the board.
  3. It may be necessary to invert the signals sent to the relays for their correct operation, in my case the relay is activated by sending a LOW signal, with other relays it can be the other way around. If necessary, the functions that interact with the motor should be modified, such as blind_motor_off() inside automatic_blinds.ino.

Important settings to modify in the Arduino IDE

  • CPU Frequency: 160MHz (Must)
  • Board/Module: Generic ESP8266 Module
  • Erase Flash: Only Sketch (ideally select All Flash Contents when uploading the code for the first time)
  • SSL Support: Basic SSL ciphers (lower ROM use)

Usage

blind_usage.mp4

Clarification

A fork of the original library Arduino-HomeKit-ESP8266 is used, since with the changes proposed in #212 and coupled with this other change #2, it is working as intended.

If in the future they update the original repository, which for now seems deprecated, this no longer matters. As of today 7/26/2023 without these changes it does not work.

Useful Bibliography

Thanks

esp8266-homekit-controlled-blinds's People

Contributors

pradajoaquin avatar

Stargazers

Ankit Jain avatar Lucas Sotelo avatar Matias Pedelhez avatar

Watchers

 avatar Ankit Jain 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.