1. 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.
    Dismiss Notice

Logic Gate problems (AND 4081)

Discussion in 'General Electronics Chat' started by Maarten, Aug 7, 2017.

  1. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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..

    [​IMG]



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

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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?
     
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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
     
    • Like Like x 1
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland

    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
     
  6. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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
     
  7. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    Maarten,
    Have a look at this:

    Pull Up Down Resistors.png

    All about pull up and pull down resistors.

    JimB
     
  8. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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?
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,174
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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: Aug 7, 2017
  10. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    ONLINE
    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.
     
  11. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales
    It's only the unused input pins which need pull-ups/downs.
     
  12. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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?
    [​IMG]
    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!
     
  13. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    Have a good journey.

    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: Aug 8, 2017
    • Like Like x 1
  14. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    ONLINE
    The 5k resistor should be in series with the LED.
     
  15. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    Thanks I understood it. I will try it out now with different circuits..

    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..
     
  16. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales
    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.
     
  17. Maarten

    Maarten New Member

    Joined:
    Jun 7, 2017
    Messages:
    13
    Likes:
    0
    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?

    [​IMG]
     
  18. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales
    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.
     
  19. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    ONLINE
    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Ω
     
  20. ci139

    ci139 Active Member

    Joined:
    Apr 12, 2012
    Messages:
    388
    Likes:
    34
    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) . . .
     
  21. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,435
    Likes:
    933
    Location:
    Canada, of course!
    ONLINE
    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.
     

    Attached Files:

Share This Page