Basic circuits help

I need some help and/or resources for understanding basic circuits. I am a smart enough guy, but for some reason, I just can't "get" a few things about circuits. I have read several introductory books including Brindley's Starting Electronics, Mims's Getting Started in Electronics, and Massimo's book. I even have Horowitz & Hill on my shelf. The programming is not an issue at all; it's just the topology of the circuits that puzzles me.

Here is where I get stuck. Maybe someone here can give me an explanation or refer me to a reference that I need to fill the gap in my knowledge. I get circuits per se, e.g., where I see a loop as in Figure 4-4 in Massimo and I get the concepts of series, parallel, Ohm's law, how to calculate resistance for resistors in series, parallel, etc. Let me say that I know obtaining this basic knowledge and theory kind of goes against the "Arduino way" of skipping the basics, but I feel that my design of circuits needs to have a basic understanding of how things work.

Figure 4-4
Imgur

Figure 5-4
Imgur

Where I get stuck is when texts move from a circuit such as in Figure 4-4 or Figure 5-4 in Massimo (i.e., where I see a loop) to a topology like in Massimo Figure 4-6.

Figure 4-6
Imgur

Once I figured out that a voltage source and ground mark the "ends" of the circuit in my mind (similar to the + and – terminals of a battery in a DC circuit), I see that there is a circuit in Figure 4-6 from the 5V source to one push button terminal, out the other push button terminal, through the resistor, and to ground. At first, I didn't understand how the wire going to pin 7 was involved in a circuit. It just seemed to dead end.

Appendix D
Imgur

After seeing the corresponding schematic in Appendix D, I see that pin 7 is at ground, so that there is a second parallel circuit from the 5V source to one push button terminal, out the other push button terminal, then to pin 7 on the board.

Now, my question becomes: why do we need both of these circuits in parallel? Why do we need the circuit that goes through the push button and resistor to connect the 5V source to ground? Why can't we just have one circuit that goes from 5V source, through the push button, through a resistor, then to pin 7 to apply a voltage to pin 7 when the button is closed? I anticipate that one answer will be to figure this out by building my proposed circuit and seeing what happens (the Arduino way). I don't have a board yet though.

In a similar way, Figure 5-6 and Figure 5-7 confuse me.

Figure 5-6
Imgur

Figure 5-7
Imgur

Am I thinking about circuits wrong? Is there a better model or scheme for understanding what is going on?

Can you post a pic of the figure you're talking about?- maybe grab one with your mobile? It's difficult to follow your description.

It "might" be that the resistor is a so-called pull-down; but can't really tell. That means that it's there to force the pin 7 to a known value of 0V when the button isn't pushed and taking it to 5V. When a pin is set as an input, which I'm guessing is the case.... hint: post code 8) ... it floats at some arbitrary value. Just because it's not set to 5V, doesn't mean it's at 0V. So if you want the pin to be at a known value, you need to force it to 0V when it's not being set to 5V.

But that's really all guesswork without a pic and the code.

EDIT.... is it something like this?

First thing to learn is that currents into a junction sum to zero, voltages round a loop
sum to zero. These are Kirchoff's laws and they generally apply to all the circuits you
are likely to encounter (exceptions being inside inductors, motors, transformers, very
fast circuits).

Whenever you have a circuit you can write down an voltage equation for each loop,
a current equation for each "node". Add the equations for all the components individually
and each voltage and current source.

Then you simply solve the equations.... :wink:

When the circuit contains only linear devices the equations are easier, and you can
use the principle of superposition and various tricks.

However we generally don't deal with complex topologies if we can help it.

Now, my question becomes: why do we need both of these circuits in parallel? Why do we need the circuit that goes through the push button and resistor to connect the 5V source to ground? Why can't we just have one circuit that goes from 5V source, through the push button, through a resistor, then to pin 7 to apply a voltage to pin 7 when the button is closed? I anticipate that one answer will be to figure this out by building my proposed circuit and seeing what happens (the Arduino way). I don't have a board yet though.

