Go Down

### Topic: Basic circuits help (Read 4178 times)previous topic - next topic

#### tomisenbarger

##### Jan 30, 2014, 04:00 pmLast Edit: Jan 30, 2014, 09:13 pm by tomisenbarger Reason: 1
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
http://www.flickr.com/photos/tomisenbarger/12223492796/

Figure 5-4
http://www.flickr.com/photos/tomisenbarger/12223307364/

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
http://www.flickr.com/photos/tomisenbarger/12223493156/

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
http://www.flickr.com/photos/tomisenbarger/12223083073/

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
http://www.flickr.com/photos/tomisenbarger/12222899835/

Figure 5-7
http://www.flickr.com/photos/tomisenbarger/12222900565/

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

#### JimboZA

#1
##### Jan 30, 2014, 04:10 pmLast Edit: Jan 30, 2014, 04:13 pm by JimboZA Reason: 1
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   ... 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?
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

#### MarkT

#2
##### Jan 30, 2014, 04:19 pm
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....

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### crullier

#3
##### Jan 30, 2014, 04:37 pm
Quote
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.

#### JimboZA

#4
##### Jan 30, 2014, 04:45 pm
Quote
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"?

Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

#### tomisenbarger

#5
##### Jan 30, 2014, 05:44 pm
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?

#### JimboZA

#6
##### Jan 30, 2014, 05:49 pm

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.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

#### jremington

#7
##### Jan 30, 2014, 06:02 pmLast Edit: Jan 30, 2014, 06:34 pm by jremington Reason: 1
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.
No PM's please.

#### tomisenbarger

#8
##### Jan 30, 2014, 08:48 pmLast Edit: Jan 30, 2014, 09:03 pm by tomisenbarger Reason: 1
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.&amp;reg;_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.

#### CrossRoads

#9
##### Jan 30, 2014, 09:01 pm
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### CrossRoads

#10
##### Jan 30, 2014, 09:04 pm
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### tomisenbarger

#11
##### Jan 30, 2014, 09:22 pm
Quote
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?

#### Grumpy_Mike

#12
##### Jan 30, 2014, 09:30 pm
Quote
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

#### CrossRoads

#13
##### Jan 30, 2014, 09:34 pm
Quote
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### tomisenbarger

#14
##### Jan 30, 2014, 09:46 pm
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.

Quote
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?

Go Up