Go Down

Topic: level shifting using CD4050BE (Read 11813 times) previous topic - next topic

wothke

I am using a 5V ProMini with a 3.3V transceiver (that I supply using an additional DC/DC converter).


So far I have been using two separate 4-channel level-shifter PCBs to interface the 5 needed Arduino I/O pins to the transceiver. This works fine.


Meanwhile I'd come across the suggestion to instead use one CD4050BE chip to handle the level-shifting - which would make for a simpler/cheaper circuit.

However I am not sure if the CD4050BE would really perform the bi-directional signal conversion that I need (I have not much of an electronics background and I might have missed that information in the datasheet). I noticed that the CD4050BE does not use two reference voltages (unlike the original level-shifter PCBs) - so while the IC would know how to shift an incoming 5V Arduino signal to the 3.3V reference voltage I wonder what will happen to the 3.3V signals from the transceiver - these should ideally be shifted to the 5V expected by the Arduino (but the CD4050BE will not know that 5V is expected).

Any experiences / thoughts?

OldSteve

#1
Apr 22, 2016, 02:18 pm Last Edit: Apr 23, 2016, 01:32 am by OldSteve
A 5V Arduino (ATMega328P) will see 3.3V as a high, in fact anything from Vcc x 0.6, (3.0V), up is considered high, so level shifting from 3.3V to 5V isn't absolutely necessary.

Edit: It's still needed in the other direction though. (I just went into more detail in reply #5.)
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

strykeroz

A 5V Arduino (ATMega328P) will see 3.3V as a high, in fact anything from Vcc x 0.6, (3.0V), up is considered high, so level shifting from 3.3V to 5V isn't absolutely necessary.
Depending on if the other device is 5V tollerant, might it make sense to use one for translating the Arduino's high to a safe level for it though?
"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield

CrossRoads

Use cd74HC4050 powered from 3.3V to go from 5V to 3.3C, cd74HC125 powered from 5V to go from 3.3V to 5V.
Plus with 74CH125, can disable its outputs, like MISO from SD card to keep it off the bus so other 5V devices do not have their outputs dragged down.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paul__B

This discussion has taken a bad turn!

I am using a 5V ProMini with a 3.3V transceiver (that I supply using an additional DC/DC converter).

So far I have been using two separate 4-channel level-shifter PCBs to interface the 5 needed Arduino I/O pins to the transceiver. This works fine.
So the very first question is - just what is this "transceiver"?  All meaningful advice is dependent on this detail.

Let's have the Web link for it unless it is a commonly discussed part which you forgot to name.

Meanwhile I'd come across the suggestion to instead use one CD4050BE chip to handle the level-shifting - which would make for a simpler/cheaper circuit.
I rather doubt that.  If the level shifter modules are the ones I think they are, they are dirt cheap and eminently easy to use.

However I am not sure if the CD4050BE would really perform the bi-directional signal conversion that I need
No, it will not perform bidirectional level shifting that the above modules will - but without revealing your actual application, we do not know whether the bidirectional function is even necessary.

OldSteve

#5
Apr 23, 2016, 01:27 am Last Edit: Apr 23, 2016, 01:33 am by OldSteve
Depending on if the other device is 5V tollerant, might it make sense to use one for translating the Arduino's high to a safe level for it though?
I meant that the level shifting wasn't necessary for the 3.3V to 5V side. I didn't mean to do away with it altogether, but that it only needs to be used for the 5V to 3.3V connections, by powering the CD4050BE with 3.3V and applying the Arduino's 5V signals to the inputs.
Edit: I just edited my earlier reply to clarify this point. :)


Quote from: CrossRoads
Use cd74HC4050 powered from 3.3V to go from 5V to 3.3C,
The 74HC4050 can be harder to get hold of, whereas the CD4050B is very common and easy to get. As long as it's a CD4050B and not just a plain CD4050 there isn't a problem. The "B" version has been in production for decades now, so I doubt if anyone could still get their hands on the earlier one anyway.
The difference is that the early one had a simple diode from the input to Vdd, so the input couldn't exceed Vdd by more than about 0.5V, but the "B" version uses a 30V protection diode on the input, eliminating the problem.

And as long as the 3.3V is really 3.3V, a level shift in the other direction isn't absolutely necessary, since that's 0.3V higher than the level detected as a HIGH by an ATMega328P.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

OldSteve

