Giter Site home page Giter Site logo

esp32_time_relay's Introduction

Time Relay Controller

Simple time relay based on ESP32 + MicroPython

Features

  • Single channel for any relay

  • Set ON and OFF timer with infinite loop between them.

  • Idle mode with turn off display after 30 sec after last activity and turn on on encoder moved.

  • Additional commands: RESET, REBOOT

  • LED indicator which show current state.

Code features

  • Simple implementation of event system

  • All logic based on classes

Hardware

Schematic

scheme

Pin on part Pin on ESP32
LED1 + D23
LED1 - RESISTOR
LED2 + D4
LED2 - RESISTOR
RESISTOR GND
ENC + VCC
ENC - GND
ENC CLK D14
ENC DT D13
ENC SW D27
RELAY + VCC
RELAY - GND
RELAY SIGNAL D26
LCD VCC VCC
LCD GND GND
LCD SDA D21
LCD CSL D22

Used external libs

  • encoderLib.py

    Encoder library for MicroPython

  • python_lcd

    LCD control library. Used only files: lcd_api.py and machine_i2c_lcd.py

How to install

  1. Connect on the breadboard or weld hardware as on schematic

  2. Flash MicroPython to ESP32

  3. Upload external library to ESP32 (you can get it from libs dir) to root of file system

  4. Upload main.py and time_relay.py to ESP32

  5. Reboot

Main Menu

Line 1: State

  • OFFLINE

    Timer is off, nothing happens

  • ON

    Timer with POWER ON is in progress

  • OFF

    Timer with POWER OFF in progress

Line 2: POWER ON Timer

Setup POWER ON timer

Line 3: POWER OFF Timer

Setup POWER OFF timer

Line 4: Actions

  • START ON - start loop from ON state

  • START OFF - start loop from OFF state

  • STOP - stop timer

  • NEXT - switch to next timer now

  • RESET - stop and reset timers to 0

  • REBOOT - reboot device

  • <= - back to main menu (not action)

esp32_time_relay's People

Contributors

paulwinex 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.