Understadn the need\use in pullups for i2c dsa\scl lines

Hello ,

can someone can help me understadn the logic beyond the pullups?

this is what I know (please correct me if I’m wrong):

  1. usually the Arduino\pi is the server and the sensor device is the client

meaning that the scl go from the arduino\pi to the device.

2.the sda goes both-ways - the arduino\pi “ask” something and the devcie return to him an “answer”.

  1. all the data\clock will will be 5V (assuimg the Arduino is 5V and the device is 5V also).

  2. I understand I need to use pullups to avoid “noise” in the system.

if I’m correct until here this is the main question:

noraml states on the line:

“0” - Arduino is sending “0” and the device get “0”

“1” - Arduino is sending “1” (which is 5V) and the device is getting 5V

what if the arduino is sending “0” and there is noise of 1V on the line , how does the pullups help me?

In case of I2C comunication the SDA and SCL are only pulled to GND by either the Arduino (master) or slave (device). They do not send a “1”, but only pull to GND if needed. That is how the I2C protocol works. The pull-up resistors are needed to set SDA or SCL to “1” if neither the Master or Slave is pulling the line to ground, else it would be floating.

A lot of microcontrollers have integrated pull up resistors in package. So when the SDA/SCL lines are connected to the microcontroller they can already be pulled up to VCC. However, on our products we include pull-ups just to make everything uniform.