Showing posts with label Resistance. Show all posts
Showing posts with label Resistance. Show all posts

Monday, July 09, 2012

Electronics lessons: The Resistor Simple circuits Wheatstone bridge

So, A long time ago we covered potential dividers, in that lab we used a potential divider to vary the brightness of a light bulb.

Since then we've used potential dividers to bias amplifiers and provide feedback networks for other amplifiers.

Now I'm going to introduce a very simple circuit, that really going to test that you understand, what voltage, resistance voltage difference and potential dividers are all about!

Potential difference
Now, we mostly think of potential difference as being the difference between a point and ground. when we say what's the voltage there, it's just common sense that we mean, what's the voltage there with reference to 0v, not what's the voltage there with reference to the positive power rail, or negative power rail...

When you think about it, if you have a +9, -9 and 0v power rails, If I say what's the voltage there.
you measure potential difference between 0v and that point and get +3v, if you measured between the 9v rail and that point you'd see -6v, if you measured between the -9v rail and that point you'd measure 12v.

Measuring resistance
The real crux of what we've getting into here is measuring resistance. This can be though of as a how to make your own multimeter.

We should now be comfortable with the potential divider. and what potential difference is.


So I'm going to draw a series of potential dividers, and talk about the voltages that are in use in those circuits.

First, the circuit that I'm going to talk about looks like this:

Pretty simple eh? pretty useful as well

We know that the voltage at any point is relatively easy to find

Voltage = 10v
R1 = 5
R2 = 5
R3 = 5
R4 = 5

We know that the voltage at V1 is (V / R1 + R1) x R2
in this case that's (10 / 5 + 5) x 5
10/10 = 1 multiplied by 5 is 5volts.

We know that the voltage at V2 is 5v also.

So the potential difference between V1 and V2 is zero.


Now lets change the value of R3 to 15

now V1 = 5
but V2 = 10/20 x 5 = 2.5

So the potential difference V1 - V3 is 2.5.


Now is we change the resistor R3 to be 1
V1 still = 5 (that's out reference voltage)
but V2 = 10 / 6 * 5 (10/6 = 1.66666, 1.6666 x 5 = 8.3333

The potential difference is 5 - 8.33333 = -3.3v

This sounds simple and it is.

Lets build a circuit from this.
We'll need a battery.
an analogue volt meter,
3 resistors,
2 bits of wire
1 sharpie.

Use the wire to connect resistors of a known value to the circuit, then use the sharpie to draw onto the analogue meters screen to give you calibrated marks.

Alternatively, use a light dependant resistor, and draw on the screen specific points (as measured against another calibrated device) to make a light meter.

Or use a thermistor, in a range of temperatures measured by a mercury thermometer to can have a fully calibrated electronics thermometer.


If you use load cells, (that alter resistance in accordance to the load placed on them) you have electronic scales.
Light, heat water, position of wiper on a potentiometer, if you can get a sensor to return a resistance for whatever environmental input you want, then you can use a whetstone bridge setup like the one above to measure.

Monday, June 11, 2012

Electronics lessons: Music effects: The distortion pedal

This is the first guitar pedal that I eve made...

What is distortion.
Distortion is the changing of a wave form from one form to another so as to distort it.

Technically speaking, a tone control distorts the signal, a envelop filter distorts the signal, anything that "colours" the signal also distorts it.

but if I stop being a smart ass for a second.

distortion to most people means fuzz.

History of overdrive.
It seems to make sense to me to start at the very beginning, and lets take a look at the physics of what's happening.

Many people try to make a distinction of what type of distortion they are listening to, if it's a hard clipping, or soft clipping, some people thing that an over drive and a distortion are different, they kind of are, but fundamentally it's all the same.

OK, distortion was around long before this, but lets set the scene...
To understand this analogy you;re going to need to know what a green back is.
A green back is a speaker made by the British speaker manufacturing company Celestion in the 60's or 70's.
It was a basic run of the mill speaker, which has gained cult status (and price) with it's inability to handle the power of the signals that people were trying to drive thought it.

Now you might think that from the description above of a basic speaker that's gained notoriety for sounding bad might make you think that I dislike it.
nothing could be further from the truth. the point I'm getting at here is that the magic sound of 60/70 British rock, (think Rolling stones/Yard birds/Led Zepplin) lays a lot in the mechanical and electrical limitations of the time.

Consider how a speaker works,
a coil of wire is suspended in a permanent magnet,
the coil of wire is subject to an electrical current, this makes the coil magnetic, where it will be either attracted to, or repelled from the permanent basket on the back of the cone.
the coil has a paper cone attached to it.
as the coil moves the paper cone moves, this moves air particles, which vibrate through the air and then the air vibrates against our ear drums and happy days we hear sound.

So we get that the coil is moving, and we get that we can turn the volume up and make it move more, but, the coil is attached (with what's called suspension) to the metal frame (spider) in the speaker construction. The size and stiffness of the suspension limits how far that speaker cone can move.
that means that for very large wave forms the speaker will not replicate exactly what is being asked of it.
it tries to reach the point where the signal applied it telling it to go, but excersion limits are met and the speaker cannot move any more.
additionally the suspension on the speaker slows down the cone as it reaches the excursion limit

So the following picture hopes to show you what I mean, I've drawn it on it's side so you can visualise a speaker cone going in and out.

The thick black line is zero, this is where the speaker normally rests.
the red line is the input to the speaker.
you see it rising, the green line (speaker position) moves with it, then we reach the blue line, this is nearing the excursion limits for the speaker, so whilst the red line continues to move, the green line is being slowed by the suspension of the speaker.

The red line continues to rise where it meets the black line, this is the excursion limit the speaker can no longer move at all past this point whilst the red line continues to be at this point the speaker sits as it's maximum excursion position waiting for the red line to fall.

This is, in the most traditional sense an over drive distortion.
the wave is quite smooth, (as the suspension prevents square edges to the sound wave) and as such will sound like a warm fuzz.

It is also possible to get over drive distortion from an amplifier.
Consider the following chart.
the blue wave is what we want. the red wave is what we get

lets say we have an amplifier with supply rails of +15 and -15 volts, you we give the amplifier a 1v / -1v signal and say, amplify that, and set the gain to 15.

What should come out of the amplifier is a smooth wave (the same as went in) with peak values of + and - 15 volts.
but we can't actually drive the amplifier to the supply rail voltages, the most that we could get out is +13 and -13 volts, so the top and the bottom of the votlage is cut off.

This is a much harder clipping sound.

Now that we've listened to loads of music and realised that the classic hot sound of the 60/70s is so desirable what can we do to emulate that?
(clearly we don't want to run our amplifier at that level forever, and the amount of power that you need to put into a speaker cone to reach cone excursion limits makes your show loud, (and perhaps not suited to the venue size you have!)

So you want to fake it.


Well, now that we know what we're trying to fake, it's a very simple matter of finding a way to cut a little from the top and a little from the bottom of an audio wave.


So what we want to do is take a small wave form say 1 or 2 volts then shave a small amount of voltage off of it.

So what we want is a component that can give a low resistivity for small signals, and gradually that resistivity will increase until it hits a limit then it will only allow that amount of signal to pass.
kind of like some kind of flow control.


well, we don't exactly want flow control, but if we look at the diode we have the component that we need.

the following graph shows the voltage and current flow of a regular silicone an germanium diodes as they approach their forward conduction zones:

You see that (especially with the silicone diode) there is a gently slope on the voltage vs current graph, this is that component gradually decreasing it's resistance to a signal, until it reaches ~0.65 volts where it begins to conduct, at 0.7 volts the junction inside the diode is saturated and it's in full conduction mode.


So what does this mean for our distortion effect.

Well, quite simply, we wanted a component that we could use to clamp our voltage inside an artificial set of parameters that would mimic the gentle slowing due to suspension and then flat constraint of an over driven speaker. and with a diode we actually have that.


There are two ways of using diodes in a distortion circuit, these are often called hard and soft distortions.
what makes a distortion hard is very angular edges on the wave form when it flattens off, (see the picture of the amplifier distortion above, and soft distortion is more controlled, the distortion still exists, but it's smoother.

not only does the wave look smoother, but it sounds smoother too!.

There are two ways to use diodes to produce this distortion.

First we need to understand the building block that we're using.

two diodes are placed back to back, (and front to front)
this looks like a crazy way to put a diode,-surely they'll just conduct to ground regardless of the signal applied and there will be no output?

Well, no they won't just conduct to ground because as explained above, as the diode is switching on it has a resistance, and even when it's on there is a voltage drop.

So what actually happens is we clamp the signal line to only permit signals within a certain threshold, and limit any larger signals to that threshold.

So now we have a simple model.

for signals under 0.5 volts a diode acts much like an open circuit,
for (silicone) 0.5 - 0.7 volts a diode acts like a resistor with progressively less resistance being applied as the signal rises
for germanium diodes 0.2-0.3 volts acts like a resistor with progressively less resistance being applied as the signal rises
for signal over 0.7 volts the diode acts like a short circuit grounding the circuits and therefore clamping the signal to the activation energy threshold.


now that we have this component block figured out we can look at how to apply to to a circuit.

The first method of connection is to follow the amplifier that is used in the circuit with the component block.

This literally clamps the output to 0.7v, this type of circuit arrangement is suited to either Light emitting diodes or germanium diodes.
the use of silicone diodes produces a quiet hard clipping in this position, mixing a silicone diode and a germanium diode in series for the block can have a positive effect in making this clipping less harsh.


The second way to use this component block is in the feed back network of the inverting amplifier.

we put the network in parallel with the feedback resistor.

At low signals the diodes act like an infinitely large resistor.

so the value of 1/Rfn = 1/Rf + 1/diodeR(infinity) therefore the total value for the resistor network (Rfn) equals Rf

so if R1 = 100 Ohm, and Rf = 200 Ohms,
Gain = -Rf / R1 so the gain = 2

now as the signal gets larger the amplifier will put out a larger signal, when the output of the amplifier reached 0.55v the diodes are behaving like a resistor.
we'll (for the sake of simplicity) say that the value of this acting resistor is 200 Ohms.

now the feedback network has a resistivity if found by the equation
1/Rfn =  (1/200) + (1/200)
so Rfn = 100 Ohms

now the gain of the amplifier is
Gain =-rf/R1
gain = -100 / 100 = -1

so the gain has gone down.

Now the voltage continues to rise to above 0.7 volts, the diodes now act like short circuits.

the resistance of the feed back network a 1/Rfn = 1/200 + 1/0  so Rfn 0

and the gain is
-0/100 which also equals zero.

Remember a gain of 1 is unity.
the output = input x gain.

so a gain of zero actually turns the output off completely.
(but if that were to actually happen the there would be no voltage so the diodes would have infinite resistance again.

thus the voltage is again clamped in the region of the diode conduction threshold.



You can see in the graph below what a gradually increasing waveform looks like as it approaches the clipping region.
at the start there is no distortion, as teh wave gets gradually larger the clamping effect of the distortion begins to take effect, you see by the end of the graph the distortion is no longer smooth, the input signal is massive and the clipping is more and more choppy (and will sound worse)


Tuesday, August 23, 2011

Electronics Lessons: The Resistor Standard Values -The E12 Values

In the transistor amplifier lesson I introduced a new concept without talking about it too much. I kind of just shoved it in there and assumed that you'd get to know what I was talking about.

If you found it confusing or didn't have the foggiest what I was talking about, then read on.

Standard Values
Standardising the values allows manufacturers to make a handful of components, in bulk quantities, therefore keeping costs down.

Can you imagine the size of the hobby section in electronics shops if every component value imaginable was actually made? 1oh, 2 ohm, 3 ohm, etc or 1 and 1.1 and 1.2 and 1.3 and 1.4ohms all the way up to millions of ohms?

Instead of making every size imaginable, the manufacturers use standard values instead.

This values are spaced in the same kind of range of values as notes on a piano, (white and black).
in an Octave, there are 7 white keys and 5 black keys.
C, C#, D, D#, E, F, F#, G, G#, A, A#, B then we get back to C
Those notes are all equally spaced apart and the gap between then is called a semitone.

Standard resistor values have the same sort of spacing, the spacing between them is 10^(1/12)
(or ~1.212). (there are, just like on a piano, 12 values in a range, and the ratio of the spacing of these is equal.)

This is why it's called the E12 series (there are 12 values in the series)

The values
This makes values that start a 1,
then (multiply by 1.2 = 1.2), x1.2 = ~1.5

Therefore the actual values are

1, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2 and 10 (the ten is the start of the next range, kinda like how that C was the start of the next scale on the piano.)

Designing
Of course this is a bit of a trouble, when we're designing circuits we often come up with values where there just isn't a standard value.

In the amplifier lab none of the values were standard! all had to have a closest fit.

However, when you look at the range of values, it's not all that bad...

Margins of error/Tolerance
If you look at the values, they are all equally spaced, with not more than 20% between the values.

The gap between 5.6 and 6.8 is 1.2Ohms, so lets hit exactly in the middle, and say that you need a 6.2Ohm resistor.

If you go for a 6.8Ohm, resistor you're 0.6Ohms over,
If you go for a 5.6Ohm resistor you're 0.6Ohms under.

In short, whichever way (up or down) you go, you're only ever going to be 10% or less out of what you want the value to actually be.

I suppose you could say that 10% is a large percentage and does makes a difference.
You would of course be right to say that.

But consider two things, firstly, your designs, are mathematical models, not measured values,
And that even the values on the data sheet, though they are measured values, they are measured from a sample, not the component that you have in front of you, -hence data sheets provide minimum, typical and maximum values, measured from a range of samples.

Whether you chose a higher or lower value depends what you're working with, if you're getting close to the absolute maximum values of current, then choosing a lower value, and possibly exceeding that absolute maximum would not be a good idea. However, if you're well within the absolute maximum, then choosing a slightly lower value of resistor isn't going to cause too much current to flow, nothing is going to fail or melt!

Also, you should remember that if you desperately need an exact non standard value, you can add resistances together.
if you need exactly 45Ohms, no more no less then instead of settling for 47 ohms, use a 12 ohm and 33 ohm resistor in series!

Also remember that on resistors there is a tolerance band.
If you're using a silver tolerance band then your components may be as much as 10% out of their marked values anyway!

Wednesday, July 06, 2011

Electronics Lessons: The resistor and Ohms law

I started to write a post on what is electricity, but soon realised that subject was far too broad, far to detailed, far to simple and far to complicated all at once...

Suffice to say, what electricity is doesn't matter so much as what you can do with it.

I'm going to create a series of blog posts as a kind of electronics 101, the idea being that anyone can start at the beginning, learn about components, and learn how to build up circuits.

Throughout these lessons I'll be making a series of good analogies, and bad analogies.

Resistors











Theory
In Physics things have potential energy when they are sat still, a weight sitting on top of a book shelf has potential energy, if you nudge the weight to the edge it'll fall off, that potential energy has been converted into kinetic energy.

For the purpose of a resistor, think of electricity as like a tank of water, sat on top of a hill, the electricity, like anything is itching to get to the ground, and will take the path of least resistance.

A resistor adds resistance to the flow of electricity.


Look at the two pictures, the first shows a tank of water with a small opening, when you think about it you'll see that in this case the water will run down slowly, the narrow channel adds resistance and stops the water just gushing out.

The second picture has a bigger opening, in this case the water just gushes out, you can't stop it because the channel is too wide, the water gushes out with such force that you couldn't just put your hand over it.

There are calculations that you could do, knowing the size of the header tank and the size of the outlet to know with what force the water is pouring through the hole.

In electricity, the size of the header tank is measured in Volts, the size of the pipe or opening is measured in Ohms, and the force that the water pushes is not measured in PSI but is measured in Amps.

Resistance, Voltage and Current
The equation is simple.

The voltage, divided by the resistance is equal to the current.
V/R = I
so say you have a 9v battery, and a 100Ohm Resistor.
9/10 - 0.09A (or 90mA)

Next you might be thinking about about how much power that actually is. (if your resistor can't handle the power it's get hot and fail, sometimes quite spectacularly.)

Voltage, Current and Power
Another electronics law tells us that Power = Voltage multiplied by Current
In the example above the voltage was 9V, and the current dissipated was 0.09A

9 x 0.09 = 0.81W

Now less than 1 Watt doesn't sound like a lot, but consider that resistors generally come in 1/8th Watt, 1/4 Watt, 1/2 Watt, you're going to need at least a 1Watt resistor, so it's going to be reasonably large.

Resistor values

Resistor values are quite easy to remember, once you've been told what the values equate to.
black is zero and brown is one, after that the colours follow the colour spectrum, Red, Orange, Yellow, Green, Blue, Purple, then Grey and white are tagged onto the end. quite why it was done like this with black and brown first, and not just the spectrum colours first then extra ones I don't know...

Anyway,

Black = 0
Brown = 1
Red = 2
Orange = 3
Yellow = 4
Green = 5
Blue = 6
Purple = 7
Grey = 8
White = 9

The last band on the resistor is always Silver, Gold, Brown, Red, Green, Blue, Purple or Grey, these colours relate to the tolerances. (how far off of the stated values the component might be).
Silver = 10%
Gold = 5%
Brown = 1%
Red = 2%
Green = 0.5%
Blue = 0.25%
Purple = 0.1%
Grey = 0.05%

So, if you have a resistor that has colour codes

Red, Red, Brown, Silver
the values are
2 2 * 10 = 220Ohm, +/- 10% -i.e the value is somewhere in the region of 220 Ohm, 198 Ohm - 242 Ohm range (quite a range.)

You might notice that black is missing from the first column, and be thinking how do you write 1Ohm, this should be Black, Brown, Black right? (01 x 1)

Wrong, the correct way to write 1 ohm, is Brown, Black, Gold (10 x 0.1)

Symbols
Resistors, like all components have a symbol user to indicate them on electronics schematics.
the symbol for a resistor looks like a box (the box does not have a line through it) however you may sometimes find the symbol written as a zig zagged line.

So that about wraps up the humble resistor. There is of course more to learn, there is indeed always more to learn. I'll cover some more advanced stuff with resistors, and the different type of resistors later.

Calculations
As with everything electronics related, sooner or later you run into something maths related.

Even with the simplest of components, maths somehow finds it's way in.
Not to worry though, the calculations concerning resistors are really simple.

Resistors in series
This is as easy as one add one.

When resistors are in series (one linked to the other like a train) you just add all the values together.

R1 + R2 + R3 + ... + Rn = Rtotal

In the circuit above there are 4 x 8Ohm resistors.

8 + 8 + 8 + 8 = 32Ohms.

Resistors in parallel
When you connect resistors in parallel, things get a little more complicated, a mathematician would tell you that it's the sum of the reciprocal of the values of the resistors that makes the reciprocal of the total resistance.

And they would be right, but they'd also likely confuse the hell out of you.

In laymans terms, it's the sum of one over the value of all the components, that makes one over the final value, 1 over this value gives you the total resistance.
(1/R1) + (1/R2) + (1/R3) + ...+ (1/Rn) = 1/Rtotal

In this circuit the resistors are all arranged parallel to each other and connected differently from the original circuit.

The sum for creating this circuit is

(1/8) + (1/8) + (1/8) + (1/8) = (1/total)
1/8 = 0.125

So writing this out a bit more long hand we have...
0.125 + 0.125 + 0.125 + 0.125 =(1/total)

If you add all of those together you get 0.5
And 1/0.5 = 2

The total resistance of 4 x 8ohm resistors in parallel is 2 Ohms.


Series and parallel connections
Sometimes you're going to want to connect things in a mixture of series and parallel.

You might do this because you want a 1.5ohm resistor, they don't make these but you could connect 2 x 1ohm resistors in parallel

1/1 + 1/1 = 2
1/2 = 0.5

Then add a third 1 ohm resistor in afterwards in series and you get 1.5Ohm.

You might want to do this for a completely different reason than getting values that you can't get...

look at this example:

To start with break it down into two halves.
there's clearly a top half (2x 8ohm resistors) and a bottom half that's the same.

So work out the values of those first.

Top half = 8 + 8 = 16 Ohms.
The bottom half also is 16Ohms.

Now they are in parallel to each other
( 1/16) + ( 1/16) = 0.125
1/0.125 = 8

Now you may be wondering why anyone would be such a sadist as to use four components, have to go through that maths when they end up with the same value as just one of those components.

And the answer is power, as in power handling.
If you have a wire that can conduct a certain amount of power (voltage and current), and if you exceed that it'll heat up and melt, then you want to get a bigger gauge wire, you're adding more strands of wire, more paths to go down.

In the example above imagine that they were 10W resistors, but you needed to be able to handle 20W of load, buy arranging two side by side you've doubled that power handling capability to the 20W that you want.

but you've also halved the resistance, so then you add a couple more resistors in series to increase the resistance again.