How to Connect Multiple Arduino Microcontrollers with I2C Hur ansluta flera Arduino Microcontrollers med I2C

354278597_3c989ca432

Use I2c to connect several Arduinos together to combine their power.  I2C stands for the Inter Integrated Circuits and  is one of the best Använd I2C att ansluta flera Arduinos tillsammans för att kombinera sina power. I2C står för Inter Integrated Circuits and är en av de bästa Multi Master Serial Computer Bus Multi Master Serial datorbussar technologies used in different systems to connect the peripherals of low speed data transmission. teknik som används i olika system för att ansluta kringutrustning med låg hastighet för dataöverföring. The technology was invented by Philips for TVs but is used in all sorts of applications including our Teknologin uppfanns av Philips för TV, men används i alla typer av applikationer, inklusive vår Wiimote and Arduino tutorial Wiimote och Arduino tutorial . .

0108bcfig11

The I2C circuits follow a standard operational procedure where only two bi-directional lines, a serial clock, and a serial data systems are used.   There are recently improved versions of I2Cs available on the market which can hold a higher number of nodes and can perform faster than the rest. Den I2C kretsar följer en standard operativt förfarande där bara två bi-directional linjer, en seriell klocka, och en seriell datasystem är used. Det finns nyligen förbättrade versioner av I2Cs finns på marknaden som kan hålla ett större antal noder och kan utföra snabbare än resten.

You can use I2C then you will be able to connect more than one Du kan använda I2C kommer du att kunna ansluta fler än en Arduino Arduino to a robot or other application and you can easily establish a network of sensors. till en robot eller andra program och du kan enkelt skapa ett nätverk av sensorer. By using these circuits you will have more controller pins at your disposal which will allow you to add more devices.  You do have other options such as an expander or Genom att använda dessa kretsar kommer du att ha mer controller stift till ditt förfogande som gör att du kan lägga till fler devices. Du behöver andra möjligheter såsom en expander eller Arduino Mega Arduino Mega , but I2C because is significantly cheaper. Men I2C eftersom den är betydligt billigare.

How To Set Up Your I2C Hur ställa in din I2C

Here are the basic requirements for setting the Här är de grundläggande kraven för att fastställa I2C protocol with the Arduino I2C protokoll med Arduino : :

  • More than two Arduinos Mer än två Arduinos
  • The latest version of the Arduino IDE Den senaste versionen av Arduino IDE
  • Few pieces of hook up wire Några bitar ansluta tråd
  • 1.5 to 2K Pull-up resistors 1.5 till 2K Pull-up motstånd
  • You need to install the Arduino wire library (new versions have it built in) Du måste installera Arduino tråd biblioteket (nya versioner har det inbyggda)

If you are working with two Arduinos, then one must be the master and the other must act as the slave.  To ensure a successful project, you need to make sure that you are using a minimum 1K pull-up resistor on every single line which will pull it to 5 Volts. Om du arbetar med två Arduinos, då måste man vara master och den andra skall fungera som slave. att säkerställa ett framgångsrikt projekt, måste du se till att du använder ett minimum 1K pull-up resistor på varenda rad som kommer att dra den till 5 volt.

If you are interested in learning more about the I2C and the Arduino, here are a few great resources: Om du är intresserad av att lära mer om I2C och Arduino, här är några stora resurser:

Comment: Kommentar:
Velon Velon

August 13th, 2009 13 augusti 2009

Hello! Hej!
I've done some time in practice with the Arduino I2Cbus based on the Philips device PCF8574P, the truth is that I had no idea how complicated that would be, in principle I am trying to make a 4×3 numeric keypad, as is the example shown in this link: Jag har gjort en del tid i praktiken Arduino I2Cbus baserad på Philips-enheten PCF8574P, sanningen är att jag hade ingen aning om hur komplicerat det skulle i princip vara jag försöker göra en 4 × 3-numerisk knappsats, vilket är Exemplet som visas i denna länk:

http://www.arduino.cc/playground/Main/I2CPortExpanderAndKeypads http://www.arduino.cc/playground/Main/I2CPortExpanderAndKeypads

I can not get back the number of the button pressed. Jag kan inte få tillbaka antalet knappen intryckt.

I can help, what should I do to show me the number for the button pressed. Jag kan hjälpa till, vad ska jag göra för att visa mig numret till knappen intryckt.

Thanks for your reply. Tack för ditt svar.