News for hackers. Stuff that matters.
Re:Ask HN: What's the purpose of the resistor in this circuit? by tocomment on Thursday March 19, 2009 @09:47PM (#524351)
I understand what circuits do a lot of times but I never understood why there's always a resistor even on simple circuits. And how do you decide when to use one, how do you know what resistance to use when designing a circuit?

This really simple circuit illustrates my confusion.

Re:Ask HN: What's the purpose of the resistor in this circuit? by mindslight on Thursday March 19, 2009 @10:41PM (#524416)
Look at it this way - a thermistor varies its resistance based on temperature. But an A/D port doesn't read resistance - it reads voltage. Therefore, you need some circuitry to translate the sensor resistance into a voltage. The simplest way of doing this is the "voltage divider" shown.
Re:Ask HN: What's the purpose of the resistor in this circuit? by soundsop on Thursday March 19, 2009 @11:56PM (#524483)
Other people have answered what the resistance does (create a voltage divider that feeds a voltage to the A/D converter), so I'll describe ways to select the resistance value.

There are several specifications that might have to be met:

  * Power delivery limit of the energy source
  * Current specification for optimal operation of the thermistor
  * Voltage level of the A/D input
The resistance value might be completely constrained by one of these requirements or, in tougher cases, might be constrained by more than one requirement (often in different directions).

For example, if the thermistor has an effective resistance of about 1kOhm and requires a current of about 1mA, then you need to set the resistor to 4kOhm (assuming the A/D input draws negligible current). If this is the case, you're stuck on the other requirements. Your power consumption will be 5mW (5Vx1mA) and the nominal level of the A/D converter input will be about 4V (5Vx4k/(1k+4k)).

Experienced circuit designers seem to magically come up with correct values because they are familiar with typical requirements and can quickly identify the limiting specification. You'll have to struggle a bit at the beginning to get the hang of it.

Re:Ask HN: What's the purpose of the resistor in this circuit? by sketerpot on Friday March 20, 2009 @01:19AM (#524554)
To understand circuits, you really have to become familiar with some common building blocks. When I saw this circuit, I didn't think "okay, a couple resistors in a configuration"; I thought, "oh, a voltage divider."

So read up on voltage dividers, RC circuits, pull-up and pull-down resistors, and diode current-limiting resistors. Google them right now and start reading. That will make you dramatically better equipped to understand real-world circuits.

Re:Ask HN: What's the purpose of the resistor in this circuit? by ErrantX on Friday March 20, 2009 @07:37AM (#524772)
As an electronics engineer (yes, someone gave me a degree! :o) I quickly learned that resisitors are mythical magical beasts that can fix anything.

In a circuits lab you would regularly hear the cry "grrr, it's not working! Fetch me the resistors". No one has quite worked out how they do it every time.

Or as one of my favourite lecturers put it "you can design the most impressive, streamlined, cut down, beautiful circuit in the world. But I bet it still has a resistor in it"

:)

Re:Ask HN: What's the purpose of the resistor in this circuit? by HeyLaughingBoy on Friday March 20, 2009 @12:43PM (#525149)
Considering that even the wiring & conductors you use to interconnect components have resistance, I'd have to agree completely :-)
Re:Ask HN: What's the purpose of the resistor in this circuit? by ErrantX on Friday March 20, 2009 @01:02PM (#525178)
pfft now your being geeky!
Re:Ask HN: What's the purpose of the resistor in this circuit? by jimmyjim on Thursday March 19, 2009 @11:49PM (#524472)
A resistor is usually to "resist" current on a certain component. If you've 10 volts in a circuit, you wouldn't want to connect a simple LED there, because you wouldn't want that much current going to the LED. So you'd use a resistor of appropriate resistance in that instance to keep it from burning out.

