I have successfully interfaced 5v sensors/devices to my 5v PSoC microprocessor. Currently, I am interfacing the 3.3v BME280 environmental sensor to a 5v PSoC microprocessor. I am using SparkFun’s Single Supply Logic Level Converter as the interface for the I2C communications between the BME280 and PSoC uP. I am using PSoC’s Bridge Control Panel as an I2C master to send read/writes to the BME280 via the Logic Level Converter. However, I cannot communicate with the BME 280. In fact, the Bridge Control’s live list command returns No Devices Found.
I heeded the warning in the hook up guide notes, “… It is recommended to use the GND pin by the lower VCCA side above the A1-A4 pins when you are referencing ground on the low side.” So, I am not sure why the communication is not working properly.
I saw a note in SparkFun’s BMP180 Hook Up Guide stating, “…it is safe to connect the SCA and SDL pins to an I2C port on a 5V Arduino, as the pullup resistors on the BMP180 board will keep the voltage below 3.6V.”
So can I eliminate the Logic Level Converter and connect the I2C lines directly between the 5v PSoC and the BME280?
Let me know your thoughts…thank you in advance!
In the I2C interface, SDA and SCL pins are pulled to GND to send a binary zero and are released to Tri-state to send a binary-one. As such SDA and SCL are NOT sending a high signal, but the signal is pulled high with the pull-up resistors.
So when you power the BME280 with 3v3, have the pull-resistors on 3v3 and of course GND connected there is NO need for an extra logic level converter.
However :
- If you add more devices to the same I2C line which use 5V, you will need it.
- Sometimes the MCU / PSoc already has pull-resistors on the board to 5V it self. Look at the schematics and/or share the board type you have so we might be able to help
Thank you for the fast response. I removed the Level Converter and it works fine now!
I think the problem I am having with the Level Converter may be the 3.3v pullup resistors on the BME280 breakout board. Do you think they are interfering with the Level Converter’s operation? Please see the attached schematic.
I would like to add a 5v LCD device to the 5v I2C bus. I did not include it in the attached sketch.
Let me know your thoughts…thank you in advance.
depending on the level converter schematics, you might not need pull-up resistors at all… but else you only need pull-up on the BME280 side.
A HIGH on the 3v3 side will become a HIGH on 5V side.
Which level converter did you use ?
I am using SparkFun’s Single Supply Logic Level Converter which utilizes the TXB0104 chip.
Here is the schematic as a reference.
Single_Supply_Logic_Level_Converter.pdf (73.0 KB)
It appears to be rather straightforward on how it changes levels (3.3 to 5 and vice versa) but it is giving me troubles…
I have worked with the TXB0104 chip before, but only for serial communication.
There is a remark that might be the root cause (although I don’t understand) on SparkFun Logic Level Converter - Single Supply it states : Note: This product does not work with Qwiic / I2C.
Yikes…I did not see that note…I might ping their product team about it…I will post anything I learn…thank you for your help!!!
I just found the following information from the TXB0104 datasheet:
8.3.5 Pullup or Pulldown Resistors on I/O Lines The device is designed to drive capacitive loads of up to 70 pF. The output drivers of the TXB0104 device have low dc drive strength. If pullup or pulldown resistors are connected externally to the data I/Os, their values must be kept higher than 50 kΩ to ensure that they do not contend with the output drivers of the TXB0104 device.
For the same reason, the TXB0104 device must not be used in applications such as I2C or 1-Wire where an open-drain driver is connected on the bidirectional data I/O. For these applications, use a device from the TI TXS01xx series of level translators.
So I wonder if I change the 4.7K pullup with 50K resistors on the BME280 breakout board, will it work? Likely not…what do you think?
I also found SparkFun BOB-12009 which utilizes BSS138 MOSFETs. A reviewer stated, "This level shifter does exactly what it should do and what Sparkfun says it will do, shift 3.3 volt logic levels up to 5.0 volt levels and the other way around too. I have looked at the signals on a digital oscilloscope with the board connected to i2c bus signals and find them to be clean and exactly correct for each voltage level. "
wow.. good catch but also bad news.
I would just forget about the TXB0104 and this Sparkfun board. I got already concerned about the remark about I2c AND the need to use a certain GND connection for no good reason. ( GND = GND)
Personally I would stop wasting time on this and get a board that works. There are plenty around. Even from Sparkfun. e.g. take the SparkFun Logic Level Converter - Bi-Directional. It is MUCH cheaper and the 5V and 3v3 can be sourced from your MCU/pSoc
Agreed!
Thank you again for your help.