Run Several Devices on One Bus
Share I2C between an LCD and a sensor.
Run Several Devices on One Bus is a free Arduino & IoT Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Share the Same Wires
The real power of I2C is sharing. An LCD and a sensor can sit on the same two wires at once. 🔗
Addresses Keep Order
Because every device has a unique address, the master talks to each one in turn without any of them getting confused.
Wire Them in Parallel
Connect every device's SDA to SDA and SCL to SCL. They all sit in parallel on the same shared bus lines.
One Set of Pull-Ups
The whole bus needs only one pair of pull-up resistors, not one per device. Many breakouts already include theirs.
Beware Address Clashes
Two devices sharing one address will conflict. Run your scanner first to spot duplicates before wiring everything together.
Change an Address
Many boards let you change the address with a solder jumper or pin. That frees you to run two identical sensors at once.
One Wire.begin for All
You call Wire.begin() just once. Every library on the bus shares that single connection no matter how many devices you add.
void setup() {
Wire.begin();
}Each Library Knows Its Address
You give each library the device's address when you create it, so calls route to the right chip automatically.
LiquidCrystal_I2C lcd(0x27, 16, 2);Talk to Each in the Loop
In loop, read the sensor, then update the LCD. The bus handles one conversation at a time, so order is fine.
float t = sensor.readTemp();
lcd.print(t);Keep Wires Short
Long shared wires add noise and can break the bus. Keep I2C runs short and tidy for reliable communication.
Scale Up Your Projects
With this skill you can grow a project by simply adding more I2C modules, all on the same two trusty wires. 🚀
Quick Check
What happens if two I2C devices share the same address?
Recap
You can now wire multiple I2C devices in parallel, avoid address clashes, and address each one to build bigger projects. ✅
Frequently asked questions
Is the “Run Several Devices on One Bus” lesson free?
Yes — the full text of “Run Several Devices on One Bus” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.
What will I learn in “Run Several Devices on One Bus”?
Share I2C between an LCD and a sensor. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Arduino & IoT Academy?
No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Run Several Devices on One Bus” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Arduino & IoT Academy lesson?
Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- How I2C Talks on Two Wires
- Scan for I2C Addresses
- How SPI Moves Data Fast
- Run Several Devices on One Bus