PDA

View Full Version : Opto isolator question



CharlieRam
27-06-2019, 08:26 PM
I'm hoping someone can point me in the right direction. I have an axbb which is great btw, I also bought a cheap 5 axis Bob to connect to port 3 to give me more inputs for the control panel. I thought I would use the additional outputs to light the control switches to show their active state and bought a cheap 4 channel opto isolator for the job. The Leds on the optoboard switch on when I activate the output but I can't seem to get the switch lights to work on the output side of the opto? I connected the output side G to -0v(24v) and the output side to the switch bulb with the other side of the bulb to +24v. Is this correct? Also I checked continuity on both grounds on input and output sides and they seem to be connected....is this right?
Cheers for any help you would like to give [emoji16]https://uploads.tapatalk-cdn.com/20190627/064f27de9c05109d1f2b8069b99bc94e.jpghttps://uploads.tapatalk-cdn.com/20190627/152093a68c45f18328b332f8d4d449c0.jpghttps://uploads.tapatalk-cdn.com/20190627/6c7a51d29a436727b0e97e00f84a2228.jpg

Sent from my SM-G920F using Tapatalk

Voicecoil
27-06-2019, 10:27 PM
I've never used this board but going off normal terminology I would guess that you need to connect your outputs to the U1, U2, U3, U4 terminals and the ground to the G terminals (you may need to common these up if your lights aren't). I also suspect that the 4 jumpers link the input side ground to the output G on a channel by channel basis, so pull thes for proper isolation. And check that your lights don't require too much current, opto's do have a finite current rating.

john swift
28-06-2019, 12:33 AM
which breakout board do you have ?
a photo or link will help to find out what type of input the BOB has

going by your photo of the opto-isolator board it looks like the opto-isolators photo transistor collector is connected to the output terminal (U1, U2 ,U3 ,U4 ) via a resistor
the photos resolution is too low to read the value

can you either post a photo that shows the 3 numbers printed on the resistors or just say what the resistors are in your reply

John

Doddy
28-06-2019, 07:41 AM
Your thinking is broadly correct, but you don't understand Opto-Isolators. Your chance of success lies with the type of illumination provided by the switches.

In operation, the internal LED translates current to light, and the internal transistor translates light to (essentially) current. The device has a characteristic called Current Transfer Ratio - which for an EL817 (cheap) device (and given the markings on the board a likely candidate for the devices you have) is specified between 50% to 600% (the variance is depending on manufacturing deviations, temperature, etc). Let's imagine a CTR of 200% - not unreasonable. Now, examine the resistor on the input to the Opto Isolator on the driver board, and what looks like a series-connected LED for status-indication. The resistor is likely to be rated to provide a forward current through the Opto Isolator between 1mA and 5mA (once upon a time likely higher, but modern LEDs have better efficiency and the trend is to reduce the forward current) - Let's say 2mA. With a CTR of 200% that means you can only expect 2mA x 200%. = 4mA through the collector/emitter junction of the transistor in the opto-isolator. Now, if your 24V panel indicator/switch is an incandescent lamp I'd expect the operating current to be around 50mA or so - so you're not going to get the required current to illuminate the switch. Additionally, there is a series resistor on the collector to the opto-isolator which is going to limit the maximum current available through the device.

You've a chance of this working if your indicators are, themselves, LED indicators, as these are likely to operate with the relatively low current provided by the device.

A better solution is to wire up any number of NPN transistors, rather than use the opto-isolator board, or even use these after the opto-isolator board if you actually require galvanic isolation (unlikely) - happy to explain further if you want to pursue this option.


***FURTHER INFO***

An image of this board from eBay shows the LED current-limiting resistor is 1k, in series with the on-board status LED, so you have the forward voltage drop across both devices (call this 3.6V), so if driving from 5V (I'll be generous and ignore the drop across the driving device) that gives 1.4V through 1k resistor, or 1.4mA forward current. Now, on the collector there's a 3k3 resistor - which means that at 24V across the C-E on the isolator's transistor, you're limited to 24/3300 = 7mA, before considering the CTR of the device. Realistically, given the LED forward current limiting I'd work on switching no more than 1mA reliably.

*** FURTHER FURTHER INFO ***

I'm concerned of your wiring in the image, and I'd agree with VoiceCoil's post - If the link-options (red jumpers) provide a shorting link from the opto isolator's emitters to the common ground from the input-side, then you need to be wiring your indictors to the upper terminal of each channel - the otto-isolators will be switching the ground level - so the other side of the indicators would be wired to +24V. But for the reasons above this is still unlikely to work.

Mike

john swift
28-06-2019, 01:34 PM
found this circuit of the 4ch opto-isolator board online
25980

looking at this photo it looks like the resistors are 1K (marked 102) and not the 3K on the circuit diagram !!!
25981

John

PS
once the details of the breakout board are known it will be possible to workout if the 1K resistor connecting the photo transistor to the output terminal will stop the BOB seeing the output switch

PPS
example
two possible ways of connecting the opt-isolator board to a C11G breakout board

25982

25983

revised diagram for your BOB can be made once I have details of the BOB

with the 1K resistor on the opto-isolator board the opt-isolator board limiting the current
I think your going to need to add some form of lamp driver to operate the bulbs on your iluminated switches
an octal darlington array - possibly ULN2803 should work
ULN2803 pdf data
25984


what current does the bulbs take ???

CharlieRam
28-06-2019, 07:49 PM
Wow guys, I wasn't expecting this much info when I got back! :) it seems I have forgotten stuff since I last dabbled in electronics! I once made a solenoid gun recoil for mame powered via a Parallel port using opto isolator but I forgot about using mosfets. You are all right, I was expecting the opto to act like a switch...that is off or on and it was rated upto 36v on the output side so just assumed I could drive a 24v bulb from the 24v power. Bugger!
I also don't really need the isolator for the bulbs!
I also just found the leftover mosfets but I'm thinking they may be a bit overkill for a bulb. I wonder how hard it would be to fit a LED into the switches?

Cheers guys https://uploads.tapatalk-cdn.com/20190628/c3f424b6e854378158f8b4607d52e945.jpghttps://uploads.tapatalk-cdn.com/20190628/71f53198a7bc177e2b0cd0146c3ab7e1.jpghttps://uploads.tapatalk-cdn.com/20190628/c6dff9c833c8281c4a43a65722c9166a.jpg

Sent from my SM-G920F using Tapatalk

Doddy
28-06-2019, 07:56 PM
I also just found the leftover mosfets but I'm thinking they may be a bit overkill for a bulb. I wonder how hard it would be to fit a LED into the switches?
Sent from my SM-G920F using Tapatalk

My experience - easier to just order new switches from China. I've never been happy with transplanting LEDs into illuminated switches - the standard diffuser element doesn't work well to provide uniform lighting compared to a bulb. Try with one but...

john swift
28-06-2019, 08:34 PM
looking at the photo of the opto-isolator board
it has 3K resistors fitted as shown on the chinese circuit diagram
so the output current is even more limited

with a 3K or 3.3K resistor between the gate and source of the Fets you have you could wire the opto-isolator to pull the gate upto +12V (half of the 24V supply ) to switch the FET on

25986

the BOB is like this I have looked at before
25985

John

CharlieRam
28-06-2019, 09:39 PM
looking at the photo of the opto-isolator board
it has 3K resistors fitted as shown on the chinese circuit diagram
so the output current is even more limited

with a 3K or 3.3K resistor between the gate and source of the Fets you have you could wire the opto-isolator to pull the gate upto +12V (half of the 24V supply ) to switch the FET on

25986

the BOB is like this I have looked at before
25985

JohnCheers John, look what I just found...[emoji16] seems I may as well use them as I have them lying aroundhttps://uploads.tapatalk-cdn.com/20190628/d48a973298ed7557a65ff7833882b788.jpg

Sent from my SM-G920F using Tapatalk

john swift
28-06-2019, 09:53 PM
it looks like you have all the parts to try it out with the FET

the combination of the high value resistors and the gate source capacitance is going to slow the FETs switching but for this application it should be OK

I usually use a 100 ohm resistor to connect the gate to a low impeadance driver
(very like the 100 ohm "grid stopper" with valve (tube) circuits )

John

CharlieRam
28-06-2019, 09:56 PM
I think I also have 1k and 100ohm resistors as well as 6 pin optos that I forgot I had! :)

Sent from my SM-G920F using Tapatalk

john swift
28-06-2019, 10:03 PM
it looks like you have a few options to try if the opto-isolator board does not work

John

Doddy
28-06-2019, 10:09 PM
... or simplify the whole thing and bin off the board, any isolation and just use the mosfets. What’s the Vgs(on) for the details?

john swift
28-06-2019, 10:32 PM
going by figure 6 on page 5 of the pdf data
I would aim for a minimum of 5V

while the absolute maximum ratings for Vgs is +/- 30V
I would limit the maximum to about 20 V

pdf data
25990

John

CharlieRam
29-06-2019, 08:15 AM
So how would the circuit look if I ditch the opto and connected the mosfet direct to the 5 axis Bob? You'll have to excuse my lack of electronics knowledge, I've occasionally dabbled over the years but i always forget what I learnt!

Sent from my SM-G920F using Tapatalk

john swift
29-06-2019, 11:08 AM
you should be able to connect the BOB directly to the FET

25991


the 2N7000 would be an alternative FET in a smaller TO92 case

25992

John

CharlieRam
29-06-2019, 12:53 PM
Cheers John

Sent from my SM-G920F using Tapatalk

magicniner
29-06-2019, 01:08 PM
Optically Isolated means the input has no current flow or connection to the output, a lot like a Relay!
By using one wire on the output you are connecting your wires to a floating point in your circuit!
The outputs will not work unless both connections are used, you need a common ground or common live to one side of each output in order for there to be any signal at the other side of the output! :D

CharlieRam
29-06-2019, 01:12 PM
I was connecting both :) I would of expected the resistance to drop when the opto was activated but nothing seems to change! Anyhow I'll ditch the opto and just use the mosfets

Sent from my SM-G920F using Tapatalk

magicniner
29-06-2019, 01:37 PM
Not in the photo of your setup which you posted in your first post :D

CharlieRam
29-06-2019, 01:38 PM
Not in the photo of your setup which you posted :DThat's after I disconnected loads of wire :)

Sent from my SM-G920F using Tapatalk

magicniner
29-06-2019, 01:41 PM
That's after I disconnected loads of wire :)

Sent from my SM-G920F using Tapatalk

Oh, well that helps and isn't pointless at all :D

CharlieRam
29-06-2019, 01:49 PM
Oh, well that helps and isn't pointless at all :DYeah, in hindsight it wasn't the best image to show! [emoji23]

Sent from my SM-G920F using Tapatalk

john swift
29-06-2019, 06:34 PM
I have had a quick look at the various arduino boards available

this looks like a ready made you can use (amazon are out of stock but it appears to on sale from ebay )
https://www.amazon.co.uk/d/Wall-Socket/Channel-MOSFET-Button-IRF540-Arduino/B01MRQFYJN

hi res readable picture from amazon advert
25994

the small 16 pin IC is a quad opto isolator - part number PS2801-4



another possible board

https://ja.aliexpress.com/item/32748663765.html?spm=a2g0o.detail.1000013.1.780610 c7c33SkV&gps-id=pcDetailBottomMoreThisSeller&scm=1007.13339.128551.0&scm_id=1007.13339.128551.0&scm-url=1007.13339.128551.0&pvid=fc33f7c4-d345-4224-bbc3-954e0244d34d


25995


I was going to say the problem with all of the chinese boards is the lack of information but
I have found this
http://www.ekt2.com/pdf/412_ARDUINO_MODULE_4CH_MOSFET_SWITCH.pdf

25996


john

Ger21
30-06-2019, 02:41 AM
Wouldn't a relay board be easier?

https://www.ebay.com/itm/1CH-2CH-4CH-Relay-Module-Board-With-Optocoupler-H-L-Level-Triger-5-9-12-24V/264029008588?hash=item3d795af2cc:m:mZDHIKCabH4U4QO ng0awJrg

CharlieRam
30-06-2019, 01:35 PM
Cheers guys, I really appreciate the help. I went ahead and used my mosfets and soldered it up in the sun yesterday...boy it was hot!!
Anyway...its all sorted now although the red switches are very bright[emoji848]
Cheers again...my machine will hopefully be finished this year!https://uploads.tapatalk-cdn.com/20190630/52a494df1b9a9b5f0182856040c6949e.jpg

Sent from my SM-G920F using Tapatalk

john swift
30-06-2019, 02:23 PM
Gerry

the relay board is a simple alternative to using transistors that some will prefer
( as always the best solution is the one that works for you )

the relay board has the advantage the outputs can be wired to either have a common +24V or common 0V / ground connection


Charlie

great result

do you have the option to use 28V bulbs in the switches ?

under run 28V bulbs will last longer


an alternative would be to add a resistor in series with the bulb
if the bulb takes 40 mA a 100 ohm resistor would drop the voltage by 4 V

john

CharlieRam
30-06-2019, 02:31 PM
Gerry

an alternative would be to add a resistor in series with the bulb
if the bulb takes 40 mA a 100 ohm resistor would drop the voltage by 4 V

john

That was my thinking John, thanks.

Charlie

Sent from my SM-G920F using Tapatalk