0–9999 UP counter with RESET from Arduino UNO

Circuit is done as shown in the diagram.



Purchase the module from this purchase link.

Purchase link

4 digit up counter module using CD4026

530 Rs


Upload the following program to Arduino UNO.
							
							
const int CLK = 2;
const int RESET = 3;

int count = 0;
int countLimit = 36;

// the setup function runs once when you press reset or power the board
void setup() {
  pinMode(CLK, OUTPUT);
  pinMode(RESET, OUTPUT);

  digitalWrite(RESET, HIGH);
  delay(100);
  digitalWrite(RESET, LOW);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(CLK, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for 100 mS
  digitalWrite(CLK, LOW);   // turn the LED off by making the voltage LOW
  delay(100);               // wait for 100mS
  count++;

  if(count >= countLimit)
  {
    count = 0;
    
    digitalWrite(RESET, HIGH);
    delay(1000);
    digitalWrite(RESET, LOW);
  }
}		
				
							
						
Once uploading is successful, counter will start counting from 0. When the count reaches “countLimit”, count will be reset to zero.

Videos

HaberOcean

HaberOcean is the leading electronics store with wide variety of products your requirements for all your projects.

Subscribe

© Copyright 2022 HaberOcean - All rights reserved.