Go Down

Topic: What level shifter is that "CJMCU"? (Read 127 times) previous topic - next topic

falexandru

Apr 16, 2018, 07:29 pm Last Edit: Apr 16, 2018, 07:34 pm by falexandru
I am working on mounting my BMP 280 on a level shifter to Arduino nano.

The Level shifter low is 1.08 V instead of 3.3. V (measured).

Before entering into details (post schematics, code), I am kindey asking you whether somebody knows what type of level shifter is this one:

https://www.optimusdigital.ro/ro/interfata-convertoare-de-niveluri/182-translator-de-nivel-bidirectional-cu-2-canale.html

By googling it I found the following item, which seems the same:

https://alexnld.com/product/10pcs-two-channel-iic-i2c-logic-level-converter-bi-directional-module/

It is explained how to wire it but the photos do no match the description (Pins are differently named).

OK, is a Chinese woogie-boogie, but shall be documented anyway.

From the datasheet I can first figure out whether this is a real I2C as claimed. Thank you very much!


falexandru

Late Edit: or please point me to a clear tutorial or pinout scheme. The one I found on YouTube are of poor video quality and horribly explained.Thank you very much!

Koepel

#2
Apr 16, 2018, 08:39 pm Last Edit: Apr 16, 2018, 08:41 pm by Koepel
It is a clone of the retired Sparkfun RX-TX level converter: https://learn.sparkfun.com/tutorials/retired---using-the-logic-level-converter.
For a picture with I2C, scroll down to: "Using the LLC for I2C".

You can use it for I2C, but don't use the voltage dividers, only the channels with the mosfet.

On the photos, the left side is the HV 5V side for all signals, and the right side is the LV 3.3V side for all signals.

HV = High Voltage, connect to the Arduino 5V pin.
LV = Low Voltage, connect to the Arduino 3.3V pin. It is not an output, you need to apply 3.3V to it.
Both GND are the same, connect to Arduino GND and sensor GND.

Ignore all RX pins, don't use them.
Now you have to channels for level converting, the one at the top and the one at the bottom. Use those for SDA and SCL.


falexandru

@Koepel Thank you very much! You save me a lot of time!

[This shifter is a therefore 1 channel one and not a 2 channels one, aka it can only command one sensor mounted on I2C. Very misleading name: one wire I2C does not make any sense, it shall be at least "one pair of channels" or similar, in my opinion.]

I dare to stress again that you helped me very much.


+++
I hope I can power the shifter from my Arduino Nano. The Nano description said that the 3.3 V output is not available when powered on sources other than on USB. However, I measured the 3.3. V of the Nano (powered via 5V - regulated) and it does output 3.3 V (3.43 V to be precise).


Koepel

#4
Apr 16, 2018, 09:15 pm Last Edit: Apr 16, 2018, 09:17 pm by Koepel
The 3.43 is okay. There are many Nano clones with different schematics and the original Arduino Nano has been changed as well. The latest schematic of the official Arduino Nano shows that the FTDI chip is powered from the 5V and not from the USB as it was in the past.

There is no 3.3V voltage regulator, but the usb-serial chip (either the FTDI chip or a CH340G on clones) generates 3.3V.

falexandru

I re-read the text you reccomended. I guess I was wrong in my previous post, when I said that only one device an be commanded.

The level shifter mounted on I2C works on the 2 wires of the single I2C, and since he slaves are indentified by their unique addresses, like in the case without shifter, they can share the same I2C. So no need for more channels in the case of I2C. Assuming the shifter can handle the current of 2 or even three sensors (in my case).

I am very interested in this shifter because it is cheap. Burning 1-3 bucks ("for a buck")is one thing, and burning 20 - another thing.

There are other shifters "on 8 bits" - whatever that means and  4 channels ones (which I imagine are designed  for digital pins). All cost 3-4 times more than this one.

Koepel

With a I2C level shifter, you have a 5V I2C bus and a 3.3V I2C.
You can connect 5V I2C devices to the 5V I2C bus.
You can connect 3.3V I2C devices to the 3.3V I2C bus.

Keep in mind that when an Arduino or a sensor pulls the SDA low, it has to pull both the 5V and 3.3V of the SDA low with all the pullup resistors on both sides.

Maybe I wrote this before, but I prefer the small modules with voltage regulator since the Pro Micro board has no 3.3V: https://www.aliexpress.com/item/Free-Shipping-5pcs-lot-5V-3V-IIC-UART-SPI-Four-Channel-Level-Converter-Module-for/1759225984.html.

falexandru

Mine looks identical to the one in your link. Then I assume it regulates the 3.3 v. I saw in the schematics that my shifter uses BSS 138 MOSFETs, but I cant figure out how they regulates 3.3. V.

 

falexandru

I found this explanation about logical converters:

http://www.hobbytronics.co.uk/mosfet-voltage-level-converter

If I get it right, one can rely on 5V alone to supply 3.3V to the 3.3 V side. But I cant understand how it works and whether I can use my module to achieve that. Indeed, my Arduino nano(CH340) offers that 3.3 V supply when powered via 5V in from a breadboard power supply. 

Koepel

A voltage regulator is the SMD component with 5 pins.
A single mosfet has three pins, but sometimes a few mosfets are in a single SMD chip.

If you don't have a voltage regulator on the level shifter, you must apply both 5V and 3.3V to the module, or the level shifter won't work.

Your question was about the level shifter that you showed in the link. That is a different level shifter than the ones that I prefer.
I'm confused. You could make a photo of your level shifter with the wiring.

Go Up