๐Ÿ”— Master-Slave I2C Communication Between Two Arduinos – Full Guide + Code

Want to connect two Arduino boards to communicate seamlessly? Using I2C (Inter-Integrated Circuit) communication, you can send and receive data between a master Arduino and a slave Arduino with just two wires. Whether you're building a sensor network, multi-Arduino system, or an IoT prototype, I2C makes it super easy!


๐Ÿงฐ Components Required

  • ✅ 2x Arduino Uno or Nano

  • ✅ Jumper wires (Male to Male)

  • ✅ Common Ground Connection

  • ✅ (Optional) OLED Display or other I2C devices

  • ✅ Android phone to test/control via app

๐Ÿ›’ Buy all these at Plysmotix.in – Affordable electronics for makers, students, and developers!


๐Ÿ“ฒ Bonus: Download the Plysmotix Android App

Make your I2C projects smarter with our Android app:

  • ✅ Send/receive data via Bluetooth

  • ✅ Monitor serial output remotely

  • ✅ Access DIY tutorials

  • ✅ Shop components anytime

๐ŸŽฏ Download the Plysmotix Android App


๐Ÿ”Œ I2C Wiring Between Two Arduinos

Pin on MasterPin on Slave
A4 (SDA)A4 (SDA)
A5 (SCL)A5 (SCL)
GNDGND

๐Ÿ“Œ Use pull-up resistors (4.7kฮฉ) on SDA and SCL for longer wire lengths.


๐Ÿ’ป Arduino I2C Master Code

Filename: Master_Code_Arduino_1.cpp

#include <Wire.h> void setup() { Wire.begin(); // Join I2C bus as master Serial.begin(9600); } void loop() { Wire.beginTransmission(8); // Address of slave Wire.write("Hello, Slave!"); Wire.endTransmission(); Serial.println("Message sent!"); delay(1000); }

๐Ÿ’ป Arduino I2C Slave Code

Filename: Slave_Code_Arduino_2.cpp

#include <Wire.h> void setup() { Wire.begin(8); // Set address as 8 Wire.onReceive(receiveEvent); Serial.begin(9600); } void receiveEvent(int bytes) { while (Wire.available()) { char c = Wire.read(); Serial.print(c); } Serial.println(); } void loop() {}

๐Ÿง  How It Works

  • The Master Arduino sends a message "Hello, Slave!" every second to the slave with address 8.

  • The Slave Arduino receives and prints the message using the onReceive() interrupt handler.

  • You can easily scale this system to control multiple slaves or sensors.


๐Ÿ”ฅ Real-World Applications

  • ๐ŸŒก️ Distributed sensor networks

  • ๐Ÿšช Multi-point home automation systems

  • ๐Ÿง  Modular robotics communication

  • ๐ŸŽ›️ Remote control of actuators/devices

  • ๐Ÿ“ถ I2C with Bluetooth/Wi-Fi master for IoT projects


๐Ÿ›’ Why Buy I2C Components from Plysmotix.in?

  • ๐Ÿ”Œ Genuine Arduino boards (Uno, Mega, Nano)

  • ๐Ÿ“ฆ I2C modules like OLED, RTC, sensors

  • ๐Ÿ”ง Jumper wires, breadboards, and resistors

  • ๐Ÿงช DIY kits with preloaded I2C codes

๐ŸŽฏ Shop Now at Plysmotix.in – Everything you need in one place.


๐Ÿ“ฒ Unlock More Features with Plysmotix Android App

Use the app to:

  • View real-time I2C data

  • Store communication logs

  • Control master Arduino wirelessly

  • Access I2C tutorials offline

  • Order compatible sensors and boards

๐ŸŽฏ Download the Plysmotix Android App for the complete DIY experience.


๐Ÿ”Ž SEO Keywords to Boost Your Blog’s Ranking

  • Arduino I2C master slave communication

  • Connect two Arduino boards via I2C

  • I2C Arduino code tutorial

  • Master slave communication with Wire library

  • Arduino Uno I2C example

  • Buy Arduino and sensors online in India

  • Plysmotix electronics and DIY kits

  • Download Arduino app Plysmotix


✅ Conclusion

I2C communication between two Arduino boards is an essential skill for any electronics hobbyist or developer. It's fast, efficient, and perfect for building scalable systems.

So what are you waiting for?

๐Ÿ›️ Get your I2C modules today from Plysmotix.in
๐Ÿ“ฒ Enhance your projects with the Plysmotix Android App

Comments

Popular posts from this blog

๐Ÿ’กHow to Blink an LED with Arduino – Beginner's Guide with Code

☢๐ŸŒซ How to Control Fan Speed with Arduino Using PWM and a Potentiometer

๐Ÿ”Š How to Make a Buzzer Beep with Arduino – Easy Sound Project for Beginners