Logic Gates

I'm doing a project about Logic Gates. Using a HCT00 IC, a Quad 2-input NAND, and a photoresistor,
I tried to do what the article here said, but instead using the pins for my IC. Unfortunetly, the LED was always on, no matter the photoresistor. Is the IC fried, or is a photoresistor just not compatible?

P.S, photoresitor is here: http://www.digikey.com/product-detail/en/PDV-P9005-1/PDV-P9005-1-ND/480622
and I didn't use the resistors, because the photoresistor I had had way more resistance than the one it said to use.

You can not use the 74HTC00 instead of a CD4011.
The problem lies within the 2 different chips input circuits.

The basic idea of this circuit is exactly using the CD4011 as an analog op-amp.
It can do so, although somewhat poorly.

The HCT00 can not, it will require a true logic TTL level to shift its ouput.

Level_100:
P.S, photoresitor is here: PDV-P9005-1 Advanced Photonix | Sensors, Transducers | DigiKey
and I didn't use the resistors, because the photoresistor I had had way more resistance than the one it said to use.

And then you still expect the circuit to function ?

Anders53:
You can not use the 74HTC00 instead of a CD4011.
The problem lies within the 2 different chips input circuits.

The basic idea of this circuit is exactly using the CD4011 as an analog op-amp.
It can do so, although somewhat poorly.

The HCT00 can not, it will require a true logic TTL level to shift its ouput.

It will work, the threshold voltage will just be lower with the HCT family, its still
a CMOS input. Incidentally the circuit is flawed from the start by not using a
schmitt-trigger input gate such as 74HC14, so the output will have multiple
transitions as the input voltage varies.

MarkT:
It will work, the threshold voltage will just be lower with the HCT family, its still
a CMOS input. Incidentally the circuit is flawed from the start by not using a
schmitt-trigger input gate such as 74HC14, so the output will have multiple
transitions as the input voltage varies.

Remember that the CMos series have their tresholds at 1/3 and 2/3 of the supply voltage, giving it a "natural" hysteresis.
Therefore it wont flicker the LED.

Yes the HCT series would also work at different thresholds, which means the resistor must be re-calculated.

But given that each and every component is different from the original setup, and still expecting it to work, is very optimistic IMHO :slight_smile:

So the CD4011 will work TAYDA, right? It isn't CMOS or anything?

Almost any gate will work, including the one in your first post.

Do: measure the resistance of the LDR at the light level you want it to switch.
Use: about the same value resistor for the other half of the voltage divider.
Do: connect all unused INPUTS (NOT the outputs!) to a logic level, e.g. ground or Vcc.
Do: use a capacitor (e.g. 100n), close to the IC, between Vcc and ground.
That circuit SHOULD work. If not, post a picture of YOUR setup.
Leo..

P.S. The long side rails of a breadboard could be split in half !

Anders53:
Remember that the CMos series have their tresholds at 1/3 and 2/3 of the supply voltage, giving it a "natural" hysteresis.
Therefore it wont flicker the LED.

No. You have the wrong idea of hysteresis. That's just a different threshold voltage.

By the way, all the unused inputs should be grounded or tied to VCC.

I can't help but notice, you are doing a project about logic gates that uses no logic. :slight_smile:
Why not run one input to a switch, call it an "override". Show the truth table in your report, and get an A+!

Anders53:
Remember that the CMOS series have their thresholds at 1/3 and 2/3 of the supply voltage, giving it a "natural" hysteresis.

Unfortunately, you appear not to comprehend datasheets. :frowning: {OK, so it isn't always easy! :grin: }

1/3 and 2/3 of the supply voltage are the warranted threshold limits. The actual threshold would be expected to be at half the supply voltage (or at 1.5V for a HCT device operating at 5V). The point is that between these two thresholds is the actual region of linear operation where both high and low side drivers are conducting.


Given that Level_100 understands the different pinout of the 4011/ 74HC4011 and the 74HC00 (though pins 1, 2, 3, 13, 12 and 11 match) and the need to tie high all unused inputs (I say "tie high" in case you only used one of the inputs for the LDR) the circuit should work but I note the specification in the description for the LDR makes it only 40k for a nominal light condition. I suspect given correct wiring, the LED will go off if the board is exposed to sunlight or else the resistor on the LDR may need to be increased to 100k.


Level_100:
and I didn't use the resistors, because the photoresistor I had had way more resistance than the one it said to use.

Oh! I missed that! No resistors, eh? Really?

So - in short you do not understand anything whatsoever about electronics?

:astonished: :astonished: :astonished: :astonished: :astonished: :astonished:

Oh!

Using logic gates as some sort of analog threshold detector seems like quite a pointlessly dodgy idea.

Level 100, change the 33 kOhm to 330 kohm and 74HCT00 to 74HC00 or 4011 and I think it vill switch for about 1 lux.

Pelle

michinyon:
Using logic gates as some sort of analog threshold detector seems like quite a pointlessly dodgy idea.

Not as pointless as using an entire microprocessor board as one. As is often is around here. :slight_smile:

Wouldn't a '339 be a more natural choice here? That way you could set the threshold with a pot...

And yeah, a photoresistor is useless without putting a resistor in series with it.

The whole idea is to try that simple setup referred to.
Not to find the best or political most correct method.

Since I started back in '73 with electronics, it was a remarkable thing when the Cmos series logic were introduced.
Now you had an "indefinite" input resistance, and a whole new world of applications opened up.
More too, the input treshold were different from the standard TTL levels, namely symmetric to the Vcc.

As in this example, you can build a very simple sensor switch, if you carefully match the resistor to the LDR.
The gate wont switch its output, until either of the input thresholds is reached : 1/3 or 2/3 Vcc.
In between these levels, it will stay in the last toggled state, leaving a pretty good hysteresis for noise suppression.

I really beg opponents to re-read data in depth, before you start barking again.
I wont discuss it any further.

Your photocell only goes to 48-140K when subjected to visible light. You'll need to replace the 33K in the circuit with something much higher ... 470K-1M should work.

LDRs can be all over the place.
As said, MEASURE the LDR's resistance in the light you want it to switch over.
Leo..

Anders53:
The gate wont switch its output, until either of the input thresholds is reached : 1/3 or 2/3 Vcc.
In between these levels, it will stay in the last toggled state, leaving a pretty good hysteresis for noise suppression.

You are referring here to the 4017, 4020, 4022, 4024, 4040, 4093, 40106/ 74C14, 14538 and similar derivative devices. These are deliberately designed with "[Schmitt_trigger](Schmitt - Wikipedia trigger)" input stages. Mind you, even there the levels are actually narrower than you describe.

This absolutely does not apply to the other devices - 4000, 4001, 4049 and so on.

Anders53:
I really beg opponents to re-read data in depth, before you start barking again.
I wont discuss it any further.

Hey! Suit yourself. :grinning:

If you have it wrong, it doesn't matter so much in the great scheme of things. As long as everyone else realises you don't know - quite - what you are talking about. :astonished:

Hi,

I'm doing a project about Logic Gates.

I assume it for school/college, what subject.
What have they presented to you about logic gates that you are supposed to have learnt?

It looks like you didn't even look up the data for any of the digital chips you are using.

Use this site, get the data sheets on all your IC's you have, READ them, find out what is or isn't CMOS digital, find out what gates they have, find out how each gate works, consult your teacher/tutor.
Consulting you teacher will show you are doing the work, earn browny points, not the forum and cut and paste.

Tom...... :slight_smile: