I am trying to build three circuits, an AND, a OR and a NOT gate for a personal side project.

I think I have the logic part down right, i.e. using the following gate logic:


simulate this circuit – Schematic created using CircuitLab

I'm building this by connecting two switches and a led to a 4011 Integrated Circuit. I'm powering this with an Arduino (5V) or battery (6V).

Here is the newbie question. The behavior of the IC is ...inconsistent once I try to cross connect any pins In order to use more than one gate (e.g. to build the AND gate)

What resistors do I need to insert in this circuit to make it work properly? How do I calculate their value? Or is it simply a case that I can't use the IC like this?

  • 1
    \$\begingroup\$ You should be able to simply connect them as above - don't need resistors. Have you go plenty of decoupling capacitors? Also what frequency are you trying to run it all at? \$\endgroup\$ Commented Jul 26, 2015 at 17:24
  • \$\begingroup\$ Ah, no decoupling capacitors -- I didn't even know what they were until you mentioned them (I'm a complete newbie). The circuit is DC at the moment. If you could expand your comment in an answer I'd gladly accept it. \$\endgroup\$
    – Sklivvz
    Commented Jul 26, 2015 at 17:27
  • 1
    \$\begingroup\$ @Sklivvz Just an aside. I just looked at your site and the photos on them. On one of them there is a glimpse of the multimeter you are using. It seems one of those supermarket crappy 1MOhm input impedance DMM (I've got one of those and I use it only for very basic stuff, since it is so small). An advice for an EE newbie: if that is the only DMM you have, do yourself a favor and get a better one. You won't regret it when you'll begin troubleshooting a complex system or if you ever need to do measurement on something more high voltage. Relevant EEVBlog video. \$\endgroup\$ Commented Jul 26, 2015 at 17:50
  • \$\begingroup\$ @Sklivvz BTW, (+1) for "I have a plan" and associated A-Team photo! :-D Happy electronics hacking! \$\endgroup\$ Commented Jul 26, 2015 at 17:51

1 Answer 1


CMOS parts like the 4011 have a very high input impedance and will have a random value if left unconnected.

If you are connecting your switches between an input pin and the positive supply, you need a pull-down resistor (10K or so will do) to ensure that the input will be low when the switch is open. If your switches are between the input pin and ground, use a pull-up to the positive supply to make the inputs High when the switch is open.

Also, any unused inputs must be connected to either the positive supply or ground to ensure they don't sit at a "maybe" state and cause the input circuit of the gate to draw excessive current.

You don't need any resistors between the gates.

As one comment says, it is good practice to have 0.1 uF bypass capacitors between the power supply and ground at each IC - more important with flip-flops and other clocked logic than with simple gates, but it is good to get in the habit...


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.