• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Digital Dice Circuit using Arduino Uno

Digital Dice Circuit using Arduino Uno

Last updated on 29 June 2026 by Admin-Lavi Leave a Comment

Want to roll a dice without touching it?

Build a digital dice using an Arduino Uno and an LCD screen; upload the code to Arduino Uno, test the button to ensure it generates random numbers (1–6).

This circuit works like real dice but uses electronics, as this is a simple and easy and a fun project for beginners.

Arduino Code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
int buttonPin = 2;
int buttonState = 0;

void setup() {
  lcd.init();
  lcd.backlight();
  pinMode(buttonPin, INPUT);
  lcd.setCursor(0,0);
  lcd.print("Electronic Dice");
  delay(2000);
  lcd.clear();
}

void loop() {
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {
    int number = random(1,7);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("You Rolled:");
    lcd.setCursor(6,1);
    lcd.print(number);
    delay(1000);
  }
}

Circuit Working:

Digital Dice Circuit Diagram using Arduino Uno

Parts List:

ComponentsQuantity
Resistor 10k 1/4 watt1
Arduino UNO1
16×2 LCD Display1
LCM 1602 IIC Module1
Push Button Switch (SPST)1

The 10k resistor keeps pin 2 LOW when we do not press the button.

The LCD shows nothing or the last number, but when we press the button, 5V goes to pin 2 and the Arduino reads a HIGH signal and generates a random number from 1 to 6.

Then the LCD displays that number as the dice result, and when the button releases, the system waits for the next press.

Formulas with Calculation:

Below is the basic formula for Digital Dice Circuit using Arduino Uno.

Pull-down resistor keeps pin low when button not pressed.

Formula is: R = (Vcc – Vinput) / I

here,

  • Vcc is 5V
  • Vinput is 0V
  • I is 0.5mA (safe limit)

So R = (5 – 0) / 0.0005 = 10k (approx).

Hence, this value matches the 10k resistor used in circuit.

How to Build:

To build a Digital Dice Circuit using Arduino Uno follow the below steps for connection:

  • First, gather all the parts as shown in circuit diagram.
  • Next, button one side connect to 5V and button other side connect to pin 2
  • After that, 10k resistor connect between pin 2 and GND.
  • Now LCD I2C Module VCC pin connect to 5V
  • Then LCD I2C Module GND pin connect to GND
  • Further, LCD I2C Module SDA pin connect to A4
  • Finally, LCD I2C Module SCL pin connect to A5

Conclusion:

To conclude, this Digital Dice Circuit using Arduino Uno is easy to make, as it works like electronic dice.

We can also learn how button works and we can see how LCD shows number; here Arduino makes random number, furthermore, its good for beginners which helps to practice coding and circuit.

Filed Under: Arduino Projects, DIY Projects, Indicator Circuits

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Smooth Servo Rotation Circuit with Arduino and Potentiometer
Next Post: Obstacle Detection Circuit with 555 Timer and Ultrasonic Sensor »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • 555 Timer Projects (137)
  • Alarm Circuits (81)
  • Amplifier Circuits (94)
  • Arduino Projects (103)
  • Audio Circuits (189)
  • Automation Circuits (150)
  • Automobile Circuits (40)
  • Battery Charger Circuits (88)
  • DIY Projects (435)
  • Free Energy (12)
  • Heater and Temperature Controllers (32)
  • High Voltage (24)
  • Hobby Circuits (241)
  • Indicator Circuits (63)
  • Inverter Circuits (17)
  • IoT projects (12)
  • LDR Circuits (47)
  • LED and Lamps (201)
  • Meters and Testers (44)
  • Mini Projects (390)
  • Motor Controllers (26)
  • Oscillator Circuits (70)
  • Power Supply Circuits (244)
  • Radio Frequency (8)
  • Remote Control Circuits (12)
  • Renewable energy (20)
  • Security and Protection (128)
  • Sensors and Detectors (236)
  • Solar Circuits (31)
  • Timer Circuits (63)
  • Transistor Circuits (178)
  • Transmitter Circuit (19)
  • Tutorials (33)
  • Voltage Regulator (55)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. Admin-Lavi on High Voltage Fence Charger Circuit
  2. etere on High Voltage Fence Charger Circuit
  3. Admin-Lavi on High Voltage Fence Charger Circuit
  4. egidio grzinic on High Voltage Fence Charger Circuit
  5. Logic OR Gate Circuit using Transistors - Circuit Ideas for You on Automatic Street Light Circuit using LDR

Copyright © 2026 | New Circuit Ideas