Though, in the example you linked to, there's no use of the resistor -- it's connected to the ground. It's just useless. Unless of course, I'm not understanding things right. (If I'm wrong anywhere, please point it out!)

Re:Ask HN: What's the purpose of the resistor in this circuit? by mechanical_fish on Friday March 20, 2009 @12:16AM (#524503)
Well, no, you're not understanding things right. ;)

The problem is that resistors have many uses. One of them is, indeed, to limit the current flowing through some bit of a circuit: If you have a nine-volt source, and you want some current to flow from nine volts to ground (because, say, you want to run that current through an LED and make light), and you don't want that current to be too large, put in more resistance.

Another obvious application that everyone learns is: If you want to heat something up, strap a resistor to it and run a bunch of current through the resistor and it will heat right up. (Although you had better heed the wattage rating on your resistor or it will blow out right away.)

This is a third application: Resistors convert a current to a voltage. Voltages are often easier to measure than currents. In this case, if you just hooked a 5 volt source across a thermistor, the voltage at the top of the thermistor is always 5 volts, and the voltage at the bottom is always zero by definition. (Because we're defining it as ground -- ground means "the point which we define as zero voltage in this diagram", although sometimes it also means "a point which we literally attach to the earth" -- darned EEs with their crazy terminology!) You can't use a voltage probe to measure anything interesting in this thermistor-only circuit. The resistance of the thermistor is changing with temperature, which means that the current in the circuit is changing with temperature, but you can't see that with your voltage probe. Unless you put in a second resistor -- the voltage across that resistor will be proportional to the current. That's what the resistor is doing here: Converting current to voltage so that we can see it.

Of course, one of the reasons EE is tricky to grasp is that the resistor is doing more than one thing at once. For example, it is also limiting the total amount of current in the circult, just as you suggested. If you let the current be limited only by the thermistor you might draw too much of it and break the thermistor. Or, even if the thermistor has enough resistance to prevent that, there's a catch: If the thermistor draws enough current it will heat up, which will affect its reading. So you might want to choose a second resistor that is big enough to keep the current very small. But not too small, or there will be a lot of noise.

Sooner or later you have to stop thinking and use good old trial and error! Learning this stuff is a little bit of thinking, then some math, then some more thinking from another angle, then some tinkering. Occasionally you have to melt some things -- that can help you learn too. It does take time. I was probably halfway through college before I could see this stuff, and I'm still blind compared to the real circuits guys.

Re:Ask HN: What's the purpose of the resistor in this circuit? by jimmyjim on Friday March 20, 2009 @12:53AM (#524529)
Thank you very much for the elaboration.

> ...the voltage at the top of the thermistor is always 5 volts, and the voltage at the bottom is always zero by definition. (Because we're defining it as ground -- ground means "the point which we define as zero voltage in this diagram", although sometimes it also means "a point which we literally attach to the earth" -- darned EEs with their crazy terminology!)

Isn't what you're referring to rather a "common" than a ground?

Re:Ask HN: What's the purpose of the resistor in this circuit? by blackguardx on Friday March 20, 2009 @04:39AM (#524682)
Technically that is true, but any common reference point is usually referred to as a ground. If it does indeed connect to the earth, then it is usually called an earth ground.
Re:Ask HN: What's the purpose of the resistor in this circuit? by mechanical_fish on Friday March 20, 2009 @08:41AM (#524814)
Yeah, in an ideal world we would all use "common" for the one concept and "ground" or "earth ground" for the other. But in practice we use "ground" to mean "common" and "earth ground" to mean "earth ground".

I remember, when I was a beginner, being completely confused about what all those ground symbols meant. That was one of my first big stumbling blocks in electronics. The answer is that they're usually nothing but notational: They save you drawing some wires (every ground symbol is assumed to be attached directly to every other ground symbol by a very-low-resistance wire [1]) and more importantly they define your reference voltage (once you've drawn a ground, you can say things like "this point in the circuit is at 3.2 volts", instead of "this point in the circuit is at 3.2 volts relative to Point X".)

---

[1] There are times when the connections from ground to ground have too high a resistance, or when you pour so much current into ground that the ground-lead resistance can't be ignored anymore. Those are called ground loops, and are topics for advanced class. I have a nasty ground loop when I connect my stereo system to my cable TV. It manifests as the sixty-hertz hum from hell.

http://en.wikipedia.org/wiki/Ground_loop_(electricity)

Re:Ask HN: What's the purpose of the resistor in this circuit? by cosmo7 on Friday March 20, 2009 @10:48AM (#524959)
Ohm my god.