Shop OBEX P1 Docs P2 Docs Learn Events
Help with circuit design — Parallax Forums

Help with circuit design

Michael @ AfineolMichael @ Afineol Posts: 33
edited 2010-03-02 16:59 in Propeller 1
What components should I use to create an electronic switch so I can have two inputs to a single i/o pin depending on output from a different· i/o pin or pins. I am thinking that a npn or pnp transistor. I actually need to drive 6 mechanical switches·or 6 force connectors (each set, one switch and one force connector goes to a single i/o pin input).· I am concerned (and maybe I don’t need to be) about current on the input that is not active. I am really new to this so any help would be appreciated. I am open to any suggestion.
Mike

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-03-02 04:17
    There are analog and digital multiplexer chips to do this but more info is needed to provide more specific information.
  • Michael @ AfineolMichael @ Afineol Posts: 33
    edited 2010-03-02 04:35
    I am using a Prop that I want to record either a mechanical switch input (on/off) or the Flexiforce sensor (input) to record force (RC Time). I want to control which is recorded·with the use of another i/o pin or·pins·(output). I have two i/o to spare to control what is selected. I have six sets, each on a seperate i/o, that I need to control.·All mechanical switchs or all Flexforce sensors.

    Mike
  • Tired2Tired2 Posts: 29
    edited 2010-03-02 05:44
    It sounds to me like you are trying to make a system that will take in an analog signal at times, and a digital signal at other times.

    I dont do much with RC time circuits, but I recall they charge a capacitor, then time how long it takes to fall below the voltage threshold for the input logic... So, you have to use the pin as both an input and an output, and have the propeller time everything. So, unless the propeller knew you were about to flip a switch, it could be in output mode, and get hit with voltage from the switch... i think that is bad...

    Maybe you could work around the problem by adding in a shift register and ADC.

    The shift register can input 8 channels of digital I/O on only 3 pins or so.

    74hc597 driver
    http://obex.parallax.com/objects/381/

    Then, you could use an ADC like the ADC0838 (8-bit) or the MCP3208 (12-bit) for the analog inputs from your flex force sensors...

    http://obex.parallax.com/objects/459/
    http://obex.parallax.com/objects/180/

    You could use the ADC as a digital input as well at the same time as the flex force. Just have the propeller decide which it needs to read... maybe use a spare switch input for an extra mode switch.

    Does that help at all??
  • rjo_rjo_ Posts: 1,825
    edited 2010-03-02 06:15
    you could drive an npn and a pnp transistor with the same line.... i think[noparse]:)[/noparse]
    when your line is high... you get the npn... when low you get the pnp
    but you still need a sense pin... so you don't really save anything... unless you have already dedicated your sense pins.

    shift registers save you drive pins and sense pins...and the code is pretty compact. you can use 3.3V to your sense pins but to be safe put a little resistor in there...400 Ohms-1k.
  • rjo_rjo_ Posts: 1,825
    edited 2010-03-02 06:20
    serial to parallel and parallel to serial shift registers are pretty simple. The code looked funny to me... just couldn't quite get my head around it until the obex author said... "look, you can drive these things by hand if you want to." They are a lot of fun and you will find all kinds of uses for them... people are always asking... how can I get a few more pins... well, either "use another Prop" of "dust off your shift register" is the usual answer. AND you can control a bunch(32?) of 5V lines with a couple of Prop Pins... that's pretty neat.
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-03-02 07:13
    4066 ?


    @_rjo:
    did you already try to drive a shift register with the video generator?


    PS: Sorry ... mixed it up ... 4019 would be the right one.

    Post Edited (MagIO2) : 3/2/2010 7:39:53 AM GMT
  • navigatornavigator Posts: 10
    edited 2010-03-02 08:25
    The 4066 is a quad bilateral switch it should pass an ac or dc signal.
  • navigatornavigator Posts: 10
    edited 2010-03-02 08:28
    Here is the 4066 data sheet
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-02 08:38
    I'd recommend a 74HC4053 (3 x 2:1 analog multiplexer).

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-02 08:59
    Well you are not real clear as to WHY you need to mux them because there may be easier solutions with the other I/O that you have connected rather than forcing upon these inputs. However because the force sensor is resistive you either need an analog mux (a chip) or if you are going to do that then why mux, just use a shift register (a chip) to read the switches and leave the sensors directly connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • rjo_rjo_ Posts: 1,825
    edited 2010-03-02 16:59
    uh-oh...thought I had misread the topic.· whew... glad I didn't[noparse]:)[/noparse]

    I just got in trouble for being 10 pixels OT over in the sensor forum...

    (don't want to do that again[noparse]:)[/noparse]· but to answer your question... no, but I'd be interested in hearing the results.

    Mike,

    did that do it for you?

    Rich






    Post Edited (rjo_) : 3/2/2010 5:09:25 PM GMT
Sign In or Register to comment.