What don't I understand about the operation of a CD4051 chip and supply voltage? - Page 1
Forum section: electronics / beginners

author: silicon_ghost
author_rank: Contributor
timestamp: August 05, 2012, 07:16:43 pm
content: Or perhaps I just have made a boneheaded electrical mistake? I tried to create a diagram in Fritzing but that got difficult with the extreme lack of parts in the palette but I did attach a crude example of my Arduino tied to the 4051 and a generic voltage regulator. I did succeed in drawing a simplified EagleCAD version of the voltage reference circuit and how I connected it to the CD4051 chip.Goal:I wanted a battery powered circuit that could deliver ten voltages from a relatively precise 5V or 3V regulator. This was a prelude to working with using a 4051 for multiplexed sensor inputs. I wanted to characterize any distortions introduced by putting the 4051 into my circuit.I built up a 10 step voltage divider circuit with the following parts:10 sorted/binned 220 Ohm metal film resistors (total spread of 0.8 Ohms after binning)9V battery source with switch9V feeds through a schottky diode (reverse polarity protection due to bare wire connectors on board)...feeds through an LM7806 voltage regulator (this was a hack to fix Vin limits on my MCP1700 LDO voltage regulators)LM7806 Vout feeds to MCP1700-50 (5.0 volt) and MCP1700-30 (3.0 volt) regulators. They have quiescent current in uA range so I don't care both are active all the time.A SPDT switch selects whether 5 V or 3V is sent to voltage divderI routed 8 of the outputs to a 4051 hooked up to my Arduino Uno. The grounds of the battery powered circuit are tied to the Arduino's ground. Output of the MCP1700 was connected to Arduino AREF pin and set EXTERNAL reference in my code. Here's where it gets weird. Per the Arduino example for using a 4051 (seehttp://www.arduino.cc/playground/Learning/4051), I tied Vee, Vss, and INH to ground. Vdd was connected to 5V supply from Arduino. The Arduino code saw ~2.8V after conversion. If I unplugged the Arduino from USB port (i.e. it should have powered down), the power light stayed on. 2.8V were backfeeding through the 4051 Vdd pin into the Arduino 5V pin.I started probing with my scope while the Arduino provided the 5 V Vdd and and clearly saw on Xout the 0V, 5V and half-volt steps as the Arduino cycled channel select pins A, B, C. The steps were clean with no ringing or unstable values. The Arduino continued to see ~2.8V on A0 regardless of which 4051 channel was selected. When I switched to the MCP1700-30, the Arduino worked as expected, showing at most 2 LSB from expected values.I checked and rechecked my circuit layout and probed the voltage reference board (no problems) and the voltage reference board connected to 4051 but not to Arduino. If I left every pin connected from the voltage reference board to the 4051 (including ground) but left Vdd floating, I saw that same 2.7 - 2.8 V value on the Vdd pin.Questions:What is the real relationship between Vdd, Vee and Vss on the 4051? This is my noobness showing through.Is the Arduino Playground linked article correct in tying Vee and Vss to Gnd for 3V and 5V signals?How does voltage on a channel bleed back to Vdd?How does one supply Vdd = 5V to a CD4051 if I'm connecting it to an Arduino? I assumed that simply tying my Arduino, CD4051 and voltage reference (since it is battery powered) grounds together should have not caused any power issues.

author: SeanB
author_rank: Super Contributor
timestamp: August 05, 2012, 07:32:00 pm
content: Feed the 4051 from the 5V rail. Decouple the rail to the chip with a 10R resistor and a 100uF capacitor. Then check you can read the values correctly. If you feed the 4051 from the USB bus it will feed voltage back via all the inpiut protection diodes, the highest voltage winning.Vee and Vss are for the switches and logic respectively. Vss is used by the logic as the low reference point, then the control signals are shifted internally to operate the switches. I would recommend using the 74HC4051 as it is optimised for a single 5v rail, the CD part works best with +-15V supplies. it then is not TTL compatible, but needs a 4050 as a level shifter.

author: silicon_ghost
author_rank: Contributor
timestamp: August 07, 2012, 11:13:37 pm
content: Quote from: SeanB on August 05, 2012, 07:32:00 pmWhen you say 5V rail, you are referring to the output of the MCP1700-50 as opposed to the 5V rail available on the Arduino?Quote from: SeanB on August 05, 2012, 07:32:00 pmI did order some 74HC5041 chips from DigiKey. I'm confused as to why it is not TTL compatible. Looking at the datasheet I see that Vcc is rated for 2 to 6 V, Vee includes 0 V and Vis is Vee to Vcc. I snipped part of the TI datasheet here. I apparently need you to apply a sledgehammer to my brain.Let me ask perhaps a "forest for the trees" question: If I wanted to accurately (as in minimizing DC distortion) mux 8 analog values into an Atmel chip with either 5V or 3.3V logic, what chips would be recommended?

author: free_electron
author_rank: Super Contributor
timestamp: August 08, 2012, 12:38:09 am
content: really good analog multiplexers are the DG4xx series rom fairchild ( actually siliconix but they were bought by fairchild )but the 4051 should do the trick too.

author: SeanB
author_rank: Super Contributor
timestamp: August 08, 2012, 04:25:39 am
content: Feed it from the 5V rail you make yourself. The 5V from the USB can be too low, and will probably account for the strange behaviour you see.The CD4051 is ttl compatible at 5V, but only just so, most will work but with a 3.3V micro as switching source they are marginal. The 74HC are designed to work off a 5V rail and should be able to switch with 3.3v cmos as inputs as the high can go above the threshold value. If you have LED's to show state directly on the micro output then all bets are off.As FE says the 4051 is a good analogue switch, but there are better available. The 4051 works, but the distortion can be high, and the on resistance does vary considerably in the switch as you traverse from one rail to the other, so it should not be used to drive a low impedance load, preferably one above 100k.