analog input help

I am trying to make a simple circuit which activates an LED when a finger is placed across the analog input pin and ground pin, I have played around with the example analog input program which activates the LED when input pin is touched though does not require the ground and is sensitive to movement. My question is how to achieve this , please note I would not be asking this if I had any kind of a clue, thanks in advance

Take a peek at a few of the analog examples. Copy some of what they did and set the threshold lower so that a finger can be detected. You might consider making a capacitive sensor as well. That would work.

The simplest method would be to place a 100 K resistor from 5V to the input pin you want to measure and checking to see if it goes low when finger contact is made, however allowing direct contact to an input pin on an Arduino isn't a great idea, hard to protect the device as it is hard to protect from accidental static electricity discharges. an interface of some kind is in order but I think you need to do some reading first and decide what you are going to do. I can suggest a couple of inexpensive and bullet proof (as far as the Arduino goes) methods of interfacing a pin to the outside world but I think you need some more thought about what you want to do. Under any circumstanced you need to either pull up the pin and let the finger contact bring it down or do the reverse but you will get no real results with an open pin as it doesn't have a predefined state to change from. If the Pin is neither high nor low then what information is present when it changes state??? and how do you tell??? IMO

Doc

thank you for your replies, is this achievable with minimum number of components? an how simple could this circuit be? I found reference to a similar project with 4 LED's using the following code:

// attiny85
// reset -+---+- power
// (on while touching) pb3 -+* +- pb2 (toggled by touch)
// (touch input) pb4 -+ +- pb1 (fading while touching)
// ground -+---+- pb0 (fading always)

int fadepin1 = 0; // the led that fades on and off
int fadepin2 = 1; // the led that fades on and off while you're touching the input pin
int togglepin = 2; // the led that's toggled when you touch the input pin
int steadypin = 3; // the led that's on while you're touching the input pin

int calibration = 0;
int previous;

int randomval = 0;
int fadeval = 0, fadestep = 1;
int togglestate = LOW;

void setup()
{
pinMode(fadepin1, OUTPUT);
pinMode(fadepin2, OUTPUT);
pinMode(togglepin, OUTPUT);
pinMode(steadypin, OUTPUT);

delay(100);
for (int i = 0; i < 8; i++) {
calibration += chargeTime(PB4);
delay(20);
}
calibration = (calibration + 4) / 8;
}

void loop()
{
int n = chargeTime(PB4);

if (n > calibration) digitalWrite(steadypin, HIGH);
else digitalWrite(steadypin, LOW);

analogWrite(fadepin1, fadeval);
if (n > calibration) analogWrite(fadepin2, fadeval);
else analogWrite(fadepin2, 0);
fadeval = fadeval + fadestep;
if (fadeval == 255) fadestep = -1;
if (fadeval == 0) fadestep = 1;

if (previous <= calibration && n > calibration) {
if (togglestate == LOW) togglestate = HIGH;
else togglestate = LOW;

digitalWrite(togglepin, togglestate);
}

previous = n;

delayMicroseconds(500);
}

byte chargeTime(byte pin)
{
byte mask = (1 << pin);
byte i;

DDRB &= ~mask; // input
PORTB |= mask; // pull-up on

for (i = 0; i < 16; i++) {
if (PINB & mask) break;
}

PORTB &= ~mask; // pull-up off
DDRB |= mask; // discharge

return i;
}

I cant seem to work out how to trim the code down to a single LED, any help much appreciated