Using the Custard Pi 6


Published on

Custard Pi 6 - 8 Relay card with ribbon connector

The Downloads tab has sample Python code to demonstrate the use of the Custard Pi 6.

The Custard Pi 6 provides the following benefits for the hobbyist intending to use the GPIO.

1. The board simply plugs into the 26 way GPIO connector Using the supplied ribbon connector. The LED fitted to the 3.3V rail confirms correct plug in.

2. Uses the two I2C pins on the GPIO connector to control 8 relays.

3. There are 8 screw terminals provided to access the three pins of each relay: C (common), NC (Normally Closed) and NO (Normally Open).

4. The necessary functions to control the relays are provided by SF Innovations making it very easy for the programmer.

6. Switch S1 on each Custard Pi 6 can be used to set it a unique address with a choice of 8. Up to 8 different cards can be controlled each with 8 relays - allowing a total of 64 relays to be controlled using the Custard Pi 6.

7. There are 2 26 way connectors provided on each Custard Pi 6 allowing a maximum of 8 to be daisy chained.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Using the Custard Pi 6

  1. 1. CUSTARD PI 6 WITHOUT SETTING UP I2C UTILITIES 8 Relay card with ribbon connector & I2C Interface 18th October 2013 SF Innovations
  2. 2. FEATURES
  3. 3. INTRODUCTION TO THIS SLIDESHOW When using this, there is no need to set up the Raspberry Pi I2C routines. In this set of instructions we show how to control the Custard Pi 6 8relay card using the functions provided in routine. This used “bit banging” to provide a basic I2C bus serial interface to address the Custard Pi 6 board and switch relays ON and OFF.
  4. 4. ADDITIONAL DETAILS To Custard Pi 6 Notch to the right The 12V adaptor to supply the Custard Pi 6 is NOT supplied. This can easily be purchased on Amazon or EBay. Spec: 12V DC, 1 Amp To Raspberry Pi Notch to the right
  5. 5. GPIO CONNECTIONS Only 4 pins used 3.3V and 0V to power the I2C chip and driver & I2C SDA and SCL pins
  6. 6. USING THE CUSTARD PI 6 We supply a set of routines to make it very easy to control the Custard Pi 6. Just download the file “cpi6.txt” and place this in the same directory as the program that you are developing. Rename it as “”. Addressing the board You can use up to 8 different Custard Pi 6 boards to control a total of 64 relays. Use switch S1 to set the address of the card that you are using. Download cpi6 resources spi6.txt Then just use the following commands to control each individual relay on the card.
  7. 7. USING SWITCH S1 TO SET THE ADDRESS S1 pos 2 S1 pos 3 S1 pos 4 Address ON ON add0 OFF ON ON add1 ON OFF ON add2 OFF OFF ON add3 ON ON OFF add4 OFF ON OFF add5 ON OFF OFF add6 OFF OFF OFF add7 Position 1 is not used. ON
  8. 8. USING THE CUSTARD PI 6 First, set all the pins to be as outputs by using the following command. board1=cpi6.add1 cpi6.setasoutput(board1) cpi6.setbit(board1, cpi6.ONrelay0) The following command clears relay 0 on board 1 – ie turns it OFF cpi6.clrbit(board1, cpi6.OFFrelay0) The following command sets relay 0 on board 1 – ie turns it ON
  9. 9. PYTHON PROGRAM This program sets relays 0,1&7 on board 1 ON and then turns them all OFF again. This is done continuously until the program is aborted by a CTRL C. When testing, please make sure that switch S1 is set correctly for add1. #1/usr/bin/env python import RPi.GPIO as GPIO import time import cpi6 GPIO.setmode(GPIO.BOARD) #start program board1=cpi6.add1 cpi6.setasoutput(board1) while True: cpi6.setbit(board1, cpi6.ONrelay0) cpi6.setbit(board1, cpi6.ONrelay1) cpi6.setbit(board1, cpi6.ONrelay7) cpi6.clrbit(board1, cpi6.OFFrelay0) cpi6.clrbit(board1, cpi6.OFFrelay1) cpi6.clrbit(board1, cpi6.OFFrelay7) GPIO.cleanup() import sys sys.exit()
  10. 10. Blog dedicated to electronics & Raspberry Pi Custard Pi 5 available from stockists Up-to-date info on stockists on website Further information