Shop OBEX P1 Docs P2 Docs Learn Events
Can we use an input that is not powered directly by the basic stamp? — Parallax Forums

Can we use an input that is not powered directly by the basic stamp?

gussirgussir Posts: 8
edited 2013-12-19 08:23 in General Discussion
Hello guys,

I'm a bit new to programming using parallax but I had a question. Can I use an input that is not powered directly by the parallax board (the 5V). I have a remote control from an old remote controled car where I can read 2V on the receiver when I press the left switch. I actually want to use this electric signal (0V when not pressed to 2V when pressed) as an input in order to start a program. The only problem is that this input is not directly powered by the board so I don't know where to connect the two wires that give me a difference of potential when I press the left button of my remote.

Thank you!

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-12-12 08:39
    Yes you can... as long as you are careful to not go over a 110% of the 5 volt limit.

    A 2 volt high may work, but you should test this again with both boards sharing the same ground. Sometimes, the actual voltage readings will be inaccurate when the two boards have no connection.
  • gussirgussir Posts: 8
    edited 2013-12-12 08:48
    Thank you for answering this fast!
    Do you mean I need to connect the ground of my remote control receiver to the vdd of the parallax?
  • Mike GreenMike Green Posts: 23,101
    edited 2013-12-12 08:51
    At the very least, you need to connect the ground connection on the remote to the ground connection on the Stamp (labelled Vss). 2V is a little low for a Stamp input and may not work reliably for a High voltage. Better would be something like 2.5V. You could use a comparator like the LM339 (available from RadioShack) or even a simple 2N2222A or 2N3904 switching transistor and a few resistors to interface the two devices. First try connecting the two grounds and see how well it works. If the output voltage is a little bit more than 2V, that may be enough.

    Vdd is the regulated power supply for the Stamp and is essentially 5V. Vss is the ground for the Stamp. Vin is the unregulated supply voltage, either to the Stamp module or to the whole Stamp board. Vin can range from about 6V to at least 9V, sometimes higher depending on how it's regulated. The Stamp module has its own regulator if Vin is connected to the module. You never want to use Vin to power something or to connect to an I/O pin or other device if you don't know what you're doing. Connecting more than 5V to an I/O pin can damage or destroy the I/O pin and possibly the whole Stamp. The same is true about connecting a power source backwards to Vdd and Vss so the voltage on Vdd is negative with respect to Vss or if the voltage on an I/O pin is negative with respect to Vss.
  • gussirgussir Posts: 8
    edited 2013-12-12 08:55
    If I do something wrong, is there a possible risk of burning the stamp or with 2V only its okay?
  • PublisonPublison Posts: 12,366
    edited 2013-12-12 08:59
    gussir wrote: »
    Hello guys,

    I'm a bit new to programming using parallax but I had a question. Can I use an input that is not powered directly by the parallax board (the 5V). I have a remote control from an old remote controled car where I can read 2V on the receiver when I press the left switch. I actually want to use this electric signal (0V when not pressed to 2V when pressed) as an input in order to start a program. The only problem is that this input is not directly powered by the board so I don't know where to connect the two wires that give me a difference of potential when I press the left button of my remote.

    Thank you!

    Welcome to the forums!

    When you say "Parallax Board", which one? Propeller or BS2? A Propeller pin has a 1.6 volt thresold to read a high signal.

    I suspect you might be reading high of 2 volts on your reciever if you are using a general meter because of the averaging of PWM signals.

    An inventory of the parts involved would help alot.

    EDIT: Mike always types faster! And just noticed BS2 in message.
  • gussirgussir Posts: 8
    edited 2013-12-12 09:03
    Thanks
    Its a BS2.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-12-12 09:03
    Less that 5.5 VDC is okay... just as long as you don't go below 0 volts. Reverse polarity will cause immediate damage, much like overvoltage.

    I suspect you would not destroy the whole BasicStamp if you made a big mistake. You would likely just damage the one i/o pin that is involved. I realize how worried you might be about this. But at some point, you have to learn to be careful to really enjoy using the BasicStamp.

    Mike mentions using the LM339 to clean up the low voltage. it will work well and will provide protection to the BasicStamp. If you connect the 2 volts wrong to the LM339, that might suffer damage.. but nothing would happen to the BasicStamp.
  • ercoerco Posts: 20,256
    edited 2013-12-12 09:08
    2 volts should work fine, the Stamp's TTL switching voltage is about 1.4V. You'll need to tie the circuit grounds (Vss) together, and put a resistor (330-470 ohms) from your 2 volt output into a Stamp pin to limit current "just in case" you accidentally make that pin an output.
  • gussirgussir Posts: 8
    edited 2013-12-12 09:12
    My receiver comes from a chinese model car. It has a Rx 2-G micro controler. At first, I wanted to use the signal coming directly from the motors. But it was too high (7V), By looking at the receiver board I found out that when I pressed the left switch I could read a 2V signal at the terminal of a resistor. I thought that I could use this signal as an input to my Basic stamp Board. My receiver is powered by a 7,5 V battery.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-12-12 09:18
    Try this Non Inverting Level Shifter.
    2V_to_5V.png


    Note, the input can go as high as +11V and as low as -1.1V without harm to the BS2.

    Duane J
    245 x 350 - 5K
  • gussirgussir Posts: 8
    edited 2013-12-12 09:40
    Hello duane
    I'm sorry, I don't really understand your wiring diagram. Where should I connect the wires to vdd, vss? I'm new to all this and I guess I'm not ready to build this type of diagram without explanations. Also for me the output of the stamp is a signal that would command a servo. When you say "o-5v out" what are you meaning?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-12-12 10:32
    Hi gussir;
    gussir wrote: »
    Hello Duane J
    I'm sorry, I don't really understand your wiring diagram. Where should I connect the wires to VDD VSS? I'm new to all this and I guess I'm not ready to build this type of diagram without explanations.
    Fair enough.
    VDD is 5V on the BS2.
    VSS is 0V or ground on the BS2 and on your RC equipment.
    2V_to_5V.png
    Also for me the output of the stamp is a signal that would command a servo. When you say "0V-5V OUT" what are you meaning?
    The "IN" and "OUT" is in reference to the circuit diagram itself.
    So:
    "0V-5V OUT" in the diagram would go to the BS2 input pin which could be labeled "0V-5V IN".
    Also:
    Your RC equipment could be labeled "0V-2V OUT" and connected to "0V-2V IN" on the diagram.

    Think:
    OUT connects to IN.

    BTW, almost any NPN transistor can be used in the circuit.
    The 2N3904 is very generic and can even be gotten at Radio Shack.

    Hope that helps.

    Duane J
    245 x 350 - 5K
  • gussirgussir Posts: 8
    edited 2013-12-19 06:54
    Hello guys, I'm continuing on my project and bought the components, but I still have to questions concerning the connections.
    - whhere do I connect whats looking like a box with a cross on the top right?
    - same for the one on the bottom right? Is it just indicating that I have to connect the ground of my remote to the ground of the board and nothing more?
    Same for teh first questio, does it mean I have to connect the 2K and 3K resistors directly to the vdd?

    Thanks
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-12-19 08:23
    Hi gussir;
    gussir wrote: »
    Hello guys, I'm continuing on my project and bought the components, but I still have two questions concerning the connections.
    - where do I connect what's looking like a box with a cross on the top right?
    Those boxy symbols are connections outside the diagram.
    In this case to VDD on the Stamp.
    - same for the one on the bottom right? Is it just indicating that I have to connect the ground of my remote to the ground of the board and nothing more?
    That is correct. The ground, or VSS, between the Stamp and your equipment must be connected together. As well as one of the leads of the 2K resistor on the left.
    Same for the first question, does it mean I have to connect the 2K and 3K resistors directly to the VDD?
    That is correct.

    Duane J
Sign In or Register to comment.