Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with project :tongue2:

  1. Oct 6, 2005 #1
    hmm.............

    Well, Ima 1st year student and I've been taught all about resistors and capacitors and inductors. So I decided to use my n00bish skills to change my old saga joystick into a pc one(analog) :P Everything is fine. Learned all about ports and everything I need to make the joypad. Now yesterday, I startted designing the circuts n stuff and came across a problem thats not within my scope to solve :( PC joystick port works by completing/varying resistance of the joystick circuit. E.g. for the x-axis pin 0 ohm implys left is pressed, 50 ohm nutral and 100 ohm indicates right. i.e. I need to come up with a circuit which should have a resistance of 50 ohm at normal state, 0 ohm when left button is pressed and 100 ohm when right button is pressed.

    The easiest way to get this problem solved is using 2 way microswitches which allow current to flow one way when the switch is supposed to be open and other way when its closed. But the problem is, my sega kaypad buttons can only act as on and off. It does not have the fancy 2 way stuff. :frown:
    So I was wondering if there was an easy way to do this without making things too complicated.

    Thanks in advance
     
  2. jcsd
  3. Oct 6, 2005 #2

    berkeman

    User Avatar

    Staff: Mentor

    Is there any power available from the game port? What is the expected behavior when both switches are pressed at the same time (back to 50 Ohms?)? Can you change the right switch to be a normally-closed switch instead of a normally-open switch?

    I think if you can change the R switch to a NC switch, you can make it work the easiest. You would put the left NO switch around a 50 Ohm resistor, and the right NC switch around another 50 Ohm resistor. The two 50 Ohm resistors are connected in series.
     
    Last edited: Oct 6, 2005
  4. Oct 6, 2005 #3
    Exactly. The problem is I can only have a NO switch and no NC. And no, you shouldnot be able to press right and left at once.
     
  5. Oct 6, 2005 #4

    berkeman

    User Avatar

    Staff: Mentor

    Is power available on the port? If so, just use FET switches that are driven by the two buttons. And I think you should plan for both switches being pressed at once, and make the result the 50 Ohm middle position.
     
  6. Oct 6, 2005 #5
    power???? you mean the +5 v bit and current supply? Yup :P ANd Nope :P you dont want to go to right and left at the same time. Even if some controlloers allowed that, its not possible with that sega controller I have.

    hmmmm....

    I have access to some "FET MPF102 N-Ch Junction", I've googled about FET's a bit. All the examples I've come across that i have understood seems to be like "put current thru this to open the switch." Gives me ideas for an analog and gate using 2 of those :) I am still confused :S I dont have much experiance with those transistors :(
     
  7. Oct 6, 2005 #6
    hmm...Something just came up...How would make an analog not gate:P?
     
  8. Oct 7, 2005 #7

    berkeman

    User Avatar

    Staff: Mentor

    An analog NOT gate would be something like an NPN transistor with its emitter grounded, a resistor from its collector to 5V, and a resistor from its base to your input voltage source. As the input voltage rises, that turns on the NPN transistor, and drives it into saturation which pulls the collector down to a few times 0.1V. As the input voltage comes down to ground, that turns off the transistor, which allows the pullup resistor to raise the collector voltage up to 5V.

    Since you have a 5V supply available, you can do your function easily with CMOS switches. For example, check out the MAX4626 CMOS switch:

    http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=116996&Row=386685&Site=US

    It will do what you want. Maxim has a pretty broad line of FET switches, so you might be able to find a little cheaper switch that meets your needs. Use two FET switches with the two 50 Ohm resistors that I initially described, and have the left button pull the enable input of the left CMOS switch up when pressed, and have the right button pull the enable of the right CMOS switch down to ground when pressed. Have a default pulldown resistor on the left switch enable input, and a default pullup resistor on the right switch enable input. Use several kOhms for the pullup/pulldown resistors.
     
  9. Oct 10, 2005 #8
    hmmm...Complicated :bugeye:
    ok...how about a transistor circuit breaker ?
     
  10. Oct 10, 2005 #9
    I was thinking there was any easy way to do this like A transistor which allows current to flow normally and when u put current through its base, it stops??? Is that possible???
     
  11. Oct 11, 2005 #10

    berkeman

    User Avatar

    Staff: Mentor

    It sounds like you need to find out more about what the game port is looking for. I'd assumed that it was 50 Ohms and 100 Ohms differential, but if it is just to ground, then it makes your job easier. And yes, you could do it with transistors then.
     
  12. Oct 11, 2005 #11
    hmm...looks like it..
    Code (Text):
                                UP
    ______+----------------------------------------------+
    ______¦ x = 0 kohm   ¦  x = 50 kohm  ¦  x = 100 kohm ¦
    ______¦ y = 0 kohm   ¦  y = 0 kohm   ¦  y = 0 kohm   ¦
    ______+--------------+---------------+---------------¦
    LEFT  ¦ x = 0 kohm   ¦  x = 50 kohm  ¦  x = 100 ohm  ¦   RIGHT
    ______¦ y = 50 kohm  ¦  y = 50 kohm  ¦  y = 50 ohm   ¦
    ______+--------------+---------------+---------------¦
    ______¦ x = 0 kohm   ¦  x = 50 kohm  ¦  x = 100 kohm ¦
    ______¦ y = 100 kohm ¦  y = 100 kohm ¦  y = 100 kohm ¦
    ______+----------------------------------------------+
    _________________________DOWN
    So there are such transistors that does the job??? Which once should I look for?
     
  13. Oct 12, 2005 #12
  14. Oct 12, 2005 #13

    berkeman

    User Avatar

    Staff: Mentor

    He probably means "hfe", which is one measure of the transistor's gain.

    hfe = Ic/Ib

    But hfe varies with collector current, and it is lower at lower collector currents. The resistor values shown in the example schematic are pretty high, so the collector current is going to be in the 20uA range, where a typical transistor like the 2N3904 doesn't have a great hfe. So the transistor that he lists in the schematic probably has good hfe (100 isn't bad) at low currents. If you are going to use a different transistor, look on its datasheet for its hfe value down in the 10-20uA range, and make sure it is >=100 min. The 2N3904 has an hfe of about 10-20 min at that low of a collecter current.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Help with project :tongue2:
  1. Help with Projects (Replies: 1)

  2. Help in a project (Replies: 2)

Loading...