Author Topic: Please I need help to calculate resistance?  (Read 2552 times)

0 Members and 1 Guest are viewing this topic.

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Please I need help to calculate resistance?
« on: January 17, 2021, 11:03:13 am »
The circuit is meant to dimm the optocouplers LED from full on to full off.



The pot is a liniar pot with a resistor to make it a logoritmic pot. The pot is a 270 deg one turn pot.
The two resistors after the cap is to been able to adjust the resistance to a precise value.

I am truing to calculate the resistance that each resistor (including the potentiometer) but I can't simply understand the datasheet and has not enough knowledge of calculating ohms' law in that circuit.

nte3085: https://www.nteinc.com/specs/3000to3099/pdf/nte3085.pdf

On a web-site about the logaritmic sollution, do the author write that there are some "gotcha" when using a liniar pot and a resistor to make a logaritmic pot. But I do simply have no idea on what it means:
"Unfortunately there's a gotcha in there. It's true that the voltage division ratio of this rig is arbitrarily close to that of a log taper pot. However, neither the load seen by whatever drives Vin or the source resistance as seen by the input of whatever is connected to Vout is close to what would exist for a real log pot of value R. In fact, theload on Vin varies from 1/(1+1/b)*R up to R. That means that if we're trying to do a log taper with b = 1/4, the load on Vin will be as much as 0.2* R. This may beOK, but you have to keep it in mind."

« Last Edit: January 17, 2021, 11:09:18 am by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1101
  • Country: nz
  • Retired Electronics Design Engineer
Re: Please I need help to calculate resistance?
« Reply #1 on: January 17, 2021, 12:07:49 pm »
The circuit is meant to dimm the optocouplers LED from full on to full off.



The pot is a liniar pot with a resistor to make it a logoritmic pot. The pot is a 270 deg one turn pot.
The two resistors after the cap is to been able to adjust the resistance to a precise value.

I am truing to calculate the resistance that each resistor (including the potentiometer) but I can't simply understand the datasheet and has not enough knowledge of calculating ohms' law in that circuit.

nte3085: https://www.nteinc.com/specs/3000to3099/pdf/nte3085.pdf

On a web-site about the logaritmic sollution, do the author write that there are some "gotcha" when using a liniar pot and a resistor to make a logaritmic pot. But I do simply have no idea on what it means:
"Unfortunately there's a gotcha in there. It's true that the voltage division ratio of this rig is arbitrarily close to that of a log taper pot. However, neither the load seen by whatever drives Vin or the source resistance as seen by the input of whatever is connected to Vout is close to what would exist for a real log pot of value R. In fact, theload on Vin varies from 1/(1+1/b)*R up to R. That means that if we're trying to do a log taper with b = 1/4, the load on Vin will be as much as 0.2* R. This may beOK, but you have to keep it in mind."
The description from the web site means that the load (current drawn from the incoming supply) will vary considerably as the pseudo-logarithmic pot is adjusted. A true logarithmic pot would draw constant current from the supply, provided there was no load on the wiper of the pot. This is not applicable anyway as in this application there is a significant load on the wiper.

If you are trying to control the current through the opto-coupler LED in a smooth exponential (not logarithmic) fashion then this is not really the best way to do it - as you turn up the pot from zero you will initially get no current through the LED until the pot is almost full scale and then the LED current will very rapidly increase to excessive levels possibly damaging both the opto-coupler and the pot.

A better approach would be to use an active current sink controlled by the voltage off your pseudo-logarithmic pot. This would provide better control of the LED current despite variations in the LED characteristics, eliminate the excessive current drawn from the pot wiper and limit the maximum current through the LED to safe limits.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #2 on: January 17, 2021, 12:39:05 pm »
Okay thanks it sounds really great.
My plan is to make the sound trough the pin 4-6 be adjustable as in a normal volume.

Do I just find any active current sink or is there something to consider?

« Last Edit: January 17, 2021, 01:29:18 pm by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2768
  • Country: us
Re: Please I need help to calculate resistance?
« Reply #3 on: January 17, 2021, 04:53:50 pm »
if the pot is turned all the way up, the opto's LED will see 145 mA, which is almost certainly going to destroy it.

(5 - 1.6) / (47 / 2)

I think R26 and R27 should be replaced by one resistor of about 170 Ohms.

Jon
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #4 on: January 17, 2021, 05:45:06 pm »
Tanks yes the LED would be destroyed but by combining two or more resistors will I be able to make 171.52 Ohm resistance if I want:-)
The biggest problem is to  build and calculate the right values:-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1101
  • Country: nz
  • Retired Electronics Design Engineer
Re: Please I need help to calculate resistance?
« Reply #5 on: January 17, 2021, 10:58:23 pm »
Okay thanks it sounds really great.
My plan is to make the sound trough the pin 4-6 be adjustable as in a normal volume.

Do I just find any active current sink or is there something to consider?
A variable active current sink, sometimes known as an electronic load, would be more appropriate here. There are numerous examples in this forum so a simple search on the term "electronic load" should turn up some suitable circuits. Carefully read any comments by other forum members as many of the example circuits sourced from a web search have serious flaws in them.

These circuits usually have a power MOSFET driven by an op amp. There is a small value sense resistor in the source lead the voltage of which is taken back to the inverting input of the op amp. The non-inverting input of the op amp is usually driven by a variable reference voltage derived off a pot. You could simply modify the linear response pot to get your pseudo-logarithmic pot with a shunt resistor as per your original circuit. You can get a much better, smoother response out of such as circuit as the pot doesn't have to supply the LED current and the feedback circuit with the op amp overcomes the effect of the highly non-linear load presented by the LED.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #6 on: January 18, 2021, 12:30:46 am »
Great explanation!
I have found this small circuit from the internet, after reading several threads on this forum.



I am hoping on making it tiny in THT with as few components as possible.
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1774
  • Country: is
Re: Please I need help to calculate resistance?
« Reply #7 on: January 18, 2021, 02:23:43 pm »
You will probably burn way to much power with that 47 ohm resistor directly on the pot. It looks like you could raise the values of your resistors all by the same ratio like maybe 500% (5X). That opto will probably be fully saturated with only 5 to 10 milliamps of current on it and it won't conduct until it sees about 1.1 volts applied to it. at 10ma it will show about 1.19 volts across it and at 50ma it will only show about 1.25 volts across it (the led part) as the led acts like a 1.2v zener diode basically.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1889
  • Country: us
Re: Please I need help to calculate resistance?
« Reply #8 on: January 18, 2021, 06:55:04 pm »
You don't need that R25 from potentiometer wiper to ground, the LED in the optoisolator will provide a similar quasi-log effect when being fed from an appropriate potentiometer.
Here's how to work this out:
The opto LED has a forward drop of about 1.7V (will vary with current).  When the pot is cranked full-on, it puts 5V on the wiper.  You need a series resistor to limit the LED current to (say) 20 mA.  This value will be R = E / I, or (5V - 1.7V) / 20mA, or about 165 Ohms.  This is R3 in my schematic, I used 180 Ohms.

To get a quasi-log effect, your potentiometer value has to be significantly greater than R3.  If the value is too small you burn excess current (and perhaps the pot), and the log effect will be minimal, and if it is too high the log effect will be to extreme.  I chose a 5K pot, this might be OK.

Since the LED won't turn at all much below 1.7V, to avoid a big "deadband" at the bottom range of the pot, put a series resistor between pot and ground (R2 in my schematic).  1.2K here sets the bottom of the pot at about 1V.

With these values, the LED current will range from 0 to about 20 mA (roughly), and at 50% pot setting the current will be about 1.3 mA. This may give you what you are looking for.  Please note that my numbers and values aren't exact, since I assume a fixed 1.75V LED voltage.

Problems with this approach: 
There is significant current flowing through the pot wiper -- depending on the pot this may be an issue.
The opto specs don't provide transfer curve data so I don't know how it's actually going to behave.
The LED "off" voltage isn't provided, so you might need to adjust the value of R2.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #9 on: January 19, 2021, 07:14:11 pm »
Sorry for my late answer but had to try to understand it all:-)
Combined am I a bit confused about if I shall use both the active load and the circuit right above this message?

I have made "my version" of both circuits, hope you all will still help:-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #10 on: January 19, 2021, 07:37:09 pm »
I smell an XY problem.
What does the output side of the OptoFET connect to, and what do you actually want it to do?   Give details of the characteristic you are trying to achieve, and the likely signal levels.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #11 on: January 19, 2021, 09:41:25 pm »
Thanks for asking:-)
I am sending a audio signal from i.e. a CD-player or some other device.
The opto is ment to act as a volume control.
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #12 on: January 19, 2021, 10:16:44 pm »
Hmmm..... The NTE3085 crossreferences to H11F1M, and that datasheet is far more informative.  Looking at fig.2 its only sufficiently linear (i.e. purely resistive) for a volume control if you keep the voltage across it under 0.1V pk-pk.  Consumer 'line level' is typically -10dBv, which is 0.894V pk-pk, so I'd expect severe harmonic distortion if you use this optoFET in a simple unamplified attenuator circuit feeding a line level input.

To make it work satisfactorily you'd need to attenuate the signal by a factor of 10 before the optoFET so it doesn't distort, then amplify it x10 afterwards to restore line level.

If you've got to amplify it anyway, so need power rails, there are plenty of other options ranging from dedicated digital volume control chips, to VCAs like the AS3360 if you want an analog control signal.   However why can't you simply use a volume control pot in the signal path?

If you *MUST* do this with optoFETs, I suspect you'll need three optoFETS with their LEDs in series, selected to be reasonably well matched.  Two for the signal channels and the third for feedback control of If, arranged in a bridge with the same fixed resistor as the two signal chanels and a log law (or faked log law) control pot, feeding an OPAMP to drive the LEDs.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #13 on: January 19, 2021, 10:34:24 pm »
My reason for using the optocoupler is simply to learn on how different variable resistive components influences sound, THD, frequency and so on and I thought it could be fun also to adjust such a small difference in current.
But if we do talk about the best solution, is there a way to avoid an analog pot, a way to use as few components as possible?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #14 on: January 19, 2021, 10:48:14 pm »
There are some entirely pot-free options that don't require a MCU to control them. e.g.

MAX5486 Stereo Volume Control with Pushbutton Interface
https://datasheets.maximintegrated.com/en/ds/MAX5486.pdf

MAX5440 Stereo Volume Control with Rotary Encoder Interface
https://datasheets.maximintegrated.com/en/ds/MAX5440.pdf

However as a learning experience you might as well continue to experiment with NTE3085/H11F1M based circuits.   There are some suggested attenuator circuits in the latter's datasheet.  For linear If control by a hi-Z control voltage, put the opto's LED between out and -in of an OPAMP, with a resistor to ground to set the voltage to curret scaling.  Apply your control voltage to +in.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #15 on: January 20, 2021, 12:42:36 pm »
That looks super interesting! :-)
Am I right in thinking that you can even make these solutions to act as a balance control at the same time, by using two circuits in parallel?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #16 on: January 20, 2021, 12:56:21 pm »
The two Maxim chips I linked already include balance control functionality.

If you are going with my suggestion of implementing an isolated voltage controlled attenuator with an OptoFET in its feedback loop, simply make two mono circuits, each with its own OPAMP and feedback (so total four OptoFETs), and implement balance by offsetting their control voltages.
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1117
  • Country: lt
Re: Please I need help to calculate resistance?
« Reply #17 on: January 20, 2021, 01:05:33 pm »
The idea is ok, but the tools used are kinda wrong. You should look at photocell optocouplers. Basically they are photoresistor (LDR) output and deliver better linearity.

Also if you want to experiment, you may even buy some bare LDRs and package them with a light source of your own. Like incandescent or LED. That could be fun. There is good hope to get a resonable audio performance. Your original idea would most likely have high distortion and sound bad.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #18 on: January 20, 2021, 11:02:50 pm »
okay so LDR is gotten better? I have always read about LDR being all over the place, that if you chose to use two, it would be nearly impossible to make them work equally?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #19 on: January 20, 2021, 11:53:25 pm »
If I am understanding correct, do you want to let two chips run in opposite mode, so when one chip is turned up, the other is turned down and in that way keep the impedance the same no matter the volume?
And let the balance work in the same way but across the two channels?

EDIT: Do I need high impedance if I avoid grounding the signal?
Instead of connecting ground to the cabinet do I think of just letting both wires go directly to the power amplifier, see picture.
Please understand that I am in no way ignoring your advices but chose to use the NTE3085 as a symbol for the function I want to reach. The right side of the opto is to illustrate what I mean by "not grounding the ground" :-)
« Last Edit: January 21, 2021, 12:36:19 am by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #20 on: January 21, 2021, 12:41:04 am »
Nope the Maxim ICs I mentioned only need a pushbutton to toggle balance mode + a LED to indicate its in balance mode.

