Master I2C Interview Questions & Answers | Basic to Advanced Questions (2026)

On: March 1, 2025
I2C Interview Questions & Answers

Master I2C Interview Questions and Answers from basic to advanced. Learn I2C protocol, addressing, ACK/NACK, clock stretching, arbitration, pull-up resistors, and real-world debugging tips. Perfect guide for embedded engineers and interview preparation

I2C Interview Questions & Answers (Basic to Advanced): I2C (Inter-Integrated Circuit) is a widely used serial communication protocol that enables data exchange between microcontrollers and peripherals using just two wires: SDA (Serial Data Line) and SCL (Serial Clock Line).

I2C Interview Questions : In this guide, we will explore I2C interview questions step by step, covering basic, medium, and advanced levels, with detailed answers to help you master this essential protocol.

Basic I2C Interview Questions

1. What is I2C and how does it work?

I2C is a serial communication protocol that enables multiple devices to communicate over a shared two-wire interface. It follows a master-slave architecture, where the master initiates communication, and slaves respond based on their unique addresses.

2. What are the roles of SDA and SCL in I2C communication?

  • SDA (Serial Data Line): Transfers data between devices.
  • SCL (Serial Clock Line): Provides synchronization for data transmission.

Both lines are open-drain and require pull-up resistors for proper operation.

3. What are the standard speeds of I2C communication?

I2C supports different speed modes:

  • Standard Mode (SM): 100 kbps
  • Fast Mode (FM): 400 kbps
  • Fast Mode Plus (FM+): 1 Mbps
  • High-Speed Mode (HS): 3.4 Mbps
  • Ultra-Fast Mode (UF): 5 Mbps

4. How many devices can be connected to a single I2C bus?

I2C supports up to 127 devices (7-bit addressing) or 1024 devices (10-bit addressing). The actual number depends on bus capacitance and pull-up resistor values.

5. What is the difference between I2C and SPI?

FeatureI2CSPI
Wires Needed2 (SDA, SCL)4 (MISO, MOSI, SCLK, SS)
SpeedUp to 3.4 MbpsUp to 100 Mbps
Multi-Master SupportYesNo
ComplexityLowHigher

6. Why are pull-up resistors needed in I2C?

Since I2C uses open-drain logic, pull-up resistors are required to keep the SDA and SCL lines HIGH when no device is actively pulling them LOW.

Think of the I²C bus like two wires:

  • SDA (data wire)
  • SCL (clock wire)

Many devices (master and slaves) are connected to these same two wires.

I²C devices can only pull the wire LOW

In I²C:

  • Devices can make the wire LOW (0)
  • Devices cannot make the wire HIGH (1)

So when a device wants to send 0, it pulls the wire down.
But when it wants to send 1, it does nothing.

This means the wire is left hanging unless something pulls it up.

Pull-up resistor makes the wire HIGH

A pull-up resistor is connected:

  • Between the wire and power (VCC)

What it does:

  • When no device pulls the wire LOW
  • The resistor gently pulls the wire HIGH

So:

  • LOW → device pulls the wire down
  • HIGH → pull-up resistor pulls the wire up

Without pull-up resistor, I²C will not work

If there is no pull-up resistor:

  • The wire will float
  • The voltage will be unclear
  • Master and slave cannot understand 0 or 1

Result: No communication

Why not let devices drive HIGH directly?

Because many devices share the same wire.

If:

  • One device drives HIGH
  • Another device drives LOW

Short circuit and damage

So I²C uses:

  • Open-drain outputs
  • Pull-up resistors

This makes I²C safe and reliable.

Simple real-life example

Imagine:

  • A rope hanging down (LOW)
  • A spring pulling it up (pull-up resistor)

Anyone can pull the rope down,
but when nobody pulls it,
the spring pulls it back up.

That’s exactly how I²C works.

Common pull-up resistor values

For beginners, remember this:

4.7 kΩ is the most common value

Used in:

  • Arduino
  • STM32
  • ESP32
  • Sensors

7. What are the possible states of SDA and SCL lines?

  • HIGH (Idle state)
  • LOW (Active state)
  • Transitioning (During data transmission)

8. What is an I2C address, and how is it assigned?

Each slave device has a unique 7-bit or 10-bit address, assigned by the manufacturer. Some devices allow hardware pin configurations to change the address.

