Introduction:

This project is a simple  Electronic Dice system using Arduino. In this project Arduino is interfaced with Seven Segment Display and one Tactile Switch. In Dice Game we throw Dice and get some number which is located  at front side of Dice. In this we are using switch. When Switch  is pressed we will  get any number from 0-6. Every time we will get a random number from  0-6 which we cannot predict.

Here we’ve interfaced the seven segment display which is a Common Anode Type Display

the construction of Seven Segment Display is like this

7-sement-pin-configAs the picture shows above, the display consist of 8 Different LED’s out which 7 are used for displaying an entire numeric character and the 8th LED is used to display a decimal point. We are not utilizing Decimal Point in this project. The common terminal of this Display varies according to the type of display being used. For Common Anode, the Common terminal is Anode that is positive, we need to give +5v Supply to this terminal. Rest all pins can be directly connected to Arduino.

Whenever Arduino writes 0 on any digital line connected to any segment, that particular segment of LED is lit. So we’ve to write values on arduino pin according to the number we wish to print. In the program, we’ve decoded sequence of 1 and 0’s to be written on Arduino Pins to print any particular number. Always remember to add resistors in series with each of these LED’s

Components required:

  • 1 x Arduino Board with USB cable
  • 1 x Bread Board
  • 1 x Seven Segment display
  • 7 x 220 Ohm Resistors
  • Bread Board Connecting Wires
  • 1 x Tactile Switch

Arduino Schematic:

Assemble the circuit as shown in the above diagram. The program for Arduino is mentioned below. Please check the connections twice before you give power to the circuit. Paste below code in arduino and upload it to the board.

 

Code: