Help me to understand ways Arduinos talk with things: SPI, Serial, I2C etc.

I guess I don't need to mention my lack of knowledge and experience with embedded programming, I reckon it's visible from the moon :-)

I'm struggling to understand the ways Arduinos communicate and talk with things, be it sensors or screens or other electronic devices.

I figured how Analog works. I figure (guess) digital is similar but it is not converted (electric signal coming in/out like PWM).

What about other things I keep hearing? Such as Serial, SPI or I2C?

I read about I2C, apparently one bus can handle many. Serial has to be one device connected at a time to a single port. And I heard about SPI but don't know anything about it yet.

Is there a document or a website, that shows (using Arduino Uno or Mega etc):

  • what these busses / ways of communication protocols are,
  • where they get connected (which pins),
  • what are their advantages / disadvantages,
  • possibility to convert one and the other via code or a module

And things I should know about them as a beginner Arduino user?

Many thanks in advance.

Hi.

It's clear you heard of stuff, but have no idea what all that stuff means. If you are coming into this "business" fresh and without any luggage, things can be puzzling. Serial communication is the simplest way of digital communication. But then one would argue that all mentioned methods are a form of serial communication, and be right about that.

Serial as you have it in mind, is indeed meant to be one to one communication, but if you have a "talker", you could have multiple "listeners". Those are words known in NMEA, a form of serial communication you will find in GPS applications. I'd advice you to start with serial communication. It's the easiest way to get things going.

I2C and 2wire are the same thing, different names because of rights to use. It is indeed a bus system that allows communication to 127 devices on that single bus. This is possible because of the use of addresses.

SPI is also capable of communicating with multiple devices, addressing is done by enable pins (meaning each device needs a specific pin from your Arduino to be addressed).

Your choice of which protocol to use, will most likely be determined by the hardware you plan to use.

You can find out a lot by clicking Learning - Playground in the topbar of this site. And by clicking Products - Arduino, and then clicking on your board, you'll find out about the pins to use. There are some initiatives that offer very clear overviews over these pins, but PighiXXX (an Italian user of this board, known for his very nice artwork) is working out a new version of his pictures, and already took the old ones offline. In the Microcontrollers section, you can find some clear pictures too, they are pinned to the top.