I also would like to know this. I was wiring a transistor last night, and the only way to get it to work was to use power from a different circuit at the base.

from a different circuit at the base.

What does that mean?- different from what? Becasue to test a transistor circuit you can take + from the + that feeds the load (I'm picturing an npn with the load above the collector) and stick it to the base (as long as it's an acceptable voltage for that purpose...). But that's not a hugely practical idea. So normally you switch the transistor by tickling the base from say a micro, where the micro's output is subject to some logic or other. Is that what you mean by "different circuit"?

Thanks jimboZA and MarkT

JimboZA – I added links to the figures in my original post.

MarkT – Thanks for reminding me about Kirchoff. I will try that, but a first step I need to accomplish is being able to identify loops in circuits. Do I just identify all possible paths between a voltage source and ground? Is any connection on the board that is not a voltage source at ground?

tomisenbarger:
JimboZA – I added links to the figures in my original post.

Yep- the Appendix D one is indeed a pull-down, as I surmised and as I described. It forces the input pin to be low when it's not high through the switch; without that it could be anything, based on transient atmospheric phenomena or the colour of your socks.

A serious problem with the approach of "teaching electronics with the Arduino" is that the Arduino is an enormously complex circuit in itself. To judge from the photos posted, this complexity is completely hidden from the beginner in the mentioned textbook. Understandably that leads to a lot of confusion, like the wire that "goes to nowhere" -- it in fact goes to a digital or analog input that in turn is connected to ground somewhere within the Arduino. The crude, confusing breadboard diagrams don't help either. You should start learning to read standard schematic notation right away.

I think the Arduino approach to teaching electronics is a bad idea, but don't know what to recommend to a beginner other than to take a hands-on course in analog electronics at a community college or similar. Make sure it is one that starts with basic circuits (and no Arduino). Notably, it takes some time before a beginner understands that a multimeter becomes part of the circuit and does perturb the circuit operation.

As an aside, I've taught out of Horowitz and Hill, but it is considered to be extremely difficult by college physics majors. The title "The Art of Electronics" says a lot.

Thanks jremington –

I have a book entitled Beginner's Guide to Reading Schematics by Traister and Lisk. I have browsed that in the past, but maybe I should take another look now. Horowitz & Hill was actually the first electronics book I bought … on the recommendation of my post-doc advisor when I asked for suggested books to start learning electronics.

I also bought my daughters a snap circuits kit http://www.snapcircuits.net/products/product_details/snap_circuits_jr.®_100_experiments=MzUz that I have played around with, too, in hopes of gaining some intuition about circuits.

jimboZA –

Thanks again. I will do some googling around to see why a pull-down (or up) resistor works. It's not apparent to me why such a thing would have an effect. As I look again at Figure 4-6, when the switch is open, the resistor is between ground and pin 7 (which is putatively at ground too, so still puzzling to me a bit). But, I kind of get it now.

It's not an open circuit tho.
A resistor from +5 to a pin supplies a miniscule amount of current into that pin, which goes into the gate of transistor; think of the gate as a small resistor to Gnd.
So 5V-resistor-resistor-Gnd. The resistor-resistor junction is a voltage point that can be high or low. The ATmegas have internal pullup resistor to 5V that can be enabled so an external resistor is not needed, value is only defined as 20-50K. When enabled, and the pin is not connected to anything externally, the voltage becomes high.
If a switch is connected to that junction and connects to Gnd, the voltage becomes 0.

If the 5V/ upper resistor is not there, it doesn't take much current into the bottom resistor to create a voltage (Volt = current * resistance), thus a "floating input" can seemingly transition high/low all by itself, from a nearby hand, etc.

Next time when you Reply, click Additional Options at the bottom, Browse to your photo, and Attach them. Pre-edit them so their width is around 1000 max.

It's not an open circuit tho.
A resistor from +5 to a pin supplies a miniscule amount of current into that pin, which goes into the gate of transistor; think of the gate as a small resistor to Gnd.
So 5V-resistor-resistor-Gnd. The resistor-resistor junction is a voltage point that can be high or low. The ATmegas have internal pullup resistor to 5V that can be enabled so an external resistor is not needed, value is only defined as 20-50K. When enabled, and the pin is not connected to anything externally, the voltage becomes high.
If a switch is connected to that junction and connects to Gnd, the voltage becomes 0.

Thanks CrossRoads.

I see that I was wrong to state that it is an open circuit (previous reply already edited to show that).

So the resistor-resistor junction you mention is the connection from the resistor on the breadboard to pin 7 (which a transistor gate).

Can you clarify where in the circuit there is "a resistor from +5 to a pin" when the switch is open?

Can you clarify where in the circuit there is "a resistor from +5 to a pin" when the switch is open?

Because when the switch is closed the resistor and the input are connected to ground. The fact that there is now 5V across the resistor does absolutely nothing for the circuit it is the fact that the input pin is connected to ground that matters. When the switch is open the input is connected to 5V through the resistor thus pulling it up.
Read:-

http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

Can you clarify where in the circuit there is "a resistor from +5 to a pin" when the switch is open?

That's the internal pullup resistor that can be enabled. There is no internal pulldown tho. GM goes into it quite well.

Thanks Grumpy

I will take a look at the link you sent. Perhaps that will clear things up. I have come to understand now that there are really three states to consider: high, low, and floating.

Because when the switch is closed the resistor and the input are connected to ground. The fact that there is now 5V across the resistor does absolutely nothing for the circuit it is the fact that the input pin is connected to ground that matters. When the switch is open the input is connected to 5V through the resistor thus pulling it up.

I may be thick, but I still don't see how "[w]hen the switch is open the input is connected to 5V through the resistor thus pulling it up". When the switch is open, I see the input pin 7 connected across the resistor to ground (i.e., thus pulling it down).

Also, are not the resistor and input connected to ground when the switch is open, rather than when the switch is closed as you say?

When the switch is open, I see the pin 7 connected across the resistor to ground (thus, pin is at low). When the switch is closed, I see that the pin is at 5V (thus, pin is high).

Are we dealing here with contrary definitions of what +5 (or –5) V means with respect to ground?

The problem is that there are two ways to skin the cat, but so long as the pin is always in a known state neither one is technically wrong. Although there are a number of reasons why I prefer using pull up resistors as opposed to pull down resistors (primarily since the Arduino - more specifically the microprocessor on the Arduino - has them built in) so you can activate internal pull up resistors via code and reduce the complexity of external circuits.

The pics you posted had pull down resistors so that pin 7 was at ground when the button was not pressed, then when you pressed the button, it brought pin 7 high (5V).

Alternatively it can be setup so that the pin sits at high when the button is not pressed, but tying pin 7 to 5V via a resistor and then when you push the button it makes pin 7 LOW (GND) by tying the other end of the button to GND.

Also you might try software such as this where you can easily play with simulated electronic circuits with no cost associated and no risk of damaging Arduino or components etc.

http://www.virtualbreadboard.com/Main.aspx?TAB=0

Not that the Arduino is specifically dangerous, but you could if not careful short a 5V digital pin to GND and that is a quick way to make things stop working. So its always nice with software because you can experiment with 0 risk.

Another good one: http://phet.colorado.edu/en/simulation/circuit-construction-kit-dc

Are we dealing here with contrary definitions of what +5 (or –5) V means with respect to ground?

No, you are reading my descrition into your circuit, not my discussion of my circuit:

When enabled, and the pin is not connected to anything externally, the voltage becomes high.
If a switch is connected to that junction and connects to Gnd, the voltage becomes 0.

Ah, I did not see where you switched the antecedence in the conversation to refer to your other circuit.