How to Connect Multiple Arduino Microcontrollers with I2C Як підключити кілька Arduino мікроконтролери з 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 I2c використання для підключення декількох Arduinos разом, щоб об'єднати їх power. I2C виступає за Інтер інтегральних мікросхем Анда є одним з кращих Multi Master Serial Computer Bus Multi Master Serial Bus Комп'ютерні technologies used in different systems to connect the peripherals of low speed data transmission. технології, які використовуються в різних системах для підключення периферійних пристроїв низькій швидкості передачі даних. The technology was invented by Philips for TVs but is used in all sorts of applications including our Ця технологія була винайдена для телевізорів Philips, але використовується в різних програмах, включаючи нашу Wiimote and Arduino tutorial Wiimote і Arduino Підручник . .

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. I2C схеми дотримуються стандартної оперативної процедурою, де тільки дві бі-directional ліній, серійні годинник і серійних системах дані used. Є останнім часом покращився I2Cs версії доступні на ринку, що може містити більшу кількість вузлів і може працювати швидше, ніж інші.

You can use I2C then you will be able to connect more than one Ви можете використовувати I2C тоді ви зможете підключити більше одного Arduino Arduino to a robot or other application and you can easily establish a network of sensors. з роботом або інший додаток і ви можете легко створити мережу датчиків. 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 За допомогою цих схем ви будете мати більше штифтів контролера у вашому розпорядженні, яка дозволить вам додати більше devices.Â У вас є інші варіанти, такі як розширення або Arduino Mega Arduino Mega , but I2C because is significantly cheaper. , I2C, але тому, що значно дешевше.

How To Set Up Your I2C Як створити свій I2C

Here are the basic requirements for setting the Ось основні вимоги для установки I2C protocol with the Arduino I2C протокол з Arduino : :

  • More than two Arduinos Більше двох Arduinos
  • The latest version of the Arduino IDE В останній версії Arduino IDE
  • Few pieces of hook up wire Кілька шматків підключення проводів
  • 1.5 to 2K Pull-up resistors 1,5 до 2K підтягань резисторів
  • You need to install the Arduino wire library (new versions have it built in) Вам необхідно встановити бібліотеки Arduino дроту (нова версія її вбудований)

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. Якщо ви працюєте з двома Arduinos, то потрібно бути майстром, а інша повинна виступати як slave. Щоб забезпечити успішний проект, ви повинні переконатися, що ви використовуєте мінімальний 1K навантажувального резистора на кожну лінію який буде тягнути його на 5 вольт.

If you are interested in learning more about the I2C and the Arduino, here are a few great resources: Якщо ви зацікавлені в отриманні додаткової інформації про I2C і Arduino, тут трохи більше ресурсів:

Comment: Коментар:
Velon Велон

August 13th, 2009 13 серпня 2009

Hello! Здравствуйте!
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: Я зробив якийсь час на практиці з Arduino I2Cbus заснований на пристрої Philips PCF8574P, по правді кажучи, я поняття не мав, наскільки складна, що було б, у принципі, я намагаюся зробити 4 × 3 цифровою клавіатурою, як це приклад, показаний на цим посиланням:

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. Я не можу отримати назад число кнопка натиснута.

I can help, what should I do to show me the number for the button pressed. Я можу допомогти, що я повинен зробити, щоб показати мені номер для кнопка натиснута.

Thanks for your reply. Спасибі за Вашу відповідь.