VIrtual Gloves Using Arduino (how to define output from arduino)

here is the situation..

i have a finger sensor(flex/bend sensors) using IR LEDs, when bend there will be a voltage drop and that voltage now will be compared to a reference voltage using a comparator, that comparator now will output either 0.25v or 6.25v(depending on the voltage comparison, i think thats logic 0 or 1 in digital input), and that output will be the inputed to the analog pins of ARDUINO,

how will i program arduino that when 6.25v is read from the analog input, it will light an LED (LED = high) and if 0.25 nothing will happen..

actually i have a thesis that will make the output of arduino to be the input on VB.NET..

lets just say that youre 4 fingers(excluding the thumb, palm facing you) is not bend, i will assign it as 0000, (0=not bend, 1=bend) and when the pointing and middle finger is bend or 1100. i want to have an output like that on arduino..0000(no bend),0001(pinky finger bend),0010(ring finger bend) etc.. and i want that ouput to be fetch by a software that im going to make using VB.NET..

is it possible?..if so how?..

hoping for your reply T__T

for a start, the analog inputs are only able to read from 0 - 5 volts.

apart from that,


will give you the analog value of that pin

if(analogRead(pin) < [threshold value]){

if(analogRead(pin) > [threshold value]){

You can drop your voltage into range using a potential divider.

You can drop your voltage into range using a potential divider.

You could use the digital pins instead of the analog ones. use pinMode(pin, mode) to set the pin to an input, then use digitalRead(pin) to find the value of it.

i want to output HIGH on an LED if the analog input receives < 0.20volts and LOW if it receives > 0.20v…meaning if 0.10 or 0.15 or 0 is inputted on the analog input…the LED in pin13 will light up…i have read somewhere that 40 is the equivalent voltage for 0.20v

i got that 0.20v from a comparator, lm339 to be exact… it outputs 0.20v or 4.2v…and that output from the comparator is inputted to the analog input of arduino…ive tried the code below…when i use potentiometer as the input in arduino, it works however when the output from the comparator is used it wont work…

this code wont work.

int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;       // value output to the PWM (analog out)
void setup() {

void loop() {
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue, DEC);
   if(sensorValue > 41){
  // turn the ledPin on
  digitalWrite(ledPin, HIGH);  
  // stop the program for <sensorValue> milliseconds:
  delay(0);        }
  if(sensorValue < 41){
  // turn the ledPin off:        
  digitalWrite(ledPin, LOW);   
  // stop the program for for <sensorValue> milliseconds:
  delay(0);         }