User avatar
pjjones
Posts: 13
Joined: Sat Feb 22, 2014 9:27 am
Location: Sidney, Australia

Connect Pi(A) to Pi(B)

Sat Feb 22, 2014 9:36 am

Hi all.
I am using all my 16 gpio pins on my Pi(A) for a 16 channel relay board and now I find that I need some more pins for some input devices.
Now, I know that I cant use Pi(A) so can you tell me, if you know, how would I send signals from Pi(B) to Pi(A).
Thanx
pj

p.s. It is for an automated fish tank system with pumps heatrers and now hopefully temperature sensors and water levels
I grew up with punch cards!
A wiseman once told me..."Don't live your life by clever sayings"

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

Re: Connect Pi(A) to Pi(B)

Sat Feb 22, 2014 1:03 pm

You'll do much better by getting some MCP23017 chips. They use the I2C bus and give you 16 gpio pins per chip. The chips can be configured to sit as I2C device 0x20 to 0x27. So with eight MCP23017 ONE RPi can control 128 devices.

There's code in Gordon's WiringPi http://wiringpi.com to easily drive MCP23017s from python or C/C++.

Comms between two RPis is best done using a UDP/IP or TCP/IP client on one connected to a UDP/IP or TCP/IP server on the other. The way I like to do that is with Mosquitto (http://mosquitto.org) MQTT broker to transfer simple messages.

For your application I'd use the hardware answer rather than the software answer.
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.

pleriche
Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

Re: Connect Pi(A) to Pi(B)

Sat Feb 22, 2014 6:01 pm

And once you get stuck into I2C you can add an ADC such as MCP3428 for analogue inputs. There's a nice little module available at http://hackaday.com/2012/09/14/a-truly- ... log-input/

Regards - Philip

User avatar
pjjones
Posts: 13
Joined: Sat Feb 22, 2014 9:27 am
Location: Sidney, Australia

Re: Connect Pi(A) to Pi(B)

Sat Feb 22, 2014 8:21 pm

@Dougie - thanx for that - very interesting info. I have worked with message queues before and your suggestion seems similar - very interesting indeed. thanx for the links and thanx for your reply.
@Phillip - thanx for your reply. Those input boards look very tasty and thanx for the link.

pj
I grew up with punch cards!
A wiseman once told me..."Don't live your life by clever sayings"

User avatar
shawny
Posts: 14
Joined: Sun Feb 02, 2014 1:21 pm
Location: Prague, Czech Republic

Re: Connect Pi(A) to Pi(B)

Sun Feb 23, 2014 1:33 pm

I'd like to share a different idea, which is to extend your Pi with Arduino boards ;)

The pro is that you don't need to make the boards by yourself, and you can buy any Arduino board that could be connected to Raspberry Pi via USB cable. By uploading a sketch to the Arduino board and using a library on the Pi, your application that runs on the Pi can control the IOs on the Arduino.

Checkout the project homepage if you are interested: http://www.uugear.com/uugear-rpi-arduino-solution/
Cool stuff for Raspberry Pi, Arduino and more: http://www.uugear.com/
Raspberry Pi + Arduino Solution: http://www.uugear.com/uugear-rpi-arduino-solution/

0117blocky
Posts: 43
Joined: Mon Apr 30, 2012 8:03 am

Re: Connect Pi(A) to Pi(B)

Tue Feb 25, 2014 12:16 pm

An alternative to Arduino is mbed http://mbed.org/ . Currently mbed supports 25 different arm based microcrontroller boards and the cheapest are ST's nucleo boards at less than £8 excluding vat. They all have more GPIO pins than a RPI, plus the online compiler is free and easy to use. I have had a Freescale FRDM KL25Z communicating with a RPI via a USB connection.

Return to “Advanced users”