• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logic Gate problems (AND 4081)

Status
Not open for further replies.

Maarten

New Member
Hello,

I am a little stuck with the practic of these Logic Gates... I understand how the basic works.. And tried it on a program ( circuit wizzard ) but I guess it does differ a lot with the reality...

So basicly i firstly tried to make the first AND option work the pins 1/2/3 and it worked without a problem...
When I give volts to the 1 and 2 pin the 3 pin is a led and it works.. But then I went further on and wanted another led to bright from pin 4.. But I want the signal from pin 3 so I connect pin 3 to pin 5, and to pin 6. But the problem i am with already occured.. When I put a led in to the out pin 4 it already brightes a bit.. Then i took the Multimeter and there is on all pin around 0.9V ? So I think i have problems with the ground or something? Or do i need to add at some place a high resistor?

Should there be like 0v on the pins? Or is it me.. And when i do give power to the pin 5 and 6 then the leds works just a little bit more brighter..





As Source for both the LEDS, and Logic Gate itself i used a 7805.. And the ground is the same. This might the problem?
 

Maarten

New Member
The most weird thing about it all is.. That it does sometimes work, or sometimes when i touch it with my hand or something it does sometimes work... That's why i think its like a ground problem or something?
 

ericgibbs

Well-Known Member
Most Helpful Member
Hi M,
CMOS logic has a very high input impedance and the input/pin can assume either high or low state simply by introducing electrical noise from your finger.
Use pull up or pull down resistors on the input pins.

E
 

JimB

Super Moderator
Most Helpful Member
I agree with Eric.

It is a very bad idea to have input pins floating (ie not connected to anything) on a CMOS IC.

Use 10k resistors (exact value is not critical) to pull the input pins down to 0v or up to the supply voltage.
Then, when you want to change the state of an input, you can simply connect to 0v or the supply as required using a piece of wire.

JimB
 

Maarten

New Member
Hmm I think I understand. I did came across on the term of the pull up/ pull down resistor but didn't read it yet... Wanted to do this simple circuit first.. I am going to search about it.. I hope it will solve it... Thanks already
 

JimB

Super Moderator
Most Helpful Member
Maarten,
Have a look at this:

Pull Up Down Resistors.png

All about pull up and pull down resistors.

JimB
 

Maarten

New Member
But should we connect this pull up/down resistors to all the pins we are using?
Even the output pin? Or only when the output pins goes to another input pin?

@ the pull down-resistor.. Like if we want to turn it on we just give the 5v + to the same pin (2) right?
 

ericgibbs

Well-Known Member
Most Helpful Member
hi,
Connect all unused Input pins to either 0v or Vdd
Unconnected pins can be permanently damaged with a static discharge
E
Typo missed out Input, duh!
 
Last edited:

crutschow

Well-Known Member
Most Helpful Member
Attaching a LED at the output without a series resistor will also load the output and give a low output voltage.
The output has a limited current capability of about a half mA worst-case.
You should have at least a 5kΩ resistor in series with the LED.
 

alec_t

Well-Known Member
Most Helpful Member
It's only the unused input pins which need pull-ups/downs.
 

Maarten

New Member
hi,
Connect all unused pins to either 0v or Vdd
Unconnected pins can be permanently damaged with a static discharge
E
Attaching a LED at the output without a series resistor will also load the output and give a low output voltage.
The output has a limited current capability of about a half mA worst-case.
You should have at least a 5kΩ resistor in series with the LED.
It's only the unused input pins which need pull-ups/downs.
Okay. I am very happy with the answer but it gets a little confused this time...
What i just tested on my breadboard is this: Sorry I tried paint but it was awefull my drawing.. And can't take a pic.. The program doesn't desplay the whole thing and ofc 7 and 14 are Vcc/GND

This way i tested it and it worked... But after reading your comment i got confused maybe it worked but not on the good way? so I should of added the pin 11/12/13/ 8/9/10 to the GND? And to The leds i have i should connect 5K resistor?

And the last quote which i really didn't fully understand is that i shouldn't have connect any of those 10kResistors? and should have connected them to the 11/12/13/ 8/9/10 Pins?

BTW: This circuit didn't workout on the program... (i think because of the less volt going to 5/6? But on my board it worked.. )

Sorry Guys While you guys helping me I need to go, forgive me for that. i have a long travel to do. I'll check up tomorrow!
 

JimB

Super Moderator
Most Helpful Member
i have a long travel to do.
Have a good journey.

I'll check up tomorrow!
When you do, look at this:
Pull Up Down Resistors 2.png

JimB

EDIT
In view of the information provided by Crutschow in post ~#18, resistors R3 and R6 should be of higher value, ie not less than 5.9k for correct operation within the limits of the IC.
 
Last edited:

crutschow

Well-Known Member
Most Helpful Member

Maarten

New Member
Have a good journey.


When you do, look at this:
View attachment 107443

JimB
Thanks I understood it. I will try it out now with different circuits..

The 5k resistor should be in series with the LED.
I still didn't understand this one... The one Jimb just mentoined and said I should have it 1k? The r3 and r6?
What is the reason for it even to be 1k? at 5v? And why that one 5k? Was this because of the max output current ? so the Resistor will make the flowing currect lower?

I think wiring the output to a transistor will be the best option ? But I was just using LEDs for testing..
 

alec_t

Well-Known Member
Most Helpful Member
I think wiring the output to a transistor will be the best option ?
If you do that, don't forget to include a current-limiting resistor in series with the transistor base. The resistor value will depend on how much collector current the transistor passes.
 

Maarten

New Member
If you do that, don't forget to include a current-limiting resistor in series with the transistor base. The resistor value will depend on how much collector current the transistor passes.
So basicly with any load we put on the output pins, we should put an resistor on it based on the current the load used as example a LED/transistor?
Even if the flowing current is under the max currecnt of the out pin?

This is what I read on the datasheet
Must whe look at the Iok or Ii/o? or am I totally looking at the wrong place... Which both says it like only 10mA?
While if we take like the Bc337 as simple example when I open the datasheet says like this:
Base−Emitter On Voltage (IC = 300 mA, VCE = 1.0 V)
How should we chose the Value here?

 

alec_t

Well-Known Member
Most Helpful Member
So basicly with any load we put on the output pins, we should put an resistor on it based on the current the load used as example a LED/transistor? Even if the flowing current is under the max currecnt of the out pin?
From the datasheet, the maximum output current the gate can source or sink (Ii/o) is 10mA, subject to a maximum power dissipation of 100mW per output. At that current the output voltage won't be the normal logic high or low, because of voltage drop within the gate. But it's not usually a good idea to work to the device limits. If you restrict the output current to about 1mA then the output voltage will be close to the full logic levels. 1mA of base current in a BC337 should enable at least 100mA of collector current to flow.
 

crutschow

Well-Known Member
Most Helpful Member
So basicly with any load we put on the output pins, we should put an resistor on it based on the current the load used as example a LED/transistor?
Even if the flowing current is under the max currecnt of the out pin?
Yes, a resistor in series if you still want the proper logic levels to appear at the output.
Here's the part of the data sheet that pertains to the output current for a grounded load: upload_2017-8-8_8-18-59.png
upload_2017-8-8_8-17-34.png
You can see that at a 5V supply the highest worst-case current load you should have at 25°C, and still maintain a good logic level, is 0.51mA.
For an LED with a forward drop of 2V, this means you need a series resistor of no less than 3V/0.51mA = 5.9kΩ.
For a transistor with an input Vbe of 0.7V the resistor should be >4.3V/0.51mA = 8.4kΩ
 

ci139

Active Member
It is a very bad idea to have input pins floating (ie not connected to anything) on a CMOS IC.
if you don't connect TTL inputs they are automatically set as positive
if you don't connect CMOS inputs they very likely float near the threshold that also keeps the output switches both open since their R.DS.ON-s at 5 V Vcc are apx. 300 ohm and (P-MOS) 50 ohm (N-MOS) they may pass 5 / 350 = 14 mA if you have 10 gates floating it's 140mA e.c. -- otherwise - if your pulse fronts and trails are sharp (the time that both switches are simultaneously open) - the CMOS consumes only few µA (micro ampers) . . .
 

audioguru

Well-Known Member
Most Helpful Member
You show some of the pin numbers WRONG and you are trying to drive an LED and have a logic high voltage at the same time.
 

Attachments

Status
Not open for further replies.

EE World Online Articles

Loading
Top