#7
Apr 23, 2016, 04:16 am Last Edit: Apr 23, 2016, 04:17 am by OldSteve
cd74HC4050 hard to get a hold of? Hardly.
http://www.digikey.com/product-search/en/integrated-circuits-ics/logic-buffers-drivers-receivers-transceivers/2556308?k=cd74hc4050&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25
The two common hobbyist electronics suppliers here in Australia, (and New Zealand), are Jaycar and Altronics, neither of which carries the 74HC4050. (Jaycar are located in many suburbs and all major cities, so their parts don't need to be ordered online and can be procured in a matter of minutes without waiting.)
Also, not everyone knows of the existence of the suppliers that do carry the harder to get parts.
The CD4050B is every bit as good for the purpose.

And I said "harder", not "hard", meaning harder to get than a CD4050B. (Which is true here.)
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

wothke

#8
Apr 25, 2016, 03:28 am Last Edit: Jul 01, 2016, 07:09 pm by wothke
This discussion has taken a bad turn!
So the very first question is - just what is this "transceiver"?  All meaningful advice is dependent on this detail.

Let's have the Web link for it unless it is a commonly discussed part which you forgot to name.
I rather doubt that.  If the level shifter modules are the ones I think they are, they are dirt cheap and eminently easy to use.
No, it will not perform bidirectional level shifting that the above modules will - but without revealing your actual application, we do not know whether the bidirectional function is even necessary.

Here some added info: The transceiver that I am using is a SI4432 based one like this one: http://www.aliexpress.com/item/2pcs-SI4432-1000m-Wireless-Module-470Mhz-433mhz-915MHZ-SI4432-B1-FMR/32367586737.html (i.e. it does not tolerate more than 3v3).

The level-shifters that I have been using so far are very similar to the ones you depicted. I bought them for about 30cents apiece - and I need two of them to handle the 5 pins (while a CD4050B costs me about 17cents and I only need one) - so with the suppliers available to me (i.e. AliExpress) the CD4050B approach would be cheaper. Also I already managed to fry some of the level-shifters and I find it much more convenient to just plug in a replacement IC rather than having to first solder the bloody pin headers on.. finally the CD4050B is more compact and I can place it below my DC/DC converter PCB - which potentially allows me to fit everything into a smaller/less expensive box.

Paul__B

The level-shifters that I have been using so far are very similar to the ones you depicted. I bought them for about 30cents apiece - and I need two of them to handle the 5 pins
Well, there's the first blunder.

Studying the circuit you propose to use with the CD4050B demonstrates that you only ever need three level converter stages to begin with, so you only require one of the 4-way level converters above or two of the two-way.

so with the suppliers available to me (i.e. AliExpress) the CD4050B approach would be cheaper.
Well, that's OK.

Also I already managed to fry some of the level-shifters and I find it much more convenient to just plug in a replacement IC rather than having to first solder the bloody pin headers on.
Now we're talking - one just has to ask - how did you ever manage that?

raschemmel

#10
Apr 25, 2016, 05:18 am Last Edit: Aug 24, 2016, 04:23 pm by raschemmel
The CD4050BE is a level shifter (called a CMOS to TTL converter in the datasheet) . For those of you too young to know what TTL is , it is the industry standard name for 5V logic, based on the original forrunner of logic chips, Transistor Transistor Logic. Back in the day, before 7400 family ICs existed. 5V logic was done with discrete transistors. The 7400 family of ICs made the transistors obsolete because they were internal to the IC, which came in a user friendly form factor that could be plugged into sockets. Today, the name is still used to denote any 5V logic circuit as "TTL level" , whether it was MOS or whatever. You don't call chips "MOS level" if you're talking about 5V logic. Point is, the 4050 IS a 3.3v,12V or 15V CMOS to 5V TTL converter IC. It is 5V tolerant when powered off 3.3V and 12V or 15V tolerant when powered off 5V. The maximum supply voltage is 18V but the recommended voltage is 3 to 15V. The only drawback is that once you select the voltage you are going to use to power it, you can only convert levels in one direction.
Suppose you power it from 5V. That means you can convert from 3.3V to 5V , or 12V to 5V or 15V to 5V, but you can't convert back the other direction (5V to 12V etc). You have to get a second CD4050BE and power that from 12V, to convert from 5V to 12V. So if you are only converting one direction , you only need one IC . If you are converting in both directions , you need two ICs. Aside , from that, it is a very reliable chip and I use it whenever I need to do level convertion. The 74HC4050 is a one trick pony. It only converts from higher to 5V, with the exception of 3.3V. Point being, the 74HC4050 can't convert from 5V to 12V or 15V like the CD4050 can. That's why I like it so much. It can handle any situation (except bidirectional in the SAME IC). There's another chip called the 74LVC245 and 74LVCH245, both of which can only be powered from 3.3V to 5V so, depending on which way you need to convert, the voltage on the Vcc pin sets the output voltage and the inputs are 5V tolerant.

OldSteve

There's another chip called the 74LVC245 and 74LVCH245, both of which can only be powered from 3.3V to 5V so, depending on which way you need to convert, the voltage on the Vcc pin sets the output voltage and the inputs are 5V tolerant.
Another handy level shifter chip is the CD4504B. It's dual-supply with TTL/CMOS input select. I have a few sitting here, but don't use them very often.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

wothke

#12
Apr 25, 2016, 12:47 pm Last Edit: Apr 25, 2016, 03:09 pm by wothke
Now we're talking - one just has to ask - how did you ever manage that?

Edit: I guess the question is about my statement that I "..managed to fry some of the level-shifters.."

Quite frankly I have no idea what killed them, maybe some electrostatic discharge.

raschemmel

Manage what ,? (soldering the bloody connectors?)

wothke

#14
Apr 25, 2016, 03:21 pm Last Edit: Apr 25, 2016, 04:08 pm by wothke

Studying the circuit you propose to use with the CD4050B demonstrates that you only ever need three level converter stages to begin with, so you only require one of the 4-way level converters above or two of the two-way.
Actually I did not propose the design you are depicting here (I just asked a question :-) ). But thanks for the link and it seems that people are already using a configuration that would also help me. There is one thing that I do not understand in "your" above design and maybe some of the electronics savy people in here can fix my ignorance: Why is SDN connected through the level-shifter and instead of directly connecting it to GND and why is the CD4050BE grounded through the Si4432? (Why that funny chaining and why not connect GND/SDN of the Si4432 and VSS of the CD4050BE directly to GND of the Arduino?)

Go Up