Driving IN-13's with an optocoupler and PWM from an Arduino.

673 views
Skip to first unread message

Chill4844

unread,
Mar 5, 2013, 7:46:15 PM3/5/13
to neoni...@googlegroups.com
Hello fine folks of the Neonixie community, I'll lay out the scenario here my troubles are at the bottom.  I am working on an interesting computer case project in which i would like to use 2 IN-13's or IN-9's (I have some of both) to drive some meters for my computer (CPU usage, Temperature, VU, ect.).

Components I am using, Or at least intend to use include



Arduino to communicate with the computer and output PWM

I have experimented with several different configurations, done all of the calculations i am smart enough to achieve (Not very many of them unfotunately) ,But I cant seem to get the optocouplers to drive the nixies in any good way they seem to scale to full in only a few percent of PWM and then over-current or segment and move to the wrong end of the tube, all sorts of nightmarish things.

Please Please Please, Can someone help me to figure out the proper resistance vals between the Arduino and my optocoupler and between the cathode and ground.

Thank you all for your patience with this newbie

P.S.  I am willing to learn or do research on my own if you can even point me in the right direction.

John Rehwinkel

unread,
Mar 5, 2013, 8:15:25 PM3/5/13
to neoni...@googlegroups.com
> Hello fine folks of the Neonixie community, I'll lay out the scenario here my troubles are at the bottom. I am working on an interesting computer case project in which i would like to use 2 IN-13's or IN-9's (I have some of both) to drive some meters for my computer (CPU usage, Temperature, VU, ect.).
>
> Components I am using, Or at least intend to use include
>
> PSU - http://www.ebay.com/itm/High-Voltage-Power-Supply-Kit-45V-to-190V-Out-for-Nixie-Old-Radio-Kit-/251228875692?pt=LH_DefaultDomain_0&hash=item3a7e686bac
>
> Vishay H11D3-X007 Optocouplers http://pdf1.alldatasheet.com/datasheet-pdf/view/230514/VISHAY/H11D3-X007.html

Note that this link won't work, as the alldatasheet people don't accept foreign links directly to their data pages. It's probably
easier just to link to the manufacturer's data sheet:

http://www.vishay.com/docs/83611/83611.pdf

> Arduino to communicate with the computer and output PWM

Okay, you're trying to solve two problems here. One is that you're using PWM as an analog output. It isn't really analog, it's a pulse with a varying duty cycle. You need to filter it to get an analog signal. While you can modulate the (apparent) brightness of an LED just fine with a PWM signal, it won't work with these displays, it will just turn them on and off rapidly, changing the brightness but not the lit length.

The second problem is the optocoupler. I'm not sure why you're using one in the first place - normally when driving these displays, they're current modulated by a high voltage transistor at the ground end. Optocouplers aren't very linear either, which makes things harder, unless you're coupling the PWM through the optocoupler and filtering it to an analog signal on the other side. You'll also need a current limiting resistor between your Arduino I/O pin and the optocoupler - without it, the LED will try to draw too much current from the Arduino, and things won't work right.

I like the project, and we're willing to help you, but let's start with a few questions.

Are you converting your PWM signal to analog with a filter? The filter is very simple, just a resistor and a capacitor.

Where are you doing your PWM to analog conversion, before or after the optocoupler?

Why are you using an optocoupler in the first place?

> I have experimented with several different configurations, done all of the calculations i am smart enough to achieve (Not very many of them unfotunately)

We're happy to walk you through the calculations, but first we need to know what configurations you've tried, and what your current one is.

> Please Please Please, Can someone help me to figure out the proper resistance vals between the Arduino and my optocoupler and between the cathode and ground.

Between the Arduino and the optocoupler, there are two choices, you can run from the I/O pin to +5V or from the I/O pin to ground. Either can work, and
happily the resistor is the same either way. I'm going to assume you're running your optocoupler in digital mode, and converting your PWM to analog
on the other side. To get a decent current flow through the output transistor, you'll need to push 10mA or so through the LED. From the data sheet,
the LED will have a voltage drop of 1.1V at this current. Armed with that, you can use Ohm's law to figure the resistance. The voltage across the
resistor will be 5 volts (your Arduino supply voltage*) minus the LED voltage of 1.1V, which works out to 3.9V. You want 10mA through this resistor
to drop those 3.9V. 10mA is 0.01A, and it's generally worthwhile to work Ohm's law directly using amps, volts, and ohms. Ohm's law says E=IR,
or voltage equals current times resistance. For this problem, you get 3.9V = 0.01A * R. Multiply both sides by 100, and you get 390Ω. Happily,
that's a common value, but 330Ω is close enough. You can figure the current for that too, again using Ohm's law: 3.9 = 330I, which works out to 11.8mA,
which is just fine. Note that I'm assuming here that the LED voltage won't change too much with the current - it's actually a workable assumption here,
but I thought I'd make it clear that I'm making it.

* unless you're using a 3.3V Arduino

As for cathode and ground, I'm not quite sure what your lashup looks like. It sounds like you're trying to use the optocoupler as a high-side switch, and
putting the current limiting resistor on the low side. That's a valid approach, but a little peculiar.

> Thank you all for your patience with this newbie

Hey, we were all newbies once! And I remember being thrilled to get help, so I'm happy to help others.

> P.S. I am willing to learn or do research on my own if you can even point me in the right direction.

Sounds like you've done some solid thinking so far, but like I said, you're trying to do a complicated thing, so there will be some unknowns. Once we
know more about how you're trying to get this to work, we can hopefully be more help.

Cheers,
John

Chill4844

unread,
Mar 5, 2013, 8:47:28 PM3/5/13
to neoni...@googlegroups.com
John,  Wow thanks for the fast response, I'll try answer inline to avoid confusion.


On Tuesday, March 5, 2013 8:15:25 PM UTC-5, jrehwin wrote:
> Hello fine folks of the Neonixie community, I'll lay out the scenario here my troubles are at the bottom.  I am working on an interesting computer case project in which i would like to use 2 IN-13's or IN-9's (I have some of both) to drive some meters for my computer (CPU usage, Temperature, VU, ect.).
>
> Components I am using, Or at least intend to use include
>
> PSU - http://www.ebay.com/itm/High-Voltage-Power-Supply-Kit-45V-to-190V-Out-for-Nixie-Old-Radio-Kit-/251228875692?pt=LH_DefaultDomain_0&hash=item3a7e686bac
>
> Vishay H11D3-X007 Optocouplers http://pdf1.alldatasheet.com/datasheet-pdf/view/230514/VISHAY/H11D3-X007.html

Note that this link won't work, as the alldatasheet people don't accept foreign links directly to their data pages.  It's probably
easier just to link to the manufacturer's data sheet:

http://www.vishay.com/docs/83611/83611.pdf

> Arduino to communicate with the computer and output PWM

Okay, you're trying to solve two problems here.  One is that you're using PWM as an analog output.  It isn't really analog, it's a pulse with a varying duty cycle.  You need to filter it to get an analog signal.  While you can modulate the (apparent) brightness of an LED just fine with a PWM signal, it won't work with these displays, it will just turn them on and off rapidly, changing the brightness but not the lit length.

 As of this moment I am not using any sort of filtration Just a simple Current sink driver as the first scenario described here http://www.die-wuestens.de/iz/IN9-2.pdf 
Any help in designing or implementing someone elses design would be much appriciatied.

The second problem is the optocoupler.  I'm not sure why you're using one in the first place - normally when driving these displays, they're current modulated by a high voltage transistor at the ground end.  Optocouplers aren't very linear either, which makes things harder, unless you're coupling the PWM through the optocoupler and filtering it to an analog signal on the other side.  You'll also need a current limiting resistor between your Arduino I/O pin and the optocoupler - without it, the LED will try to draw too much current from the Arduino, and things won't work right.

 
I like the project, and we're willing to help you, but let's start with a few questions.

Are you converting your PWM signal to analog with a filter?  The filter is very simple, just a resistor and a capacitor.

No 

Where are you doing your PWM to analog conversion, before or after the optocoupler?

Neither I could definately use some help here. 

Why are you using an optocoupler in the first place?

I was under the impression that the output of this optocoupler would be the same as say an MJE340, As for the reason for the optocoupler, It was circuit protection. These components will be installed next to and powered by some fairly expensive computer components, and upon some research I thought it would be a good way to make sure that 190VDC doesn't get anywhere near them. If this was an unnecessary or silly move don't hesitate to correct me. I have tried to calc the resisitor between the arduino as well, and it drove the display but not well which could be because i need to filter that signal to analog. I'm really not sure  

> I have experimented with several different configurations, done all of the calculations i am smart enough to achieve (Not very many of them unfotunately)

We're happy to walk you through the calculations, but first we need to know what configurations you've tried, and what your current one is.

> Please Please Please, Can someone help me to figure out the proper resistance vals between the Arduino and my optocoupler and between the cathode and ground.

Between the Arduino and the optocoupler, there are two choices, you can run from the I/O pin to +5V or from the I/O pin to ground.  Either can work, and
happily the resistor is the same either way.  I'm going to assume you're running your optocoupler in digital mode, and converting your PWM to analog
on the other side.  To get a decent current flow through the output transistor, you'll need to push 10mA or so through the LED.  From the data sheet,
the LED will have a voltage drop of 1.1V at this current.  Armed with that, you can use Ohm's law to figure the resistance.  The voltage across the
resistor will be 5 volts (your Arduino supply voltage*) minus the LED voltage of 1.1V, which works out to 3.9V.  You want 10mA through this resistor
to drop those 3.9V.  10mA is 0.01A, and it's generally worthwhile to work Ohm's law directly using amps, volts, and ohms.  Ohm's law says E=IR,
or voltage equals current times resistance.  For this problem, you get 3.9V = 0.01A * R.  Multiply both sides by 100, and you get 390Ω.  Happily,
that's a common value, but 330Ω is close enough.  You can figure the current for that too, again using Ohm's law: 3.9 = 330I, which works out to 11.8mA,
which is just fine.  Note that I'm assuming here that the LED voltage won't change too much with the current - it's actually a workable assumption here,
but I thought I'd make it clear that I'm making it.

* unless you're using a 3.3V Arduino

It is a 5V arduino  Mega2560 if it helps.  

As for cathode and ground, I'm not quite sure what your lashup looks like.  It sounds like you're trying to use the optocoupler as a high-side switch, and
putting the current limiting resistor on the low side.  That's a valid approach, but a little peculiar.

 My circuit is as described in http://www.die-wuestens.de/iz/IN9-2.pdf first model substituting the Optocoupler for the transitor..
> Thank you all for your patience with this newbie

Hey, we were all newbies once!  And I remember being thrilled to get help, so I'm happy to help others.

Definately right there, I can't tell you how grateful and trilled I am. 

John Rehwinkel

unread,
Mar 7, 2013, 5:52:02 PM3/7/13
to neoni...@googlegroups.com
> As of this moment I am not using any sort of filtration Just a simple Current sink driver as the first scenario described here http://www.die-wuestens.de/iz/IN9-2.pdf
> Any help in designing or implementing someone elses design would be much appriciatied.

That's a valid design, but it's designed to work with an analog signal. There are a couple of ways you can attack it. Since there's already a resistance in the circuit, you could build an RC filter around the transistor by simply connecting a capacitor in parallel with it. I think the default Arduino PWM frequency is 500Hz, which would need about 10µf with the 270Ω resistor. That's a pretty large capacitor, since I think it would have to be able to withstand the entire supply voltage.

The other approach is a little more complicated - you'd need to put a higher impedance RC filter (smaller capacitor and larger resistor) on the output side of the optocoupler and then use the output of that to drive a separate transistor to control the IN-13.

> Why are you using an optocoupler in the first place?
>
> I was under the impression that the output of this optocoupler would be the same as say an MJE340, As for the reason for the optocoupler, It was circuit protection. These components will be installed next to and powered by some fairly expensive computer components, and upon some research I thought it would be a good way to make sure that 190VDC doesn't get anywhere near them. If this was an unnecessary or silly move don't hesitate to correct me.

Ah, that makes sense. Inadvertently cooking a $35 Arduino is bad enough, but if it's hooked up to more expensive gear, isolation is a good idea.

- Regards,
John

Reply all
Reply to author
Forward
0 new messages