![]() |
Forum Index : Microcontroller and PC projects : Opto-Coupler Resistor Value
Author | Message | ||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
What is really required? I am only driving a Pico's input from an external 24v. CTR is not an issue so I guess that the DS-stated LED If of 10mA is unimportant, correct? Really want to keep the resistor's power-rating to the minimum. ![]() Craig |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7879 |
You usually only need a couple of mA through the LED to get good enough current transfer. With a 24v input, that's 22.2v / .002 = 11.1k. Try 10k as the series resistor. It'll dissipate about 0.05W. The exact output current depends on the LED current, but it hardly matters here. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 650 |
The resistor value is calculated like for any other LED; R= (Vin - ledVf) / Iled Example: R= (24v-1,5v)/ 0,04A = 562 Ohm, for the Power rating of the resistor: P= 0,04A^2*562 = 0,89W Greetings Daniel |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Thanks Mick ![]() I was looking at 3.3K but I guess, with this format, I can easily test a variety: Craig |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2620 |
The required LED current can be reduced by increasing the load resistance on the output side. Maximum speed may be reduced if you go too high. Experiment! |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7879 |
You can get the "gain" of the opto from the DS. It's the current transfer ratio - the ratio of the LED current to the output current. There will be a graph as it's usually non-linear. It doesn't start at zero as you need a minimum current through the LED for anything to happen. Better allow a bit more than minimum though as your "24v" might be 19v in reality. :( Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5066 |
@Tinine If you have 10k from 24V to the LED, and 10k pullup or pulldown at the optocoupler output that will work for all normal optocouplers. Assuming 3.3V. In specific cases you can tune these values (speed / noise immunity / analog behaviour). But if speed is an issue, please don't spend too much time tuning. Solve it by using a digital optocoupler. These are far superior in speed to anything you can achieve with normal optocouplers. Volhout PicomiteVGA PETSCII ROBOTS |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Many thanks, guys ![]() No speed concerns here. These are typical inputs from proximity-sensors and they all spend a chunk of time in software de-bounce. I think I have another question but I'll start a new thread because I like to keep the topic in the main thread title. Craig |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |