Skip to content

tekkies/esp-12e-alexa-door-bell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp-12e-alexa-door-bell

stability-release-candidate

Announce the doorbell on Alexa using ESP-12E WiFi module from a 15V AC or DC power supply.

A practical teaching project to learn electronics and coding with my kid: "It's like a puzzle that when you complete, your life get's an upgrade"

Designing the high-level program flow using PlantUML, then generating the state machine C++ abstract classes allows very simple program design around the setup() loop() Arduino paradigm.

Video

Demo Video

PlantUML Based Program Flow

Software Design

State Machine Implementation

FloHsm is used to convert the PlantUML source used to crete the diagram above to generate C++ abstract classes. The details of the states, events and actions are then implemented in a concrete subclass, e.g.

State/Event

Here, the state case statement is called in every time loop() runs, so on each loop, the code checks to see it the button is pressed. If so, the event triggers and we move to the next state.

case StateId_Sense:
  if (!digitalRead(4)) {
    SwitchIsPushed(); //Trigger an event
  }
  break;

Action

void NotifyAlexa() override {
      Serial.printf("NotifyAlexa() called\r\n");
      ...
}

LED States

.. WiFi Connecting

... Sensing

______ Reporting

Circuit Design

Circuit Design

Board Layout

Board Layout

Power Supply Design

Power Supply Simulator

Development Environment

Windows

Toolchain

Build & Deploy

  • Regenerate state machine template code if the state diagram has changed
  • Run from folder src\esp-12e-alexa-door-bell
  • FloHsm.py fsm.plantuml

Using Docker

  • docker run -v $(pwd):/run tekkiesuk/flohsm:latest fsm.plantuml
    • A couple or warnings is normal

Using VS Code

  • Open the .ino file
  • Ctrl + Shift + P, Arduino: Select Serial Port
  • Ctrl + ALT + U
    • Alternative: Ctrl + Shift + P, Arduino: Upload

Using Arduino IDE

  • Select Board NODEMCU 1.0
  • Select Port
  • Sketch, Upload

Debug

Using VS Code

  • Open the .ino file
  • Close the serial monitor if you have it open, otherwise the debugger will not be able to connect
  • First Build & Deploy
    • Remember to redeploy if you change the code
  • Ctrl + Shift + P, Arduino: Upload
  • Place a breakpoint inside loop()
  • Press F5
  • CAVEAT: It appears only one breakpoint can be set at a time due to hardware limitations

Credits

Built standing on the shoulders of these giants:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages