How to pull up I2C pins?

I’m using an adafruit BME280 and TSL2561 sensor, which are both I2C. I have my 4.7k ohm resistors, because I’ve read that I have to pull up both of the sensor’s logic levels to 5V. From what I’ve read online, it says that I have to put one end of the resistors in the VIN line and the other end(s) in the SDA and SCL lines. I’m pretty new to wiring, so I don’t want to damage any pins or sensors by plugging in the resistor to the wrong place. Here’s my wiring and my connections right now.
BME280:

VIN -> 3v3
GND-> GND
SCK-> D1
SCI-> D0

TSL2561:

VIN-> 3v3
GND->GND
SDA-> D0
SCL->D1

You probably don’t need pull-ups in your setup. It looks like you have Adafruit boards, and they all have 10K I2C pull-ups on the breakout boards.

You’ll end up with two 10K pull-ups in parallel, so you effectively get 5K, which is fine.

There’s more about I2C here:

https://docs.particle.io/support/particle-devices-faq/i2c-faq/

2 Likes

I have tried running them already without pull-ups, and the results are highly unstable(sensors will or won’t work by chance), even when I swap out sensors with duplicates of the same sensor. I’ve done a ton of troubleshooting and I’ve determined this is what I need to do to fix it.

In that case it depends whether you are powering the sensors off VIN or 3V3. Whatever you’ve selected you need to have the pull-up go to that.

Say you’re powering at 5V (VIN):

One resistor goes from D0 (SDA) to VIN.
Another resistor goes from D1 (SCL) to VIN.