/esp8266-distance-measurement

Using an ESP8266 to get the distance data from an AJ-SR04M ultrasonic sensor over a really simple REST API.

Primary LanguageOpenSCADMIT LicenseMIT

ESP8266 distance measurement

a photo of the ESP8266 with the sensor soldered on, without the case

Case

a screenshot of the 3D case

STL File SCAD file

Arduino Code Logic

Arduino code

flowchart TD
    A("Initialize Serial Communication") --> B("Initialize Wi-Fi")
    B --> C("Try to Connect to WAP")
    C --> D{"Is Connected?"}
    D -->|Yes| H("Set Up Webserver")
    D -->|No| F["Print Status to Serial Console"]
    F --> G["Wait for Connection"]
    G --> C
    H --> I("Loop")
    I --> J{"Is there an HTTP Request?"}
    J -->|Yes| K["Send Distance Data as JSON over HTTP"]
    J -->|No| M["Print Distance to Serial Console"]
    K --> M
    M --> I
Loading