Shop OBEX P1 Docs P2 Docs Learn Events
Sensing Vdd and Vss. — Parallax Forums

Sensing Vdd and Vss.

cedtinsicedtinsi Posts: 45
edited 2011-02-14 10:38 in General Discussion
I was reading through the "What is a microcontroller?" manual and on the circuit at page 69, I had to figure out why the Basic Stamp senses a low signal when the pushbutton is being pressed. I thought that it is because the current coming from Vdd reaches the pushbutton and divides,a part of this current going to the 220 ohms resistor and the other part to Vss. Is my thought on this correct?
If I am correct, then the Basic Stamp sends a 0 to the debug terminal when the pushbutton is pressed, not because it actually senses Vss but because it senses a potential a little less than Vdd; am I correct?
Please If I am wrong, can you explain that to me because I need your help on this.
thank you for your consideration.
thank you in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-12 23:18
    When the pushbutton is pushed it essentially has zero resistance (actually on the order of milliOhms). When the pushbutton is released it essentially has infinite resistance (actually on the order of hundreds of megOhms depending on the humidity and materials used).

    To find out how current flows in a circuit, you need to study Ohm's Law and Kirchoff's Law, both of which are explained well on the Wikipedia (look them up). When the pushbutton is pushed, the 220 Ohm resistor is essentially connected to Vss and the Stamp's input circuitry sees perhaps milliVolts above Vss, essentially zero Volts.

    It is against forum rules to post the same message on more than one forum. Your other message has been deleted and any further questions or comments should be made here. If you want this whole thread moved to another forum, ask, but it belongs here as much as anywhere else.
  • cedtinsicedtinsi Posts: 45
    edited 2011-02-13 18:48
    Sir, I am very familiar with Ohm's law an Kirchoff's laws, but I still cannot get why when the pushbutton is pressed the 220 ohms resistor senses Vss; why not Vdd? when the button is pressed, both Vdd and Vss have a pathway to the 220 ohms resistor no matter what the resistance of the pushbutton is, right?
    Please, I know the problem is not in the circuit, it is me understanding; I would really appreciate if you could point out what I miss.

    About the double thread, I am sorry.
    I just couldn't delete one of those.

    thanks.
  • FranklinFranklin Posts: 4,747
    edited 2011-02-13 19:44
    Try calculating the voltage drop across the devices between Vdd and Vss. That should give you a hint.
  • Mike GMike G Posts: 2,702
    edited 2011-02-13 20:14
    @cedtinsi, Mike Green gave you the answer. Image you were measuring the voltage across the button with a voltmeter. What would the voltmeter read if the button were closed?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-13 20:45
    Assuming that the pushbutton has an on resistance of 0.01 Ohms and Vdd is +5.0V (and Vss is ground ... 0V), calculate the voltage at the Stamp end of the 220 Ohm resistor using Ohm's Law (and Kirchoff's Law). For the purposes of discussion, assume that the Stamp I/O pin consists of an ideal voltage sensor.
  • cedtinsicedtinsi Posts: 45
    edited 2011-02-14 01:58
    Sir, to start the calculations I need to know where pin P3 runs to inside the stamp. Is P3 connected to Vdd inside the stamp? Vss? because to apply kirchoff's voltage law, I need closed loops.
  • ctwardellctwardell Posts: 1,716
    edited 2011-02-14 05:52
    As Mike Green said "For the purposes of discussion, assume that the Stamp I/O pin consists of an IDEAL voltage sensor. "

    C.W.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-14 08:03
    The ideal voltage sensor measures the voltage between an I/O pin and Vss. For purposes of this exercise, consider it to be a 100 megOhm resistor connected between the I/O pin and ground (Vss) although that's not really true. The microprocessor in the BS2 is a Microchip PIC16F57. You can download the datasheet from Microchip's website and look at their description of the I/O pin circuitry as well as things like the leakage current, etc.
  • cedtinsicedtinsi Posts: 45
    edited 2011-02-14 10:38
    thank you Sir, that helps.
Sign In or Register to comment.