Do you HAVE to control LED brightness with a voltage divider?

Started by David, April 02, 2008, 08:28:04 AM

Previous topic - Next topic

David

I'm still trying to wrap my head around the concept of mechanically controlling the amount of illumination on an LDR, and hence its voltage output.  I started thinking about how this could be translated into the Anderton retrofit.  Then it hit me:  the wah pot remains in a voltage divider configuration to control LED brightness.  Why couldn't it have been set up as a rheostat?  Does this have something to do with current to the LED, not just voltage?  My high school physics teacher would probably rap me upside the head for asking that question, but if I ever knew, I sure don't now.

I know this sounds crazy, but if you could use an LDR as a rheostat, you could still output a voltage to drive offboard optocouplers. If the resistance of this LDR could be controlled mechanically (Yes, I've raised this issue before, but now I might know a way to do it AND have a long travel, to boot!) with a light regulator between it and an LDR, you would then have a control voltage pedal that was almost purely mechanical.  The only component that could possibly be consumable is the LED shining on the "rheostat" LDR.

This begs the question:  can the "voltage divider" configuration somehow be changed to a "rheostat" configuration and still work?

MarcoMike

I got quite lost in your topic... but a reply to the title is YES, you can use a rheostat (variable resistor, right?) to vary the brightness. in the Meatball the Intensity pot acts that way and I implemented mine with an external 5k (or10k) pot that acts just as a rheostat and allows a complete wah sweep.
Only those who attempt the absurd will achieve the impossible.

gez

Can you link us to a schematic of this mod/whatever it is you're trying to do?  Your post is difficult to follow without some reference point.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

ollie

If I've got this right, you want to control the brightness of an LED using either a potentiometer or an LDR but you don't want to put the LDR into a voltage divider to make a 'standard' light sensing circuit?

To answer the first part (if I got that right) yes, you can use a pot to control the brightness without it being in a voltage divider as it can act as one by itself. Here's a diagram of how to do that:



As for changing the pot for an LDR - there has to be (as far as I'm aware) a point in which the LDR is attached to both the +v and 0v.

Can I ask why you don't want it in a voltage divider? If you use a small enough resistor it should have very little affect
The duty of youth is to challenge corruption.

johngreene

Quote from: David on April 02, 2008, 08:28:04 AM
I'm still trying to wrap my head around the concept of mechanically controlling the amount of illumination on an LDR, and hence its voltage output.  I started thinking about how this could be translated into the Anderton retrofit.  Then it hit me:  the wah pot remains in a voltage divider configuration to control LED brightness.  Why couldn't it have been set up as a rheostat?  Does this have something to do with current to the LED, not just voltage?  My high school physics teacher would probably rap me upside the head for asking that question, but if I ever knew, I sure don't now.

I know this sounds crazy, but if you could use an LDR as a rheostat, you could still output a voltage to drive offboard optocouplers. If the resistance of this LDR could be controlled mechanically (Yes, I've raised this issue before, but now I might know a way to do it AND have a long travel, to boot!) with a light regulator between it and an LDR, you would then have a control voltage pedal that was almost purely mechanical.  The only component that could possibly be consumable is the LED shining on the "rheostat" LDR.

This begs the question:  can the "voltage divider" configuration somehow be changed to a "rheostat" configuration and still work?
Not sure what exactly you are getting at but an LDR is basically a rheostat. The problem is usually getting it to behave like a potentiometer.
LEDs are current controlled devices. The light output is proportional to the current flowing through it.
Morley pedals used a lamp/led and LDR setup where the pedal moved a slot of varying width between the light and the LDR. Thus giving a mechanical way of controlling it.

--john
I started out with nothing... I still have most of it.

David

Sorry for making things hard to understand.  I was being intentionally vague because I don't want to violate any patents, etc.

OK, the basic idea is to derive a rheostat from a LED and a photocell (LDR) which are separated by a small piece of opaque material which has a shape cut into it.  This is where I have to be vague.  Anyway, the mechanical movement of this opaque material is going to change the amount of illumination on the LDR and thereby its resistance.  This results in a mechanical rheostat.  No pots.  No variable capacitors.  No gears.  No cams.  Yes, Morley did it.  Their screen is not DIY-friendly.  I think mine is.  Furthermore, it's cheap, light and you can make the pedal as big or as small as you want.

The rheostat will then regulate the brightness of the LEDs in two external optocouplers.  The LDR portion of one opto is the control resistor of a resistor-to-ground wah.  The other LDR is in a voltage divider connected to a Tonepad "Andervol".

R.G.

The same thing was done in a DIY wah pedal circuit in Popular Electronics in the late 1960s. They used two LDRs, one light bulb and a moving opaque screen with a tapered hole in one and a full on/off hole for the other LDR.

The full on/off LDR was to take the pedal out of bypass when the rocker was pressed, the tapered triangular hole was to do the variable resistance for the wah.

In your scheme, you will need to be careful about the resistance and current rating of the LDR you use as a rheostat to get the right currents in the LEDs for the second set of LDRs. I think that getting that light/LDR/LED/LDR scaling working may be your biggest problem.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

David

Quote from: R.G. on April 02, 2008, 02:07:04 PM
The same thing was done in a DIY wah pedal circuit in Popular Electronics in the late 1960s. They used two LDRs, one light bulb and a moving opaque screen with a tapered hole in one and a full on/off hole for the other LDR.

The full on/off LDR was to take the pedal out of bypass when the rocker was pressed, the tapered triangular hole was to do the variable resistance for the wah.

In your scheme, you will need to be careful about the resistance and current rating of the LDR you use as a rheostat to get the right currents in the LEDs for the second set of LDRs. I think that getting that light/LDR/LED/LDR scaling working may be your biggest problem.

Dang it!  Every time I think of something cool, somebody else did it first!
OK, the stretched-out triangle hole is exactly what I was going to do.  The big end was only going to be as big as the squiggly area on the LDR, and the other end would be a...  point.  The height of the triangle governs the travel of the pedal.

Thanks for the reminders about current and scaling.  I know where to look to get some help with those.

Sir H C

I like to set it up as a resistor controlling the current through a diode connected transistor, mirroring to another transistor that drives the LED.  You can this way get a very controlled range for the current through the LED (based on the pot value and a series resistor to limit the current at the end of the pot range).  Cool thing is that you can control multiple LEDs this way, so if you need a lot of different points of control this works, and you can trim current with emitter degen resistors.

R.G.

Yep, the single and multi-output current mirror is a good one.

Another neat trick if you've gone far enough to understand current mirrors is to drive the input transistor with a **voltage** source from 0V to that voltage which produces the max current you want for that device, down in the 0.7V range.

If you do that, the current in, and hence being mirrored, will be an exponential function of the applied voltage and you get exponential operation (within the linearity of what you're driving) of the thing being controlled. Getting a 0 to 0.7V linear voltage source which is also limited to no more than the max current you want is a bit of a trick, but then it's always the secret sauce that makes the dish, right?  :icon_biggrin:

I also like PNP diffamps. Neat stuff there.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

brett

Hi
some time ago, I posted a couple of items about a wah that used an LED and LDR, with the LED brightness controlled by a proximity device. 
That proximity device was a Hall effect sensor, which responds in voltage output according to magnetic field strength.  So I put the circuit was in the base of a home-made wah, and the wah pedal had a tiny magnet stuck under it.  It was quite good, too.
cheers
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

birt

Quote from: Sir H C on April 02, 2008, 05:11:01 PM
I like to set it up as a resistor controlling the current through a diode connected transistor, mirroring to another transistor that drives the LED.  You can this way get a very controlled range for the current through the LED (based on the pot value and a series resistor to limit the current at the end of the pot range).  Cool thing is that you can control multiple LEDs this way, so if you need a lot of different points of control this works, and you can trim current with emitter degen resistors.

is there a schematic you can refer to? maybe i'll understand it better then. i want to control a variable resistance and a variable voltage divider with one expression pedal. and i think what you are saying might be the way to go to keep it simple and part count low. if i understand it right.
http://www.last.fm/user/birt/
visit http://www.effectsdatabase.com for info on (allmost) every effect in the world!

David

Quote from: R.G. on April 02, 2008, 07:10:09 PM
Yep, the single and multi-output current mirror is a good one.

Another neat trick if you've gone far enough to understand current mirrors is to drive the input transistor with a **voltage** source from 0V to that voltage which produces the max current you want for that device, down in the 0.7V range.

If you do that, the current in, and hence being mirrored, will be an exponential function of the applied voltage and you get exponential operation (within the linearity of what you're driving) of the thing being controlled. Getting a 0 to 0.7V linear voltage source which is also limited to no more than the max current you want is a bit of a trick, but then it's always the secret sauce that makes the dish, right?  :icon_biggrin:

I also like PNP diffamps. Neat stuff there.

I guess I haven't gone far enough to understand.  I also don't know anything about PNP diffamps or current mirrors.  But I'm not sure I need to.  My core question is simply this:  Is it possible to regulate 2 LEDs (max current of what?  20ma) through a rheostat to ground?  If so, would I use a current limiting resistor for each LED, or could I connect the LEDs to the same resistor?  Do I need math to calculate the value of the required resistor(s), or can I just use a "rule of thumb" value?  How about the resistor in the GEO wah technology article?

If I can't do it directly, can I use a transistor like in the Rock'n'Control article, or the PIC stuff I've seen for driving LED digits?  Again, would I need a transistor per LED, or can both LEDs be driven from the same transistor?

By LED, I mean the LED portion of an optocoupler.

R.G.

QuoteMy core question is simply this:  Is it possible to regulate 2 LEDs (max current of what?  20ma) through a rheostat to ground?
Yes. The simplest thing to do is to put the two LEDs in series. That forces the currents to be exactly equal - it's the same current. If you're working from 9V, that can get tricky, as the LEDs each have a voltage drop, and that voltage drop is subtracted from the 9V that's available, leaving the remainder for the controller resistor. That's one reason you heard the stuff about diffamps and current mirrors; active elements can control current on lower voltages than resistors.

A current mirror (sounds fancy, is actually very easy) can ease this a bit by forcing the current in a second -or third, fourth, etc - LED to follow that in a first one. You control one current, the others follow.
Quote
If so, would I use a current limiting resistor for each LED, or could I connect the LEDs to the same resistor? 
Simplest - LEDs in series, one resistor. Next simplest, one basic resistor per LED, and two LED/resistor combinations in parallel to one resistor.
Quote
Do I need math to calculate the value of the required resistor(s), or can I just use a "rule of thumb" value?
This is going to sound snotty, but it's not. You need math for EVERYTHING. Any time you don't know the numbers and how what relates to what through the numbers, you have no real idea what's going on. Rules of thumb are just things that someone else who does know the math has taken the time to calculate and then tell you.

But I'm going to give you the total of the algebra you need. Ready? Here it is:  V=I*R  and its alternate forms I=V/R,  R=V/I, and the wild duck, 1/R = I/V.

If you can master that, plus the arithmetic of doing the calculations of what the voltages, currents and resistors are, you're probably as well equipped as many degreed EEs for a career in electronics. Again, I'm not being snide, or making jokes at your or anyone else's expense.

In your case, you want to calculate a resistance from a voltage and a desired current. Given a power supply (9V??) and an LED ( 1.5 to 3V, depends on the LED) you want to calculate a resistance that lets 20ma (or whatever the maximum current you want to flow is; many LEDs require less than that for the 'right' current to light an LDR) flow. From there, any bigger resistance makes a lower current flow and turns the light down.

So let's do an example. You have a green LED and you've either looked up or measured the voltage across it when it's lit to be 2.1V. How would you measure it?

Well, I would put a 1K resistor and a 9V battery in series with it. A 9V battery driving ONLY a 1K resistor causes a current of I = V/R = 9/1k = 0.009A or 9ma to flow. That's safe for any LED.  You can test any LED safely that way, as well as telling from which way round the LED and battery are turned the polarity on the LED.

But back at the issue at hand. We want 20ma or less in a 2.1V green LED from a 9V battery. We know the LED eats 2.1V of the available 9V, leaving only 6.9V for the resistor remaining. So with 6.9V, what resistor gives us 20ma? Well, R=V/I =6.9V/0.020 = 345 ohms. Any bigger resistor, like maybe 1K will be a smaller current.

If we use 1K, we get I=V/R = 6.9/1000= 6.9ma.  If we use 2K we get I = V/R = 6.9/2000 = 3.45ma. If we use 10K, we get I=V/R= 6.9V/10000 = 0.69ma or 690uA.

About 90% of the math in designing pedals is done with that set of equations. You add/subtract up all the factors that go into a voltage or current, then pick a resistance/current/voltage you want, and do the math to find the third thing that makes the math work out.

QuoteIf I can't do it directly, can I use a transistor like in the Rock'n'Control article, or the PIC stuff I've seen for driving LED digits?  Again, would I need a transistor per LED, or can both LEDs be driven from the same transistor?

I'm going to give you the secret of the current mirror.
1) get two same-type number NPN transistors. 2N3904 works, as do 2N5088, BC549, 2N4124, 2N4401, whatever.
2) connect both emitters to ground.
3) connect both bases together.
4) connect ONE collector to the two bases.
5) connect one LED to the collector and two bases
6) connect the other LED to the collector that was previously not connected.
7) connect the LED from the collector only to +V.
8) connect the LED from the collector/bases through a resistor to +V.

The current through the collector/bases is the master current. If you set the current through this leg to whatever you want, the action of the equal base-voltages will allow a theoretically equal current to flow in the free collector if it can. So you set the current in the master side, the slave side follows. Both LEDs have nearly equal currents.

I say nearly equal because the two transistors are not perfectly identical nor do they have infinite gain. So there's some error. But it's pretty close. You can get closer with dual monolithic transistors (hard to find!) or by putting one 22ohm resistor in series with each transistor's emitter to ground.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

birt

so if you use an NPN/PNP pair... can you make an electronic pot? one current goes up while the opther goes down?
http://www.last.fm/user/birt/
visit http://www.effectsdatabase.com for info on (allmost) every effect in the world!

David

Quote from: birt on April 10, 2008, 01:26:48 PM
so if you use an NPN/PNP pair... can you make an electronic pot? one current goes up while the opther goes down?

R.G. answered MY question, so I'm going to pay it forward.  Look at Andrew "The Tone God's"  Rock'n'Control project.  He has a circuit using optocouplers that replaces a 3-pole voltage divider pot.

R.G., thanks for the explanation.  Believe it or not, Ohm's law I understand.  I just didn't know how to apply it here as I thought the matter at hand should be cut and dried.  I must admit, I had no idea I could implement the dual LEDs in series.  Somehow I was fixated on the idea that they had to be parallel.

R.G.

Quote from: birt on April 10, 2008, 01:26:48 PM
so if you use an NPN/PNP pair... can you make an electronic pot? one current goes up while the opther goes down?
No.

That is a differential amplifier. In a diffamp, you set the total current on the emitters. Then you shift it from 100% one collector to equal to 100% the other collector by the voltage imbalance on the base. +/-25mV runs it from fully one collector to fully the other collector. But a diffamp is both the same polarity.

You're well down the road to reinventing the OTA, which is a diffamp and four current mirrors, two each polarity.  :icon_biggrin:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

birt

http://www.last.fm/user/birt/
visit http://www.effectsdatabase.com for info on (allmost) every effect in the world!

David

R.G. et al:

Thanks for all the help with unraveling this issue.  You've given me the tools to move this along.

As I said before, I thought I had come up with a way to implement this "mechanically driven" wah thing.  Last night, I did a little bit of experimenting and built a prototype pedal mechanism.  It went together absurdly easily and seems to work very well.  I'm waiting for some LDRs I ordered before I put the open LED/LDR combo on there.  I think I've found a good way to handle that, too.  If this works out, and I'm hopeful since the mechanics went together ten times easier than I could have ever hoped for, I might just do a build article on it.