SSR Unit

UNIT SSR Solid-state relays are different from traditional electromagnetic relays in that their switching life are much longer than that of electromagnetic relays. With integrated MOC3043M optocoupler isolation and zero-crossing detection,It supports input 3.3-5V DC control signal, and control output single-phase 220-250V AC power.

Support the following products:

SSRUnit

Micropython Example:

 1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import os, sys, io
 6import M5
 7from M5 import *
 8from unit import SSRUnit
 9import time
10
11
12ssr_0 = None
13
14
15def setup():
16    global ssr_0
17
18    M5.begin()
19    Widgets.fillScreen(0x222222)
20
21    ssr_0 = SSRUnit((8, 9))
22
23
24def loop():
25    global ssr_0
26    M5.update()
27    ssr_0.set_state(1)
28    time.sleep(1)
29    ssr_0.off()
30    time.sleep(1)
31
32
33if __name__ == "__main__":
34    try:
35        setup()
36        while True:
37            loop()
38    except (Exception, KeyboardInterrupt) as e:
39        try:
40            from utility import print_error_msg
41
42            print_error_msg(e)
43        except ImportError:
44            print("please update to latest firmware")

UIFLOW2 Example:

example.png

cores3_ssr_example.m5f2

class SSRUnit

Constructors

SSRUnit(port)

Initialize the SSR.

  • port: The port to which the Fader is connected. port[1]: control pin

UIFLOW2:

init.png

Methods

SSRUnit.on()

Turn on the SSR.

UIFLOW2:

on.png

SSRUnit.off()

Turn off the SSR.

UIFLOW2:

off.png

SSRUnit.set_state(state)

Set the state of the SSR.

  • state: The state of the SSR.

UIFLOW2:

set_state.png