iganin
Posts: 10
Joined: Thu Aug 09, 2012 8:35 pm

GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 2:20 pm

Hi,

I try to find out if i can use GPIO 2 and 3 for I2C interface meanwhile GPIO 28 and 29 to control relays via a python script.
It seems that activation of I2C takes over 28 and 29 as the second I2C bus.

Thank you in advance for your help.

Best Regard.
Iganin

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:11 pm

You can but you have to reassign the pins.

This chart should help.

http://elinux.org/RPi_BCM2835_GPIOs
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

iganin
Posts: 10
Joined: Thu Aug 09, 2012 8:35 pm

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:36 pm

Thank you for your fast response.

Could you please also help me to find out how I can do that?

Thank you.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:41 pm

Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:48 pm

Why use GPIO 28 and 29?

Did you use up all the rest? If so, I would look into using a MCP23017 chip. Cost is between $1-$2 and is easy to program and use.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
DougieLawson
Posts: 39788
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:51 pm

Richard-TX wrote:Why use GPIO 28 and 29?

Did you use up all the rest? If so, I would look into using a MCP23017 chip. Cost is between $1-$2 and is easy to program and use.
I'd second that. I've now got two expansion boards that have that chip on them. One is the driver board for my 8x8 LED matrix.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: GPIO 2& 3 -> I2C, 28 & 29 -> relay control

Sun Dec 29, 2013 5:56 pm

DougieLawson wrote:
Richard-TX wrote:Why use GPIO 28 and 29?

Did you use up all the rest? If so, I would look into using a MCP23017 chip. Cost is between $1-$2 and is easy to program and use.
I'd second that. I've now got two expansion boards that have that chip on them. One is the driver board for my 8x8 LED matrix.
If you do use it, you will thank us later. :D
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Return to “Interfacing (DSI, CSI, I2C, etc.)”