Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What am I not getting about logic gates?

Status
Not open for further replies.

franklinb

Newbie level 3
Joined
May 25, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
I've just decided to take up circuit design as a hobby, a nice complement to software programming/engineering.

I've figured quite a bit out, but right now I'm stumped. I'm using a 9v battery which is connected to a tiny PCB with 5 columns of solder. The outermost 2 have pins attached to them, but the pins attach to nothing. Then, the inner three are connected to a 5v regulator such that:

  • The black wire from the battery connects to the middle pin on the regulator
  • The red wire from the battery connects to the left wire on the regulator (front view)
  • The regulator has a red wire protruding from the right pin
  • The regulator has a black wire protruding from the middle pin

I use the two wires that come from the regulator to power the circuit. This layout seems odd to me, why might it be set up like that? It seems like it just eliminates my opportunity to ground anything.

I also have a few SN74HCT08N gates (AND). I've looked at the datasheet and it seems like I should connect two wires to the positive bus (two inputs) at the two upper-left two pins on the gate (the notch is facing upwards). Then the next one down should connect to the LED which should then connect to the negative bus.

However, as long as one input pin is connected (it's AND, so both should be required), it lights up. Not only on pin 3, but almost any other pin, but the LED's brightness varies depending on the pin.

Am I using too much voltage for the gate, or is there something big I'm not understanding?

Thanks!
 

I think your problem is floating input.
Even though you connect the positive to only one input, the other input you seem to be not connected to the Ground. That means the other input is in a floating condition, ie neither positive nor Zero. You may not get a valid out put at this state. This is same for all the other pins you observe. In this state the LED can glow, go off, glow lightly anything.

So try connecting one input to positive and the other input to Ground(Black Wire) and see the LEd now. It should be off.

So the overall lesson is, the input pins should be in a known state , either High(positive) or Low (Ground). Not connecting the pin anywhere doesnt mean that it is "0"
 
Regarding the behaviour of the SN74HCT08, I'd say that cameo_2007's reply is spot on.

As to the regulator set-up, there's nothing wrong with what you described. Assuming that the regulator is the ubiquitous 7805, the middle pin is the common ground path for both input and output. If you want to ground the circuit, the middle pin is the one to ground. The IC should also have at least one capacitor between the input and ground pins, and another one between the output and ground pins. This is necessary to avoid unwanted oscillations and ensure stability.

If you're going to take up electronics, I suggest that you learn to read schematics and the correct way to refer to them. For example, instead of saying "two upper-left pins" while "the notch is facing upwards", the simpler and more standard way to identify those pins would be to call them pin 1 and 2. In that orientation, the left uppermost pin is pin No.1 and the rest are counted counter-clockwise (clockwise when viewed from the bottom).

Electronics is fun and once you get hooked, it's hard to let go. In many ways, digital electronics is much easier than analog, but it also has pitfalls you'll encounter as you go. The floating pin pointed out by cameo is an example. A floating input terminal in a CMOS IC can not only cause weird and unpredictable behaviour, but can also result in damage from static electricity.
 
Thanks for you help! :) Your solutions worked.
 

One other minor suggestion would be to use a medium-valued resistor (1k-100kohms) to supply voltages to the inputs of the digital gates. For example, rather than connecting the +5V output from your voltage regulator to pin 1 and 2 of the AND gate chip, you should use a 1K resistor in series to limit current spikes that could damage the transistors that make up the AND gate.

+5VDC-----1K resistor-----Pin 1
+5VDC-----1K resistor-----Pin 2

You can also use the current-limiting resistor when you connect an input pin to Ground, too. It won't hurt anything, but it may save you in case something goes wrong accidentally.

I also agree w/ the above post for using input and output capacitors on the voltage regulator (assuming its a linear regulator or LDO, like the aforementioned 7805 series regulator). It's best practice to have those filter caps installed to prevent the regulator from acting flaky (unstable).
 

Thanks for the suggestions. I should use resistors anyway since the 5v is too high for the LED, but they're still in the mail and I didn't want to wait to start tinkering. :) I've been careful not to leave the circuit running long enough to damage anything (although I think I did blow 1 LED already).

I think I remember reading about capacitors preventing oscillators, and it makes sense that they do that, knowing how they work. Can I assume that, if I had capacitors set up in the way Pjdd suggested, the LED wouldn't flicker even if the input were still floating (but would still act oddly)?
 

It will still act the same. Capacitors are for stabilizing the power supply (Regulator)

The LED output is derived out of your input combinations (truth table)
 

Thanks for the suggestions. I should use resistors anyway since the 5v is too high for the LED, but they're still in the mail and I didn't want to wait to start tinkering. :) I've been careful not to leave the circuit running long enough to damage anything (although I think I did blow 1 LED already).

I think I remember reading about capacitors preventing oscillators, and it makes sense that they do that, knowing how they work. Can I assume that, if I had capacitors set up in the way Pjdd suggested, the LED wouldn't flicker even if the input were still floating (but would still act oddly)?

If you look inside the 5V regulator it has a feedback loop (sense circuit, feedback circuits, error amplifier, and pass transistor to control the output voltage). The input/output caps are to help keep that internal feedback circuit in regulation. The caps should have no impact on the LEDs, as cameo stated.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top