Acidmods

Console Modding------ ( Here you can talk about your favorite Consoles ) => XBOX 360 => 360 Controllers / 360 Rapid Fire Controllers => Topic started by: RDC on January 29, 2010, 05:58:38 AM

Title: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 29, 2010, 05:58:38 AM
Save yourself the trouble of hunting for a good switched voltage source in the controller and use an OctoCoupler to 'make' one. They're fairly cheap, small and will work on any of the versions of controller that are currently out now as well as get you the most voltage you'll be able to without wiring straight up to the batteries and using a switch to manually turn on/off whatever you're powering.

For those of you that aren't aware, an OptoCoupler is like a Transistor (and if you're not aware of what either is a trip to Gooogltown is advised ;) ) but the Base is controlled by an LED inside the device, so it's input is isolated from it's output. It takes a little more to turn it on compared to a Transistor, but there's 1 less Resistor to mess with and it can easily turn on a + or - source from a + source whereas an NPN or PNP Transistor alone cannot.

The typical OC has 4 pins, but they come in all types, so I'm just covering the basics here. Read the DataSheet on the OC that you intend to use and make sure it's Forward Voltage of the Input (LED) is no more than 1.5v~1.6v Max, and it's output (Collector Current) is capable of handling the load you need it too before installing it and then wondering why it doesn't work.

EXAMPLE: If you're wanting to use this to turn some LEDs on/off, lets say 4 of them that each have a current rating of 25mA each, and since 4 x 25 = 100, the OC will need to be able to handle at least 100mA of current, and should be rated a bit more than this to be safe.

The Collector of the OC will go to the B+ line or whatever spot you choose for the power source.

The Emitter of the OC will go to your LEDs, Crapid Fire mod or whatever you need to power.

The Cathode of the OC will go to Ground.

The Anode of the OC will go to a 10ohm or so Resistor (the exact value depends on the OC you choose, same with LEDs, read the DS) and then to the Analog Voltage line of the controller, which is switched on/off with the controller.

The recommended spots for wiring up an OC are shown below.

NOTE: This does NOT get you a nice Regulated power source, only one that's switched on/off with the controller. It will still vary with battery voltage on the Wireless controllers and is not recommended for powering Blue or White LEDs. If you want or need a Regulated 3v or higher source from the controller look into (aka Google it) using a Charge Pump or DC-DC converter.

NOTE 2: There's no real reason to mess with this on a Wired controller since it has a 5v source that comes from the console, though it is on all the time, so if you don't want the LEDs or whatever to run constantly an OC can be installed.

WIRED MATRIX

TP7 - Analog Voltage, 1.6v
TP2 - Ground
TP12 or TP18 - 5v

(https://www.acidmods.com/RDC/360//WiredMatrixOC.jpg)

WIRED CL (Common Line)

TP5 - Analog Voltage, 1.6v
TP100, TP101 or TP102 - Ground
TP28 - 5v

(https://www.acidmods.com/RDC/360//WiredCLOC.jpg)

WIRELESS MATRIX and the WIRELESS MATRIX 2

TP7 - Analog Voltage, 1.6v
TP2 or TP22 - Ground
TP1 - AA and PnC B+

(https://www.acidmods.com/RDC/360//WirelessMatrixOC.jpg)

WIRELESS CG (Common Ground)

TP8 - Analog Voltage, 1.5v
TP2 or TP22 - Ground
TP1 - AA and PnC B+

(https://www.acidmods.com/RDC/360//WirelessCGOC.jpg)

WIRELESS CG2 (Common Ground 2)

TP8 - Analog Voltage, 1.5v
TP2 or TP22 - Ground
TP5 - AA and PnC B+

(https://www.acidmods.com/RDC/360//WirelessCGv2OC.jpg)
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: Hazer on January 29, 2010, 06:03:17 PM
I would just like to add that my final rapdifire design used this as well.
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: DaDo on March 05, 2010, 04:56:35 PM
When i add this to my CG2 Board my sticks dont work anymore they schould do. Im twisting and strafing slow to right side and i cant run anymore. (MW2)

Which resistor do i need for CG2 and 4N26 OptoCoupler??
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: RDC on March 08, 2010, 05:44:09 AM
If you installed the OC and it's causing that issue then you did something wrong.

On that 4N26 make sure you're wiring it up correctly..

OC Pin - Controller

1 - TP8, thru a 4.7ohm or so Resistor
2 - Ground
3 - Not Connected
4 - To power LEDs or whatever
5 - B+
6 - Not Connected
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: Brainstorm32 on March 08, 2010, 11:31:45 AM
Where can you buy these other than Ebay. There are different types. Could someone post a picture of one. I would rather do this than use a transistor.
thanks,
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: RDC on March 08, 2010, 03:43:33 PM
Posting a pic would be kind of pointless, since they come in several different packages.

You can get them at all sort of online places like Mouser, Digikey and the like.
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: Brainstorm32 on March 08, 2010, 04:34:21 PM
I found some. They are 6 pin. looks like 100pcs for 10 bucks. Not a bad deal
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: DaDo on March 08, 2010, 05:01:12 PM
If you installed the OC and it's causing that issue then you did something wrong.

On that 4N26 make sure you're wiring it up correctly..

OC Pin - Controller

1 - TP8, thru a 4.7ohm or so Resistor
2 - Ground
3 - Not Connected
4 - To power LEDs or whatever
5 - B+
6 - Not Connected

There it is. Thx.

I doesnt used the resistor, i think thats the point.

I´ll try it tommorow.

Greetz


edit:

Worked!! Thx

edit2:

Hmmm....
On first view it worked, but whem I played a couple of rounds, i noticed when put the stick right forward and press it down for run nothing happens, i must turn the stick a little bit to left or right, then i start running. It´s like the 0-point is moved a little bit forward.

edit3:
After alöt of reading about the 4N26, Resistors, Forward Voltage and all that stuff,
Im a little bit confused about the datasheet of the 4N26, there are 4 Forwrd voltage listed 1.05, 1.15, 1.3 and max 1.5 volt, which schould i use. I calculated 47ohm for 1.05 volt but that was to much and the OC dont power on. 1.5 volt with no resistor powers on but making trouble on my thumbsticks same with the 4.7 ohm resistors.  i came to that point that i need a 33ohm resistor to get on 1.15 volt. Is that right??
Or should i use 20ohm resistors for 1.3 volt??

Im really frustrated because i dont get it to work.

Greetz
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: FastBrad on April 20, 2010, 05:53:41 PM
If you installed the OC and it's causing that issue then you did something wrong.

On that 4N26 make sure you're wiring it up correctly..

OC Pin - Controller

1 - TP8, thru a 4.7ohm or so Resistor
2 - Ground
3 - Not Connected
4 - To power LEDs or whatever
5 - B+
6 - Not Connected

Just to clarify, I am using hazers Flex with tri colored led so could someone tell me please where I should connect pin 4 on oc to, I am using a cg2 board.

Thanks

edit:Ok I have tried a few things, I am using a 4n25 with a 47ohm resistor and when everything is wired up an soldered down, I can still use the code function without the controller turned on.Can anyone help me please.

Post Merge: April 21, 2010, 03:54:03 PM
I think I may no know what my issue is. I am using 4n25 white package not black.Can anyone confirm if this is my issue
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: FastBrad on April 26, 2010, 09:44:09 PM
Can anyone help me please, I have flex mod in cg2 and cant for the life of me get this OC schematic working,I have followed the tut and re-done it multiple times and still cannot get mod to turn off when control pad powers off
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: RDC on May 09, 2010, 01:09:22 PM
The white or black package of the OC makes no difference at all, though the white is more efficient since internally it takes a bit less light to trigger the CE, but either one will work the same for this.

Pin 4 of the OC (4N25) should be going to power your PIC (VCC) that way it has no power to it when the controller is turned off since the OC will be off.
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: FastBrad on May 10, 2010, 09:11:15 PM
Pin 4 of the OC (4N25) should be going to power your PIC (VCC) that way it has no power to it when the controller is turned off since the OC will be off.

Thanks RDC,my problem was I misunderstood the schematic and still had v+ from board to pic :clap:

One other question is there another spot to get the switched 1.5v from, I have another cg board here and the contact is damaged on TP8.

Thanks in advance
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: RDC on May 16, 2010, 07:18:23 AM
Thanks RDC,my problem was I misunderstood the schematic and still had v+ from board to pic :clap:

One other question is there another spot to get the switched 1.5v from, I have another cg board here and the contact is damaged on TP8.

Thanks in advance
You're Welcome.

The Analog voltage is at the Sticks and Triggers, so you can use the solder joints there for that connection.

The outside solder joints of the Sticks POTs are Voltage and Ground, while the center lead is the Wiper line. Going by the Wireless Matrix pic above, the solder joints to the Right of the X line and above the Y line are Voltage (TP7 on that board) and those spots are the same on every 360 controller, the sticks are in the same layout no matter the version.
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: 1mmort41 on August 18, 2010, 06:40:09 AM
I have been told by many people now, that the CG1 board already turns the LED's on/off with the controller. As in some controller lighting tutorials they say that they use a CG1 as its easier to light. If this is true theres no need to do anything fancey to these CG1 boards, correct? OR NO?   
Does a CG1 have a switched voltage already?
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: laxboy on August 18, 2010, 07:30:52 AM
That is correct you do not need a OptoCoupler on the CG1 boards, use the mic's power supply terminal for CG1 this is regulated 3v
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: luisbk2005 on September 12, 2010, 10:02:02 PM
lets say I dont want to use an optocoupler on my ABXY white LEDS to turn them on and off with the pad, where are these switched voltages located and how do I wire them? (somewhat noob, learning fast)
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: RDC on September 15, 2010, 06:23:17 PM
Lets say you don't have the CG version controller, then you can't, since only that one has a switched source, and even then no one has any idea what it can handle current wise. With an OC you know it'll work, and work on any version of controller as well as know what kind of current you'll be able to source from it, so it's a more proper way of going about it, even on the CG version.

If you have the CG version and want to use the switched source at the Headset connector (Google) then you can, but if it's any other version of controller then it doesn't have a switched source to power LEDs from, hence using an OC to make one.

You can also use a Transistor and a couple of Resistors if you like, but it only allows you to turn the Ground on/off unless you use 2 Transistors and then 4 Resistors, which for LEDs using the 1 Transistor method is fine, but the OC lets you go either way there turning on a + or - source depending on how you wire it up, and it only needs the 1 Resistor either way, so again it's the better method to use.


Just so everyone knows - The CG does not have a 3v Regulated source at the Headset connector, it varies with the battery voltage.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 28, 2011, 06:09:59 PM
I have a CG2 board and some 2n222 transistors laying around.  where would i need to solder on the board so that the LEDs turn on/off with the board being turned on/off?
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 28, 2011, 08:14:06 PM
This thread isn't about using a Transistor, however it's Base to any switched positive voltage, Emitter to Ground, Collector to the Ground source of whatever you're powering, and don't forget the Base and BE Resistors as well.

This isn't a recommended method as it turns the Ground on/off to whatever and not the power, though for LEDs it's fine.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 28, 2011, 08:48:53 PM
ive been look all over the place and couldnt find any threads that could answer my ques. on cg2 and switched points. (this was the closes imo) whats a good switched positive source on a CG2?  thanks RDC for the help btw
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 28, 2011, 08:51:45 PM
There are no good switched sources on the CG2, or CG and Matrix for that matter, hence using an OC to just make one from the Analog VCC which is switched.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 28, 2011, 08:56:45 PM
so im SOL with using a transistor on a CG2 to power up leds?  i just need enough juice for 2 blue 5mm for a lit dome LOL
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 28, 2011, 09:10:57 PM
If all you're powering is LEDs then using a 2N222 is fine, which was already stated.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 28, 2011, 09:53:56 PM
what point on the CG2 board do you think i can connect the Base of the transistor too? not sure what points to use. (sorry if i sound like a noob  )

Post Merge: January 29, 2011, 12:45:38 AM
would these work? want to double check

http://cgi.ebay.com/10-pcs-PC123-Optocoupler-/130355093385?pt=LH_DefaultDomain_0&hash=item1e59c4df89 (http://cgi.ebay.com/10-pcs-PC123-Optocoupler-/130355093385?pt=LH_DefaultDomain_0&hash=item1e59c4df89)
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 29, 2011, 12:37:46 PM
You need to look up the DataSheet on whatever OC you'd like to use and check the Output Collector Current rating (Ic) and make sure it can handle the amount of current that you intent to draw. In this case it's 50mA for that OC, so if all you plan to connect to it are 2 LEDs at 20mA each (40mA) then it would be fine.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 29, 2011, 01:54:51 PM
imma try and give the 2n222 a go first before buying some.  so should i connect the base of the transistor to TP8?
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 30, 2011, 04:40:21 AM
That is a switched positive voltage, so yes.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 30, 2011, 12:43:21 PM
what do u mean by "BE resitors"  when you said  "and don't forget the Base and BE Resistors as well."

thanks
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 30, 2011, 01:42:42 PM
http://www.rason.org/Projects/transwit/transwit.htm (http://www.rason.org/Projects/transwit/transwit.htm)

Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: whuthefxk on January 30, 2011, 04:40:24 PM
alright thanks i got it to work with the transistor. thanks for the help RDC
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 30, 2011, 05:00:56 PM
You're Welcome.
Title: Re: Switched Power Source in Controllers, Use an OptoCoupler
Post by: dopesun on March 04, 2011, 03:21:21 AM
.So am i using 4.7 ohm resistor or 10 ohm? i am connecting it to the Flex rf mod. maybe a couple 3mm leds. i have this OC http://www.mouser.com/ProductDetail/Vishay-Semiconductors/IL2/?qs=sGAEpiMZZMteimceiIVCBwfsK9X9U0O6dDq5LWKha9g%3d (http://www.mouser.com/ProductDetail/Vishay-Semiconductors/IL2/?qs=sGAEpiMZZMteimceiIVCBwfsK9X9U0O6dDq5LWKha9g%3d)

would these do? http://www.mouser.com/ProductDetail/Xicon/261-47-RC/?qs=sGAEpiMZZMvmQ%252bOLa8n/M8l8YhoOUzC1ytLScxgK3w0%3d (http://www.mouser.com/ProductDetail/Xicon/261-47-RC/?qs=sGAEpiMZZMvmQ%252bOLa8n/M8l8YhoOUzC1ytLScxgK3w0%3d)


OC Pin - Controller

1 - TP8, thru a 4.7ohm or so Resistor
2 - Ground
3 - Not Connected
4 - To power LEDs or whatever
5 - B+
6 - Not Connected
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on March 04, 2011, 03:35:46 AM
If you don't know what value Resistor you're using then no one else is going too, and how to figure that out was explained in the very first post as well.

Those Resistors are 1 Watt, way, way too big for what you're doing. You only need to use 1/8W or 1/4W at most for the OC.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: dopesun on March 04, 2011, 04:05:16 AM
yeah sorry dude i have ADD when it comes to this stuff. the only part i read where i might be able to find correct resistor value was when u stated " The Anode of the OC will go to a 10ohm or so Resistor (the exact value depends on the OC you choose, same with LEDs, read the DS) and then to the Analog Voltage line of the controller, which is switched on/off with the controller." that seems a bit vague to me. so the OC i have are correct i just have to get the correct resistors. how bout these?  http://www.mouser.com/ProductDetail/IRC/RC07GF4R7JTR/?qs=sGAEpiMZZMuDPtTs5Gda27wrhmXZJ9FBy%252bDtWKPnQ/g%3d (http://www.mouser.com/ProductDetail/IRC/RC07GF4R7JTR/?qs=sGAEpiMZZMuDPtTs5Gda27wrhmXZJ9FBy%252bDtWKPnQ/g%3d)
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on March 04, 2011, 04:47:07 AM
 The OC has an LED in it, that's part of how it works, and just like with any LED you should have a current limiting Resistor on there when the supply voltage is higher than the LED voltage rating. The exact value depends on the rating of the LED in the OC you're using, as well as the controller version, though it's going to be either 1.5v or 1.6v for the OC LED. In this case a 4.7ohm is fine, but anything from 4.7ohm to 10ohm would work pretty much the same here, but again the DS should be checked to make sure. The thing that must be checked in the DS though is the Output current rating, to see that it can handle whatever load you're going to be putting on it, and in this case the 400mA one you've picked is more than big enough.

Those Resistors aren't stocked, use one of these or something similar - http://www.mouser.com/ProductDetail/Xicon/299-47-RC/?qs=sGAEpiMZZMu61qfTUdNhG9b%252bnPleCCQSrnHQji5JyuU%3d
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: dopesun on March 04, 2011, 05:02:32 AM
Thanks dude ur the goodest. even though u scolded me. lmfao.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Dcofer on April 21, 2011, 12:52:32 PM
Ok so I am going to be using one of these for my rapidfire and wanted to double check my resistor value.  I am using a 4n25 opto on a CG1 pcb.

Ifwd = 60mA
Vfwd = typical (25oC) = 1.15V ; Max = 1.5V
Vsource = 1.5V

so with this information I need ~6.8ohm resistor according to my calculations, does this sound right?

edit: I dont have any 6.8ohm but I can parallel two 15 ohm to get 7.5ohm which should be good enough
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on April 21, 2011, 03:15:30 PM
The Value doesn't really have to be that specific, the LED in the OC will still light up and turn the EC connection on over a pretty wide range. You're fine with just a 15ohm Resistor, or you can parallel 2 of them if you like, but you'll probably never notice the difference.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Dcofer on April 22, 2011, 11:05:05 PM
For sure, I have never worked with optocouplers so I wasn't sure.  I'll probably look through my giant assortment of resistors and see what I have to work with and see how close I really wanna make it haha.  Thanks for the quick reply, and the helpful advice.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: manwinder on May 07, 2011, 11:15:47 AM
i have cg2 and i installed the oc and the analogs did not work, then i put the resistor in, first i tried a 330ohm resistor 1/4w, and the flex rapidifre didn't work, then i tried a 1kohm 1/4 w resistor and the rapidfire worked worked and the a and b button didn't work and then i tried a 1k 1/8w  resistor, the rapid fire worked but the a and b buttons did not work, what is happening, are some of the points o the back of the board being bridged.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Dcofer on May 09, 2011, 06:17:26 PM
that is one really odd problem since the OC shouldn't cause any problems with the controller, make sure you wires that are bare are isolated and are not making contact with the board because they could accidentily bridge something, also if your resistor is too high you will have issues with the voltage being too low to turn on the OC (I am only using 7.5 ohms (two 15 ohm in parallel)).  Just my thoughts, hopefully you are able to figure something out.  my bet is on an accidental short somewhere, sometimes when you put the case back together wires get pinched or move where you dont want them.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on May 13, 2011, 12:22:42 AM
i have cg2 and i installed the oc and the analogs did not work, then i put the resistor in, first i tried a 330ohm resistor 1/4w, and the flex rapidifre didn't work, then i tried a 1kohm 1/4 w resistor and the rapidfire worked worked and the a and b button didn't work and then i tried a 1k 1/8w  resistor, the rapid fire worked but the a and b buttons did not work, what is happening, are some of the points o the back of the board being bridged.
The OC is not causing any of the issues you're having, that's all from improper installation of it, soldering, pinched wires or who knows what.

It depends on the specs of your OC, but that Resistor value is most likely too high also, but it's not causing those issues.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: magic_man185 on June 21, 2011, 09:31:22 AM
I have a question about selecting the correct OC to use in my controller.  I am looking at using the 4n25 or 4n26, which seem to be popular choices, but it seems like they would not be sufficient.  The collector current is 50mA, wouldn't the rf code working on the 12f683 use more than that?  I know from the datasheet the chip itself takes a minute amount of current, but it you think about it, if you are sourcing the left and right trigger (dual wield) and sourcing an LED, you would be sourcing up to 75mA (per datasheet, 25mA per pin max, LED probably sources about 20, I don't know how much current the trigger sources).  Couldn't this cause a problem?
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: FOOKz™ on June 21, 2011, 11:44:16 AM
the LEDs and 12f683 are almost like they're being wired up in series so they have the same current through the entire circuit.

4N26 works fine.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: magic_man185 on June 21, 2011, 12:32:03 PM
FOOKz, you seem to have the uncanny ability to confuse me, maybe due to the fact that you are R&D and I am just a weekend warrior, lol. Anyway, you said that the resistors are like they are wired in series, but if in series would not the voltage be increased? Also, per the 12f683 datasheet, the GPIO combined current draw is 90mA, with a max of 25mA per pin, if they were running in series wouldn't the current be just 25mA and the voltage increase? Of course, you said it is almoste like being wired in series, so perhaps it is something else that you were trying to dumb down so I would understand it.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: FOOKz™ on June 21, 2011, 02:20:10 PM
just try not to over think it                  +V ------> Chip -----> LED ------> Ground             

current really has only 1 path to flow through the circuit... at max you use about 20mA of current through the chip.


Hey sometimes you just need to mess up to see why things happen... you just have to experiment with it. The worst that could happen is the 4N26 will die and stop working.... i doubt that anyways since i predict 100mA current draw which is pretty tiny. So just try it man see what happens.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: magic_man185 on June 21, 2011, 02:38:07 PM
See I am thinking the same thing, up to about 100mA of current draw, which your right is pretty tiny, but according to several datasheets I have seen for the 4n26, the maximum continuous collector current draw is only 50mA (max for time <1ms varies from 100~150mA, but our chip could draw it continuously, not just for less than 1ms).
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: FOOKz™ on June 21, 2011, 03:26:49 PM
are you confusing max current the 4N26 can handle versus the current that the  4N26 itself uses? they're totally different things and besides we're not really engineering anything for a nasa launch
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on June 21, 2011, 05:09:06 PM
Why is this even an issue. If you think 100lbs of crap isn't going to fit in a 50lb bag, why would you even consider trying it? Use an OC that can handle the Maximum current that either you've calculated, or believe it will draw, and be done with it. Barring that, just use one that can source a couple hundred or more so it's not even an issue. There are more than a few that can source 100mA or more, and the IL2 or IL5 can source 400mA in the same package style and layout as the 4N2X series.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: magic_man185 on June 21, 2011, 06:10:03 PM
Fookz,  I had to laugh at the NASA comment, very true.  I think I know just enough to get me into trouble sometimes, and I get too caught up in making sure it is right, and not just trying it.

RDC, I checked the IL2, and according to the manufacturer datasheet, http://www.vishay.com/docs/83612/83612.pdf (http://www.vishay.com/docs/83612/83612.pdf), even the IL2 has a collector current of 50mA, the 400mA is for time <1ms.  Regardless, I am going to get some 4n26's and maybe some il2's and give it a shot.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Hazer on June 21, 2011, 08:07:57 PM
Can I give a go at this?

So, the 4N25: After 5 datasheets from different manufacturers I found you can get anywhere from 16mA to 50mA. The 16mA was from a table that shows the IC based upon the VCE. While 50mA may be enough, 16mA is definately not enough.

So how much current do we need? Page 118 of the datasheet shows current draw of the chip doing nothing (just what it needs to run the clock and process instrcutions only, no I/O curent draw). So we see that 4MHz w/ HFINTOSC clock mode for 3VDD is 700 uA. We are designing to switch the 3V battery power so the 2V from the old matrix is ignored. Now lets look at our I/O pins. The triggers are getting forced back to thier 'neutral' voltages. For the CG, this is using the PIC output pin as a ground. The output drivers are CMOS. Quite frankly, to sink to ground means there is hardly any current being pulled through the VDD to do this and is not part of the equation. So we are only looking at sourced outputs. The Matrix requires the triggers to be forced high again. The triggers themselves are potentiometers. The current for the output is directly related to the load. So in order for the output to draw 20mA at 3V, the resistance must be 150 Ohms. Beyond this point, the output will start dropping in volts, not increase the current. Thats the reality of the PICs ability to source current. You can find it in the datasheet too. So for arguments sake, the worse we will ssee is 20mA for each trigger. The next output is the LEDs. Most LEDs can only draw 20mA or become dark. For the matrix, the LEDs are being grounded. There is no current draw for those. So either way, CG or Matrix, you will have a total combined current of 40mA maximum for the trigger and LEDs. The last thing to check is the tact button. Internal Weak Pull Ups (page 121) have a current draw of  400 uA. If you use a 10KOhm resistor pull-up, its 300uA.

So, grand total of 1 + 40 + 1 gives us 42mA we can expect to see.

Is the 4N25 a good choice? No. It maximum depends on the manufacturer. So I purused Mouser and looked at all 4-pin DIP optocoupler that had max output currents of 90mA or more. I found the OPIA4010:

http://www.optekinc.com/datasheets/OPIA4010D.pdf (http://www.optekinc.com/datasheets/OPIA4010D.pdf)

That there has 150mA in a nice small package at $0.62 each.

And for the record, I have used 50mA optos in alot of controllers.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: magic_man185 on June 22, 2011, 12:46:14 PM
Hazer,

Wow.  Very detailed description, thanks.  I didn't realize that the matrix sinks the LEDs, I thought that since it sources the triggers that it would source the LEDs also.  As for the OPIA4010, that looks like a good one to use, too bad the distributor I get things through doesn't carry that one.  I will keep looking, but now that you have broken down the main issues, I know what will work.  Thanks for the information.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: bigboss59400 on August 10, 2011, 03:31:39 AM
Hi all,

I have some problem with this :
I have a cg2 and I used an 4n25 with a 7ohm resistor (variable because I have only that), wired corectly like in the thread but rapid fire doesn't work (it works on another cg2 without optocoupler).
What did I made wrong ?


Thanks for all.

Edit : I have vdd (3v) on the emitter (pin 5) but there is no intensity (0ma), I have tested with just one led and we can see a glow in the led also I have tested with a 1,5ohm resistor (adjustable) and the goal is the same however the glow of the led is more important and finally I have try with nothing and nothing happen lol
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Icyhaze on January 01, 2013, 01:56:28 PM
I know the resistor depends on the optocoupler, but how do i determine what one for the optocoupler i buy?
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on January 01, 2013, 02:03:49 PM
By going by the information in the DataSheet for it, or just use a 10ohm if you can't find it or don't know.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Icyhaze on January 01, 2013, 03:54:24 PM
I got 2 couplers and one didnt work, im pretty sure i hooked it up right, when id put in the battery pack the lights would automatically turn on, and when i tried to turn on the controller one of the rumble motors would go continuously and the lights would flash some. Im not sure what i did wrong i used a 15 ohm resistor just for safe measure, and i used this one, http://www.mouser.com/Search/ProductDetail.aspx?R=PS2506-1-Avirtualkey55120000virtualkey551-PS2506-1-A (http://www.mouser.com/Search/ProductDetail.aspx?R=PS2506-1-Avirtualkey55120000virtualkey551-PS2506-1-A) , maybe its not the right one?
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: RDC on February 03, 2013, 10:11:08 AM
If it was wired up right, it would have worked right. ;)

Can't really help you too much without seeing exactly what you've done there, it's only 4 connections and the 1 Resistor.

That OC is an AC input one, but that shouldn't matter as DC will also make it work.
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: latetothegame on May 03, 2017, 04:50:19 PM
Trying to do an optocoupler on this controller. The points are not the same as the CG2.

Any one know what they are?  RDC you still active and answering questions?

(https://thumb.ibb.co/eSoubQ/20170503_192857.jpg) (https://ibb.co/eSoubQ)
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: latetothegame on May 04, 2017, 01:01:20 PM
SO since no one seems to be active here after 24 hours.
I figured I would pull out the multimeter and figure it out on my own.
RDC Photo Credit as I took his halo 4 photo and his optocoupler diagram and put them together to make one for the white PCB halo 4 controller.


TP4 - Analog Voltage, 1.5v
TP2 or TP22 - Ground
TP5 - AA and PnC B+
(https://preview.ibb.co/kRjUbQ/halo_4_opto.jpg) (https://ibb.co/hxPUbQ)
Title: Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
Post by: Brian 503 on May 04, 2017, 05:31:02 PM
Thank u for sharing with us. Sorry no one was able assist u in a timely matter.
SimplePortal 2.3.5 © 2008-2012, SimplePortal