I was reading this tutorial http://arduino.cc/en/tutorial/button, and I want to do the same, but with a 2 pin IR receiver LED. The problem is, the LED needs 1-2v max, or it will break. How can I use this led as an input?

• Soon, people will come and want to migrate this question to Arduino. This comment is here to tell them that this question is about electronics design and is perfectly on topic here, even though the context in which it arose is an Arduino one. – user17592 Mar 20 '15 at 9:25
• This appears to be a arduino user-level problem. "Ardunio" was mentioned, no clear explanation in the question, wiring diagrams instead of schematics, and overall it seems this is about hooking this to that without interest in the electronics. – Olin Lathrop Mar 20 '15 at 13:09
• @OlinLathrop there's no reason why a wiring diagram wouldn't suffice for a schematic. Not a valid close reason. – user17592 Mar 20 '15 at 13:26
• @Camil: No, wiring diagrams have to be interpreted to infer the circuit. That is time consuming, error prone, and annoying to electrical engineers. It's a slap in the face of those who you are asking a favor of. However, that's not the close reason, other than it might contribute to unclear. This is a arduino user-level question, having very little to do with electronics. The first word of the title says it all. – Olin Lathrop Mar 20 '15 at 13:40
• It is about using an IR receiver in place of a button. The Arduino context is irrelevant. Some users just don't know how to make a schematic. It's great they make a wiring diagram, because it's much clearer than when they simply describe the circuit. – user17592 Mar 20 '15 at 13:43

I fixed my problem, here is an explanation for others:

I connected one pin of the IR transistor to ground, and the other to both Analog pin 5, and to a 210 Ohm resistor leading to 5v.

Then I used this code:

int analogPin = 5;
int val = 0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
delay(1);
if(val<1000){
Serial.println(val);
}
}


Then if you use an IR remote, or a IR Led, the value will decrease when the signal is stronger.