Best interface layout?

Sorry! It was posted before finished and i realized after creating a new topic... ::slight_smile:
Follow at Best protocol intercom and layout for double nano board controller? - Networking, Protocols, and Devices - Arduino Forum

Hi there! I am developing a project for counting energy and wáter consuption in a scout camp, acting parallelly as a pump controller. I have these devices to connect to two identical arduino nanos:

INPUTS:

  • Water level sensor (2 analog)
  • Flowmeter (1 interrupt, 1 digital)
  • 2 Switches (2 digital)
  • 1 encoder (2 interrupt, 1 digital)
  • RealTime clock (I2C)

OUTPUTS:

  • 1 Relay (1 digital)
  • LED display (I2C)

I/O:

  • Micro SD Card (SPI)
  • Serial UART via USB to Smartphone console for debugging
  • Interconnection between both nanos to send data

The functionality I want is the following:

  1. As a controller, the system has to detect water level and enable/disable pump (relay) accordingly (already working on single nano), based in some noise reduction parameters saved on either EEPROM or SD.

  2. The switches are to enable manual mode (overwrite water level and force on/off pump (already working on single nano)

  3. I want to receive debugging info over USB (already working on single nano) from either arduinos

  4. The LED screen is to display status, consumption and configure menu to change the parameters. The navigation is controlled by the encoder

  5. I want any of the nanos to log water consumption to the sd card (preferrably as csv, in order to import data to Excel), every 5 minutes or so. Then, in one of them i have to plug the flowmeter.

As the display library is very heavy (on storage and also SRAM), I cannot handle everything with a single arduino (moreover, I have 3 interrupts to handle, with just 2 available on each nano). Therefore, I have to distribute all the peripherals between 2 arduinos, so I need a way to interconnect both to share data received from one to the other having SD/LED or whatever.

The only thing I have to share are bits, bytes and integers (I changed measurement units in order not to have floats).

Thus, I have two questions:
a) Which is the best interface I could use between the nanos?
If UART serial, then I would install another switch to bypass debug to USB. If I2C, which one should be the master? The one with the RT clock? Should't it be difficult to handle besides LED, SD and RTC connected to the same bus?
b) Which would be the best layout for all the peripherals?

mmusicoc:
Sorry! It was posted before finished and i realized after creating a new topic... ::slight_smile:
Follow at Best protocol intercom and layout for double nano board controller? - Networking, Protocols, and Devices - Arduino Forum

To avoid confusion please click "Report to Moderator" in the Topic that you don't want and ask for it to be removed or locked.

Also, you could delete all the content from the Topic apart from the link.

...R