How to use a 74HC4050N Level Shifter?

I have seen on a sketch something like this:

A 5V Arduino connected to a 3,3V RF module.

I understand this connection: RX -> 1Y, 1A -> TX
5V TX gets to 3,3V RX.

But I don't get this connection: TX -> 2A, 2Y -> RX
I mean the 3,3V TX from the RF module won't get shifted to 5V by the 74HC4050N, right? So what's the point of this connection?

Arduino will receive and interprete correctly 3.3V signal.

Did you connect GND as well? It should work.

mcufan:
Arduino will receive and interprete correctly 3.3V signal.

I know that the Arduino works perfectly well with 3,3V signals. That's why I don't understand the sketch.

Point is: I don't think the 74HC4050N works the way the creator of this sketch thinks it works (TX -> 2A, 2Y -> RX). What do you think?

Where you placed 74HC4050? Breadboard? Check first breadboard lines are correct.
Breadboard is often problematic, easily break connectors and similar.
Be sure you use header for IC to get reliable connections when push it down.
If not, you risk to break some pins of the IC when push it directly on breadboard.

Check jumper wires are conductive.

The schematic is perfectly correct. I would just additionally ground all unused input pins of it (xA) to avoid any possible source of problem...

You do not have to wire TX of the module to the RX of the arduino through IC, but this is good protection measure.

I mean the 3,3V TX from the RF module won't get shifted to 5V by the 74HC4050N, right? So what's the point of this connection?

You are quite right it is a totally useless circuit designed by an idiot.

It will not protect the 3v3 system.

How would I make a I2C connection between one system running 5V and one running 3V3?
5V SDA <-> 3V3 SDA
5V SCL <-> 3V3 SCL

How can this be done?

Use a part like an I2C level converter:

Another way is to turn off the Internal pullup resistors in the Uno after starting Wire:

Wire.begin();
digitalWrite (A4, LOW); // turn off internal pullup
digitalWrite (A5, LOW); // turn off internal pullup

and then add 2.7K pullups to 3.3V on SCL & SDA

On the Mega, the pullups to 5V are part of 8-pin package RN1, so you'd have to remove it. It's a 4 resistor package, the other 2 resistors are not used according to the R3 schematic.

Thanks CrossRoads.

I just stumbled upon "... Connecting the 5V Arduino directly to a single 3.3V-powered I2C chip usually works, even though it violates official specifications in multiple ways. In practice, Arduino's internal pullups are so weak that ESD protection diodes inside the 3.3V chip limit the voltage."
(from Arduino Playground - HomePage)

But since I have an Uno I will do as you said (turn off internal pullups).

P.S.
I'm seriously thinking about converting my Uno to 3,3V, since all modules I'm talking to are 3,3V.

Just use 4k7 pullups to 3.3V, forget about the internal pullups they are far weaker
than the external pullups.

Grumpy_Mike:
You are quite right it is a totally useless circuit designed by an idiot.

It will not protect the 3v3 system.

  1. Explain how shown simplified connections "will not protect the 3v3 system". It generally missed few bypass caps and looking in datasheet for allowed maximum current for the BT module pins and possible ESD protection.

  2. If the datasheet of the IC is "incorrect", what for the 74HC4050 is designed?

  3. How would you design OPs BT module using 74HC4050 with your expertise and academical degree?

  4. What IC to use "properly" for UART signal level-shifting between 3.3V and 5V within OPs requirements?

  5. If you hold PhD in electronic and ready to insult people (without reaction of moderators), would you call designer of this board using 74HC4050 for an "idiot":
    https://www.sparkfun.com/products/11018

  6. If you hold PhD in electronic, why spend your valuable time on this forum answering on questions way under your academical level?

All upper is rather rhetorical...

So if it is rhetorical then it does not need an answer and I would suggest that you go and do some learning about what an analogue data selector actually does.

I thought that it was just a hex buffer, but NXP states:
The 74HC4050 is a hex buffer with over-voltage tolerant inputs. Inputs are overvoltage tolerant to 15 V which enables the device to be used in HIGH-to-LOW level shifting applications.

http://www.nxp.com/products/logic/level_shifters_translators/series/74HC4050.html

Yes, and this is why I understand the two connections RX -> 1Y and 1A -> TX (HIGH-to-LOW level shifting) in the sketch - but not the two connections TX -> 2A and 2Y -> RX (because this would mean LOW-to-HIGH level shifting as well).

The output of a "3V" device can (or may or should) go directly to an Arduino "5V" input.
An Arduino "5V" output should not go directly to a "3V" input, there should be a "level shift" stage between the two. (Caveat - If the "3V" device has "over-voltage tolerant inputs", then such is unnecessary.)

With a 3V Vcc, the 74HC4050 provides no "low to high level shifting".

Maybe someone will get upset my saying so, it's inevitable, but I'd have a small-value resistance (33-100ohms) between a 5V output and a 3V input ("over-voltage tolerant" notwithstanding.)

Zealot:
Yes, and this is why I understand the two connections RX -> 1Y and 1A -> TX (HIGH-to-LOW level shifting) in the sketch - but not the two connections TX -> 2A and 2Y -> RX (because this would mean LOW-to-HIGH level shifting as well).

It means only that will send received signal from the BT board through 74HC4050 input pin and get the VCC or 0 voltage at output - to arduino's RX pin, nothing else. It does not do LOW-TO-HIGH conversion as cannot rise from VCC voltage to higer, in this case from 3.3V to 5V. That why it is called HIGH-TO-LOW level shifter.

That have nothing to do with input signals voltage of receiving around 3.3V and sending to 5V device RX input! Well, just look the datasheet and given ranges for input and output signals depending on VCC, as well as propagation delays. Arduino at 5V power supply will perfectly fine interpret 3.3V as HIGH.

Look at some LOW-TO-HIGH IC datasheet:

http://www.st.com/web/en/resource/technical/document/datasheet/CD00000359.pdf

If you want real HIGH-to-LOW and LOW-TO-HIGH IC, search for one or use both of upper IC families.

3.3V does take Arduino pins HIGH.

The only pins that need leveling are the 5V outputs. They connect to the A pins and the lower 3.3V comes out of the Y pins.