Please I need help to calculate resistance? - Page 1
Forum section: electronics / beginners

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 17, 2021, 11:03:13 am
content: 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.pdfOn 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."

author: srb1954
author_rank: Super Contributor
timestamp: January 17, 2021, 12:07:49 pm
content: Quote from: FriedMule on January 17, 2021, 11:03:13 amThe 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 17, 2021, 12:39:05 pm
content: 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?

author: jmelson
author_rank: Super Contributor
timestamp: January 17, 2021, 04:53:50 pm
content: 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

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 17, 2021, 05:45:06 pm
content: 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:-)

author: srb1954
author_rank: Super Contributor
timestamp: January 17, 2021, 10:58:23 pm
content: Quote from: FriedMule on January 17, 2021, 12:39:05 pmA 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 18, 2021, 12:30:46 am
content: 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.

author: CaptDon
author_rank: Super Contributor
timestamp: January 18, 2021, 02:23:43 pm
content: 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.

author: fourfathom
author_rank: Super Contributor
timestamp: January 18, 2021, 06:55:04 pm
content: 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 19, 2021, 07:14:11 pm
content: 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:-)

author: Ian.M
author_rank: Super Contributor
timestamp: January 19, 2021, 07:37:09 pm
content: I smell anXY 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 19, 2021, 09:41:25 pm
content: 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.

author: Ian.M
author_rank: Super Contributor
timestamp: January 19, 2021, 10:16:44 pm
content: Hmmm..... The NTE3085 crossreferences toH11F1M, 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 19, 2021, 10:34:24 pm
content: 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?

author: Ian.M
author_rank: Super Contributor
timestamp: January 19, 2021, 10:48:14 pm
content: There are some entirely pot-free options that don't require a MCU to control them. e.g.MAX5486 Stereo Volume Control with Pushbutton Interfacehttps://datasheets.maximintegrated.com/en/ds/MAX5486.pdfMAX5440 Stereo Volume Control with Rotary Encoder Interfacehttps://datasheets.maximintegrated.com/en/ds/MAX5440.pdfHowever 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 20, 2021, 12:42:36 pm
content: 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?

author: Ian.M
author_rank: Super Contributor
timestamp: January 20, 2021, 12:56:21 pm
content: 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.

author: Manul
author_rank: Super Contributor
timestamp: January 20, 2021, 01:05:33 pm
content: 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.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 20, 2021, 11:02:50 pm
content: 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?

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 20, 2021, 11:53:25 pm
content: 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" :-)

author: Ian.M
author_rank: Super Contributor
timestamp: January 21, 2021, 12:41:04 am
content: 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.

author: Manul
author_rank: Super Contributor
timestamp: January 21, 2021, 01:44:13 am
content: 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.

author: Ian.M
author_rank: Super Contributor
timestamp: January 21, 2021, 02:14:59 am
content: Yep. but photoresistor tracking between channels stinks and you also have to deal with the resistance being dependent on the previous illumination history.

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 21, 2021, 03:21:56 am
content: 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:-)

author: Ian.M
author_rank: Super Contributor
timestamp: January 21, 2021, 03:52:27 am
content: Quote from: FriedMule on January 21, 2021, 03:21:56 amNope. A higher signal level is betterin a linear systembecause 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 theH11F1M 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).

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 21, 2021, 05:03:28 pm
content: If you should find the most neutral way to adjust the volume and balance, what technique / component would you take a look at?

author: Ian.M
author_rank: Super Contributor
timestamp: January 21, 2021, 05:23:21 pm
content: 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!

author: FriedMule
author_rank: Frequent Contributor
timestamp: January 21, 2021, 07:15:20 pm
content: 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.