If you want to use OptoFETs, start with the H11F1M datasheet attenuator, 500K upper resistor, OptoFET lower version (top left page 6).  Feed it from a fixed attenuator to get a line level signal down to under 0.1Vpk-pk, e.g. 46K upper, 5K1 lower.  Follow it by an non-inverting OPAMP stage with the same 46K,5K1 divider to boost it back up to line level (when If is 0).  Even a 3.3V (split rail or AC coupled) RRIO OPAMP will do.   Duplicate for the other channel.   I've already described most of the control circuit.   Generate a 0.1V reference voltage (e.g. potential divider + OPAMP buffer)   Use the same page 6 attenuator circuit to get a feedback voltage that the OPAMP driving the series OptoLEDs compares with the control voltage, attenuated 100:1 (for a 0-10V control range).  Duplicate for the other channel sharing the 0.1V reference.

Its up to you to figure out how to generate two 0-10V control voltages, from a single log law 'volume' pot and linear 'balance' pot, that gives a consistent no. of dB balance range over nearly all the volume range.
« Last Edit: January 21, 2021, 12:43:49 am by Ian.M »
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1117
  • Country: lt
Re: Please I need help to calculate resistance?
« Reply #21 on: January 21, 2021, 01:44:13 am »
I just noticed, that photocell optocoupler, like an old VTL5C3, acts more linear, especially with higher signal amplitudes. They were used quite a lot for volume control. Also LDR introduces some lag which is often an advantage, because it helps to keep things smooth. Not easy to do perfect, but LDR volume control is quite established thing.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #22 on: January 21, 2021, 02:14:59 am »
Yep. but photoresistor tracking between channels stinks and you also have to deal with the resistance being dependent on the previous illumination history. 
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #23 on: January 21, 2021, 03:21:56 am »
Sorry but I do feel I am on deep water, I do think I lack knowledge to understand how to build a solution.
The volume control example in the datasheet do almost show parts of my flawed solution, only with another value.

The input from the power supply is right now meant to be 5V with some max Ampere and the audio signal from a CD-Player is about 1-2V.
I thought that a higher signal like 2V would be better than i.e. 0.1V:-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #24 on: January 21, 2021, 03:52:27 am »
The input from the power supply is right now meant to be 5V with some max Ampere and the audio signal from a CD-Player is about 1-2V.
I thought that a higher signal like 2V would be better than i.e. 0.1V:-)
Nope.  A higher signal level is better in a linear system because it improves the signal to noise ratio.  However OptoFETs like the NTE3085 / H11F1M only show linear resistive behavior for small voltages and currents. See Fig.2 Output Characteristics on page 5 (6 with the cover) of the H11F1M datasheet,   its only resistive for a small region of approx +/-50mV, +/-500uA centered on the origin.  Once you have over 100mV across it, its close to being a current source/sink with a slope resistance  orders of magnitude higher than in its linear resistive region.  Therefore if you let the signal peaks across it exceed +/-50mV you'll get massive amounts of third harmonic distortion.   

As you've only got a 5V supply, reduce the control voltage attenuation in my suggested circuit from 100:1 to 50:1.  That would give a range from min volume at 0V (max. attenuation, -70dB?) to max volume at 5V (min. attenuation, with the OptoFET cut off).
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #25 on: January 21, 2021, 05:03:28 pm »
If you should find the most neutral way to adjust the volume and balance, what technique / component would you take a look at?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Please I need help to calculate resistance?
« Reply #26 on: January 21, 2021, 05:23:21 pm »
First define 'neutral'!  If you are looking for an audiophile grade solution, I'd consider a pair of R-2R multiplying DACs built from gold plated contact reed relays and precision non-inductive resistors, controlled by a MCU that returns to a clock stopped deep sleep mode (to avoid it contributing any digital noise) once it has made any attenuation change until it is woken up again by further user input.  For audiophools,ditch the MCU and control the relays from pair of concentric rotary switches  via a diode matrix that 'programs' the attenuation steps.  For the rest of us, the best digitally controlled volume/balance chip we can afford is probably a better choice!
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Please I need help to calculate resistance?
« Reply #27 on: January 21, 2021, 07:15:20 pm »
LOL sounds interesting, but it sounds to me like you didn't write English in 90% of the text:-)
Or in short, have no idea on what it means:-)

EDIT: my original idea was also to separate the control unit from the audio, so I could use cheap standard parts while only a single component did touch the sound.
« Last Edit: January 21, 2021, 07:18:41 pm by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf