Wednesday 20 November 2013

Custard Pi 6 8 Relay Card for the Raspberry Pi


This post describes the Custard Pi 6 circuit. It shows users how to customise this PCB assembly for different purposes. For example, the board can be fitted with fewer relays to save cost or supplied from a single 5V supply.


Connection to the Raspberry Pi
There are two connectors provided on the Custard Pi 6. One is for connection to the Raspberry Pi GPIO and the other is for “daisy chaining” out to either a second Custard Pi 6 PCB assembly, a Custard Pi 3 (8 input analogue card) or some other suitable accessory.   

I2C interface
The MCP23008 chip is used to provide 8 ports using the I2C interface and is powered from the 3.3V rail from the GPIO bus. The benefit of using the I2C bus for this is that other than the SDA and SCL pins, the other pins on the GPIO are available to the user when the Custard Pi 6 is in use.


For example, it is possible to drive 8 Custard Pi 6’s from one Raspberry Pi and control 64 relays using the I2C bus.


The 4 way DIL switch allows the user to select the I2C address. This is set as shown below.
Note: add0 to add7 refers to the addresses set in the functions supplied by SF Innovations. If writing your own I2C routines please note that these map as follows.



Relay Driver

The output from the MCP23008 is not powerful enough to drive the relays directly. A ULN2801 is used as a relay driver. This has open collector darlington outputs that can sink up to 500mA.




Relay circuit
The standard Custard Pi 6 uses 12V single pole changeover relays. When a relay is switched on an LED also comes on to confirm this. A diode is provided across each relay coil to prevent high voltages being generated when the relay is switched off.



Power supply
The Custard Pi 6 uses a 12V supply for the relays and the leds. Diode D9 is to protect the components if the user happens to connect the supply in the wrong way round. 


In the standard Custard Pi 6 circuit, components R14, U3, R12, C3 and LD9 and omitted. The intention of this circuit is to power both the relay card and the Raspberry Pi from a single 12V supply. However observe the following if you wish to do this.

1.            Please do not supply 5V power to the Raspberry Pi through the micro USB socket and power through the Custard Pi 6 at the same time.
2.            The power dissipation in U3 is quite high (more than 5W). This will get very hot and will need a good heat sink.

How to power the Custard Pi 6 and the Raspberry Pi from a single 5V 1A supply.

In this case, the following changes are required to the PCB assembly.

1.            Fit 6V relays instead of 12V relays.
2.            Replace diode D9 with a short circuit link.
3.            make a connection from pin 1 of U3 to pin 3 of U3. (Do not fit U3)
4.            Fit a short circuit link instead of R14.
5.            Fit R12, and LD9.
6.            Fit a 5v6 zener in the position provided for C3. This will prevent the voltage from going higher than 5.6V.

Please do NOT supply the Raspberry Pi from the micro USB socket. Connect a 5V 1 Amp supply to the Custard Pi 6 PCB using connector J9. 

Note: There is no reverse voltage protection so please make sure that this is connected correctly.

Connect the Raspberry pi to the Custard Pi 6 using the ribbon cable. When the Custard Pi 6 is powered using the 5V 1Amp supply, the Raspberry Pi will be powered. It will in turn generate the 3,3V supply and feed this back the Custard pi 6 PCB assembly. Both the 5V and 3.3V LED will light up when this is working correctly.

When you buy the Custard Pi 6 kit full schematic and parts list are provided.
 


 










 

2 comments:

  1. What are the command needed to control the relays and does it need any drivers to control it?? How could you also control the relays over the web??
    Pls reply
    Thnx

    ReplyDelete
    Replies
    1. Matthew, please look at demo code on www.sf-innovations.co.uk website. You can control the relay over the web - this is a Raspberry Pi issue and there are plenty of posts on how to do this.
      MisterTee

      Delete