PDA

View Full Version : Need some help with really basic logic circuits...



ownaginatious
05-26-2009, 11:48 PM
Okay, I really suck with circuits. I used to be decent back when I was in grade 10; but I have since forgotten everything.

Here is the problem I'm having. All I'm trying to do is wire up an AND gate to turn on an LED when both of its inputs are true. There is something wrong though, and I suspect it has something to do with how I grounded the thing.

No matter if the inputs are on or not, the LED is on...

Here is a picture of my circuit. The power is unplugged in this photo. Also, it's not very evident in the picture, but the LED is connected directly to the ground along with the gate...

http://img40.imageshack.us/img40/8008/img0038b.jpg

Can anyone here perhaps tell me where my stupid mistake is? Sorry about the large image size. I currently don't have any photo editors installed (not even a paint-like thing, since I'm on Linux).

Thanks a lot!

crenn
05-27-2009, 01:13 AM
I'd say the LED is blown as you're grabbing power from USB. Also there is no inputs currently and all inputs are floating. What is the IC that you're using?

EDIT: I may be wrong, but I also believe you haven't hooked up power to the IC correctly.

Oneslowz28
05-27-2009, 01:22 AM
can you post the data sheet for the IC?

ownaginatious
05-27-2009, 01:40 AM
No, I mentioned that the power in the image currently isn't turned on, and I know that there are no inputs to the chip. The LED is fine, but I don't want to keep it on for extended periods because I already burned out one from leaving it on too long.

The IC is a 74LS08, quadruple 2-input AND gate. The LED, when the power is on in the circuit, should be off, since there are no inputs. However, the LED is on when I turn the circuit in the image on, which completely goes against how an AND logic gate should work. Adding or removing inputs doesn't make it shut off.

Here is a schematic:

http://www.doctronics.co.uk/Subsystems/Subsystem%20images/AND_11.gif

r0adawg
05-27-2009, 02:18 AM
here is something I put together.... seems to work for me... on the software side of things...


http://img211.imageshack.us/img211/3033/7408.th.jpg (http://img211.imageshack.us/my.php?image=7408.jpg)

sorry for poor quality...

hope it helps

ownaginatious
05-27-2009, 03:00 AM
Thanks, but that's pretty much what I currently have :( I remember my teacher saying it was something about how I grounded something... but that was almost 4 years ago.

Hopefully some aspiring electronics engineer will come across this post... :p

Oneslowz28
05-27-2009, 04:48 AM
if you post the data sheet I can help you.

Collinstheclown
05-27-2009, 05:31 AM
http://ecee.colorado.edu/~mcclurel/dm74ls08.pdf




-CollinstheClown

Oneslowz28
05-27-2009, 08:06 AM
This link should help you understand AND gates and trouble shoot your schematic. One thing I do not see is you providing vcc to the gate inputs. vcc on a and vcc on b will cause the led to light, vcc on one and vss on the other will open the gate. Vss on both should close the gate too. put a resistor on that led too btw. Also connect the vss (pin 7) to the power pin with a 0.1uF cap.
http://www.allaboutcircuits.com/vol_4/chpt_3/4.html


Disclaimer: I am not an EE. Just a electronics geek who knows just enough to get by. If you fry your IC i claim no responsibility and neither does TBCS.

Oneslowz28
05-27-2009, 08:12 AM
Here is a little bit more on AND and NAND gates.
http://forum.allaboutcircuits.com/showthread.php?t=2501

ownaginatious
05-27-2009, 08:57 AM
Yes, I know that the gate has no inputs. I'm pretty sure that doesn't matter, since according to the truth table; it should NOT light up since no input is equivalent to a zero (isn't it?). Currently the LED is staying lit regardless of whether or not I give it inputs. Like I said before, this isn't evident in the image because the power was off when I took that picture.

I understand the theory behind logic circuits and can do Boolean algebra and stuff... it's working with the physical chips that I'm having problems with.

Also, I don't think I need a capacitor or anything... I remember doing this years ago with only the things in my original image. A resistor would help... but I currently don't have any on me :(

Thanks for the help so far guys :)

Oneslowz28
05-27-2009, 09:26 AM
I too thought that it was odd that the led was staying lit. try connecting vss to both inputs and see if it changes anything. If not I would say that you may have a bad ic. How was it stored and handled? ICs are highly sensitive to ESD and any static charge over 5v will blow that IC.

The cap is a decoupling cap. Most ICs need to be decoupled from their power supply, usually with a 0.1uF capacitor between each power pin and ground. Decoupling is usually used to remove noise and to smooth power fluctuations.

ownaginatious
05-27-2009, 09:36 AM
I don't think the IC is broken. I've experienced this before, and like I've said, I had something connected wrong... something to do with grounding. I really hate how it's nearly impossible to find any diagrams of a simple logic gate IC connected up to an LED...

Connecting the inputs to Vss is an interesting idea. I'll try that when I get home and see if anything changes.

EDIT: I forgot to add, this IC is only worth about $0.50, and I have around 10 of them. It's not a big deal if one or two blowup :p.

Oneslowz28
05-27-2009, 09:47 AM
Since you have a few then try another one first to rule out a bad IC. When I built my first project I somehow fried a 555 and trouble shooted for 4 hours before replacing it and everything working fine.

crenn
05-27-2009, 04:44 PM
Can you connect the 2 inputs to ground? I suspect your problem is floating inputs ;)

ownaginatious
05-27-2009, 07:04 PM
Wow, wouldn't you know it. That worked :o. I tried it with a XOR gate too just to make sure, and that also performed as it was supposed to.

I think I get how this works now. By default all inputs are on, and to turn them off, you have to ground them. The schematics are kind of misleading with that...

Anyway, thanks a lot everyone! I really appreciate that you guys took the time to help me. :)

Oneslowz28
05-27-2009, 08:22 PM
Yes they work by opening the circuit when the output is low. and closing it when its high. You can build a complex multi-level safety switch using just 1 quad AND gate.

Here is some quich info that you may find useful one day. An AND gate is a NAND gate with an inverter.

crenn
05-27-2009, 11:00 PM
I had to learn this while taking digital electronics design from personal experience.