Problems with using a 4049 Inverting Hex Buffer

Discussion in 'General Electronics Discussion' started by dkpinball, Apr 4, 2012.

1. dkpinball

5
0
Feb 28, 2012
I have this circuit built. Basically I am clamping on to a switch in an existing system as a signal to turn something, in this case an LED, on and off.

In this diagram, the microcontroller is the load. With the switch closed, it's almost a short so the led in the optocoupler turns off when the switch is closed and turns on when the switch is open.

The LED on the 12v line is on when the switch is open and off when the switch is closed.

I want the opposite effect. When the switch is closed, the LED goes on.

I figured using a 4049 inverting buffer would get me the desired effect. But when I built this circuit, the LED is on with the switch open or closed. I'm not sure what I have wrong here.

File size:
28.8 KB
Views:
996
2. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,448
2,809
Jan 21, 2010
You can't short out the power supply to turn off the LED.

Do it another way

3. dkpinball

5
0
Feb 28, 2012
Actually, I'm not shorting out the power supply. Really that portion of the circuit isn't what I'm asking about. Just focus on the 4049 inverting buffer. Does the circuit look correct? Currently mine will not invert. It's a constant high signal.

4. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,448
2,809
Jan 21, 2010
You don't give any values for the resistors.

Also if the same 5V is being shorted on the left as is being used on the right, I would not be surprised that odd things are happening.

Clearly the resistor R is required (as is R and R), but the one labelled R is superfluous.

I'm not sure I follow that, but I'll take your word for it.

5. gorgon

603
24
Jun 6, 2011
No it does not look correct!

Just for a starter, where is the signal high, input(pin3)?

You should add a series resistor between the output (pin2) and the base of the transistor (Q)
If you use 2k2 in series and 10k to pull down the base(R) you should be good.

As it is now, the output pin is shorted low by the transistors Vbe to around 0.7V, so the input and the output may look like both is low.

TOK

6. Harald KappModeratorModerator

10,771
2,427
Nov 17, 2011
1) If the microcontroller is the load AND the LED goes off when you press the button, then obviously something is wrong on the microcontroller side. A correctly wired microcontroller will draw a few mA when connected to power. This will not suffice to turn off the LED.
2) Observe gorgon's notes about the series resistor.
3) What is the value of the resistor at the CMOS gate's input (3). You do realize that the phototransistor will deliver only a few µA or mA, do you? The resistor must be big enough (in resistance not physically ) that a voltage drop of at least 3 V (better 4 V... 5V) can develop when the phototransistor is switched on.
4) You're wasting power by connecting the right LED to 12V. Why not use 5 V, too? This reduces the waste power in the LED's series resistor.

Harald