Hello all, let me preface this by saying that my knowledge of electronics is rudimentary at best. I build arcade machines as a hobby and in doing so have learned how to solder and have messed with simple circuits and leds and what not. But I cannot read circuit diagrams well ect... So with that being said. Here is what I'm looking to do.
I would like to wire a photo interrupter to work as a button (momentary switch) on a gamepad. Basically if the path is interrupted the button is pressed or closed and if the path is clear the button is not pressed or open. What I'm trying to figure out is the wiring. I have attached an image of the interrupter I will be using.
It has 3 pins. VCC, GND and OUT. I know that VCC is 5v, GND is ground and Out would be the signal line.
Here comes the issue. The gamepad is USB thus I can tap the 5v off of that. But the ground for the 5v usb coming in and the ground to complete the button circuit are not the same...
I'm assuming to power the interrupter I must use the 5V+ form the usb cable and the black ground wire to power the unit. So then I assume the OUT pin on the interrupter would be used for the signal pin of the button I want to use.
Can I connect the ground of usb power and the ground for the button on the same pin without causing an issue? Would this be the right way to wire this?
I have attached a crude drawing of what I mean...
Thanks.
I would like to wire a photo interrupter to work as a button (momentary switch) on a gamepad. Basically if the path is interrupted the button is pressed or closed and if the path is clear the button is not pressed or open. What I'm trying to figure out is the wiring. I have attached an image of the interrupter I will be using.
It has 3 pins. VCC, GND and OUT. I know that VCC is 5v, GND is ground and Out would be the signal line.
Here comes the issue. The gamepad is USB thus I can tap the 5v off of that. But the ground for the 5v usb coming in and the ground to complete the button circuit are not the same...
I'm assuming to power the interrupter I must use the 5V+ form the usb cable and the black ground wire to power the unit. So then I assume the OUT pin on the interrupter would be used for the signal pin of the button I want to use.
Can I connect the ground of usb power and the ground for the button on the same pin without causing an issue? Would this be the right way to wire this?
I have attached a crude drawing of what I mean...
Thanks.