Get Started With BEVRLink 8 Channel Relay - ESP32 manager Arduino

Get Started With BEVRLink 8 Channel Relay - ESP32 manager Arduino

The example below is only one way how to set up the Relay Module.

In this examples we have connected a ESP32 to the BEVRLink Manager ESP32 V2 with BEVRLink 8 Channel Relay V1 12V. With this relay module board you need the BEVRLink Power Supply 12V 2A.

Optional for a safe setup we recommend to use case for both the manager and relay boards: BEVRLink Cases

Set up ESP32 support in Arduino

  1. Download latest Arduino IDE
  2. Tools->Board->Board Manager
  3. Search for ESP32
  4. Press install
  5. Tools->Board->ESP32 Arduino and select the board you are using

Code

#include <Wire.h>

void setup() {
  // put your setup code here, to run once:
  Wire.begin(21, 22);

  // Set all on address 0x20 as output, copy this to add another relay
  Wire.beginTransmission(0x20);
  Wire.write(0x00); // Register
  Wire.write(0x00); // GPIO
  Wire.endTransmission();
}
int relay = 1;
void loop() {
  // put your main code here, to run repeatedly:

  Wire.beginTransmission(0x20);
  Wire.write(0x0A); // Register
  Wire.write(relay); // GPIO
  Wire.endTransmission();

  #Cycle the relay on and off
  relay = (relay << 1) & 0xFF;
  if (relay == 0) relay++;
  delay(500);
}
  1. Connect your board to the USB port of your PC
  2. Press Upload to compile and upload you code