Arduino takes input even when there is no supply to the input pin -


void setup() {     pinmode(2,input);   //2nd pin in put     pinmode(13,output);    //onboard led output } void loop() {     digitalwrite(13,digitalread(2));    //when there i/p glow, else not } 

i wrote code , connected 1 end of wire pin 2 of arduino, other end left is, not connected anywhere , led started glowing. have 2 clones of arduino, both did same. yes, checked arduino, works fine other codes. can 1 explain me how arduino takes 5v input without supplying ? image of arduino, glowing led, wire not connected supply

the table made of wood. tried connecting 3mm led 13th pin , ground, result same.

there input mode input_pullup. without "floating" inputs acts radio receiver catches kinds of electrical interferences then.


Comments