Microcontroller GPIO

Discussion in 'Embedded Systems and Microcontrollers' started by Abhinavrajan, Aug 19, 2016.

  1. Abhinavrajan

    Thread Starter Member

    Aug 7, 2016
    77
    1
    How much Voltage will be present at the GPIO pin for a Microcontroller which has a Vcc(Input Supply voltage) of 3.3V ?
    Suppose I need to connect an LED at this GPIO what are the factors or calculations that I have to consider ?

    And, How much voltage should I apply to an LED to turn it on? What should be its supply voltage?
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,675
    899
    You don't mention which microcontroller you are using. Generally such information about voltage is in the electrical specifications section of the datasheet. If you are talking PIC's, here are data for the 12F509, which has a GPIO port:
    upload_2016-8-19_5-53-41.png

    Remember that the maximum allowed current from a pin is 25 mA (also in the electrical specifications)

    John
     
    Abhinavrajan likes this.
  3. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    Look at the specs for the microprocessor in question. What is the output voltage. How much current?
    Same with the LED. Get a data sheet for that LED and look at what voltage and current are required.

    Finding data sheets ... there are a lot of places on the WWW to find data sheets. A personal favorite of mine is www.alldatasheet.com.
     
    Last edited: Aug 19, 2016
    Abhinavrajan likes this.
  4. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    LEDs are current devices not voltage devices. What does that mean? It means you can drive them from any voltage at all, as long as you use a resistor to set the current.
     
    Abhinavrajan likes this.
  5. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    Basically true. If he only has 3 Volts white, blue, UV and such LEDs are a problem. They all like more than 3 Volts for full brightness.
     
    Abhinavrajan likes this.
  6. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,380
    494
    How much Voltage will be present at the GPIO pin for a Microcontroller which has a Vcc(Input Supply voltage) of 3.3V ?
    3.3V

    Suppose I need to connect an LED at this GPIO what are the factors or calculations that I have to consider ?
    LED forward voltage.
    LED maximum current.
    GPIO maximum current.


    And, How much voltage should I apply to an LED to turn it on?
    This information is supplied by manufacturer.

    What should be its supply voltage?
    LED forward voltage.
     
    Abhinavrajan likes this.
  7. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    DESIRED LED current. You don't have to run it at maximum. If the GPIO pin can only drive 5 mA you are limited to that, or use a buffer transistor. Can you drive the LED at 2 mA and get sufficient brightness? Try it.
     
    Abhinavrajan likes this.
  8. Abhinavrajan

    Thread Starter Member

    Aug 7, 2016
    77
    1
    Crisp and clear. Thank you.
     
Loading...