rusty ox
raspberry pi EP-0099 4 channel relay module schematic - Printable Version

+- rusty ox (https://rusty-ox.swavesey.org)
+-- Forum: Swavesey (https://rusty-ox.swavesey.org/Forum-Swavesey)
+--- Forum: Rusty Ox (https://rusty-ox.swavesey.org/Forum-Rusty-Ox)
+--- Thread: raspberry pi EP-0099 4 channel relay module schematic (/Thread-raspberry-pi-EP-0099-4-channel-relay-module-schematic)



raspberry pi EP-0099 4 channel relay module schematic - RustyOx - 30-06-2022

I bought this for my home automation project, it is planned to be used to control siren and flashlight for my security system.

Board was bought from Amazon.

I noticed that the NC, NO is labelled wrong. The NC pin on board is actually normal open (NO).

It doesn't fit well on my Raspberry Pi 4 case, after cut some bits and drill a few holes ( for heat dissipation purpose), I have managed to put it in the Raspberry Pi case.

[attachment=861]

[attachment=865]


RE: raspberry pi EP-0099 4 channel relay module schematic - RustyOx - 30-06-2022

use command below to enable I2C interface (in menu "2 Interface Options" -> "P5 I2C").

    sudo raspi-config

Below command could be used to check I2C address
    sudo i2cdetect -a -y 1


Example code in Python



Code:
import time
import smbus
import sys

DEVICE_BUS = 1
DEVICE_ADDR = 0x10
bus = smbus.SMBus(DEVICE_BUS)

while True:
    try:
        for i in range(1,5):
            print("\nturning on  %d" % i)
            bus.write_byte_data(DEVICE_ADDR, i, 0xFF)
            time.sleep(2)
            print("turning off %d" % i)
            bus.write_byte_data(DEVICE_ADDR, i, 0x0)
            time.sleep(3)
    except KeyboardInterrupt as e:
        print("Quit")
        sys.exit()


[attachment=864]






Output:




Code:
pi@raspberrypi:~ $ python3 test_relay.py

turning on  1
turning off 1

turning on  2
turning off 2

turning on  3
turning off 3

turning on  4
turning off 4



RE: raspberry pi EP-0099 4 channel relay module schematic - RustyOx - 30-06-2022

  • test commands:
  • Turn on channel No.2 relay
i2cset -y 1 0x10 0x02 0xFF
  • Turn off channel No.2 relay
i2cset -y 1 0x10 0x02 0x00
  • Turn on channel No.3 relay
i2cset -y 1 0x10 0x03 0xFF
  • Turn off channel No.3 relay
i2cset -y 1 0x10 0x03 0x00
  • Turn on channel No.4 relay
i2cset -y 1 0x10 0x04 0xFF
  • Turn off channel No.4 relay
i2cset -y 1 0x10 0x04 0x00


RE: raspberry pi EP-0099 4 channel relay module schematic - RustyOx - 30-06-2022

i2c address table for raspberry pi EP-0099 4 channel relay module

[attachment=862]