Multi Arduino Commu...
 
Notifications
Clear all

[Closed] Multi Arduino Communication

11 Posts
6 Users
1 Reactions
2,940 Views
jrbdeveloper
(@jrbdeveloper)
Member
Joined: 5 years ago
Posts: 12
Topic starter  

I'd like to suggest covering Multi Arduino communication for PIN expansion and delegation of duties. I am currently experiencing the need to expand on the amount of PINs I can take advantage of on one board. For instance I am using an UNO for an ultrasonic sensor, LCD display, Motor Controller, etc and would like to expand it to add more sensors. I realize that there is the MEGA Arduino but it would be cool to say connect 1 UNO to multiple NANOs and have the UNO serve as the master controller while the NANOs are used as slave controllers to perform other duties. 

Pragmatically the master could issue a request to one of the slaves to report back values is has for a sensor connected to it. Naturally I would scale this up to as many NANOs/Sensors I have needs for. I have been doing a bit of research and came across a few promising things. Turns out there is a library called Wire that could work for me but having you give a deep dive would be really cool!!

 

Thanks for your consideration.

The unexamined life is not worth living - Socrates


   
TKBTheLegend
(@tkb)
Engineer/builder
Joined: 5 years ago
Posts: 14
 

I would like to see how to code Arduino and raspberry pi


   
TKBTheLegend
(@tkb)
Engineer/builder
Joined: 5 years ago
Posts: 14
 

 could you do a vid on Arduino due? it is a harder board to deal with it and it would be nice to have avideo on it like the video for "how to code Arduino mini".


   
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1190
 

@jrbdeveloper - Once you get to that level of sophistication maybe you are better off working with a board such as the Teensy 4 or the like.  Compared to the uno  humungous power that can still use most of the arduino libraries.  As for communicating master/slave with other boards would not i2c do it for you?   


   
jrbdeveloper
(@jrbdeveloper)
Member
Joined: 5 years ago
Posts: 12
Topic starter  

@byron

Thanks for the reply. I had no idea the Teensy 4 existed. That's pretty much where I'm at. I'm really new to the Arduino world of microcontrollers so I suffer from a bit of, I don't know what I don't know. After doing some research it does seem like I2C is the proper route to take which as I understand is Serial communication. At least I'm somewhat certain. I really appreciate the input here because I could use all the direction I can get. 

The unexamined life is not worth living - Socrates


   
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 

@dronebot-workshop

On Topic:

I second a motion for multiple microcontroller communications.   Perhaps the following could all be done in a single episode?

  1.  Serial to Serial communication between microcontrollers.
  2. I2C to I2C communications between microcontrollers
  3. SPI to SPI communications between microcontrollers.
  4. Are there any other methods?

Also could the microcontrollers include both:

  1. Arduino to Arduino
  2. Arduino to Raspberry Pi

This might be too much content for a single episode, but if you could fit it all in it would be a great one to watch!

On The Side:

@jrbdeveloper

John, there are actually many simpler methods of increasing I/O pin capacities for a single controller.  Look into 74HC595 Shift Register and Arduino on YouTube.  There are tons of videos out there for how to increase I/O capacity using these chips. If you need more analog I/O pins, search for videos on 74HC4051 multiplexer chips and Arduino.   You're basically unlimited in the number of I/O you can use with a single Arduino.   At least if you are willing to use some external shift registers or multiplexers.

DroneBot Workshop Robotics Engineer
James


   
jrbdeveloper reacted
jrbdeveloper
(@jrbdeveloper)
Member
Joined: 5 years ago
Posts: 12
Topic starter  

@robo-pi, sweet!! Thank you for the info! Definitely going to look into this.

 

The unexamined life is not worth living - Socrates


   
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2235
 
Posted by: @jrbdeveloper

After doing some research it does seem like I2C is the proper route to take which as I understand is Serial communication. At least I'm somewhat certain. I really appreciate the input here because I could use all the direction I can get. 

Yes the I2C is something I also have to get up to speed on if I want to make use of the hardware modules that use it and I see Bill has an I2C tutorial at the dronebot workshop.  I used to do something similar pumping data out of the bidirectional ports on the old DOS computers but of course I had my own protocol.

 


   
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1190
 
Posted by: @robo-pi

 

  •  
  • Are there any other methods?

 

If the inter board link is ethernet then mqtt or the newer micro- mqtt might be a good topic

 


   
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1190
 

And following my mention of mqtt,  the OpenMQTTGateway project linking 433mhz/315mhz protocols, infrared (IR), bluetooth, LoRa, GPS etc. may also be worth a topic.


   
(@dronebot-workshop)
Workshop Guru Admin
Joined: 6 years ago
Posts: 1116
 
Posted by: @robo-pi

This might be too much content for a single episode, but if you could fit it all in it would be a great one to watch!

Yes, it would be the longest video I've ever done, and I've already exceeded an hour on a couple.

I actually have done I2C between controllers already. And I'm planning some SPI tutorials.

"Never trust a computer you can’t throw out a window." — Steve Wozniak