Robot Electronics ESP32LR88 WiFi 8 x 16A Relays User Manual

June 4, 2024
Robot Electronics

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig1

Changes from v1.5 to v1.6
Setup commands MU and MW were added to provide an MQTT username and password.

Overview

  • The ESP32LR88 is a WIFI connected relay module using the popular ESP32.
  • It provides 8 relays capable switching up to 16Amps and 8 digital inputs with pull-ups than can interface directly with volt free contacts. The normally open relay contacts have snubbers fitted across them, and can drive inductive loads such as contactors and solenoids.
  • Power for the board is 12v dc, which can be provided by a standard universal wall power supply. A 1A or greater supply should be selected.

Control Protocols

  1. Simple plain text commands sent to the module.
  2. HTML commands
  3. MQTT
  4. A built in webpage

WiFi

The ESP32LR88 connects via 2.4GHz WiFi to your network. Therefore it must be located in a position where it gets a good WiFi signal. The module should not be enclosed in a metal box/cabinet as this will shield the WiFi signal. You can check the signal level by looking at the RSSI figure which is reported by the ST (STatus) command.

Configuration

The ESP32LR88 is configured by connecting a USB cable to your PC and running a terminal program. PuTTY is a good option if you don’t have any other preferences. The serial port should be set to 115200 baud, 8 bit, 1 stop, no parity, no flow control.

USB Configuration Commands

ST Status. Return the system status

When the IP address is set to 0.0.0.0 this means that the IP address is being provided by your networks DHCP server. In that case the assigned IP address is also provided, as above. When the SSID and Password are setup, they will be displayed until the next reset, After that they will only show as ****.

  • RB ReBoot
    This will restart the module. It may produce a lot of random characters as the ESP32’s boot logging runs at a different baud rate. If it succeeds in connecting to your network it will report the IP address.

  • IP Sets the modules IP address
    Enter IP followed by the required IP address. Entering address 0.0.0.0 means the IP will be obtained from your networks DHCP server. The new IP address will take effect after the next re-boot.
    IP “192.168.0.123”
    OK. Saved IP Address: 192.168.0.123

  • GW Sets the GateWay address
    This is normally the IP address of your router.
    GW “192.168.0.1”
    OK. Saved Gateway Address: 192.168.0.1

  • PD Sets the Primary DNS
    The can be the IP address of your router which will then use your ISP provided DNS. You can also specify the DNS such as 8.8.8.8 for Googles DNS server.
    PD “192.168.0.1”
    OK. Saved Primary DNS: 192.168.0.1

  • SD Sets the Secondary DNS
    The can be the IP address of your router which will then use your You can also specify the DNS such as 8.8.4.4 for Googles DNS server.
    SD “8.8.4.4”
    OK. Saved Secondary DNS: 8.8.4.4

  • SS This sets the SSID
    The SSID is the public name of your WIFI network Enter your WIFI’s SSID here.
    SS “Devantech”
    OK. Saved SSID: Devantech

  • PW Sets your networks WIFI password
    PW “K]~kCZUVUGA6SG~”
    OK. Saved Password: K]~kCZUV
    UGA6SG~

  • PA Sets the TCP/IP port number for the ASCII commands
    PA 17126
    OK. Saved ASCII port number: 17126

  • AP Sets the ASCII password
    AP “MySecretPassword”
    OK. Saved AsciiPassword: MySecretPassword

  • MS Sets the MQTT broker address
    MS “192.168.0.121”
    OK. Saved MQTT Server: 192.168.0.121

  • MD Sets the MQTT ID for this module
    MS “UniqueModuleName”
    OK. Saved MQTT ID: UniqueModuleName

  • MP Sets the MQTT broker’s port
    Normally, this should be set to 1883.
    mp 1883
    OK. Saved MQTT port number: 1883
    If you are not using MQTT, set the port to 0. This will turn off MQTT, otherwise it will continuously try to connect if there is no MQTT broker.

  • MU Sets the MQTT user name (V1.6+)
    This is for MQTT brokers that are setup to require a username and password. For open MQTT brokers that do not require a user name/password, these may be ignored.
    MU “myUsername”
    OK. Saved MQTT User: myUsername

  • MW Sets the MQTT password (V1.6+)
    This is for MQTT brokers that are setup to require a username and password.
    MW “mySuperSecretPassword”
    OK. Saved MQTT Password: mySuperSecretPassword

  • R1-R8 Sets the MQTT topic this relay is subscribed to
    R3 “Workshop/Heater”
    OK. Saved Relay 3 Topic: Workshop/Heater
    In use, the payload for relay topics should be a string with the first character set to ‘0’ or ‘1’ (ASCII characters 0x31/0x30).

  • N1-N8 Sets the MQTT topic this Input will publish to
    N2 “Workshop/Heater”
    OK. Saved Input 2 Topic: Workshop/Heater
    The payload generated for input topics is a string with the first character set to ‘1’ if the input is open or unconnected, and ‘0’ if the input pins are shorted. (ASCII characters 0x31/0x30).

TCP/IP Commands

The ESP32LR88 has a built in TCP/IP command set which allows you to control the module remotely.All commands are sent using plain ASCII text. PuTTY is a good cross platform terminal program to use for testing. The TCP/IP port is the one you set-up with the PA command during USB configuration. Do not use port 80 as that is reserved for the HTML commands and Webpage.

SR Set Relay

This is used to turn a relay on or off

GR Get Relay

Will return the state of the relay.

GI Get Input

Will return the status of an input.

AL Get All 8 inputs

Password

From version 1.5 we have added a password to the ASCII commands, this can be set with the AP command over the USB connection. The password is passed as a prefix to any command. For example if a password is set and relay 1 is required to be turned on, start with the password (example password of 1234), then the command, so it becomes: 1234 SR 1 1

HTML Commands

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig20

Webpage

The built in webpage can be used as a remote app to monitor and control the relays. Your can access the page as a default with just the IP address or by specifying index.htm.

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig9

The webpage contains the Javascript to send an HTML toggle command, as described in the previous section. It will send the toggle command each time a button is clicked. It then uses the responding XML file to colour the buttons and set the Input buttons to indicate input status.

Schematics

CPU

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig10

Power Supply

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig11

Relay Outputs
1 of 8 identical circuits show

The relays are capable of switching up to 16 Amps at 24vdc or 230vac. A data sheet of the relay can be found here. Only the normally open (N/O) contact has the snubber circuitry.

Digital Input
1 of 8 identical circuits shown

Digital Inputs have a pull-up resistor to 3.3v and will operate with a simple contact closure to ground.Alternatively, they may be connected to 3.3v logic. The clamping diodes prevent operation at voltages higher than 3.3v, so don’t connect to 5v logic.

PCB dimensions

Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig14

Appendix 1

Programming the ESP32LR88 with Arduino studio
Customising the ESP32LR88 can easily be achieved by using the Arduino studio and importing the required libraries.

  • Step 1 – Arduino IDE installation
    Obtain and install the latest Arduino IDE from https://www.arduino.cc/en/Main/Software it should be the latest to ensure compatibility.

  • Step 2 – Add the ESP32 library URL to the Arduino IDE
    Go to File>Preferences
    Now in the Preferences screen below we need to enter https://dl.espressif.com/dl/package_esp32_index.json
    into the “Additional Board Manager URLs” option. If you already have libraries added you may need to add a comma between the URLsRobot Electronics
ESP32LR88 WiFi 8 x 16A Relays-fig15

  • Step 3 – Install the ESP32 library Go to Tools>Board:>Boards Manager…Robot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig16

  • Now filter by “esp32” and install the Espressif Systems libraryRobot Electronics ESP32LR88 WiFi 8 x 16A Relays-fig17

  • Step 4 – Board selection
    Go to Tools>Board:> and select ESP32 Dev Module

  • Step 5 – Add MQTT library
    Go to Tools>Manage Libraries…
    Filter by PubSubClient and select PubSubClient by Nick O’Leary, then press the install buttonRobot Electronics ESP32LR88 WiFi 8 x 16A Relays-
fig19

  • That’s it! Your Arduino IDE should now be able to program the ESP32LR88 module. The factory shipped code is available Here: https://github.com/devantech

Copyright © 2021, Devantech Ltd. All rights reserved. www.robot- electronics.co.uk

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals