Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Jackpot Game using LED and Arduino

June 24, 2014 By Salman Khan

 

 

This project is based on Arduino Platform. The game we choosed here is very common in casino, club and the indoor playing. This project uses three different coloured LEDs (RGB led)  that show three different cases, these three cases are continuously changes with random blinking of different coloured LEDs, player will have jackpot when he/she will get all the three LEDs with same coloured cases. It is assumed that the reader has gone through the project how to get started with the arduino and interface LCD with arduino.

 

Here are some images of complete set up of Arduino based Jackpot Game.

Prototype of Arduino based Jackpot Game

Fig. 1: 

Prototype of Arduino based Jackpot Game

Image-Showing-Initial-Messages-Flashed-On-Arduino-Based-Jackpot-Game

Fig. 2: 

Image showing initial messages flashed on Arduino based Jackpot Game

Image showing initial messages flashed on Arduino based Jackpot Game

Fig. 3: 

Image showing initial messages flashed on Arduino based Jackpot Game

Image showing ready message flashed on Arduino based Jackpot Game

Fig. 4: Image showing ready message flashed on Arduino based Jackpot Game

Working

This is a simple and interesting LED game for children’s. The circuit of this game consist a 16×2 liquid Crystal Display for displaying the status for LED’s like JACKPOT, SORRY etc.

When player pushes the switch, LCD will display wait till the result gets displayed.  LEDs goes on blinking randomly and after certain time it will get stop with randomly cases on those three LEDs, if player gets exactly same cases on all the three LEDs LCD will show JACKPOT otherwise it will show “try it next time”.

Block Diagram of Arduino based Jackpot Game

Fig. 5: Block Diagram of Arduino based Jackpot Game

 

Image showing a user playing Arduino based Jackpot Game

Fig. 6: 

Image showing a user playing Arduino based Jackpot Game

Image showing intermittent message while Arduino release a jackpot

Fig. 7: Image showing intermittent message while Arduino release a jackpot

Connections of this circuit are very simple a 16×2 LCD is connected to Arduino in 4-bit mode. And data pin is directly connected to arduino analogue/digital pins (A0/14, A1/15, A2/16, A3/17). And control pins are connected to pin 11 and 12 of Arduino. A push button is directly connected to +5 volt for play game. And three RGB LEDs are connected to pins (2,3,4,5,6,7,8,9,10) of Arduino.

Programming of this project is also very simple. Here we used random number generator. C language already contains a function of generating random number.

Image showing game result on Arduino based Jackpot Game

Fig. 8: 

Image showing game result on Arduino based Jackpot Game

Image showing game result on Arduino based Jackpot Game

Fig. 9: Image showing game result on Arduino based Jackpot Game

Rand();

And calculation as follow.

temp=rand();

temp=(temp%100)/3.50;

it will generate a random number less then 28.

It generates a integer random number and then further some calculation we gets a random number for use. In program a 2 dimensional array defined for show pattern on LEDs.

Code for displaying pattern

charpatt[27][9]={

               {1,1,0,1,1,0,1,1,0},

               {1,1,0,1,1,0,1,0,1},

               {1,1,0,1,1,0,0,1,1},

               {1,1,0,1,0,1,1,1,0},

               {1,1,0,1,0,1,1,0,1},

               {1,1,0,1,0,1,0,1,1},

               {1,1,0,0,1,1,1,1,0},

               {1,1,0,0,1,1,1,0,1},

               {1,1,0,0,1,1,0,1,1},

 

               {1,0,1,1,1,0,1,1,0},

               {1,0,1,1,1,0,1,0,1},

               {1,0,1,1,1,0,0,1,1},

               {1,0,1,1,0,1,1,1,0},

               {1,0,1,1,0,1,1,0,1},

               {1,0,1,1,0,1,0,1,1},

               {1,0,1,0,1,1,1,1,0},

               {1,0,1,0,1,1,1,0,1},

               {1,0,1,0,1,1,0,1,1},

               {0,1,1,1,1,0,1,1,0},

               {0,1,1,1,1,0,1,0,1},

               {0,1,1,1,1,0,0,1,1},

               {0,1,1,1,0,1,1,1,0},

               {0,1,1,1,0,1,1,0,1},

               {0,1,1,0,1,1,0,1,1},

               {0,1,1,1,0,1,0,1,1},

               {0,1,1,0,1,1,1,1,0},

               {0,1,1,0,1,1,1,0,1},

              };

USES:

This is very useful project, in many of the playing clubs mostly in big malls with indoor playing clubs for children’s this is very easy to play.

Components Used

1.    Arduino Board (Arduino Pro Mini)

2.     Programmer for Arduino (FTDI basic Breakout)

3.     RGB LEDs

4.     16×2 LCD Display

5.     Resistors

6.     Push Button

 

Project Source Code

###



#include <LiquidCrystal.h>

 #define sw 9

  LiquidCrystal lcd(11, 12, 17, 16, 15, 14);

   int led[]={2,3,4,5,6,7,8,9,10};

    int led1[]={2,5,8,3,6,9,4,7,10};

     int temp=28;

      char patt[27][9]={

               {1,1,0,1,1,0,1,1,0},

               {1,1,0,1,1,0,1,0,1},

               {1,1,0,1,1,0,0,1,1},

               {1,1,0,1,0,1,1,1,0},

               {1,1,0,1,0,1,1,0,1},

               {1,1,0,1,0,1,0,1,1},

               {1,1,0,0,1,1,1,1,0},

               {1,1,0,0,1,1,1,0,1},

               {1,1,0,0,1,1,0,1,1},

               

               {1,0,1,1,1,0,1,1,0},

               {1,0,1,1,1,0,1,0,1},

               {1,0,1,1,1,0,0,1,1},

               {1,0,1,1,0,1,1,1,0},

               {1,0,1,1,0,1,1,0,1},

               {1,0,1,1,0,1,0,1,1},

               {1,0,1,0,1,1,1,1,0},

               {1,0,1,0,1,1,1,0,1},

               {1,0,1,0,1,1,0,1,1},

               

               {0,1,1,1,1,0,1,1,0},

               {0,1,1,1,1,0,1,0,1},

               {0,1,1,1,1,0,0,1,1},

               {0,1,1,1,0,1,1,1,0},

               {0,1,1,1,0,1,1,0,1},

               {0,1,1,0,1,1,0,1,1},

               {0,1,1,1,0,1,0,1,1},

               {0,1,1,0,1,1,1,1,0},

               {0,1,1,0,1,1,1,0,1},

              };


void setup()

{

  

  for(int i=0;i<9;i++){

   pinMode(led[i],OUTPUT);

    }

   pinMode(sw, INPUT);

   

   lcd.begin(16,2);

    lcd.setCursor(0,0);

     lcd.print(" JACKPOT Game By");delay(2000);

      lcd.setCursor(0,1);

       lcd.print("  Saddam Khan   ");delay(2000);

        lcd.clear();

         lcd.setCursor(0,0);

          lcd.print("Please Wait......");

           delay(1000);

          

          

   for(int i=0;i<9;i++){

    digitalWrite(led[i], patt[0][i]);

     }

   

   delay(1000);

    for(int i=0;i<9;i++){

     digitalWrite(led[i], patt[23][i]);

      }

      

      delay(1000);

       for(int i=0;i<9;i++){

        digitalWrite(led[i], patt[13][i]);

      }

      

      lcd.setCursor(0,0);

       lcd.print("     Ready       ");

        lcd.setCursor(0,1);

         lcd.print("  Press Button   ");

          delay(2000);

}


void loop()

{

 int state=0;

  while(1)

  { 

     state=digitalRead(sw);

      if(state==HIGH)

      {

       lcd.clear();

        lcd.setCursor(0,0);

         lcd.print("Wait........");

          for(int i=0;i<10;i++){

           run();

     }

      temp=rand();

       temp=(temp%100)/3.50;

        for(int i=0;i<9;i++){

         digitalWrite(led[i], patt[temp][i]);

      }

    delay(1000);

    

    if(temp==13 | temp== 0 | temp==23)

    {

      lcd.clear();

       lcd.setCursor(0,0);

        lcd.print("  Jackpot...");

    }

    

   else if(temp== 5 | temp==8 | temp==11 | temp==15 | temp==19 | temp==21)

    {

      lcd.clear();

       lcd.setCursor(0,0);

        lcd.print(" You are doing   ");

         lcd.setCursor(0,1);

          lcd.print("     Great       ");

    }

    

    else 

    {

      lcd.clear();

       lcd.setCursor(0,0);

        lcd.print("Sorry.........   ");

         lcd.setCursor(0,1);

          lcd.print("Best Luck Again   ");  

    }

    }    

    delay(100);

  }

}



void run()

{

  

  for(temp=0;temp<27;temp++){

   for(int i=0;i<9;i++){

    digitalWrite(led1[i], patt[temp][i]); 

     delay(5); 

    }

  }

}

###

 


Circuit Diagrams

Circuit-Diagram-Arduino-Based-Jackpot-Game

Project Video

Related Articles Read More >

Wireless distance measurement using ultrasonic sensor
Computerized wireless Pick and Place Robot
Designing an Arduino-based ECG monitor using an AD8232 ECG sensor
Controlling Appliances Wirelessly using RF Technology

Featured Tutorials

  • Screenshot of Raspbian OS on Raspberry Pi RPi Python Programming 03: Raspberry Pi as Linux System
  • Raspberry Pi Models RPI Python Programming 02: Raspberry Pi Models
  • Raspberry Pi 4 RPi Python Programming 01: Introduction to Raspberry Pi 4
  • RPi Python Programming 05: Introduction to Python
  • RPi Python programming 04 RPi Python programming 04: Setting up Raspberry Pi Linux computer
  • Python Basics RPi Python Programming 06: Python basics

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

Recent Articles

  • Arduino’s L293D motor driver shield guide
  • NXP launches its first Wi-Fi 6E Tri-Band system-on-chip
  • Nexperia launches industry’s first 80 V RETs for high-voltage bus circuits
  • TDK releases low-profile medical sensors
  • Getting started with Raspberry Pi
...

RSS EDABOARD.com Discussions

  • What the best way to store data of size ( 90,000 * 32) bit (taken from a text file) using VHDL?
  • HSPICE Simulation refuses to match the Spectre Simulation
  • How to draw a helical coil around a rectangular core in Maxwell?
  • Where can I find the description of each layer in TSMC's pdk?
  • Same geometry but slightly different results

RSS Electro-Tech-Online.com Discussions

  • Where has the fun gone?
  • Where can I find a pole pig?
  • Voltage based relay
  • XC8 v2.31 Help: Integer Arithmetic With Numbers Larger Than 32 Bits?
  • new to Ardunio but trying to compile
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2021 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering