Before i get too far into the design phase of a project i have in mind, is there a way to connect arduinos in a non-master/slave manner to pass a few different combinations of HIGH/LOW (say 5) or 'information' both ways using digital pins? Perhaps some library i don't know about?

Each of these modules should be identical and be able to connect on any face to any other module. I've included a crude image of what I would like to accomplish.

magnet modules

I've already determined that i can solder to these neodymium magnets without loss of magnetic properties by having the little magnets attached to a stronger magnet during the soldering process. Magnet to magnet connection shows only a very tiny resistance.

If it can't be accomplished, i will need to abandon the project and look for some other means to make my project. Thanks in advance!


  • would serial connections work for you? Jan 28 '19 at 4:01
  • As long as i was only communicating to one face of the module at a time, but my understanding of the Tx/Rx communications would push out the command to all modules. I only want to send/receive to one module, not all of them at the same time. Jan 28 '19 at 4:06
  • you have more than one serial interface - some arduinos have 4 hardware serial interfaces (if I recall) ... then there's SoftwareSerial - to make any pair of pins a "serial" interface Jan 28 '19 at 4:09
  • 1
    by the way, I'd wire it differently ... if 1 is output and 2 is input, for example, then you'd need, for example 1 on top of 2 on the left of the board, and 2 on top of 1 on the right ... therefore, output connects to input and vice versa :p Jan 28 '19 at 4:20
  • 1
    not sure why you'd need 4 - the key is rotational symmetry Jan 28 '19 at 5:16

While idea looks cool, you need some kind of "locks" because not "any combination" can work.

Rotate second Arduino in bottom row on 180 degree and you will see that GND/5V reversed relatively to first arduino in second row.

You have to account magnet N-S polarities to allow good lock. Probably you can use magnet polarities to achieve proper orientation.


Non-master/Slave is absolutely the best for lots of applications. Why bother with Arduinos? There are much better processors available at low cost. Lots of the STM32 processors allow you to address the serial ports. For instance, from the reference manual of the popular STM32F103 (Blue pill).Quote. Address mark detection (WAKE=1) In this mode, bytes are recognized as addresses if their MSB is a ‘1’ else they are considered as data. In an address byte, the address of the targeted receiver is put on the 4 LSB. This 4-bit word is compared by the receiver with its own address which is programmed in the ADD bits in the USART_CR2 register. The USART enters mute mode when an address character is received which does not match its programmed address. In this case, the RWU bit is set by hardware. The RXNE flag is not set for this address byte and no interrupt nor DMA request is issued as the USART would have entered mute mode. Unquote. Then use the Embitz compiler, free, use C or C++ if you have to. C++ cannot compete with C for embedded work, proven over and over comparing code size and operating speed. Why use a processor without decent debugger? Embitz and STM32 will give you an unbeatable debugger. The larger STM32 processors also have Canbus, which is the ultimate non-master/slave. Canbus is not difficult to set up, and you will never look back. Alternatively, use ESP32 and Canbus. Regards Johan Smit

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.