Sign language with flex sensors

hey buddy.
the code isnot working, here is the screenshot of serial monitor what it is getting displayed.
and here are my connection of lcd and flexsensor.

pin 1 of lcd-GND
pin2-5v
pin3-connected with middle potentiometer
pin4-12
pin5-gnd
pin6-11

d7-2,
d6-3
d5-4
d4-5

15-5v
16-gnd

flex sensor connnected wit 10 k reesistor:
one pin goes to 5v and other pin goes to A0 and one for connection s shown in sparkfun.

now when i run the program.nothing displays on lcd just getting displayed on serial monitor only

chck this

Okay the code is workig in you IDE monitor, you need to change the 80 threshhold to 150.

Try this and see what the IDE monitor shows.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int flexPin1 = A0;
int value1;
void setup() {
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Sign Language");
  Serial.begin(9600);
  delay(200);
}

void loop() {
  // put your main code here, to run repeatedly:
  value1 = analogRead(flexPin1);
  Serial.print(value1);
  if (value1 > 150)
  {
    lcd.setCursor(0, 0);
    lcd.print("             ");
    lcd.setCursor(0, 0);
    lcd.print("Foods");
    digitalWrite(6, HIGH);
    Serial.println("   Foods");
    delay(500);
  }
  else
  {
    lcd.setCursor(0, 0);
    lcd.print("             ");
    lcd.setCursor(0, 0);
    lcd.print("Sign Language");
    lcd.clear();
    digitalWrite(6, LOW);
    Serial.println("   Sign Language");
    delay(500);
  }

}

Tom... :slight_smile:

bro
now when i run this code,
when i bend the flexsensor
the message food vanishes from the lcd
and whn i keep the flexsensor straight food message appears on lcd.
as i bend the message goes and whne i pull it off the straight the message "Food" comesback

Hi;
Okay
Change this.

 if (value1 > 150)

To,
This;

 if (value1 < 150)

Or it is it now functioning as you need it?
Tom.. :slight_smile:

yes got it :slight_smile: :stuck_out_tongue:
thanks.
but im nt getting the
void setup()
message sign language.?

Hi,
Try this.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int flexPin1 = A0;
int value1;
void setup() {
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Sign Language");
  Serial.begin(9600);
  delay(200);
}

void loop() {
  // put your main code here, to run repeatedly:
  value1 = analogRead(flexPin1);
  Serial.print(value1);
  if (value1 > 150)
  {
    lcd.setCursor(0, 1);
    lcd.print("             ");
    lcd.setCursor(0, 1);
    lcd.print("Food");
    digitalWrite(6, HIGH);
    Serial.println("   Food");
    delay(500);
  }
  else
  {
    lcd.setCursor(0, 1);
    lcd.print("             ");
    lcd.setCursor(0, 1);
    lcd.print("Sign Language");
    lcd.clear();
    digitalWrite(6, LOW);
    Serial.println("   Sign Language");
    delay(500);
  }

}

I have left the "Sign Language" Heading as the top line, and moved the response to the flex to the next line.

Tom... :slight_smile:

it worked thankyou

hey
now i have been using 3 flex sensors and im getting a issue in connection with the cod ealso
here is the code
help me out

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define FLEX_1 A0
#define FLEX_2 A1
#define FLEX_3 A2
const int sMin=950;
const int sMax=980;

void setup() {

pinMode(FLEX_1,INPUT);
pinMode(FLEX_2,INPUT);
pinMode(FLEX_3,INPUT);
// put your setup code here, to run once:
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Sign Language");
Serial.begin(9600);
delay(500);
}

void loop() {
// put your main code here, to run repeatedly:
int s1=analogRead(A0);
int s2=analogRead(A1);
int s3=analogRead(A2);

if((s1>s2) && (s1>s3))
{
int range1=map(s1,sMin,sMax,0,3);
switch(range1)
{
case 0:
lcd.noDisplay();
Serial.println("no");
break;
case 1:
lcd.display();
lcd.setCursor(0,0);
lcd.print("help");
delay(1000);
Serial.println("yes");
break;
}
}
if((s2>s1) && (s2>s3))
{
int range2=map(s2,sMin,sMax,0,3);
switch(range2)
{
case 0:
lcd.noDisplay();
Serial.println("no high");
break;
case 1:
lcd.display();
lcd.setCursor(0,0);
lcd.print("call");
delay(1000);
Serial.println("yes call");
break;
}
}
if((s3>s1) && (s3>s2))
{
int range3=map(s3,sMin,sMax,0,3);
switch(range3)
{
case 0:
lcd.noDisplay();
Serial.println("no high");
break;
case 1:
lcd.display();
lcd.setCursor(0,0);
lcd.print("call");
delay(1000);
Serial.println("yes call");
break;
}
}
}

That's a lot of code shrikant_arts!!

Here how to use a really cool feature of this website:

Edit your last post by typing "[code]" right before your code lines and then "[/code]" right after it. All of your code will be put into a scrolling frame that uses a monospaced font. The code can easily be copied whole, and doesn't take up nearly so much room!

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define FLEX_1  A0
#define FLEX_2  A1
#define FLEX_3  A2
const int sMin=950;
const int sMax=980;

void setup() {

  pinMode(FLEX_1,INPUT);
  pinMode(FLEX_2,INPUT);
  pinMode(FLEX_3,INPUT);
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Sign Language");
  Serial.begin(9600);
  delay(500);
}

void loop() {
  // put your main code here, to run repeatedly:
int s1=analogRead(A0);
int s2=analogRead(A1);
int s3=analogRead(A2);

if((s1>s2) && (s1>s3))
{
  int range1=map(s1,sMin,sMax,0,3);
  switch(range1)
  {
    case 0:
    lcd.noDisplay();
    Serial.println("no");
    break;
    case 1:
    lcd.display();
    lcd.setCursor(0,0);
    lcd.print("help");
    delay(1000);
    Serial.println("yes");
    break;
  }
}
if((s2>s1) && (s2>s3))
{
  int range2=map(s2,sMin,sMax,0,3);
  switch(range2)
  {
    case 0:
    lcd.noDisplay();
    Serial.println("no high");
    break;
    case 1:
    lcd.display();
    lcd.setCursor(0,0);
    lcd.print("call");
    delay(1000);
    Serial.println("yes call");
    break;
  }
}
if((s3>s1) && (s3>s2))
{
  int range3=map(s3,sMin,sMax,0,3);
  switch(range3)
  {
    case 0:
    lcd.noDisplay();
    Serial.println("no high");
    break;
    case 1:
    lcd.display();
    lcd.setCursor(0,0);
    lcd.print("call");
    delay(1000);
    Serial.println("yes call");
    break;
  }
}
}

Here is the code pls help me put

??????????

How does the behaviour of your code differ from your expectations ?
Can you explain why you have chosen to use 3 sensors for 3 messages. Why not just one and depending on the range returned by analogRead(), chose the appropriate message to display ?

yes i have choosen 3 because, i need to show a sign language demonstration for deaf and dumb people, so istead of 5 flexsensors i have used 3 to show 3 demostration messages for the people who cannot speak.

beofre that i was checking whether its working or not,
then i hv started with 3 so getting problem

What problem ?

Isnt getting any value.
U need a respective msg to be displayed on rhe lxs for respective sensor.thats it.but the values are automaticly cmng n going

????//

??

You seem to have a problem expressing yourself clearly and answering questions when these are asked. It is also not clear, even looking at the code what you are trying to do in detail.

Anyway, maybe you can answer these questions:

  1. For how many seconds must a user hold the flex sensor in a particular position before it determines what message the user wants to have displayed ?

  2. Once it is clear what message the user wants displayed, for how many seconds must the message remain in the display ?

  3. If more than one flex sensor is activated, which should take priority ?

Also:

You should have debug (Serial.print) statements in your code to cover all conditions so you can see what is happening. For example, what happens if switch(range2) returns a 2 or even a 3 ? . You wont see that.

Im sorry that you arr unable to get me.
Here is the thing.

Im making a sign language for deaf and dumb people using flexsensors which will be attach to the gloves.

Im using only 3 flex sensors .
Each flex sensor on bending any time would display a message on the lcd.

3 flex sensors so it is comination of 8 output.

Because deaf and dumb.cont convey thejr message properly.
Im in a way to regard them.

So i have wriiten a code
Saying s1 s2 s3.
S1 for flexsensor 1
S2 for flexsensor 2
S3 for flexsensor 3.

You can chck the code.
At ant time.
If i flex these sensor i shpuld probably get a texf on my lcd.
Each sensor mappinh would be different.

The problm.is sir im unable to gwt these outputs..aa i wrote ij thw code.

Hopw u got the overall idea sir.