9. What are the start and stop conditions in I2C communication?

  • Start Condition: Master pulls SDA LOW while SCL is HIGH.
  • Stop Condition: Master releases SDA HIGH while SCL is HIGH.

10. What are ACK and NACK in I2C?

  • ACK (Acknowledge): Slave pulls SDA LOW to confirm data reception.
  • NACK (Not Acknowledge): Slave releases SDA HIGH, indicating an issue.

Medium-Level I2C Interview Questions

11. What is clock stretching in I2C?

Clock stretching allows a slave device to hold SCL LOW to delay communication when it is not ready to process data.

12. What happens if two devices on the I2C bus share the same address?

This can cause bus conflicts. Solutions include:

  • Using address-selectable devices
  • Implementing an I2C multiplexer (e.g., PCA9548A)

13. Explain standard, fast, and high-speed modes in I2C.

ModeSpeedFeatures
Standard Mode100 kbpsDefault speed
Fast Mode400 kbpsFaster data transfer
High-Speed Mode3.4 MbpsRequires special handshake

14. How can address conflicts be resolved in I2C communication?

  • Use configurable slave addresses
  • Implement I2C multiplexers
  • Assign software-defined addresses

15. What is a repeated start condition in I2C?

It allows the master to continue communication without releasing the bus, preventing another master from interrupting.

16. How is bus arbitration handled in I2C?

When multiple masters transmit at the same time, the master detecting a LOW while expecting HIGH loses arbitration and stops transmitting.

17. What is the difference between 7-bit and 10-bit I2C addressing?

  • 7-bit Addressing: Supports up to 127 devices, commonly used.
  • 10-bit Addressing: Supports more devices but requires special handling.

18. What happens if a slave does not acknowledge a transmission?

The master can either retry transmission or issue a STOP condition.

19. How do you handle common I2C errors?

  • Bus Busy: Check if another master is using the bus.
  • NACK Received: Verify device address and connection.
  • Arbitration Lost: Implement proper recovery.

💛 Support Embedded Prep

If you find our tutorials helpful and want to support our mission of sharing high-quality embedded system knowledge, you can contribute by buying us a coffee. Every small contribution helps us keep creating valuable content for learners like you. ☕

Thank you for your support — it truly keeps Embedded Prep growing. 💻✨

20. How does a master detect a busy slave?

The slave holds SCL LOW (clock stretching) when it is busy.

Advanced I2C Interview Questions

21. How is multi-master communication handled in I2C?

By using arbitration and clock synchronization mechanisms.

22. What are the advantages and disadvantages of software I2C vs. hardware I2C?

FeatureSoftware I2CHardware I2C
FlexibilityHighLow
SpeedLowerFaster
CPU LoadHighLow

23. How can you debug I2C issues using an oscilloscope or logic analyzer?

  • Check Start/Stop conditions
  • Verify correct ACK/NACK responses
  • Analyze bit patterns on SDA and SCL

24. How does clock stretching impact I2C performance?

It slows down communication as the slave holds SCL LOW until it is ready.

25. How can power consumption be optimized in an I2C-based system?

  • Use higher pull-up resistor values
  • Implement low-power sleep modes

26. How can I2C speed be increased while maintaining data integrity?

  • Reduce bus capacitance
  • Use lower pull-up resistor values

27. What are common challenges in I2C implementation?

  • Address conflicts
  • Clock stretching issues
  • Debugging complexity

28. How is priority handled in multi-master I2C mode?

The arbitration mechanism ensures the master with the lowest address wins.

29. What is PEC (Packet Error Checking) in SMBus?

PEC adds error detection by using a CRC-8 checksum.

30. How can low-power I2C communication be implemented in battery-operated devices?

  • Use interrupt-driven I2C communication
  • Disable I2C when not in use

If you’re preparing for I2C interview questions, understanding the fundamentals of I2C communication is crucial. I2C (Inter-Integrated Circuit) is a widely used serial communication protocol in embedded systems. This guide will cover the most common I2C interview questions, from basic concepts to advanced troubleshooting techniques.

What are the differences between SMBus and I2C?

FeatureI2CSMBus
SpeedUp to 3.4 MbpsUp to 1 Mbps
Voltage2.5V, 3.3V, 5V3.0V to 5V
TimeoutNo timeout feature35 ms timeout
ProtocolOpen standardStrict protocol specification

What Is I2C ACK?

In the I2C protocol, an ACK (Acknowledge) is a signal sent by the receiver to the transmitter to confirm that it has successfully received a byte of data.

Whenever the master or slave sends a byte, the receiving device pulls the SDA line LOW during the 9th clock pulse on SCL to indicate:
“Yes, I received the data.”

This LOW signal is called I2C ACK.

Why ACK Is Important in I2C Communication?

I2C ACK is one of the most important parts of I2C communication because it ensures reliable data transfer.

Without ACK, the master will not know:

  • Whether the slave is available
  • Whether data was received correctly
  • Whether to continue sending more bytes

ACK basically works like a confirmation message in the I2C protocol.

How I2C ACK Works? (9th Clock Pulse Rule)

Each I2C data transfer happens in 8-bit (1 byte) chunks.
After every byte:

Transmitter releases the SDA line
Receiver pulls SDA LOW
This happens during 9th clock pulse on SCL

This is the ACK cycle.

When Does I2C Device Send ACK?

A device (usually a slave) sends ACK when:

  • Its address matches the address sent by the master
  • It receives a byte of data correctly
  • It is ready for the next byte of communication

What Is I2C NACK?

NACK (Not Acknowledge) happens when the receiver keeps SDA HIGH instead of pulling it LOW.

A slave sends NACK when:

  • It didn’t understand the data
  • It is not ready to receive more bytes
  • Memory/register is full
  • Communication must end

Master sends NACK at the end to stop reading data.

Real-World Example of ACK in I2C

If the master sends an address 0x68 (for RTC module), the slave responds:

  • If the device exists → SDA goes LOW → ACK
  • If the device doesn’t exist → SDA stays HIGH → NACK

This helps the microcontroller detect whether the device is connected properly.

What is open-drain logic ?

Open-drain logic is a type of digital output where a pin can do only one thing actively:

  • Pull the line LOW (0)
  • It cannot drive the line HIGH (1) by itself

To get a HIGH level, the line needs an external pull-up resistor.

Normal Output vs Open-Drain Output

1. Normal (Push-Pull) Output

A normal output pin can:

  • Drive LOW (0)
  • Drive HIGH (1)

It has two internal transistors:

  • One pulls the line to GND
  • One pulls the line to VCC

2. Open-Drain Output

An open-drain pin has only one transistor:

  • ON → pulls line to GND (LOW)
  • OFF → pin becomes floating (High-Impedance / Z state)

There is no internal transistor to pull HIGH

That’s why we use a pull-up resistor.

Simple Real-Life Analogy

Think of a rope tied to a balloon

  • You can pull the rope down → LOW
  • If you release the rope, the balloon pulls it up → HIGH

You cannot push it up, you can only release it.

That’s open-drain logic.

How Open-Drain Works

Pin StateTransistorLine Voltage
Output = 0ONLOW (0V)
Output = 1OFFHIGH (via pull-up resistor)

Why Pull-Up Resistor Is Required?

Without a pull-up resistor:

  • When transistor is OFF, the line is floating
  • Voltage is undefined
  • Leads to noise and wrong readings

Pull-up resistor gives a default HIGH.

Where Is Open-Drain Used?

1. I2C Communication

  • SDA and SCL lines are open-drain
  • Multiple devices share the same bus
  • Any device can pull the line LOW safely

2. Interrupt Lines

  • Multiple devices can trigger one interrupt

3. Level Shifting

  • Safe communication between 3.3V and 5V devices

Why Not Use Push-Pull Here?

If two push-pull outputs connect:

  • One drives HIGH
  • One drives LOW
    Short circuit!

Open-drain avoids this because:

  • Devices only pull LOW
  • HIGH is passive

Simple Example (Microcontroller)

// Open-drain output pin
if (output == 0)
{
    pin = 0;   // pull LOW
}
else
{
    pin = Z;   // release line (pull-up makes it HIGH)
}

What is a Pull-Up Resistor?

A pull-up resistor is a simple resistor used in digital electronics to make sure a signal line stays at a known HIGH (1) level when nothing else is driving it.

In short:
It “pulls” the signal up to HIGH voltage when no device is pulling it LOW.

Why Do We Need a Pull-Up Resistor?

Digital inputs must be either 0 or 1.
But sometimes a wire is not connected to anything (floating).

A floating wire can:

  • Randomly read HIGH or LOW
  • Pick up noise
  • Cause bugs and unstable behavior

A pull-up resistor prevents floating.

Simple Explanation

A pull-up resistor:

  • Connects the signal line to VCC (3.3V or 5V)
  • Has a high resistance so it doesn’t waste power

When nothing else controls the line → it becomes HIGH.

Real-Life Analogy

Think of a light spring pulling a door open

  • If nobody pushes the door → spring keeps it open (HIGH)
  • If someone pushes hard → door closes (LOW)

The spring is the pull-up resistor.

How Pull-Up Works

Case 1 Switch Open (Nothing Connected)

VCC
 |
[R]  ← Pull-up resistor
 |
Signal → HIGH (1)

✔ Signal reads HIGH

Case 2 Switch Closed (Connected to GND)

VCC
 |
[R]
 |
Signal ---- GND

✔ Signal becomes LOW (0)
✔ Current safely flows through the resistor

Why Use a Resistor? Why Not Direct VCC?

If we connect directly to VCC:

  • When pulled to GND → short circuit
    Damage!

Resistor limits current, keeping everything safe.

Where Are Pull-Up Resistors Used?

1. Push Buttons

  • Button not pressed → HIGH
  • Button pressed → LOW

2. I2C Communication

  • SDA & SCL lines use pull-ups

3. Open-Drain Outputs

  • To generate HIGH level

4. Reset Pins

  • Keep microcontroller running normally

Example (Microcontroller Button)

// Button with pull-up resistor
if (button == 1)
{
    // Button not pressed
}
else
{
    // Button pressed
}

Common Pull-Up Resistor Values

ApplicationTypical Value
Buttons10kΩ
I2C2.2kΩ – 10kΩ
Reset pin10kΩ

Pull-Up vs Pull-Down

Pull-UpPull-Down
Default HIGHDefault LOW
Connected to VCCConnected to GND

Conclusion on I2C Interview Questions

Mastering I2C Interview Questions is essential for embedded software engineers. By understanding I2C fundamentals, error handling, and debugging techniques, you can confidently answer any I2C-related questions in an interview.

Best Resources to Learn I2C Interview Questions

For more details on I2C Interview Questions, check out:

FAQ on I2C Interview Questions

1. What is I2C?

Ans:
I2C (Inter-Integrated Circuit) is a synchronous, multi-master, multi-slave, serial communication protocol used for connecting low-speed devices like sensors, EEPROMs, ADCs, and microcontrollers. It uses only two wires:
SDA (Serial Data Line) – for data transfer.
SCL (Serial Clock Line) – for clock synchronization.

2. What are the advantages of I2C over SPI?

Ans:
Fewer wires: I2C uses only two lines, while SPI requires at least four.
Multi-master support: I2C allows multiple masters on the same bus.
Addressing: I2C uses unique addresses for each device, while SPI uses separate chip select lines.
Cost-effective: I2C reduces pin usage, making it more efficient for embedded systems.

3. What are the limitations of I2C?

Ans:
Slower speed: I2C is slower compared to SPI, with maximum speeds of 3.4 Mbps.
Short distance: It is suited for short-range communication only (~1 meter).
Complex protocol: More complex addressing scheme and overhead compared to SPI.

4. What are the standard I2C speeds?

Ans:
Standard Mode: 100 kbps
Fast Mode: 400 kbps
Fast Mode Plus: 1 Mbps
High-Speed Mode: 3.4 Mbps
Ultra-Fast Mode: 5 Mbps (rarely used)

5. Explain how data is transmitted over I2C.

Ans:
Start Condition: The master generates a START condition by pulling SDA low while SCL is high.
Addressing: The master sends the 7-bit or 10-bit address of the slave, followed by the R/W bit.
Acknowledgment (ACK): The slave responds with an ACK by pulling SDA low.
Data Transfer: Data is transferred 1 byte at a time (MSB first), with an ACK after each byte.
Stop Condition: The master generates a STOP condition by releasing SDA while SCL is high.

6. What is the difference between 7-bit and 10-bit addressing in I2C?

Ans:
7-bit addressing: Supports 128 unique addresses (0x00 to 0x7F).
10-bit addressing: Allows 1024 unique addresses by using two bytes for addressing.
Usage: 7-bit addressing is common in embedded systems, while 10-bit is used for larger address space needs.

7. What is clock stretching in I2C?

