LDR digital module example

Requirements

  • Hardware Requirements
    • 1 ESP32 or ESP32S3 flashed with EzloPi firmware
    • 1 LDR digital module
    • 3 Jumper wires
  • Software Requirements
    • EzloPi desktop application
    • Vera mobile application

Circuit connection in ESP32

  1. LDR digital module VCC
  2. LDR digital module digital output
  3. LDR digital module GND

Adding LDR digital module from EzloPi desktop application

  1. Connect the ESP32 to the computer and open the EzloPi desktop application.
  2. Scan, select and open the serial port, connecting to the ESP32.

3. Click on the ‘Add Device’ button as shown below.

4. Select the “Digital Input” option from the dropdown menu.

5. Configure the LDR digital module:

  1. Give it a name. (“LDR module” as an example)
  2. Select GPIO pin for digital input.
  3. Select the LDR switch from the dropdown menu.
  4. Select default input to “LOW”
  5. Click to checkbox if inverted input is required.
  6. Select the “PULL-DOWN” option.
  7. Then click “OK”.

6. Device name, type, subtype and GPIOs are displayed in the screen; click on “set config” to burn the configurations to the ESP devices. Finally, reset the device by clicking on “Restart”.

LDR digital module in Vera Mobile Application

  1. Login to the Vera app using username and password.

2. After login you should be able to see your controller online. The current controller shown has the serial 100004005. Make sure that after flashing the ezlopi firmware to the ESP32 device, you connect to the WiFi clicking Configure WiFi button in the UI.

3. After the device gets online, click on to the controller icon as shown as it appears online. It will take some time to reload and add the device configured from the configurator UI.

The LDR digital module connected will be shown in the ‘Devices’ panel.

Upon blocking the light to the LDR on the module, the GPIO value will change.

When the LDR is blocked from light falling into it, the GPIO pin will be activated i.e. switch in turned on. Which is indicated with a glowing lamp and ON state in the UI.

7. When the LDR is exposed to light, the GPIO pin will be deactivated i.e. switch is turned off. Which is indicated with a lamp being turned off and OFF state in the UI.