Driving an optocoupler LED at different supply voltages - Page 1
Forum section: electronics / projects

author: fenclu
author_rank: Regular Contributor
timestamp: January 16, 2019, 01:41:41 pm
content: I have a project that involves a serial communication interface, that is isolated with a 6N136 optocoupler, at a relatively high speed, but well below the maximum of 1Mbaud for this optocoupler. The biggest problem is the varying supply voltage, between 1,8V and 4,5V. In that case it is impossible to choose a proper resistor for the LED, because the current will be either too low for low voltages or too high for high voltages. I experimentally determined the minimum LED current at around 4mA.Several problems overlap in such a case, because the LED is driven at a relatively high frequency, and the minimum voltage is close to the forward drop of the LED (the Lite-on version of the 6N136 features a maximum Vf of 1.7V).Does anyone have a simple idea of how to drive such an LED with a current that fits between the 4mA and 25mA with varying voltage? Some simple current source maybe?

author: MasterT
author_rank: Frequent Contributor
timestamp: January 16, 2019, 02:11:13 pm
content: I don't know if OPA with 1.8V min. Vdd exists, digikey listed from +-1V. May be you can convert supply voltage to known +2.5V - 5V and drive led as usual, than search boost converter

author: fenclu
author_rank: Regular Contributor
timestamp: January 16, 2019, 02:17:53 pm
content: Thing is, it's a bit complicated. This design is for a tiny module with an MCU on it, that is supposed to measure the battery voltage and send the data over an isolated data line. These modules will be made in big panels, so any additional cost is not desirable. Preferably i wanted to use discrete components.I had an idea, see the attatched photo. The MCU would switch one side of a paralleled resistor based on the voltage it reads. However, I am afraid that when the R2 is not needed, the MCU would pull the output high, essentially disabling the LED.

author: MasterT
author_rank: Frequent Contributor
timestamp: January 16, 2019, 02:27:22 pm
content: If you have spare digital pins on the uCPU, than pre-set 4-5 pins with different resistors value to a LED. Only one pin set as output at a time, others are inputs. Depends on the power source voltage selection of the appropriate resistor is made.

author: schmitt trigger
author_rank: Super Contributor
timestamp: January 16, 2019, 02:58:40 pm
content: What MasterT said. The trick here is to disable the unused ports configuring them as Hi-Z inputs, such that they don't contribute or draw any current.

author: CJay
author_rank: Super Contributor
timestamp: January 16, 2019, 03:13:28 pm
content: I've used a variant of the simple current sink in Fig 2 in the link, you can drive it with an I/O pin of an MCU via a resistor to the gate of the MOSFET but I'm not convinced it's simple enough (four parts) or going to work down to your lowest Vf (it simulates down to 1.8V but I don't know if that's good enough for your Opto), you'd need to experiment.Has the advantage that your MCU doesn't need to soource current, just sink it.https://www.edn.com/design/analog/4363797/Circuit-achieves-constant-current-over-wide-range-of-terminal-voltages

author: fenclu
author_rank: Regular Contributor
timestamp: January 16, 2019, 03:15:54 pm
content: Quote from: MasterT on January 16, 2019, 02:27:22 pmYou mean the pins to drive the resistor low, not additionalTX pins?

author: MasterT
author_rank: Frequent Contributor
timestamp: January 16, 2019, 03:23:06 pm
content: Quote from: fenclu on January 16, 2019, 03:15:54 pmWe still don't know uCPU type, bus, if there is a possibility to use any digital pin or it's map-ed by hardware. If transmit TX pin can't be moved, than "bridge" circuitry - one TX+led and several current supply pin+resistors to select.

author: Benta
author_rank: Super Contributor
timestamp: January 16, 2019, 04:18:53 pm
content: Just use a JFET with gate shorted to source.Look at your LED current and find a JFET with the desired drain current at VGS= 0.Simple and effective, I've done this many times.

author: dmills
author_rank: Super Contributor
timestamp: January 16, 2019, 05:32:23 pm
content: But note the WIDE spread in Idss, it is the jfet equivalent of Hfe in terms of device to device spread.Regards, Dan.

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2019, 05:58:43 pm
content: Minimum LED current is not determined experimentally, but defined by the manufacturer. If I remember correct, it is 8mA for 6N137 (please verify in the datasheet)You need acurrent sourcefor the LED.Just ask google for "LED current source" and check the simple transistorized solutions.I'd bet on this two transistor one to work quite nicely across a decent voltage range up to some decent speeds.//EDIT: I think this may be a bit better than trying to source unobtanium depletion mode (J)FETs with just the right amount of current at zero Vgs.//Those 8mA I may have probably confused with this device? Not sure, been quite a while last time I've used such opto (there are better alternatives these days):https://media.digikey.com/pdf/Data%20Sheets/Sharp%20PDFs/PC410L0NIP%20Series.pdf

