Go Down

Topic: Toggle switch/pulled-up pin extremely basic Q (Read 737 times) previous topic - next topic

Wokstation

This is an embarressingly simple question, but I thought I'd ask rather than remain in the dark...

I'd like to connect a basic flick-switch to an arduino, using the internal pullup to prevent floating.  It's to act as a mode switch for a lamp, so will be in either state for long periods, hence the question:

Is there any problem leaving a pulled-up pin with a high input for long periods? Overheating? Weird electronic-y things of which I'm unaware?

Or am I just pondering needlessly and it's totally fine and a standard thing to do?

codlink

Is there any problem leaving a pulled-up pin with a high input for long periods? Overheating? Weird electronic-y things of which I'm unaware
As long as the voltage and current are within limits, should last forever.
//LiNK

JimboZA

As long as the voltage and current are within limits, should last forever.
But with an internal pullup, which is what OP's getting at, we have no control over that. Have to assume that the power rating of the resistor is sufficient and that the (little) heat doesn't do any harm.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Wokstation

If it makes it more reliable, I can go the external pullup route instead (in which case, reccomendations on which value resistor to use would be extremely welcome).

The specific board in question is actually a clone - a Nano one, which I believe has 22k pullup resistors, but I'm not sure.

Many thanks for the help!

JimboZA

Unless someone tells you a horror story from their experience, I'd say you're ok tbh
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

JimboZA

P = V2/R = 25/22000 ~ 1mW.... no problem at all I'm sure.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Paul__B

Is there any problem leaving a pulled-up pin with a high input for long periods? Overheating? Weird electronic-y things of which I'm unaware?
Absolutely none.  It is specifically designed to do this, just like any other aspect of the microcontroller.

Or am I just pondering needlessly and it's totally fine and a standard thing to do?
To reiterate.  It is the standard thing to do.

Wokstation

Brilliant, thank you very much! Time to dig out the maths exercise book! (I use the grid to represent pin holes on perfboard ;) )

dlloyd

If the switch is close to the input pin, internal pullup should be OK. However, note that some switches specify a minimum DC switching current to operate reliably (could be 1mA). In this case, a lower value external pullup resistor is required.

If the switch has longer wires and/or located close to the lamp, then a lower value external pullup resistor is required to make a stronger signal and reduce noise pickup through the cables. If the lamp is AC, filtering or debouncing of the signal might be required.


raschemmel

Quote
P = V2/R = 25/22000 ~ 1mW.... no problem at all I'm sure.
Internal pullups are 50k. :

P = V2/R = 25/50000 = 0.0005 W = 500uW.... no problem at all I'm sure.

MarkT

Internal pullups are not actually resistors, they are actually FETs that behave like resistors,
you can rely on the value being between 20k and 50k, you cannot rely on them being
very linear (but why would you care).

For externally mounted hardware this is too weak a pullup - use 5k...1k sort of range
(a few milliamps).
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

Go Up