# Will the schematic I created for my project work?

Edit: I made it and it works like a charm :D . Only had to connect the switch -ve to the -ve lane and the switch +ve to the +ve lane (not shown in schematic!!) and the circuit works like a chram. I also found that removing the resistors connected to the LEDs helps by makeing them glow brighter. I guess the ICs take the voltage down a fair bit) thank you all for helping! This is my physics project for this term, and I want to know if my schematic would work.

However, I'd like to supply a little background first - I'm an 11th grader who doesn't know much about circuits, and definitely nothing about ICs (our sessions start in April and we have a summer break in MAY so, we haven't covered electricity as part of our syllabus.) I decided to do my project on logic gates, despite it really being a 12th grade topic, and I need a little help putting together the demonstration. This also says I won't understand any fancy terms you might throw my way. Im familiar with BASIC circuits and Ohm's law and a few of the relations (that don't really matter here) but I don't know network theorems and so on.

I've failed 3 times so this time, I'm planning properly, with a proper schematic. I haven't yet put any of it together, since I don't want to screw it up - it's really hard de-soldering a board. I somehow managed once, don't wan't to go through the hell again. Here is an inventory of all I have at my disposal. I really can't get anything else, unless its really cheap, it takes me forever to get to the shop and I have a lot of tests coming up.

• A soldering iron
• Solder
• Soldering flux
• Several 100ohm resistors (about 15, I think)
• Several LEDs (again around 10)
• One 9V battery
• One 6V (4 AA's in series) battery
• ICs (NOT, AND, OR, NOR, XOR, XNOR, NAND, NOT) and their datasheets.
• A "multipurpose" IC board (a protoboard?)
• Wire (NOT insulated, the insulated stuff is just TOO thick for the circuit)
• IC sockets (so I can make basic circuits and change the IC in just their holders to demonstrate different ones without having to make a lot of circuits, only the minimum 3 as all gates except NOT and NOR have the same input and output pins)
• 2x 3-state switches (logic 1, logic 0 and off). Model - 25139 NAB

As stated above, I have to make this work with only this stuff.

So here is the schematic, and it has one question and I think all of the necessary data.

All I need to do is show the output (but the glowing or not glowing LEDs) depending on the A and B input.

If the photo isn't visible, here is a better one. EDIT #1: at any given point of time, only ONE logic gate will be plugged in. EDIT #2: The schematic will feature a wire running from the switch to the ground(battery -ve).(Not shown in current schematic)

-
"Wire (NOT insulated, the insulated stuff is just TOO thick for the circuit)" This concerns me. While it's not a very complex circuit, it's very difficult to resolve simple problems like shorts if you are a beginner. – Adam Davis Jun 13 '14 at 16:46
@AdamDavis I am choosing to assume he means not double-insulated like mains flex. – Majenko Jun 13 '14 at 16:49
@Majenko If he's using 14awg mains flex, even without the jacket, I'm also concerned - that's not suitable for 0.1" pitch IC work, and will also have bad issues with shorts. Either way, if he can get ICs he should be able to get insulated 20-24 awg wire. – Adam Davis Jun 13 '14 at 16:54
KNow this- i live in india, its very hard to get that wire for some reason. Im basically using the metal part of the wire ( i stripped the jacket, since it wasnt fitting through the holes) – t3hCrush3r Jun 13 '14 at 17:04
@t3hCrush3r Telephone wire (the stuff used in trunk cables) should be available everywhere. It's solid wire and it usually has insulation that melts at low temperature so it's a bit tricky to work with, but at least it's insulated. Strip some cable to get lots of different colors. Maybe scrap dealers have some. As a bonus, it fits solderless breadboards. – Spehro Pefhany Jun 13 '14 at 22:19

Ok, firstly there's a few extra concepts you need to understand to get your circuit right.

Firstly it's that resistor you have pointed out as "Do I need this?". The answer is most certainly "NO!". You say you understand Ohm's law. If that is so, what is that resistor doing?

Yes, it is dropping the voltage. But, by how much? Well, according to Ohm's law, that is dependant on the current that's flowing through it. But what is the current flowing through it? Well, that is constantly changing, depending on which LEDs are lit, what gates are HIGH, which are LOW, etc. It's not a value you can predict, only model for different situations. So, the voltage dropped across it will be changing all the time too.

So definitely get rid of that resistor.

You also need to understand the concept of a logic input and how to wire up a switch to properly activate a logic input.

A logic input is HIGH when the voltage is above a certain threshold, and LOW when it is below a certain threshold. No voltage (i.e., not actually connected to anything) is not a valid input, and is known as a "floating" input as it is neither HIGH nor LOW. These are bad, especially if that input has an effect on the outputs you are using.

So to wire up a button so that it generates a valid logic signal it must only ever be generating one of two voltages - normally a voltage below the LOW threshold, or when pressed above the HIGH threshold. So you'd think that connect the input pin to ground for the normal LOW, and connect the button to V+ for the HIGH, so that when you press the button the input is connected to V+. Wrong. It's also connected to ground at the same time, and all you have done is connect V+ to ground and the whole circuit dies (or the battery explodes if you're unlucky). So what do you do?

This is where you need to learn about "pull down" (or pull up for active-low logic, but that's basically backwards) resistors. These are higher value resistors (typically around 10KΩ) which are used to "pull" the input towards the desired default level (ground in this case), so that when you press the button you're not creating a dead short, but just placing a large resistor across the power supply, which has little to no effect on the circuit, other than to connect your input pin properly to V+. Each button must have its own pull-down (or pull-up) resistor - they cannot be shared between buttons, or the effect is to have all the buttons do the same job at the same time. Messy.

So you will need to go shopping for some more resistors - 10KΩ is a very very common value, and you will use them lots I can promise you.

You should also learn to use proper schematic or logic capture programs. There are many free ones on the internet (some better than others). It is almost impossible to make out what your circuit is meant to do from the drawing, but a properly drawn circuit in a schematic program is so much easier to understand. Also learn the right symbols, and what they mean.

A simulator can also be a real godsend when working with discrete logic. One of the simplest and easiest I know is called Falstad and is a Java application on the web (or downloadable if you prefer) and lets you model simple circuits and check they will do what you hope they will.

-
Well, i dont think my switch needs a pull-down, it has 3 logic states (and 3 pins) and is a sliding switch, not a push-down. I learnt the hard way about using 6 pin push switch, which didnt work. My current switch has an off, a logic 0 and a logic 1 state. Yeah, i knwo about ohms law, only in theory (welcome india) and in the examples we've done, bulbs and wires' resistance is ignored, so my bad. Still, i thought it MIGHT help pull the pd down. (Not sure, how, last i checked V = IR , but whatever, someone said it would help). – t3hCrush3r Jun 13 '14 at 17:08
Your switch is wrong. Having 3 states is bad as mentioned in my post. It should either be HIGH or LOW, and NEVER disconnected (your third "off" state). – Majenko Jun 13 '14 at 17:09
I apologize for the bad circuit, but its my instinct use hand draw a circuit (again, thanks india) Also, only one gate will be plugged in at a time... – t3hCrush3r Jun 13 '14 at 17:10
Well, ill toggle it between low and high, right? The 3rd state doesnt matter does it? – t3hCrush3r Jun 13 '14 at 17:13
It does during the time you're passing through that point. It may not make much visible difference in this specific circuit, but when you start making more complex circuits it will cause big problems. You can use your existing switch, just use it with a pull-down resistor. – Majenko Jun 13 '14 at 17:19

Since the ICs can handle up to 7V, you could probably use 6V power supply without the 100ohm resistor (next to the 'main switch'). This resistor is not guaranteed to reduce the voltage from 6V to 5.5V. The voltage drop will depend on the total current consumed by the circuit. If you do not know how to calculate it, just use 6V.

-

This is not an answer, but should help you now and maybe later if you want to mess around with electronics.

Use some electronic circuit simulator. You will save a lot of time with experimenting.

National Instruments Multisim - software core is archaic (old good Electronics Workbench). This is my favourite tool, it's not free, but there are trial and educational licenses

Labcenter Proteus - another powerful tool for circuit simulation and more

Circuitlab - new, online, modern, but some parts are missing and web interface is annoying for me

Open source / free software - I never tried these...

-

1) You must tie all unused inputs to one level or another. Assuming that you are using "real" 7400 series chips, not 74HC, 74HCT, etc, you can either tie unused inputs to ground, or pull up to V+ with a 1 k resistor. That is, V+ on one end of the resistor, chip input on the other.

2) Again, assuming you are using 7400 parts (7400, 7402, 7404), you need to be aware that they are much weaker when outputting a 1 than a 0. That is, they can sink much more current from V+ than they can source to ground. So your LED circuits, as shown, will not work. Try this for each LED:

simulate this circuit – Schematic created using CircuitLab

Since you have 5 unused gates in your 7404, you should be in good shape. Within limits, you can make the LED brighter by adding more resistors in parallel, although there will come a point when you will damage the chip. Just for future reference, this inequality is much less when using CMOS families such as 74HC.

3) 7400 will not work well at voltages above 5.5 volts. 7 volts is an absolute maximum, and this just means that if you keep below this the chip will not fry itself. You may well get operation at 6 volts, but I guarantee the chips will start getting hot.

-
Im using the 74F04N. – t3hCrush3r Jun 14 '14 at 9:09
Then all the previous comments apply. Voltage is still a problem (maybe). See fairchildsemi.com/ds/74/74F04.pdf, page 2, note 1. But give it a try. For simple gates it may work. If you want to go farther with these chips, you'll need a 5 volt DC power supply. Some wallwarts will do the job - look around. Also, you need to put a 0.1 ceramic capacitor between V+ and ground, as near the chip as you can. – WhatRoughBeast Jun 14 '14 at 12:55