Solid State Relay Module

This documentation includes hardware info, installation guidelines and sample code for your hardware.

Overall Info

Turta Solid State Relay Module turns on or off small electronical devices. You can control a DC fan, LED strip or water pump with this module.



Module Connections

  • GPIO: Relay control, active high.

  • Power: +3.3V, GND.

External Connections

  • NO+: Device GND.

  • GND: Power source GND.

  • Connect Device + to power source +.


LCA-717S' technical specifications are as follows:

  • Maximum Voltage: 30V DC.

  • Maximum Current: 2A.

  • On Resistance: 0.023 Ohms.

  • Turn On Time: 0.92ms (3ms max).

  • Turn Off Time: 0.44ms (3ms msx).

  • Output Capacitance: 100pF.


To get maximum performance from your hardware, please make sure you'll meet the following requirements.


Solid State Relay Module is an add-in board for Turta Modular System. You'll need a compatible host device for your module. The following devices support Solid State Relay Module:

  • Turta IoT Node - ESP32


For ESP32 based systems, we're currently supporting Arduino core. Please make sure you've installed the following:

  • Arduino IDE.

  • ESP32 Hardware libraries for the Arduino IDE.

  • Python for the compilation of Arduino projects.

  • Drivers for your host device, e.g., USB Virtual Serial Port driver.


You'll need to install a library to make Arduino IDE support the module. This library includes drivers for the LCA-717S and sample code for you to jumpstart your project.


Please download the library archive from

Then, copy its contents to your Arduino Libraries folder.

You can find the Arduino Libraries folder inside your Arduino sketch directory. It is generally located inside the My Documents folder.


The library comes with included samples. There is no need to download additional files for the examples.

Source Code

The hardware, its drivers and the sample code are open source. You can use them under the terms of the MIT license. Please feel free to customize and prototype them for your projects.

Arduino Library

Turta_SSRelay_Module library is responsible for controlling the relay.

To use the library on Arduino IDE, add the following #include statement to the top of your sketch.

#include <Turta_SSRelay_Module.h>

Then, create an instance of the Turta_SSRelay_Module class.

Turta_SSRelay_Module ssr

Now you're ready to access the library by calling the ssr instance.


To initialize the module, call the begin method.


This method configures the GPIO pin to control relay.

Basic Members

Read Relay

Returns the state of the relay.

bool readRelay()
  • Parameters

    • None

  • Returns

    • Bool: Relay state.

Write Relay

Controls the relay state.

void writeRelay(bool state)
  • Parameters

    • Bool: state

  • Returns

    • None


You can open the example from Arduino IDE > File > Examples > Examples from Custom Libraries > Turta SSRelay Module. There is one example of this sensor.

Relay Toggle

This application demonstrates the basic operation of the relay. It uses Arduino IDE's Serial Monitor to display current relay state.

To run the example:

  1. Open the IoT_Node_SSRelay_Toggle sketch from the examples menu.

  2. Select Turta IoT Node from the Tools > Board menu.

  3. Select your device's COM port from Tools > Port menu.

  4. Open Serial Monitor from Tools > Serial Monitor.

  5. Select 115.200 baud from the Serial Monitor's status bar.

  6. Upload the code to your device.

Sample Code

#include <Turta_SSRelay_Module.h>
// Create SS Relay instance.
Turta_SSRelay_Module ssr;
void setup() {
// Initialize SS Relay.
// Configure serial port.
void loop() {
// Read relay state.
bool relayState = ssr.readRelay();
// Toggle relay.
// Write relay state to serial monitor.
Serial.print("Relay State: ");
Serial.println(ssr.readRelay() ? "On." : "Off.");
// Delay 10.000ms = 10 seconds.


After the application is uploaded to the device, it toggles the relay output every 10 seconds. The application writes current relay state to the Serial Monitor. The LED on the SS Relay Module is lit if the relay is on. The example output should be like this:

Relay State: On.
Relay State: Off.

The application runs forever until you clear it from memory.


If you're experiencing difficulties while working with your device, please try the following steps.

Problem: The relay conducts some current, even if it is off. Cause: In case you toggle the power of a high power device like a water pump in a high frequency, the solid state relay overheats and malfunctions. Solution: Please change the solid state relay module. Do not switch high power devices on or off quickly. Wait at least 10 seconds between switching.