# Digital pin always reading HIGH?

**URL:** <https://community.particle.io/t/digital-pin-always-reading-high/18521>\
**Category:** Getting Started\
**Created:** [December 24, 2015, 3:44pm UTC](https://community.particle.io/t/digital-pin-always-reading-high/18521 "2015-12-24T15:44:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattwarren](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattwarren/32/8171_2.png) [@mattwarren](https://community.particle.io/u/mattwarren)\
**Post date:** [December 24, 2015, 3:44pm UTC](https://community.particle.io/t/digital-pin-always-reading-high/18521/1 "2015-12-24T15:44:43Z")

</div>

Hi,

I’m new to all this, so please be gentle 😉

How is it that the following code always outputs 1 / HIGH to the serial connection? - This is with no pin connections at all on a Photon.

I get the ssame result regardless of which digital pin I use. I have also tried , in setup() setting the pin to OUTPUT and writing LOW, before switching pinmode to INPUT.

```auto
int in=D3;

void setup() {
    pinMode(in,INPUT);
    Serial.begin(115200); //baud ignored for USB
}

void loop() {
    int state=digitalRead(in);
    Serial.println(state);
}

```

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [December 24, 2015, 4:07pm UTC](https://community.particle.io/t/digital-pin-always-reading-high/18521/2 "2015-12-24T16:07:47Z")

</div>

With nothing connected, the input is ‘floating’ somewhere between low/high. If you check [the docs on I/O](https://docs.particle.io/reference/firmware/photon/#input-output), you’ll see the INPUT\_PULLDOWN, which should pull it low. Give that a try 😄

---

<div class="post-metadata">

**Author:** ![mattwarren](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattwarren/32/8171_2.png) [@mattwarren](https://community.particle.io/u/mattwarren)\
**Post date:** [December 24, 2015, 4:10pm UTC](https://community.particle.io/t/digital-pin-always-reading-high/18521/3 "2015-12-24T16:10:25Z")

</div>

Ahh thankyou 🙂
