EP-0099

From 52Pi Wiki
Jump to navigation Jump to search

4 Channel Relay Hat Board For Raspberry Pi

Description

4 Channel Relay Hat Board For Raspberry Pi is one of the "docker pi" module.
It has 4 channel relay that you can put it on your smart home project.
This four-channel relay uses high-quality relay modules combined with
the most popular microcontroller technology to communicate with the Raspberry Pi.
You can use multiple modules stacked together for use.
You can stack up to four layers.
Switch the I2C address of the device through the DIP switch on the circuit board to ensure that
the four-layer module gets different addresses, thus avoiding the problem of address duplication.
The module is very fast, easy to install, and supports multi-language development, making it ideal for smart home projects.

Features

  • Easy to use
  • 4 channel relay
  • Support I2C protocol
  • Support for stacking
  • Support address switching by dial switch
  • Support multi-language programming
  • Support 3A 250V AC
  • Support 3A 30V DC
  • Support relay status light prompt

Device Address Map

DIP switch status icon Device Address
Dipswitch01.jpg 0x10
Dipswitch02.jpg 0x11
Dipswitch03.jpg 0x12
Dipswitch04.jpg 0x13

Gallery

To be continue...

How to use it

  • Install i2c-tools package to operate the device.
 sudo apt-get update
sudo apt-get -y install i2c-tools
  • Turn on the I2C interface

Open a terminal and Run sudo raspi-config
Use the down arrow to select 5 Interfacing Options.
Arrow down to P5 I2C .
Select yes when it asks you to enable I2C.
Also select yes if it asks about automatically loading the kernel module.
Use the right arrow to select the <Finish> button.
Select yes when it asks to reboot.

  • Detect the register of the chip on board

i2cdetect -y 1
you will see this result:

I2cinfo01.jpg


Demo code