# Do analog inputs have internal pullups?

**URL:** <https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148>\
**Category:** General Guidance\
**Created:** [December 12, 2013, 4:26pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148 "2013-12-12T16:26:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![freakdaddy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/freakdaddy/32/1013044_2.png) [@freakdaddy](https://forum.arduino.cc/u/freakdaddy)\
**Post date:** [December 12, 2013, 4:26pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/1 "2013-12-12T16:26:58Z")

</div>

I have read that analog pins can be used as digital inputs although I have never used one that way. Do they have internal pullups just like the digital inputs so I can do pinMode(A0,INPUT\_PULLUP)?

---

<div class="post-metadata">

**Author:** ![JimboZA](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jimboza/32/215171_2.png) [@JimboZA](https://forum.arduino.cc/u/JimboZA)\
**Post date:** [December 12, 2013, 4:40pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/2 "2013-12-12T16:40:19Z")

</div>

I don't know the answer, but have been wondering that too, so I'm posting there simply to get the responses in my Unread replies.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 12, 2013, 4:40pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/3 "2013-12-12T16:40:47Z")

</div>

Before I answered yes, I checked the documentation to confirm...

> **[Analog Input Pins | Arduino Documentation](https://docs.arduino.cc/learn/microcontrollers/analog-input)**
>
> Find out how analog input pins work on an Arduino.

Since you didn't specify a particular board though...

---

<div class="post-metadata">

**Author:** ![freakdaddy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/freakdaddy/32/1013044_2.png) [@freakdaddy](https://forum.arduino.cc/u/freakdaddy)\
**Post date:** [December 12, 2013, 4:47pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/4 "2013-12-12T16:47:38Z")

</div>

Right but it doesn't say anything about INPUT\_PULLUP. I assume that works as well on analog?

---

<div class="post-metadata">

**Author:** ![CrossRoads](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/crossroads/32/214033_2.png) [@CrossRoads](https://forum.arduino.cc/u/CrossRoads)\
**Post date:** [December 12, 2013, 4:57pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/5 "2013-12-12T16:57:34Z")

</div>

Yes it does.  
I would use

byte pin14 = 14; // or a suitable name for its intended function  
and  
pinMode(pin14, INPUT\_PULLUP); // up to D19 on an Uno  
just for clarity.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 12, 2013, 4:58pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/6 "2013-12-12T16:58:03Z")

</div>

The internal pull-ups work on A0-A5; they are fully functional digital pins as well as being analog input pins.

Some boards also have additional analog input pins A6 - A7 and I have read that these extra ones do not have the same digital I/O capability, but I haven't tested that myself.

---

<div class="post-metadata">

**Author:** ![freakdaddy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/freakdaddy/32/1013044_2.png) [@freakdaddy](https://forum.arduino.cc/u/freakdaddy)\
**Post date:** [December 12, 2013, 5:01pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/7 "2013-12-12T17:01:50Z")

</div>

> CrossRoads:  
> Yes it does.  
> I would use
> 
> byte pin14 = 14; // or a suitable name for its intended function  
> and  
> pinMode(pin14, INPUT\_PULLUP); // up to D19 on an Uno  
> just for clarity.

What's wrong with A0,A1... etc? To me that is more obvious to which pin you are on. With pin14 you have to do the math. Easy addition I know but... Does having the "A" there make you think you are using it as an analog?

---

<div class="post-metadata">

**Author:** ![CrossRoads](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/crossroads/32/214033_2.png) [@CrossRoads](https://forum.arduino.cc/u/CrossRoads)\
**Post date:** [December 12, 2013, 5:05pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/8 "2013-12-12T17:05:26Z")

</div>

I just prefer it for consistency. Your call tho, you are the one maintaining the sketch.

> analog input pins A6 - A7 and I have read that these extra ones do not have the same digital I/O capability

that's straight from the datasheet. You need a surface mount '328P board to even access those pins (they are not brought out on a DIP package), and not all surface mount boards brought the pins to an IO connector.

---

<div class="post-metadata">

**Author:** ![retrolefty](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@retrolefty](https://forum.arduino.cc/u/retrolefty)\
**Post date:** [December 12, 2013, 5:07pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/9 "2013-12-12T17:07:16Z")

</div>

> freakdaddy:
> 
> > CrossRoads:  
> > Yes it does.  
> > I would use
> > 
> > byte pin14 = 14; // or a suitable name for its intended function  
> > and  
> > pinMode(pin14, INPUT\_PULLUP); // up to D19 on an Uno  
> > just for clarity.
> 
> What's wrong with A0,A1... etc? To me that is more obvious to which pin you are on. With pin14 you have to do the math. Easy addition I know but... Does having the "A" there make you think you are using it as an analog?

Yes, using the A0 to Ax alias is the better method as it's more portable across the different controller chips the arduino boards can have.

Lefty

---

<div class="post-metadata">

**Author:** ![liuzengqiang](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/liuzengqiang/32/213605_2.png) [@liuzengqiang](https://forum.arduino.cc/u/liuzengqiang)\
**Post date:** [December 12, 2013, 5:23pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/10 "2013-12-12T17:23:38Z")

</div>

If your signal is weak then the pullup will mess up your reading. This applies to temperature sensors that are popular around here.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 12, 2013, 5:33pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/11 "2013-12-12T17:33:12Z")

</div>

> liudr:  
> If your signal is weak then the pullup will mess up your reading. This applies to temperature sensors that are popular around here.

So, all you have to do is turn it off before you read, right?

---

<div class="post-metadata">

**Author:** ![liuzengqiang](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/liuzengqiang/32/213605_2.png) [@liuzengqiang](https://forum.arduino.cc/u/liuzengqiang)\
**Post date:** [December 12, 2013, 5:35pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/12 "2013-12-12T17:35:04Z")

</div>

Yes, you turn it off. But go right ahead and try both. You should know what you can get with and without the pullup.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 5:02pm UTC](https://forum.arduino.cc/t/do-analog-inputs-have-internal-pullups/199148/13 "2021-05-05T17:02:28Z")

</div>

Closed on May 5, 2021, 5:02pm UTC


