Fiverr gig
$15 — I will help you with your project and simulate it for you
Hire me
🌐 IoT Projects

Simple Arduino UNO counter

EmbedLab TeamNovember 30, 20243 min read
Simple Arduino UNO counter

Description of the Arduino 7-Segment Display Code

This Arduino code controls a 7-segment display to show numbers from 0 to 9 based on a button press. The segmentPins array defines the pins connected to each segment of the display, while the buttonPins variable is set to an analog pin that reads the button state. The numbers array contains the byte representations of digits 0 through 9, which are used to activate the appropriate segments of the display.

In the setup() function, the segment pins are configured as outputs, and the button pin is set as an input. The loop() function continuously checks if the button is pressed. When the button is pressed, it calls the displayNumber() function to show the current counter value on the 7-segment display. The counter increments with each button press, looping back to 0 after reaching 9, creating a simple counting mechanism.

This project is perfect for beginners interested in learning about Arduino programming, 7-segment display interfacing, and button input handling. It demonstrates fundamental concepts in electronics and coding, making it an excellent hands-on project for aspiring hobbyists.


SCHEMATIC:

Simple Arduino UNO counter

CODE:

int segmentPins[] = {2, 3, 4, 5, 6, 7, 8};
int buttonPins = A0;

byte numbers[10] = {
0x3F, // 0
0x06, // 1
0x5B, // 2
0x4F, // 3
0x66, // 4
0x6D, // 5
0x7D, // 6
0x07, // 7
0x7F, // 8
0x6F // 9
};

int counter = 0;

void setup() {
for (int i = 0; i < 7; i++) {
pinMode(segmentPins[i], OUTPUT);
}
pinMode(buttonPins, INPUT);
}

void loop() {
if(digitalRead(buttonPins) == HIGH){
displayNumber(counter);
counter = (counter + 1) % 10;
delay(1000);
}
}

void displayNumber(int num) {
for (int i = 0; i < 7; i++) {
digitalWrite(segmentPins[i], numbers[num] & (1 << i));
}
}

  • Arduino projects
  • 7-segment display tutorial
  • Arduino button input
  • Electronics projects for beginners
  • Arduino programming for beginners
  • Digital display projects
  • DIY electronics projects
  • 7-segment display interfacing
  • Counter project with Arduino
  • Arduino display projects


ET

EmbedLab Team

Embedded systems engineer and educator. Writes weekly tutorials at EmbedLab to help beginners ship real hardware.

Related projects

Arduino UNO and ESP32 Blink IoT project with Blynk app
🌐 IoT Projects

Arduino UNO Blink IoT Guide — ESP32 Arduino, Blynk App & Arduino IDE Code

Complete Arduino UNO Blink IoT guide using ESP32 Arduino and the Blynk app: free Arduino IDE code, Arduino library and LED wiring — the easiest Arduino IoT project for beginners to download and try online.

Oct 27 9 min
Blynk IoT app controlling Arduino UNO and ESP32 over Wi-Fi
🌐 IoT Projects

Blynk IoT with Arduino UNO & ESP32 — Free Arduino IDE, Library & App Tutorial

Complete Blynk IoT tutorial for Arduino UNO and ESP32 Arduino: install the Arduino IDE, add the Blynk Arduino library, wire LEDs, LCD and sensors, and control everything from the Blynk app over Wi-Fi — a free, beginner-friendly Arduino IoT project.

Nov 19 6 min
Frequency counter Arduino UNO
🌐 IoT Projects

Frequency counter Arduino UNO

Description of the Arduino Frequency Measurement Code This Arduino code utilizes a Liquid Crystal Display (LCD) to measure and display the frequency of a digital signal connected to an input pin. The

Nov 30 4 min
Top 5 IoT projects with Arduino UNO and ESP32 — Blynk app, Wi-Fi and smart home
🌐 IoT Projects

Top 5 IoT Projects with Arduino UNO & ESP32 — Blynk, Wi-Fi & Smart Home Tutorials (2026)

The top 5 IoT projects every Arduino UNO and ESP32 maker should build in 2026 — Blynk IoT control, Wi-Fi blink, ESP-WROOM-32 dev board guide, ESP32 Proteus 8 simulation and an Arduino smart home parking system. Each pick links to the full tutorial with free Arduino IDE code, library and wiring.

May 30 8 min
How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide
🌐 IoT Projects

How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide

&nbsp; How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide Controlling LEDs remotely using Blynk and an Arduino Uno is a simple yet powerful project for IoT (Internet of Things) enthusia

Apr 4 4 min
Browse all 50+ projects