author: fenclu
author_rank: Regular Contributor
timestamp: January 16, 2019, 06:28:15 pm
content: Quote from: Yansi on January 16, 2019, 05:58:43 pmThe 6N137 is actually a different beast, which uses some logic at the output and also requires a supply of between 4,5 and 5,5V. The 6N136 (or 6N135) uses a photodiode with a transistor output. The datasheet of the 6N136 does not state a minimum supply current, or at least I can't find one. Nevertheless, with the decreasing current, the speed decreases. The 4 mA I determined resulted in a fall time of around 2us, which is acceptable in my case.

author: CJay
author_rank: Super Contributor
timestamp: January 16, 2019, 06:32:55 pm
content: Quote from: Yansi on January 16, 2019, 05:58:43 pmIndeed, I did some experimenting with optocouplers a while back and found forward current through the LED is very imprtant if you need to meet specs for transfer ratio but you can drive them with quite low currents if you don't need them to be high speed.Quote from: Yansi on January 16, 2019, 05:58:43 pmThat's the bipolar version of the one I linked, it works well with a MOSFET in the T2 position, 2N7000 works.I built a few dozen for some PWM fading LED strings a few years back, they're good to really quite high frequencies, far higher than I needed. to stop the flicker

author: langwadt
author_rank: Super Contributor
timestamp: January 16, 2019, 06:47:54 pm
content: with only 100mV to work with, 1.8V LDO

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2019, 07:10:16 pm
content: Do you have (any) power supply available at the isolated (LED) side?

author: fenclu
author_rank: Regular Contributor
timestamp: January 16, 2019, 07:39:22 pm
content: Quote from: Yansi on January 16, 2019, 07:10:16 pmUnfortunately, no, I don't. I also had an idea to implement some sort of microcontroller voltage doubler, that way I would have a bit higher voltage to play with.

author: Benta
author_rank: Super Contributor
timestamp: January 16, 2019, 07:42:09 pm
content: The drain current spread of JFETs is usually rated at 1:3, but better selections are available.Using a JFET with a rated drain current of 3...9 mA would in this case be appropriate, the real spread will be smaller.The bipolar circuit proposed by Yansi is useless, it has at least 2 V drop. The JFET will work down to 0 V, but only act as a pure current source above ~0.4 V drain-source. Below that it will be resistive, which is not bad in this application.

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2019, 07:58:39 pm
content: Quote from: CJay on January 16, 2019, 06:32:55 pmBut using a FET as T2 does not fulfill requirement of low voltage drop across it, minimum operating voltage would become Vgsth+Vbe minimum, which would probably be significantly more, than just 2* Vbe for the bipolar version. (plus the LED Vfwd of course)Unfortunately both are probably too much for the OP's application.

author: Benta
author_rank: Super Contributor
timestamp: January 16, 2019, 08:18:15 pm
content: Quote from: Yansi on January 16, 2019, 07:58:39 pmWho's talking about using a FET as T2? Not me!I'm talking about usingone single JFETas a constant current source. No resistors, no diodes, no nothing. Get it?

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2019, 08:34:52 pm
content: Do you see on what part of text I have reacted?Do you get it?

author: Benta
author_rank: Super Contributor
timestamp: January 16, 2019, 08:43:46 pm
content: Quote from: Yansi on January 16, 2019, 08:34:52 pmNot really. You've presented a bipolar solution that doesn't really help the OP (far too large voltage drop). Then you've referred to "unobtainium" JFETs, as if it is important to present a current within +/-1% to an optocoupler. After that you lost me.The JFET solution is not precise, but will work down to almost 0 V voltage drop.

author: BrianHG
author_rank: Super Contributor
timestamp: January 16, 2019, 09:02:37 pm
content: +1 On the JFet constant current solution. It has a close to 0.0v drop.

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2019, 09:16:57 pm
content: Quote from: Benta on January 16, 2019, 08:43:46 pmAnd that is a reason to start attacking me? Wtf is wrong with you?Interfacing (any) LED from a 1.8V logic direct is a bad idea anyway.

author: Benta
author_rank: Super Contributor
timestamp: January 16, 2019, 09:32:50 pm
content: Quote from: Yansi on January 16, 2019, 09:16:57 pmI'm not attacking you. I've pointed out that your solution does not fulfill the requirements of the OP. That's all.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 16, 2019, 11:28:38 pm
content: Not sure you'll find a simple current source design with only 100mV dropout (in the least favorable case)...What's your budget exactly (you want something cheap?), and how many digital signals do you actually have to isolate? Only one or several?For an alternative solution, you could have a look at this:https://www.maximintegrated.com/en/products/interface/isolation/MAX14930.html

