GPIO resistors



  • Hello guys,

    Quick question, is it necessary to use one pull up per GPIO? Can I use one for many GPIO's?

    Any reason as to why if not possible?

    I am trying to pull several GPIO's up to 3.3 since the switch (reed relay) is N.C. to GND is this the best way to minimise power consumption? (I know it is not much)

    Thanks,
    Sam.



  • @Samuel-Mathieson You definitely need one pull up resistor for each GPIO you are using.
    If you only had one pull up resistor for all of them, it would have to be connected to all and so all GPIOs used would be controlled by any one of your relays. When one relay was closed, it would pull all the used GPIOs to ground.
    I wouldn't worry too much about the power consumption, the pull up resistor can be a fairly high value - e.g. 200 kOhm for each would only draw at most 16 microA per GPIO when the relay was open



  • Kit,

    Thanks for your reply, I am sorry but I don't seem to understand though... If I common up the GPIO's to one pull up to 3.3V, then I can individually use a reed to pull the GPIO down to GND, so just one resistor should do no?

    I am sorry to be a bother, just can't seem to understand why the case is that you need more than one resistor.



  • @Samuel-Mathieson Sorry, no. The following diagram may make it clearer. The diagram shows 3 GPIO pins with one relay each, but all 3 GPIO pins connected to the same single pull up resistor. When any one relay is closed, all 3 GPIO pins will be pulled to ground because of the common connection to the single pull up resistor.
    0_1470810306779_Relays1.PNG

    What you need and must have is a separate pull up resistor for each GPIO pin/Relay as in this diagram:
    0_1470810362661_Relays2.PNG



  • Kit,

    Thanks, I see what you are saying! Thanks for taking the time to explain.


Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.