Reducing current draw on using CMOS logic gates

i have been fiddling about with some CMOS logic gates using a 5V wall-wart (500mA) for the power supply.

i gave myself a bit of a shock (not electrical) when i tried to unplug the jumpers to the power rail and they were HOT ! (continuous 500 mA for about 5 minutes).

i guess i really don't need that 500 mA and perhaps 15 mA is more appropriate ? -cmiiw-

to do this, i should use a current-limiting resistor (in series b/n 5V plug and +V rail), right ?
ie. 5V and 330 Ohm resistor = 15 mA ?

then i got to thinking that the resistor will have to be better than 1/4 W rating, since the wall-wart is providing 2.5 W (5V x 500 mA).

and then i used P = I^2.R => and got I = SQRT(2.5 / 330) = 87 mA

so now i am confused - which is actually the current, and what fundamental electronic knowledge am i missing ?

CMOS logic circuits should not get hot. I'm sure there is something wrong in your connections or you use the chips outside their specs.

One fundamental missing is the specification of the power supply is not the specification of the requirement for the circuit. The former must be greater than or equal to the latter or there will not be enough power (current) for the circuit to work.

The second must be in your wiring. What all are you trying to do? Use one chip on a breadboard? It would begin to speculate the chip is toast (possibly ESD or incorrect wiring) and thus the excessive heat.

That sort of current consumption happens when you connect the power backwards to a CMOS
logic chip, or set a CMOS chip into latch-up.

If you want minimum current consumption with CMOS you need to connect every single unused input
pin to either gnd or Vcc, otherwise you can get a few mA wasted per input due to shoot-through.

If you do that, and your circuit is low speed, expect a few microamps consumption at worst (for
the logic chips themselves, that is).

Don't forget to use decoupling capacitors - that is never optional with logic chips, and make sure the
supply voltage is within spec for the actual logic family you are using (for instance 74HC is 2V to 6V,
74HCT is 5V only, CD4000 series is 3 to 15V, etc).

OK - i re-read THIS with more experience under my belt now...

the fundamental comprehension lacking was that; the Supply gives what is needed (within it's capacity) while the Device draws what is required.

so; yes - if it is getting hot - it's the Device that is drawing it - which indicates something not right.

when i said hot, i was referring to the actual metal pins on the jumpers that was connected to the power rail (as i was unplugging it, i actually touched the metal part) - although, perhaps there was also something not quite right with the circuit - some connection to the LEDs i think.

the chips themselves were not running hot.

what i'm doing is just a full adder with OR, NAND and 2xAND quad gates (4011, 4071, 4081)

so i guess there's really no problem - aside from the second full adder not functioning properly (for the 2nd-bit) - but that's a different issue of re-checking the wiring.

so the power supply remains as is.

Thanks all !

Where did the LEDs come from?

Then you have a high current draw on you power rails or a resistive connection. Dirty connections introduce resistance. Resistance causes a voltage drop. A voltage drop is power dissipated. Power is heat.

to do this, i should use a current-limiting resistor (in series b/n 5V plug and +V rail), right ?

No.

If the metal is getting hot then there is a bad connection and a lot of current. If you are lucky you just shorted the power supply, if not you blew the chips.

Grumpy_Mike:
If the metal is getting hot then there is a bad connection and a lot of current. If you are lucky you just shorted the power supply, if not you blew the chips.

i guess i was lucky, perhaps not totally shorted, but certainly drawing unnecessary current.

adwsystems:
Where did the LEDs come from?

Then you have a high current draw on you power rails or a resistive connection. Dirty connections introduce resistance. Resistance causes a voltage drop. A voltage drop is power dissipated. Power is heat.

the LEDs are to indicate the SUM from the Adder.

i also forgot to mention; to complete the full-adder, i used a "manual" OR gate, but tried two versions, one using transistors, with 680 Ohm resistors, and another "simpler" one with just diodes.

i am thinking it's this second OR gate that might be drawing unnecessary current ?

here's the circuit;

Sorry but you can’t tell much from that, it is quite a lot of a mess. When doing schematics of logic circuits you normally show the gates and any logic circuits as blocks with labled and numbered connections. The positioning of the connections on these blocks is done to minimise the number of wire crossing. What you have posted is just as useless as a Fritzing diagram.

The output LEDs do not show anything connecting to the cathodes, and what is that circle in the anodes denoting? Also you seem to hav no decoupling capacitors at all.

Basically I think you wired something wrong. I hope you are not doing any wiring with the power on.

Did you do it all at once and then applied the power? If so build up your circuit one part at a time and check it works before proceeding.

Grumpy_Mike:
Sorry but you can’t tell much from that, it is quite a lot of a mess.

yeah, i guess looking at it in one go and not having "stepped through it" is pointless.

it was more to do with keeping track of making the connections WHILE doing it, matching the colour-coding with the diagram below to show which OR goes to which NAND and then subsequently to an AND.

the chips themselves are actually symmetrical - each quad has the (two) inputs on the outside, and the output is in the middle (on the "inside" :stuck_out_tongue: !).

the top half is one full-adder, and the below is the other one, or rather, the one below (from pin 1 to 6 is for "bit 0" and the other side (top half) is for "bit 1" - making a 2-bit full adder.

Grumpy_Mike:
When doing schematics of logic circuits you normally show the gates and any logic circuits as blocks with labled and numbered connections. The positioning of the connections on these blocks is done to minimise the number of wire crossing. What you have posted is just as useless as a Fritzing diagram.

yeah, i guess it's not really a proper schematic diagram - but a physical circuit layout for doing the actual wiring.

infact using SCH-express, they showed the logic gates and not the DIP-14 layout, which i had to make myself for the above "diagram".

i guess the real schematic is actually the small diagram below.

Grumpy_Mike:
The output LEDs do not show anything connecting to the cathodes, and what is that circle in the anodes denoting? Also you seem to hav no decoupling capacitors at all.

the circle was in lieu of using yet another colour, so it was just to indicate which pin was for the 'SUM' output for the LED.

and i obviously got "tricked" by my own diagram, forgetting about the decoupling caps as well !
they're on now though... 0.1 uF for each chip, and another 10 uF on the power rail itself.

Grumpy_Mike:
Basically I think you wired something wrong. I hope you are not doing any wiring with the power on.

nope, it was a s l o w process over a few days (for each colour) to get each wire just the right length and to position it as tight as possible - it really looks quite nice if i may so myself !

Grumpy_Mike:
Did you do it all at once and then applied the power? If so build up your circuit one part at a time and check it works before proceeding.

i guess that would have been better, ensuring the logic is coherent before connecting it to the next one, but then i'd have to tie every unused input to GND and i didn't have that many free jumpers.

i've tested the outputs using an active buzzer (easier than an LED) but found that some outputs really had too small a current to even make the buzzer sound !

i really think the four quad-gates are fine and the issue is with the single OR gate(s) at the end, which is not using a chip but two transistors, or diodes for the other OR gate (2nd full-adder).

the issue is with the single OR gate(s) at the end

What is the value of R for that circuit. It is unlikely that your problem is there. To check just disconnect it.

the circle was in lieu of using yet another colour, so it was just to indicate which pin was for the 'SUM' output for the LED.

So not a resistor then?

I would draw a circuit like this:-

Then I would add the pin numbers and IC number on the symbols.

Your final carry out seems to be looped back into the beginning? There should be an LED on the carry out of the last stage.

Grumpy_Mike:
What is the value of R for that circuit. It is unlikely that your problem is there. To check just disconnect it.

they are all 680 Ohm, even for the transistor emitter to GND.

Grumpy_Mike:
So not a resistor then?

no, i have no CL resistor for the LED from a/any logic gate IC output since the current is small enough.
(i do have CL res. for the LEDs on the transistor OR gates since those would have larger currents)

Grumpy_Mike:
I would draw a circuit like this:-

Then I would add the pin numbers and IC number on the symbols.

yes, that is infact the little diagram at the bottom - those are XOR gates (in place of the individual OR/NAND/AND gates).

i have some quad-XOR chips ready for the full-adder of the next two bits, i just decided to "explode" the XOR into it's individual OR,NAND,AND (to show how ICs make some standard circuits into a single chip)

Grumpy_Mike:
Your final carry out seems to be looped back into the beginning? There should be an LED on the carry out of the last stage.

that diagram you show is ONE full-adder, which is the same as the bottom half on mine, and that "loop-back" is actually the carry OUT from the bottom full-adder(ONE), to the carry IN of the top full-adder(TWO)

yes, i should test the bottom full-adder with an LED also before commencing the carry to the next full-adder.

no, i have no CL resistor for the LED from a/any logic gate IC output since the current is small enough.

What makes you think the current is low? You are putting a very big load on a logic gate and could cause trouble, you ALWAYS need a resistor or some other current limiting device with an LED.

Grumpy_Mike:
What makes you think the current is low?

the info from this page ?

Output current is 5mA to 10mA (for the 4000 series CMOS chips)

Grumpy_Mike:
You are putting a very big load on a logic gate and could cause trouble, you ALWAYS need a resistor or some other current limiting device with an LED.

i suppose chaining FOUR ICs might be a different case...

but i actually built this circuit with the 4026;



which says;

Resistors are not required for the LEDs because the 4026 IC limits the current to about 5mA for each LED.

and it seems to run okay.

CD4000 series cannot output 5--10mA. 2--3 mA maybe with some voltage drop.

I'd recommend using 74HCxx logic family as they can actually drive an LED and are not
ancient. Better performance, better latch-up immunity, better ESD protection, works
at 3.3V without being extremely slow, will be available for decades.

MarkT:
CD4000 series cannot output 5--10mA. 2--3 mA maybe with some voltage drop.

yeah, looking at the datasheet that seems more accurate.
still, it is enough to drive an LED without a CL-res, right ?

MarkT:
I'd recommend using 74HCxx logic family as they can actually drive an LED and are not
ancient. Better performance, better latch-up immunity, better ESD protection, works
at 3.3V without being extremely slow, will be available for decades.

they are also more expensive - twice the price of the 4000 series from where i went to buy them...

since this is more for a learning experience and not an actual project application, i thought it should be fine.

Well its likely to stress the output devices - limit the current with a resistor - these days 2mA can be
very bright with high-efficiency LEDs. You must have adequate decoupling, I think this has been mentioned.

74HCxx seems to be cheaper than CD4000 series from where I buy chips. These jelly-bean parts should
be so cheap anyway that its not a factor! CD4000 will be end-of-lifed at some point I fear, they've
had a good run.

MarkT:
Well its likely to stress the output devices - limit the current with a resistor - these days 2mA can be
very bright with high-efficiency LEDs.

i see, okay - i will go with that Best Practice then, thanks for that - will have to stock up on more resistors then...

MarkT:
You must have adequate decoupling, I think this has been mentioned.

for the logic ICs, you mean ?

yes, i've since added them to the circuit.

just an additional thought, which kind of gets back to the original topic, if i could set the power supply to give a constant current of, say, just 5 mA - that would also protect the Output Devices, right ? (that way, any over-current would just fail the circuit and not ruin/burn the devices ? -cmiiw-)

how would one do that (make a PowSup of constant current) - i'd have to make a DC-DC converter circuit ?

Resistors are not required for the LEDs because the 4026 IC limits the current to about 5mA for each LED.

The internet is full of idiots and you just found another one. Low current means that is all it can supply safely, you put a honking big load on it and you over stretch the absolute current ratings.

and it seems to run okay

And you would know you are drawing too much current because?
It is when it suddenly stops working for absolutely no reason. Don’t be another idiot.