Maker Pro
Maker Pro

Problems with using a 4049 Inverting Hex Buffer

dkpinball

Feb 28, 2012
5
Joined
Feb 28, 2012
Messages
5
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.


attachment.php
 

Attachments

  • opto_inverted_circuit.jpg
    opto_inverted_circuit.jpg
    28.8 KB · Views: 998

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
You can't short out the power supply to turn off the LED.

Do it another way
 

dkpinball

Feb 28, 2012
5
Joined
Feb 28, 2012
Messages
5
You can't short out the power supply to turn off the LED.

Do it another way

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.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
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.

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.
I'm not sure I follow that, but I'll take your word for it.
 

gorgon

Jun 6, 2011
603
Joined
Jun 6, 2011
Messages
603
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.

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 ;)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
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
 
Top