My CD4050 is leaking voltage. User error?

Thread Starter

colinta

Joined Jun 25, 2014
11
I've taken a stab at getting some insight in the electronics stack exchange, and that led me to eventually order some fresh CD4050 chips, thinking that the batch I ordered off eBay were either broken or mislabeled. Here's the original post: http://electronics.stackexchange.com/questions/141830/cd4050-voltage-leaks-what-can-i-be-doing-wrong

The new batch behaves identically. So now I'm thinking that surely I must be in the wrong here. These are CMOS 4050's, specifically one batch of CD4050B and another of CD4050BE.

I want to use them to control a Nokia 5110 LCD (the PCD8544 controller). This controller is 3.3V logic, and I'm using a good ol' Arduino Uno, so a 5->3.3V logic level converter is necessary. Adafruit's tutorial recommends using a CD4050 hex buffer. I read the datasheet, which explicitly advertises it as a logic level converter (from high-to-low only of course).

The tutorial worked fine for me, but the screen was really faint, like it wasn't getting enough power. I plugged the voltmeter into my 3.3V rail... and it read 4.2V! :-/

This lead me on a circuitous journey that I won't share here, suffice to say I ended up with a really simple circuit, meant to test the CD4050.

1. LM7805 V-regulator (powered via 5V wall-wart) into one side of the breadboard (my 5V rail), and from there into Vin on the Arduino. (I also experimented with disconnecting the V-reg and powering via USB)
2. 3.3V from the Arduino board into the other rail, so I've got 5V on one side of the breadboard, 3.3V on the other.
3. Power the CD4050 from 3.3V
4. Plugin the Voltmeter into ground and the Vcc of the chip. Reads 3.3V (looking at it now: 3.28V)
5. Insert a resistor from output 1 (pin 2) into ground, and input into the 5V rail. All other inputs and outputs are grounded.
6. Voltmeter reads 4.2V. This is the WTF!? moment.
7. Disconnect power - voltmeter still reads 4.2V. More cursing ensues.

It's these moments when I really wish I had a mentor. Anyone know of a good electronics club in Denver, CO? Thanks for any help, and ask away! Tonight I'm going to be experimenting again with this.

Should I order a 74HC4050? I see those mentioned a lot, but I don't see any reason why these 4050s I have already should be misbehaving, unless all 22 of them are junk (first order had 10, second order had 12).
 

crutschow

Joined Mar 14, 2008
34,281
Just a small cockpit error. ;) You can't apply 5V to the input of a CD4050 (or most CMOS devices) when powered from a 3.3V supply. There is an input protection diode from the input to the supply rail that will conduct when the input is more that about 0.7V above the rail. Thus the 5V is being conducted to the 3.3V rail with a one-diode drop giving the 4.2V you measured.

I remember first experiencing this when I found that my CMOS circuit would operate when I fed a input signal from a pulse generate even though the power supply was off(!). It turned out the pulse generator low impedance output was supplying current to the power rail through the input diode, and that charged up the filter capacitors enough to operate the circuit.
 

#12

Joined Nov 30, 2010
18,224
So, the cure is:
a) don't apply 5 volts to an input
b) use a current limiting resistor and let the internal diode from input to Vcc leak some microamps into the 3.3 volt supply.

and...ronv beat me to the answer.
 

Papabravo

Joined Feb 24, 2006
21,159
The CD4050 is nearly 45 years old. There are more modern parts that will do what you want without the side effects. That is they will run from a 3.3V supply and have 5V tolerant inputs. If you select the right parts they will also work the other way by shifting 3.3V back upto to 5V. Using this part is in the same category as using a 741 opamp. Why would you do such a thing?
 

Thread Starter

colinta

Joined Jun 25, 2014
11
I'll try the resistor again tonight, that was recommended on the stack exchange forum, and I did try it, but without success... won't hurt to try again, though!

So I can't hook up a 5V input, that seems to go against what I'm reading in lots of places:

- the Adafruit tutorial uses a CD4050: https://learn.adafruit.com/nokia-5110-3310-monochrome-lcd/wiring
- tons of other blogs mention it, e.g.: https://developer.mbed.org/users/oliverb/notebook/level-shiftingtranslation/

Is there anything special about the 74HC variant that would allow it to accept >3.3V on the inputs? How/Why are so many people using this (successfully, I assume) to do 5v->3.3 conversion?
 

Thread Starter

colinta

Joined Jun 25, 2014
11
The CD4050 is nearly 45 years old. There are more modern parts that will do what you want without the side effects. That is they will run from a 3.3V supply and have 5V tolerant inputs. If you select the right parts they will also work the other way by shifting 3.3V back upto to 5V. Using this part is in the same category as using a 741 opamp. Why would you do such a thing?
Haha yes that's true, and I've already got a bi-directional converter based on the BSS138, and it works like a dream. So really I'm just trying to use this as a learning opportunity at this point. What would you recommend for this application, though?
 

Thread Starter

colinta

Joined Jun 25, 2014
11
I recommend the LVCMOS with TTL thresholds. I've mentioned these chips in previous posts.

http://www.onsemi.com/pub/Collateral/MC74VHC1GT50-D.PDF
I noticed that this datasheet also mentions the "TTL-compatible inputs", which I have heard mentioned in the same breath as the 74HC4050. I keep going back to wondering why the datasheet for the CD4050 and the 74HC4050 both mention this ability to handle overvoltages on the inputs. I mentioned here that voltage is being leaked into the Vcc pin, but if my memory serves (I'll check this tonight), it is also affecting the output pins.

from 74HC4050 datasheet http://www.nxp.com/documents/data_sheet/74HC4050.pdf:
Inputs are overvoltage tolerant to 15 V which enables the device to be used in HIGH-to-LOW level shifting applications.​

from CD4050B datasheet http://www.ti.com/lit/ds/symlink/cd4050b.pdf:
The input-signal high level (VIH) can exceed the VCC supply voltage when these devices are used for logic-level conversions.​
 

Papabravo

Joined Feb 24, 2006
21,159
The phrase "TTL-compatible inputs" refers to Vih and Vil. Those voltages define for a part the input-high voltage and the input low voltage. For a CMOS part the single threshold is normally Vcc/2
The HC series normally has a threshold at Vcc/2
The HCT series normally has TTL thresholds of [0.8, 2.0] volts
When looking at a spec be sure you understand what Vcc they are talking about. For example look at Table 9 in the 74HC4050 spec and notice that the actual thresholds depend on Vcc!
 

Thread Starter

colinta

Joined Jun 25, 2014
11
When looking at a spec be sure you understand what Vcc they are talking about. For example look at Table 9 in the 74HC4050 spec and notice that the actual thresholds depend on Vcc!
This is what I've been scratching my head at: this table doesn't specify a max threshold for the Vih, only the min.

I take this to mean that at 3.3V (about halfway between the listed values of 2V and 4.5V) I should expect the Vih threshold to be ~2.3V. But no upper bound on Vih, so I shouldn't be afraid of sending it 5V, 10V, up to the device maximum of 15V.

The datasheet for the CD4050 that I have (the 2nd link above) includes a diagram for the exact application I'm going for. In this case they are lowering 10V to 5V, and inverting using the 4049, but it's the same idea:

Screen Shot 2014-12-23 at 2.45.15 PM.png

So in this case, what everyone is saying here lines up perfectly with what I'm observing, but the datasheets are telling me that I should be observing 3.3V on the output.
 

crutschow

Joined Mar 14, 2008
34,281
The CMOS output high voltage equals the supply voltage (with no load). So if the supply is 3.3V the output high will be 3.3V and if the supply is 5V the output high will be 5V.
 

Thread Starter

colinta

Joined Jun 25, 2014
11
The CMOS output high voltage equals the supply voltage (with no load). So if the supply is 3.3V the output high will be 3.3V and if the supply is 5V the output high will be 5V.
Thanks again for helping me out. So do you think my chips are hosed? Again, my setup:

- supply is 3.3V (pin 1, Vcc), coming from the 3.3V pin on the Arduino
- input is 5V (pin 3), coming from a digital-output pin on the Arduino
- output (pin 2) on the 4050 should be 3.3V

Instead, I'm reading 4.2V on the output pin and supply... so is the takeaway that these chips I have are fakes/broken/useless?
 

crutschow

Joined Mar 14, 2008
34,281
.......................
- supply is 3.3V (pin 1, Vcc), coming from the 3.3V pin on the Arduino
- input is 5V (pin 3), coming from a digital-output pin on the Arduino
- output (pin 2) on the 4050 should be 3.3V

Instead, I'm reading 4.2V on the output pin and supply... so is the takeaway that these chips I have are fakes/broken/useless?
As I stated in post #2, the 5V input is charging the supply up to 4.2V through the input internal protection diode. Did you not understand that? :confused:

Your chips are likely fine.
 

Thread Starter

colinta

Joined Jun 25, 2014
11
Especially note Figure 4 in Ron's referenced article. It should help explain what I'm referring to in my previous posts.
Right, but don't the 4050 and 4049 have an input stage that is designed to inputs higher than the supply voltage (and includes a series resistor):

Screen Shot 2014-12-24 at 5.54.20 AM.png

The input stage in figure 4 doesn't have this same configuration.

The datasheet for the CD4050 says explicitly that it can function as a "CMOS to DTL/TTL Hex Converter" (in "Applications", page 1 of the datasheet), and they show an example where the input is much higher than the supply, no current-limiting resistor, and the output is the desired lower-voltage signal (the image I included previously is from the same datasheet). The Adafruit tutorial that uses the 4050 that started me on this journey also doesn't use current-limiting resistors, and I've seen other people using the 4050 in the same way. This is the crux of my confusion. I seem to be using this chip as it was designed, and yet what I'm observing is in line with what people here are telling me about CMOS chips in general.

Let me phrase my question this way:
How do I reconcile the datasheets with what I'm observing?

Last night I tried using a resistor in front of the input, on ronv's recommendation, and that does keep the voltage on the inputs and supply down to 3.3V. So that's a great solution to my problem, but I'd still like to know why the datasheet and so many other resources are reporting different results.
 
Top