0

I want to perform the same operation on 20 Pis exactly at the same time. What I am currently doing for 3 Pis (and a master) is

  • I have a master Pi that says when to perform the operation

  • And three slave Pis that perform the operation

  • There's a wire from a GPIO output pin in the master that sends a signal

  • The same wire goes to an input GPIO pin in all three slaves

  • When they receive the signal (or the signal disappears), they perform the operation

Everything is working flawlessly, but is this scalable? If I put together 20 Pis instead of 3 (40 cm far each one from the next one), will this still work? Or will there be voltage or other electric problems?

Thanks!

2

I suppose it would depend on the maximum distance from the master to a slave. Eight metres should be fine.

It should scale fine. You can always use multiple GPIO on the master and share the electrical load between them. So if you use 5 GPIO on the master each one could be connected to four different slaves.

You can write multiple GPIO at the same time on the master (as long as the library you are using supports such a write).

  • Putting the master in the middle I would be under 8 meters per pin with two pins. I'm planning to use Pigpio + Python. Can it write to several GPIO at the same time? – Marc Jul 31 '16 at 12:56
  • 1
    Yes, abyz.co.uk/rpi/pigpio/python.html#set_bank_1 will set a GPIO high if the corresponding bit in the mask is set. Similarly abyz.co.uk/rpi/pigpio/python.html#clear_bank_1 will clear a bit. E.g. say you want to set GPIO4 and 10 high you could do set_bank_1((1<<4) | (1<<10)). – joan Jul 31 '16 at 13:15
1

This is a classic bus driver issue.

There is no single answer - it depends on what speed you expect, distance (and thus indirectly capacitance). In traditional logic this would be addressed by fan out i.e. the number of standard inputs that could be driven.

To enhance robustness you could use a driver. It also depends on topography and distance - do you plan to have 20 wires from 1 Pi or a single wire which connects to 20 others on a bus?

The short answer is that if you are not expecting high speed and are operating over short distances it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.