Author Topic: Optocoupler wiring and resistance values  (Read 4281 times)

0 Members and 1 Guest are viewing this topic.

Offline briskCZTopic starter

  • Newbie
  • Posts: 5
  • Country: cz
Optocoupler wiring and resistance values
« on: August 13, 2015, 01:25:29 pm »
Hello, I study electrical engineering on high school and I have been always intersted in electronics etc...
I want to build nixie tube clock controlled by arduino, and my teacher recomended me to use optocoulplers to galvanicaly separate the arduino from the main board because there could potencialy be high voltage powering the nixie tubes. Its summer break here and I cant ask the teacher if I am doing this right, so I decided to ask here.

My wiring is as shown on attached picture. I have optocouplers CNY17 (datasheet: http://www.farnell.com/datasheets/1795692.pdf ) so I decided to use them.
Pin 1 is attached to digital arduino pin, and the current is limiter by 68R resistor ( I calculated its resistance here: http://led.linear1.org/1led.wiz)
Pin 2 is arduino ground...
Pin 4 is connected to the ground of a second board driving the nixie tubes
Pin 5 is connected to IC on the second board and its connected via pull-up (pull-down?) resistor to 5 volts.

I think that it will work, but I want to confirm that before I make the pcb.
Thanks for the replies. I hope you will understand my post because my english isnt the best :)
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 2682
  • Country: de
Re: Optocoupler wiring and resistance values
« Reply #1 on: August 13, 2015, 02:10:27 pm »
That looks generally fine. Just remember that your opto circuit is inverting the signal. So a "1" output from the arduino will set the output of the optocoupler to "0" and the opposite too. So your arduino software will have to account for this.

Yes, the resistor is a pull-up resistor - "up" if connected to VCC "down" if connected to GND. You've chosen quite a high value though. 10K would probably be fine if the Nixie driver has TTL inputs.

The resistor on the optocoupler input seems a little high. The forward current of the coupler LED is 60mA, forward voltage drop is 1.65V. This means the resistor is dropping about 3.35V so: I = V/R = 3.35/68 = 49mA, a bit low for the LED. 56R would give you 59mA, closer to what you want.

Generally regarding Nixie projects. The Tubes are driven with voltages between 170 and 180VDC. This is not to be taken lightly. Keep your hands away from the circuit when it's live!

McBryce.
30 Years making cars more difficult to repair.
 

Offline briskCZTopic starter

  • Newbie
  • Posts: 5
  • Country: cz
Re: Optocoupler wiring and resistance values
« Reply #2 on: August 13, 2015, 02:43:14 pm »
Thanks for the reply :)

I will use resistance values that you suggested, thats why I was asking.
I want galvanicaly separated arduino from the rest just because the high voltage used for the tubes. If somehow the high voltage found a way to the arduino, it would be fine, I could just replace it, but if that happened when the arduino is connected to my PC it would be bigger problem.

What would I have to change in order to make it non-inverting? It shouldn't be a problem like it is now, but I am just curious :)
 

Offline Svuppe

  • Regular Contributor
  • *
  • Posts: 92
  • Country: dk
Re: Optocoupler wiring and resistance values
« Reply #3 on: August 13, 2015, 02:56:02 pm »
60 mA in to that opto sounds like way to much. It is right up at its absolute maximum rating. Can an Arduino even deliver that much current on a port pin?
 

Offline briskCZTopic starter

  • Newbie
  • Posts: 5
  • Country: cz
Re: Optocoupler wiring and resistance values
« Reply #4 on: August 13, 2015, 03:39:51 pm »
Arduino can deliver 20mA per I/O pin...
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Optocoupler wiring and resistance values
« Reply #5 on: August 13, 2015, 04:15:16 pm »
68R seems a little low (you're driving the LED far harder than necessary) and 220K seems a little high.

You should read up on opto-couplers and CTR (current transfer ratio).
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline briskCZTopic starter

  • Newbie
  • Posts: 5
  • Country: cz
Re: Optocoupler wiring and resistance values
« Reply #6 on: August 13, 2015, 05:01:18 pm »
I will use 10k resistor for the output.
If I correctly understand the datasheet, best CTR is when IF is 10mA so the input resistor should be 390R ?
I work with optocouplers for the first time, so I am a bit confused.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Optocoupler wiring and resistance values
« Reply #7 on: August 13, 2015, 05:13:58 pm »
If a part has a CTR of 50% it means that if you ran the LED at say 10mA, the output wouldn't be able to source/sink more than 5mA.

Likewise if you had a CTR of 200%, running the LED at 10mA would allow you to source/sink a maximum of 20mA.

So in your case running 10mA into the LED (a sensible amount!) and having a 10K on the output (5V/10K= 0.5mA) would require a CTR of greater than 5% and you'll easily meet that with your CNY17.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline briskCZTopic starter

  • Newbie
  • Posts: 5
  • Country: cz
Re: Optocoupler wiring and resistance values
« Reply #8 on: August 13, 2015, 05:51:28 pm »
So if I use 390R input resistor which gives me 10mA input current, and 10k output resistor, will it work well?
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Optocoupler wiring and resistance values
« Reply #9 on: August 13, 2015, 08:07:47 pm »
So if I use 390R input resistor which gives me 10mA input current, and 10k output resistor, will it work well?

Find using a lower led current of around  4ma much better and it turns on the output transistor ok.
Try higher values, 680R , 860R or 1K and see what current your chip actually takes, (my opto runs on 1K ok ) experiment on a breadboard before connecting to your Arduinos output pins.

If you are using several outputs with opto couplers you need to be aware that the each output has a maximum output current of 20 ma according to Ardunio, but the maximum the whole chip can handle is 200ma according to the ATmel 328 datasheet.

However they are maximum figures which you really want to avoid getting that high as you will have heat problems that shorten the components life, so always run as low current as practicable.
« Last Edit: August 13, 2015, 08:11:09 pm by picandmix »
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 2682
  • Country: de
Re: Optocoupler wiring and resistance values
« Reply #10 on: August 14, 2015, 08:00:39 am »
Sorry, for the confusion briskCZ. I accidently read the absolute max for opto LED. Ignore my recommendation on that resistor.

McBryce.
30 Years making cars more difficult to repair.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Optocoupler wiring and resistance values
« Reply #11 on: August 16, 2015, 10:39:56 am »
So if I use 390R input resistor which gives me 10mA input current, and 10k output resistor, will it work well?

I would say so.  Why don't you try it?
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf