Author Topic: Power Supply Switch for CG2 and Matrix Using an OptoCoupler  (Read 56649 times)

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #30 on: January 30, 2011, 05:00:56 PM »
You're Welcome.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline dopesun

  • Chief squatting Hard
  • *
  • Posts: 19
  • Post quality +0/-0
  • Acidmods User
Re: Switched Power Source in Controllers, Use an OptoCoupler
« Reply #31 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

would these do? 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

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #32 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.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline dopesun

  • Chief squatting Hard
  • *
  • Posts: 19
  • Post quality +0/-0
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #33 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

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #34 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
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline dopesun

  • Chief squatting Hard
  • *
  • Posts: 19
  • Post quality +0/-0
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #35 on: March 04, 2011, 05:02:32 AM »
Thanks dude ur the goodest. even though u scolded me. lmfao.

Offline Dcofer

  • Ω Allumnist Ω
  • *
  • Posts: 118
  • Post quality +1/-1
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #36 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
« Last Edit: April 21, 2011, 01:35:02 PM by Dcofer »


Xbox 360 gamertag: EMERGENCY DODO
PS3 gamertag: Emergency_Dodo

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #37 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.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline Dcofer

  • Ω Allumnist Ω
  • *
  • Posts: 118
  • Post quality +1/-1
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #38 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.


Xbox 360 gamertag: EMERGENCY DODO
PS3 gamertag: Emergency_Dodo

Offline manwinder

  • ♪♪♪ Tone deff ♪♪♪
  • *
  • Posts: 59
  • Post quality +1/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #39 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.

Offline Dcofer

  • Ω Allumnist Ω
  • *
  • Posts: 118
  • Post quality +1/-1
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #40 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.
« Last Edit: May 09, 2011, 06:19:11 PM by Dcofer »


Xbox 360 gamertag: EMERGENCY DODO
PS3 gamertag: Emergency_Dodo

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #41 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.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline magic_man185

  • Who Farted ???
  • *
  • Posts: 229
  • Post quality +16/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #42 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?

Offline FOOKz™

  • Hardware Modder
  • Research & Development
  • E = MC² Mad Scientist
  • *
  • Posts: 2070
  • Post quality +37/-2
  • Electronics Expert Electrical Engineer
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #43 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.

Follow my Instagram and subscribe to my YouTube

Offline magic_man185

  • Who Farted ???
  • *
  • Posts: 229
  • Post quality +16/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #44 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.

Offline FOOKz™

  • Hardware Modder
  • Research & Development
  • E = MC² Mad Scientist
  • *
  • Posts: 2070
  • Post quality +37/-2
  • Electronics Expert Electrical Engineer
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #45 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.

Follow my Instagram and subscribe to my YouTube

Offline magic_man185

  • Who Farted ???
  • *
  • Posts: 229
  • Post quality +16/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #46 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).

Offline FOOKz™

  • Hardware Modder
  • Research & Development
  • E = MC² Mad Scientist
  • *
  • Posts: 2070
  • Post quality +37/-2
  • Electronics Expert Electrical Engineer
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #47 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

Follow my Instagram and subscribe to my YouTube

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #48 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.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline magic_man185

  • Who Farted ???
  • *
  • Posts: 229
  • Post quality +16/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #49 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, 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.
« Last Edit: June 21, 2011, 06:11:04 PM by magic_man185 »

Offline Hazer

  • x4675636B4E7574
  • Acidmods Alumni
  • Acid Modder
  • *
  • Posts: 583
  • Post quality +59/-0
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #50 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

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.
[Quote from Gamermodz via Viking forums]
Don't be jealous your not half as smart. I hate ****tards like you. An ignorant redneck. Your nothing but a posing ******. Get the **** out of here, really, your claim to fame is an open source rapid fire code? You make me laugh. You think you have control over the modding market?  You couldn't create what I can and do. You are too ignorant with your outrageous assumptions and accusations. [/Quote]

Offline magic_man185

  • Who Farted ???
  • *
  • Posts: 229
  • Post quality +16/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #51 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.

Offline bigboss59400

  • Chief squatting Hard
  • *
  • Posts: 15
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #52 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
« Last Edit: August 11, 2011, 03:42:11 AM by bigboss59400 »

Offline Icyhaze

  • Dirty Dev
  • Motor Mouth
  • *
  • Posts: 82
  • Post quality +1/-0
  • Gender: Male
  • Acidmods User Personal Modder
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #53 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?

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #54 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.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline Icyhaze

  • Dirty Dev
  • Motor Mouth
  • *
  • Posts: 82
  • Post quality +1/-0
  • Gender: Male
  • Acidmods User Personal Modder
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #55 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 , maybe its not the right one?
« Last Edit: January 31, 2013, 03:47:43 PM by Icyhaze »

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2585
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #56 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.
« Last Edit: February 03, 2013, 10:11:41 AM by RDC »
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline latetothegame

  • Guppy
  • *
  • Posts: 2
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #57 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?

« Last Edit: May 03, 2017, 04:51:42 PM by latetothegame »

Offline latetothegame

  • Guppy
  • *
  • Posts: 2
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #58 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+

Offline Brian 503

  • Acidmods Alumni
  • ♪♪♪ Tone deff ♪♪♪
  • *
  • Posts: 59
  • Post quality +1/-0
  • Gender: Male
  • Acidmods User
Re: Power Supply Switch for CG2 and Matrix Using an OptoCoupler
« Reply #59 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.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal