Little Timer Dude

by Bogan Bunk in Circuits > Electronics

264 Views, 2 Favorites, 0 Comments

Little Timer Dude

timer-9.png

This is a time that counts down when you set the time with the 3 buttons(Seconds, Min, And hours). The fourth button is to reset the time and the fifth is the set button. - https://youtube.com/shorts/oVWVbQR84vU?feature=share


Problems I faced include: LCD Screen freaking out and putting random characters.  Also LCD screen would be blank. Fixed both by re-wiring. Most problems will happen in the wiring because its so compact.

Supplies

eqweqweqwqeqe.PNG

Potentiometer x1

Push button x5

LCD 16x2 Display x1

Buzzer x1

Resistor 220Ω x6

Wires x35

Bread board x1

Arduino Uno x1


Potentiometer = Adjustable resistor 

Push button = button that can be pushed

LCD 16x2 Display = Screen that Arduino can print to

Buzzer = Noise maker

Follow Diagram

sasdsd.PNG
asdasdad.PNG

Follow this diagram.

Add Code or Make Your Own

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


int ButtonPin5 = 10;

int ButtonPin1 = 6;

int ButtonPin2 = 7;

int ButtonPin3 = 8;

int ButtonPin4 = 9;

int Buzzerpin = 13;

int buttonRead1;

int buttonRead2;

int buttonRead3;

int buttonRead4;

int buttonRead5;

int dt = 500;

int Seconds;

int Mins;

int Hours;

int Second;

int Hour;

int Min;

int Potentpin = 0;

int Start;

void setup() {

  pinMode(ButtonPin1, INPUT);

  pinMode(ButtonPin2, INPUT);

  pinMode(ButtonPin3, INPUT);

  pinMode(ButtonPin4, INPUT);

  pinMode(ButtonPin5, INPUT);

  pinMode(Buzzerpin, OUTPUT);

  

  Serial.begin(9600);

  

  lcd.begin(16, 2);

 


}


void loop()

{

  Start = analogRead(Potentpin);

  buttonRead1=digitalRead(ButtonPin1);

  buttonRead2=digitalRead(ButtonPin2);

  buttonRead3=digitalRead(ButtonPin3); 

  buttonRead4=digitalRead(ButtonPin4);

  buttonRead5=digitalRead(ButtonPin5);

  lcd.setCursor(0, 0);

  lcd.print("H ");

  lcd.print(Hours);

  lcd.print(" M ");

  lcd.print(Mins); 

  lcd.print(" S ");

  lcd.print(Seconds); 

  lcd.setCursor(0, 1);

  lcd.print("(S) ");

  lcd.print(Second); 

  

//Seconds

if(buttonRead1==1){

}

if(buttonRead1==0){

  Seconds = Seconds + 1;

  Serial.print("ah");

}

 

//Mins

if(buttonRead2==1){

}

if(buttonRead2==0){

  Mins = Mins + 1;

}

  

//Hours 

if(buttonRead3==1){

}

if(buttonRead3==0){

  Hours = Hours + 1;

}

  

//Reset  

if(buttonRead4==1){

}

if(buttonRead4==0){

  Seconds = 0;

  Mins = 0;

  Hours = 0;

  Second = 0;

  Min = 0;

  Hour = 0;

}

  

//Set

if(buttonRead5==1){

}

if(buttonRead5==0){

  Second = Seconds;

  Min = Mins;

  Hour = Hours;

 delay(500);

  Seconds = 0;

  Mins = 0;

  Hours = 0;

}

  

//Maxtime

  if (Hours > 24){

  Hours = 0;

}

  if (Mins > 60){

  Mins = 0;

}

  if (Seconds > 60){

  Seconds = 0;

}

  

//Hour to Min

  if (Hour > 0){

   Min = Hour * 60 + Min;

  delay(500); 

    Hour = 0;

  }

  

// Min to Sec

  if (Min > 0){

    Second = Min * 60 + Second;

    Min = 0;

}

  if (Start > 500){

   Second = Second - 1;

    delay(1000);

  }

  if (Second < 0){

    tone(Buzzerpin, 1000);

    delay(100);

    tone(Buzzerpin, 500);

    delay(1000);

    noTone(Buzzerpin);

  }

}



Box

You can make a box or case for it but I didn't have time.

You Are Done

Congrats