I'm using SCD30 and SPS30 connected to Wemos D1 mini ESP32. Using I2C they connect to the same pins and everything works without an issue, but the SPS30 data sheet mentions that it requires 10kOhm pull-up resistors connected to the 5V line. SCD30 operates on 3.3V pin.
Would that affect the SCD30, since its data lines are connected to the same pins as SPS30's?
The I2C bus needs pullup resistors, or it does not work at all. They are an important part of the I2C bus, but the value of those resistors should not be too low or too high ![]()
Sometimes a Arduino board has onboard pullup resistors, sometimes a module has pullup resistors, sometimes you have to add your own pullup resistors.
Can you give links to the SCD30 and SPS30 modules (links to where you bought them). So we can check for pullup resistors.
You can also measure the pullup in your circuit yourself.
Put a "Wire.begin();" in setup() and keep the loop() empty. Measure the voltage of SDA and SCL. They should be near 3.3V. Then connect a 10k resistor from SDA to GND and measure the voltage again. Do the same with SCL or use a 1k resistor for it.
With those voltages it should be possible to calculate how much pullup therea already is in your circuit.
If you know electronics, then you can measure the short circuit current from SDA to GND and also from SCL to GND without the need for a resistor. I prefer that it is between 1mA and 3mA.
Ok, so I should have probably mentioned that the SCD30 has an internal pull-up (45kOhm) to 3V.
And SPS30 requires 10kOhm pull-up resistors to be added. Is there a way to figure out how much I should add without actually measuring? They use different voltages to operate (3.3V and 5V), which for me makes it even more complicated.
These are the data sheets for SCD30 and SPS30.
You also mentioned connecting SDA/SCL via resistor to ground? The scheme in the data sheet shows those lines connected to supply voltage (VDD) ![]()
The SDA and SCL should not be connected to GND with a resistor. The I2C bus only needs pullup resistors.
But if you want to calculate the amount pullup, then those resistors pull the voltage down and then you can calculate the amount of pullup there is in the circuit. That is to test the I2C bus, not for a I2C bus in use.
The SCD30 at Sparkfun: https://www.sparkfun.com/products/15112
It runs at 3.3V.
The SPS30 at Sparkfun: https://www.sparkfun.com/products/15103
It needs 5V. I think that you are in luck, the SCL and SDA work at a lower level. You should be able to connect them to same I2C bus, directly to the ESP32.
At this moment you only have the 45k pullup of the SCD30.
You can add 10k pullup resistors from SDA to 3.3V and from SCL to 3.3V.
Even the 10k is just a weak pullup, you can go lower, anything between 1k2 and 10k is okay.
The I2C standard has a 3mA sink current as the maximum on the bus. Every I2C device should be able to work with that, even your SCD30. If you calculate it, then 3.3V / 3mA = 1k1 pullup resistor. That is the limit.
Thank you! Real helpful stuff ![]()