CM3-Home

Relay interface

Two relays are available on the CM3-HOME-B and CM3-HOME-F board. This article explais how to use them.

  • Normally-Opened and Normally-Closed contacts available on screw terminals
  • Max rated: 24 VAC/DC @ 1A
  • Snubbers already on-board to increase reliability with induction loads

GPIO used

  • RL1 (left relay) GPIO21
  • RL2 (right relay) GPIO22

Python example

This example turns-on the relays alternately with a period of 1 second.

import RPi.GPIO as GPIO
import time

RELAY_LEFT=21
RELAY_RIGHT=22

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(RELAY_LEFT,GPIO.OUT)
GPIO.setup(RELAY_RIGHT,GPIO.OUT)

for i in range(5):
        GPIO.output(RELAY_LEFT,GPIO.HIGH)
        GPIO.output(RELAY_RIGHT,GPIO.LOW)
        time.sleep(1)
        GPIO.output(RELAY_LEFT,GPIO.LOW)
        GPIO.output(RELAY_RIGHT,GPIO.HIGH)
        time.sleep(1)

GPIO.output(RELAY_LEFT,GPIO.LOW)
GPIO.output(RELAY_RIGHT,GPIO.LOW)

eShop

EUR 130.00


CM3-HOME-B - CM3-Home board basic edition

CM3-Home board basic edition

| Product description || CM3-Home catalog |

EUR 330.00


CM3-HOME-F - CM3-Home board full edition

CM3-Home board full edition

| Product description || CM3-Home catalog |

Author:
Sergio Tanzilli - tanzilli@acmesystems.it
http://www.tanzolab.it - http://www.tanzilli.com - https://github.com/tanzilli