Shop OBEX P1 Docs P2 Docs Learn Events
Some questions I wished I thought of BEFORE I saughtered my circuts. — Parallax Forums

Some questions I wished I thought of BEFORE I saughtered my circuts.

Armored CarsArmored Cars Posts: 172
edited 2004-10-22 15:02 in BASIC Stamp
I wanted to make sure before I fired it up that the pins are negeitive, and I thought that the white wire from an RC servo could·be connected directly to·a pin on the·BS2, but·I run mine on 6v (recomended), which if I am correct will damage the stamp.· Ethier I am incorrect, yall run less than 6v, or I need a resistor or voltage reg between the servo or the stamp.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-21 13:35
    You will shorten the life of your servos if you run them at voltages greater than 6 volts -- that said, it gets done quite frequenty by experienced robotics enthusiasts.

    Connections:
    -- White: To control pin on BASIC Stamp
    -- Red: To positive side of supply (5 to 6 volts)
    -- Black: Common ground (must be connect to supply ground and BASIC Stamp ground)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-21 13:44
    And, the 6-volts on the Servo drives only the Servo. The 'Signal' wire is a TTL (0 to 5 volt) signal input to the Servo only -- the Servo voltage does not drive this wire. So, you can drive the Servo with any voltage without risking the BS2. Of course, if you use more than 6 volts on the Servo, you risk damage to the Servo, but your BS2 on the Signal wire will be safe.
  • Armored CarsArmored Cars Posts: 172
    edited 2004-10-21 17:56
    Thats what I wanted to hear... Now for other switches when defining a 1 or 0 does the negitive go to the pins?
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-21 18:18
    What Negative????

    I didn't think there were any negative voltages with the BS2 -- ok, *maybe* the RS-232 input signal from the PC goes negative during signaling. What 'negative' are you talking about?
  • Armored CarsArmored Cars Posts: 172
    edited 2004-10-21 18:58
    When putting power to the pins to define an input, like when using a contact switch to control something, do I attatch a negitive lead or a positive one?
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-21 19:03
    While there does exist a 'negative' voltage, generally with the BS2 you are connecting to GROUND (Zero volts) or +5. Don't call Ground 'negative', or you'll just confuse us all.

    And you don't really 'put power to a pin to define it as an input', there is a PBasic keyword ("INPUT MyPin") which defines the pin as an input. If you are reading a voltage off of a switch, you should read the BS2 manual for 'Button' -- this shows the schematic of how to wire the switch and resistor, and the BS2 pin.
  • Armored CarsArmored Cars Posts: 172
    edited 2004-10-22 01:48
    AAUGH

    I cant really complain because at·someone is·trying to help...

    I have a pin.· There is a pushbutton connected to the pin.· I want the BS2 to read when the pushbutton is depressed, the program is already written.· Lets say I have a 5v battery.· Do I attatch the side with the +·written on it or the side with the - written on it?

    All I want·to know is which way·must current flow through the pins of the BS2.
  • cyberbiotacyberbiota Posts: 79
    edited 2004-10-22 06:39
    Dog8Spam-

    Connect the Stamp pin to the ground (VSS or minus on the battery) through a 1K Ohm or so resistor.· This will keep the pin pulled low and prevent it from "floating" and giving you a false positive.· To the same pin, connect a pushbutton to the positive (VDD) rail.· When you push the button, you will pull the pin positive, and detect the button press.· Good luck and happy stamping.

    peter

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Peter C. Charles

    Director, Research and Technology
    CyberBiota, Incorporated
    Peter.charles@cyberbiota.com
    http://www.cyberbiota.com
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-22 15:02
    I usually dislike telling people to read the manual, but *really*. Download the "Basic Stamp Programming Manual" PDF file from www.parallax.com, downloads. Under the Button command, on page 86, there is a schematic of exactly what you want to do. I can't correct your mis-conceptions any easier than that.

    Basically, the switch is in series with a 10K ohm resistor across +5 to GND. +5 volts wired to Switch +, Switch - (bottom) wired to Resistor +, Resistor - wired to GND. Switch(bottom) then wired to the BS2 pin.

    When you close the switch, you conduct current through the resistor, and the bottom of the switch is at 5 volts. When you open the switch, no current flows, and the bottom of the switch is at 0 volts. If you then attach the BS2 pin to the bottom of the switch, the BS2 can read the value at the bottom of the switch.

    The BS2 'input's are very high-impedance (high-resistance) sensors. They don't take readings by conducting a lot of current into the BS2 -- they take readings by sensing what the voltage is on the pin. It sounds like you think you should wire the switch directly to the BS2, so when the switch is open no current flows, and the BS2 senses this -- this is *not* how the BS2 works.
Sign In or Register to comment.