Ans:
Clock stretching is a mechanism where the slave holds the SCL line low to force the master into a wait state. It allows the slave to:
Catch up with processing data.
Synchronize with the master.
Prevent data loss due to speed mismatch.

8. What is the role of pull-up resistors in I2C?

Ans:
Pull-up resistors are necessary to:
Keep the lines in a known state when idle (HIGH).
Ensure proper voltage levels during data transfer.
Typical values range from 2.2kΩ to 10kΩ, depending on the bus speed and capacitance.

9. How does I2C handle multiple masters?

Ans:
I2C supports multi-master mode using arbitration:
If two masters start communication simultaneously, they compare the bits being transmitted.
The master that sends a low bit while detecting a high bit loses arbitration and stops transmission.
The master with the lower address value wins arbitration.

10. What is repeated start in I2C?

Ans:
A repeated start condition allows the master to:
Continue communication without releasing the bus.
Avoid generating a stop condition between consecutive transfers.
Useful for reading data after writing without losing bus control.

11. What is clock stretching and why is it needed?

Ans:
Clock stretching occurs when a slave holds the SCL line low to delay further communication, allowing it time to process data.
It prevents the master from overrunning the slave.
Ensures data integrity.
Commonly used in slow peripherals.

12. How do you avoid data collision in I2C?

Ans:
Arbitration: Masters monitor the bus and back off if they lose arbitration.
ACK/NACK checking: Slaves respond with ACK or NACK to confirm data reception.
Bus recovery: Masters can reset the bus if it gets stuck.

13. What is the difference between ACK and NACK?

Ans:
ACK (Acknowledge): The receiver pulls the SDA line low during the 9th clock cycle, confirming successful data reception.
NACK (Not Acknowledge): The receiver leaves SDA high during the 9th clock cycle, indicating no data received or end of communication.

14. How do you troubleshoot I2C communication issues?

Check pull-up resistors: Ensure proper resistance values.
Verify address conflicts: Check for duplicate addresses.
Use logic analyzers or oscilloscopes: Inspect the waveforms.
Check clock stretching issues: Identify if slaves are holding SCL low.
Look for bus contention: Resolve multiple masters fighting for bus control.

15. What is the impact of capacitance on I2C communication?

Excessive capacitance slows down the signal rise time.
Maximum capacitance for I2C is typically 400 pF.
To mitigate this: Reduce bus length.
Use lower-value pull-up resistors.

16. How do you calculate I2C bus speed?

Bus speed is determined by: Bus Speed=1(THIGH+TLOW)\\text{Bus Speed} = \\frac{1}{(T_{HIGH} + T_{LOW})}
Where:
THIGHT_{HIGH} = High clock period.
TLOWT_{LOW} = Low clock period.
For example, in 100 kbps mode:
THIGH=4.7μsT_{HIGH} = 4.7 \\mu s
TLOW=4.7μsT_{LOW} = 4.7 \\mu s
Bus speed = 100 kbps

17. What is I2C bus arbitration?

Arbitration is the process where multiple masters compete for bus control.
It prevents data corruption by ensuring only one master controls the bus at a time.
Arbitration uses bitwise comparison of data bits.

18. How do you implement I2C in embedded systems?

Initialize the I2C module with the desired clock speed.
Set the device address.
Start communication with a START condition.
Send/receive data in bytes.
Wait for ACK/NACK signals.
End communication with a STOP condition.

19. What are common issues with I2C communication?

No ACK: Slave not responding.
Bus hang: SCL line stuck low due to clock stretching.
Address conflict: Two slaves with the same address.
Data corruption: Incorrect pull-up resistor values or noise.

Above FAQ covers the I2C Interview Questions and provides detailed answers to frequently asked interview questions, ranging from basic to advanced topics. Let me know if you want in-depth explanations or code examples wrt I2C Interview Questions!

Thank you for exploring I2c Interview Question tutorials ! Stay ahead in embedded systems with expert insights, hands-on projects, and in-depth guides. Follow Embedded Prep for the latest trends, best practices, and step-by-step tutorials to enhance your expertise. Keep learning, keep innovating!

Special thanks to @mr-raj for contributing to this article on Embedded Prep

Master I2C Interview Questions & Answers (Basic to Advanced)

12 thoughts on “Master I2C Interview Questions & Answers | Basic to Advanced Questions (2026)”

Leave a Comment

Exit mobile version