Arduino Uno - Disabling a Switch for specific time in multi switch arrangement.

Hi,
I'm new to Arduino.
I have made a circuit using switches in when a switch is pressed, the connected PIN goes HIGH and based on that it will send corresponding digit to COM PORT.

Circuit detects key press and shows the output in Serial Monitor but bouncing causes multiple key detections. Tried with Schmitt trigger but no noticeable improvement. Later changed value of R1, R2, C to 10K,100 and 1micro but no success.

Secondly I want to disable a switch for 2 seconds after it is pressed while other switches should be enabled. What should I do?

Thanks

code-1.doc (12.5 KB)

What makes you think that people can open doc files? Some can, some can't. If you attach, attach the ino file. Why waste 12 kilobytes on a 1 kilobyte sketch?

Your code is small enough to embed in your post using code tags. Here it is

int bp1 = 9;
int bp2 = 8;
int bp3 = 7;
int bp4 = 6;
int bp5 = 5;
int bp6 = 4;
int bp7 = 3;
int bp8 = 2;
int buzzer = 10;
void setup() {
  // put your setup code here, to run once:

pinMode(bp1, INPUT);
pinMode(bp2, INPUT);
pinMode(bp3, INPUT);
pinMode(bp4, INPUT);
pinMode(bp5, INPUT);
pinMode(bp6, INPUT);
pinMode(bp7, INPUT);
pinMode(bp8, INPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(bp1) == HIGH) 
{
Serial.println(1);
}
if (digitalRead(bp2) == HIGH) 
{
Serial.println(2);
}
if (digitalRead(bp3) == HIGH) 
{
Serial.println(3);
}
if (digitalRead(bp4) == HIGH) 
{
Serial.println(4);
}
if (digitalRead(bp5) == HIGH) 
{
Serial.println(5);
}
if (digitalRead(bp6) == HIGH) 
{
Serial.println(6);
}
if (digitalRead(bp7) == HIGH) 
{
Serial.println(7);
}
if (digitalRead(bp8) == HIGH) 
{
Serial.println(8);
}
}

Next learn to indent; in the IDE, use tools -> autoformat.

You can not reliably use a 74LS14 in combination with e.g. an Uno (which board are you using?). The minimum Voh of the 74LS14 is lower than the minimum Vih of the 328P (in case of 328P based board).

The simplest debounce is a short delay of e.g. 20ms. Next you can look at the debounce example that comes with the IDE if you don't want to or can't use delay.

Thank you for the timely advice.

Regarding the second part of my query, disabling the switch 2 sec after it is pressed. Since each switch is pressed by different persons only the pressed switch is disabled while other switches should be enabled. How it can be implemented?

For each switch, you need to keep track if it was pressed and start a delay based on millis(). While that millis() based delay is in progress, don't read the switch.

You need a millis() based delay for each switch (so 8 additional variables). I would suggest that you first read up on arrays. You can have an array for the button pins, an array for the state of the button and an array for the the start times of millis() based delays. Later you can improve by using an array of so-called structs that combine a pin, a state and the start time for a millis() based delay.

Something to read for the use of millis(): Using millis() for timing. A beginners guide

Thank you!