author: Giaime
author_rank: Regular Contributor
timestamp: January 17, 2019, 08:09:38 am
content: Quote from: langwadt on January 16, 2019, 06:47:54 pmIt seems the best solution to me so far, just lower the supply voltage to the minimum expected and calculate the resistor accordingly.

author: langwadt
author_rank: Super Contributor
timestamp: January 17, 2019, 10:41:18 am
content: Quote from: Giaime on January 17, 2019, 08:09:38 amyeh, but come to think of it, it might be far too slow ..

author: Zero999
author_rank: Super Contributor
timestamp: January 17, 2019, 12:34:52 pm
content: Quote from: Benta on January 16, 2019, 08:43:46 pmI'm not convinced. The JFET constant current based sources I've found require a few volts for devices with a current limit of 4mA.http://njsemi.com/datasheets/J500%20-%20J511.pdfhttps://my.centralsemi.com/get_document.php?cmp=1&mergetype=pd&mergepath=pd&pdf_id=1N5283-5314.PDFhttp://www.mccsemi.com/up_pdf/CLD20B(DO-214AA).pdfhttps://atcsemitec.co.uk/wp-content/uploads/2018/08/Semitec-CRDs-webpage.pdf

author: Benta
author_rank: Super Contributor
timestamp: January 17, 2019, 04:12:00 pm
content: In my experience, the JFET works as a current source down to appr. 1...2 V drain-source (depends on current). Below that it tends to go resistive, which is not really an issue in this application.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 17, 2019, 04:27:28 pm
content: Generally I'd say current regualtor is ideal for driving LEDs but if you want the smallest and easiest solution, this could be one the rare occassions where zener voltage regulator is good.Look up: EEVblog #908 - Zener Diodes

author: Kalvin
author_rank: Super Contributor
timestamp: January 17, 2019, 04:41:32 pm
content: Use a small boost-converter with Vin 1.8V ... 4.5V and Vout 5V.Something like this:https://www.banggood.com/0_9-5V-To-5V-DC-DC-Step-Up-Power-Module-Boost-Converter-Board-1_5V-1_8V-2_5V-3V-3_3V-3_7V-4_2V-To-5V-p-1209841.html

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2019, 10:52:39 pm
content: I am becoming lost. What would you use the boost converter for? I thought, there was not power supply available on the LED side?

author: spec
author_rank: Frequent Contributor
timestamp: January 17, 2019, 11:42:07 pm
content: UPDATE: I see Kalvin at reply #30 beat me too itQuote from: fenclu on January 16, 2019, 01:41:41 pmHi fencluI would suggest a simple low power switch mode PSU chip to generate, say 5V constant from your 1V8 to 4V5 varying supply, and then drive the LED from that supply via a resistor.https://datasheets.maximintegrated.com/en/ds/MAX17220-MAX17225.pdfhttps://www.digikey.co.uk/products/en/integrated-circuits-ics/pmic-voltage-regulators-dc-dc-switching-regulators/739?k=MAX17220&k=&pkeyword=MAX17220&sv=0&sf=0&FV=ffe002e3&quantity=1&ColumnSort=0&page=1&nstock=1&pageSize=25PS: Have you had a look at the 6N137 family of optocouplers?

author: Zero999
author_rank: Super Contributor
timestamp: January 18, 2019, 09:23:14 am
content: Quote from: MasterT on January 16, 2019, 02:11:13 pmQuote from: fenclu on January 16, 2019, 02:17:53 pmI would disagree about that circuit being complicated. Your requirements of 100mV drop-out, over a power supply voltage range of 1.8V to 4.5V aren't straightforward. It can be simplified by omitting the driver transistor, which probably isn't needed for only 4mA.The circuit you've suggested seems sensible, but the MCU's IO pin will have to be set to an input or high impedance mode to avoid shorting the LED.

author: Kalvin
author_rank: Super Contributor
timestamp: January 18, 2019, 10:25:50 am
content: Alternative to the boost-converter idea: If your optocoupler could be driven off from a 1.8V minus 100 mV or so, you could use an RRIO op amp as a constant voltage source (read: 1.8V voltage regulator) to provide constant 1.8V for the LED with a proper series resistor. If your LED driver output is open drain or open collector type, you could drive the LED directly by the output pin. Just select the RRIO op amp which is able to provide enough current for LED even at the 1.8V. You can use a simple diode as voltage reference if the temperature drift is not an issue, and you do not have any other convenient voltage reference available. CMOS outputs and MOSFETs can sink quite well down to 0V, but bipolar transistors will have 100mV - 200mV saturation voltage across collector and emitter.

author: TrickyNekro
author_rank: Frequent Contributor
timestamp: January 18, 2019, 01:50:39 pm
content: How about using a 1.2V reference and a control transistor (either BJT or MOSFET) for the LED. Easy enough.You get the stability of the reference and the the fast switching of the transistor. Most optocouplers their LED is IR based so dropout is at around 0.8V - 1V.You can almost get away with using a BJT for switching. The collector - emitter saturation is around 0.2V. If you want to be sure you get to use a MOSFET like 2N7002.And there are dirty cheap references out there, you need it mostly for regulation anyhow.Edit: And there are parts that can work from 1.8V to 5V or maybe higher. Also you look for a voltage output reference not a shunt reference.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 18, 2019, 06:16:16 pm
content: Quote from: Benta on January 17, 2019, 04:12:00 pm@Zero999 and Benta: indeed. Using a JFET was my first thought as well, but then I quickly realized this would not work properly in the op's use case.Beyond the variation of the current between JFETs of the same model, which may not be a big problem here (you'd just have to settle for a minimum current, the circuit would work fine for higher currents), you have to consider the characteristic curve of a JFET (Ids vs. Vds) @Vgs = 0 to see that below a certain Vds (which would typically be somewhere between 0.5V and 3V depending on the JFET), the current would drop a lot, defeating the purpose of driving the optocoupler's LED at a somewhat constant current regardless of the supply voltage. You could try selecting a JFET for a minimum acceptable current for the LED at Vds = 0.1V, but good luck finding a proper JFET for this while still limiting the max current to an acceptable level for the LED for the max. Vds (thus max. working voltage).As a side note, the Vfd of the LED is said to be 1.7V but in the 6N135/136 datasheet I have, Vfd is up to 1.9V max? So 1.8V may not even allow to light up the LED if you're unlucky...

author: TrickyNekro
author_rank: Frequent Contributor
timestamp: January 18, 2019, 09:15:26 pm
content: Quote from: SiliconWizard on January 18, 2019, 06:16:16 pmDo you have to use the 6N135/6? Cause I can find many parts that are much cheaper and have a lower forward voltage.Example:https://eu.mouser.com/Optoelectronics/Optocouplers-Photocouplers/_/N-6x5ji?Ns=Pricing%7c0&No=25&Rl=6x5jiZgjdhqbZ1yuoc3aZ1yuo3qbSGTAnd... a more specific example:https://eu.mouser.com/ProductDetail/Vishay-Semiconductors/VOH1016AB-T?qs=sGAEpiMZZMtd3yBnp8bAgLhQurE%252baQR29IOeeMf%252bGH1H6u1Y7D9ZWg%3d%3dI am sure if you search a little bit you can find better parts than 6N135/6. These are quite mature parts, that alone makes them expensive.

author: fenclu
author_rank: Regular Contributor
timestamp: January 20, 2019, 08:59:30 am
content: Quote from: TrickyNekro on January 18, 2019, 09:15:26 pmThis one needs a supply voltage of at least 3V.Quote from: MasterT on January 16, 2019, 02:27:22 pmI think that MasterT's solution is the closest to what I had in mind. I will have to try that in practice and let you know how it went. Thank you everybody for your ideas.

author: Zero999
author_rank: Super Contributor
timestamp: January 20, 2019, 11:10:05 am
content: Here's an implementation of MasterT's solution.

author: voltsandjolts
author_rank: Unknown
timestamp: January 20, 2019, 11:24:12 am
content: Maybe microcontroller can measure the supply voltage then use PWM to set LED drive current, along with on-off keying for the comms. Probably lowest BOM cost.

author: TrickyNekro
author_rank: Frequent Contributor
timestamp: January 21, 2019, 01:26:57 am
content: Quote from: fenclu on January 20, 2019, 08:59:30 amHmmm yes, the isolated side, because you got a amp and gate there, there are others that use only a transistor.Are you going to run both sides with the same power supply? I thought your problem was the LED!How fast do you want it to be? Sorry, If I missed an earlier comment or something but something is not adding up.Cause if you need an optocoupler with a low voltage switch LED there are solutions, as far as I remember you needed it for comms.Edit: I´ve read your first comment again, the 3V is for the gate side not the LED side. Also if you want it for serial, your best bet is anyhow going with a gated design cause you can be sure that it works.Or you want to have bidirectional comms? As far as I understood it, it´s for the LED side.A gated design is also the best for both varying driving current and simplicity. Remember KISSing is always your safest bet.

author: TrickyNekro
author_rank: Frequent Contributor
timestamp: January 21, 2019, 01:42:46 am
content: And in case you did not understand it! Here! Page 3 of Datasheet, you look at the input characteristics!Your microcontroller is going to be at the input side. As far as you told us anyhow.Maximum Vf = 1.4V! You can run it down to 300uA in case it is a battery operated project.Unless you are stuck with a bunch of 6N135/136 for whatever reason, there are many other optocouplers that are far superior for your use case, ready out of the box!