Shop OBEX P1 Docs P2 Docs Learn Events
Need help switching resistance values — Parallax Forums

Need help switching resistance values

MitchSFMitchSF Posts: 2
edited 2005-05-01 18:20 in BASIC Stamp
I'm working on an·application where I have to switch six different resistor values between a single line, and ground.· My first thought is to tie all six together and to the other device's input line, then the other side of each resistor will go to an i/o pin, which will initially be set to an input, so it will float.· To switch one of the resistor values to ground, I'll change an i/o pin to output, then set it's state to zero.·

I'm not really happy with this, and it depends on the i/o lines floating when not set to output.· There must be a better way to do this.· Any help is appreciated.

Thanks,
Mitch
·

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-04-29 00:27
    Your proposed solution will work fine so long as the resistance values are large compared to the effective internal resistance of the Stamp pins (which are somewhere around 50 ohms for small currents.) So, it will work fine if the resistances are 100000 ohms, but not well at all if the resistances are 1000 ohms. There should be no problem leaving the Stamp pins as inputs, so long as the voltage from the other device does not exceed the Vdd to Vss range of the Stamp.

    Other solutions might use external transistors with the drains (or collectors) attached to the lower side of the resistors. If it needs lots of current, you could use beefy mosfets. Or an external intergrated circuit that would provide the 6 open drain outputs. so you could address it serially and not use up so many stamp pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • MitchSFMitchSF Posts: 2
    edited 2005-04-29 00:34
    While not much current will be switched, and resistor values aren't that critical, they are in the 1-2k range, so the transistor switch sounds like a better idea.

    I'm not clear on how the transistor would be connected - one end of each resistor goes to the other device's input wire, the other end of each resistor goes to the transistor's collector, the emitter goes to ground (?), and the base goes to the input pin?· Doing it this way, how is the transistor powered?

    Thanks very much for the help.

    Mitch

    Edit - I think i see, it depends on the voltage of the input line.



    Post Edited (MitchSF) : 4/29/2005 12:56:49 AM GMT
  • KenMKenM Posts: 657
    edited 2005-04-29 03:10
    MitchSF said...
    While not much current will be switched, and resistor values aren't that critical, they are in the 1-2k range, so the transistor switch sounds like a better idea.

    I'm not clear on how the transistor would be connected - one end of each resistor goes to the other device's input wire, the other end of each resistor goes to the transistor's collector, the emitter goes to ground (?), and the base goes to the input pin?· Doing it this way, how is the transistor powered?

    Thanks very much for the help.

    Mitch

    Edit - I think i see, it depends on the voltage of the input line.

    Ken
    533 x 502 - 28K
  • Lee HarkerLee Harker Posts: 104
    edited 2005-04-29 13:03
    Mitch,
    It might help if we knew the whole story. It depends what function the switching of resistors performs. If you are looking for a way to create a digital switch, the method would be different than if you were trying to adjust the gain of an amp for example. It sounds like a place for a digital pot but maybe you could give us the rest of the story.

    Lee
  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-05-01 18:20
    ·I have never used a quad bilateral switch but that is what a CD4016 does. I glanced at the data sheet and it says " for analog and digital switching"· I believe its a cheap part, and the on resistance is on the order of 100 to 200 ohms. http://www.cedmagic.com/tech-info/data/cd4016.pdf
Sign In or Register to comment.