Struggling to wire externally powered 5V I2C sensor to Teensy 4.1

munch

Member
Hi all,

I'm relatively new to this but have spent some time working on a Teensy project last year so I know some basics.
I have this CO2 sensor (https://sandboxelectronics.com/?pro...art-5v3-3v-interface-for-arduinoraspeberry-pi) for which they have recommended using a 12V power supply (if you're on an arduino) rather than relying only on USB power. This is explained here: http://sandboxelectronics.com/?p=1126.

Since the teensy 4.1 does not have a 12V jack, I bought an MB102 breadboard power supply module to power both the teensy and the sensor. The teensy uses 3V3 for I2C logic levels, but the sensor is 5V, hence I have a bi-directional logic level shifter too. I have wired power from the MB102 to both the teensy, and the sensor, and have connected the I2C lines to either side of the logic level shifter. My question is: do I also need to connect 3V3 power from the teensy 4.1 to the 'low-voltage' pin in the level shifter?

Thanks!
 
Looking at the datasheet of the CO2 sensor, the current consumption is rather low (<85mA), so I would just power the interface board and sensor from the 5V pin on the Teensy 4.1. The USB host port on your PC or laptop should be able to supply at least 500mA @ 5V.

The product page also mentions that there is a resistor to set the IO voltage to 3V3 which is save for the Teensy 4.1. No need for a levelshifter in that case. Default position
of the resistor on the interface board is 5V IO.

Don't forget to set the I2C/UART switch to I2C.

If you want to be sure about the IO voltages, only connect 5V and GND to the 4 pin connector on the interface board, solder the resistor to 3V3 position
, and check with a multimeter whether both I2C signals are pulled high to 3V3. If so, then connect both I2C signals to the Teensy and start playing with the software.

Paul​
 
Maybe I am missing something, my browser does not want to allow me to go to their interface... link (your first one) saying it is not private...

But the second link shows:
There is another jumper(block 3) next to the two address setting jumpers in figure 2. Connect this jumper to the left, which is the default setting, sets the IO level of the sensor to 5V. Connect it to the right will set the IO level of the sensor to 3.3V.

Does this not work with your sensor?

Which level shifter? But would guess is yes you need to bring the lower voltage to shifter.
 
Hi all,

I'm relatively new to this but have spent some time working on a Teensy project last year so I know some basics.
I have this CO2 sensor (https://sandboxelectronics.com/?pro...art-5v3-3v-interface-for-arduinoraspeberry-pi) for which they have recommended using a 12V power supply (if you're on an arduino) rather than relying only on USB power. This is explained here: http://sandboxelectronics.com/?p=1126.

Since the teensy 4.1 does not have a 12V jack, I bought an MB102 breadboard power supply module to power both the teensy and the sensor. The teensy uses 3V3 for I2C logic levels, but the sensor is 5V, hence I have a bi-directional logic level shifter too. I have wired power from the MB102 to both the teensy, and the sensor, and have connected the I2C lines to either side of the logic level shifter. My question is: do I also need to connect 3V3 power from the teensy 4.1 to the 'low-voltage' pin in the level shifter?

Thanks!

It's been awhile since I've done I2C level shifting, but if I understand your question, you would need to connect the Teensy 4.1 3.3v output to the low power voltage. If the power to the Teensy comes from a different source then the sensor, you will need to correct the ground pins together. Some of the level shifters include a slot for the grounds on both sides. Electrically, I believe it doesn't need the ground, but it is convenient to make sure the grounds are interconnected.

For example, I would typically use the Pololu 2595 level shifter: https://www.pololu.com/product/2595.

This has 2 sets of 5 pins. One set of pins is labeled LV, L1, L2, L3, and L4. The other set of pins labeled HV, H1, H2, H3, and H4. I would connect the following:
  • LV: Teensy 3.3v power
  • L1: Teensy pin 18 (SDA)
  • L2: Teensy pin 19 (SCL)
  • HV: 5v power (I tended to use VIN from the Teensy)
  • H1: Sensor SDA
  • H2: Sensor SCL
  • Teensy ground to sensor ground

If you have an Adafruit BSS138: https://www.adafruit.com/product/757, the hookup would same, with the addition of connecting the two ground pins.
 
I plan to solder the jumper to the 3V3 setting soon, but just wanted to see if I could get it work otherwise!

I currently got the sensor to work running on 5V, with a level shifter (wired as per the last post), using an external 9V supply, with the red wire in my USB cable cut so that it only acts as a data cable; you've helped me realised it'll probably be fine without an external power supply, but i might keep it this way since I plan on adding at least one more sensor.


Thanks all the responses - much appreciated!
 
Back
Top