Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • 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
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Fastest Finger First Circuit using ATMega16

By Ganesh Selvaraj

 

Fastest Finger first circuit is basically used in quiz type games where the reaction speed of a participant is significant. The circuit enables us to identify who responded first to the question by triggering a visual and audio indication.

Components Required

      1.      1 x ATMega16 development board

      2.      1 x Seven Segment display

      3.      8 x 330 ohms Resistor

      4.      9 x Momentary Switches (8 Teams + 1 Reset switch)

      5.      1 x Buzzer

      6.       1 x BC547 Transistor

Description

The circuit uses a buzzer to produce the audio signal and a seven segment display for visual indication. The display shows the corresponding team number which pressed the buzzer first. The brain of this circuit is an ATMega16 microcontroller which can run at a maximum speed of 16MHz and so there will be no question of clash between any two contestants until and unless their reaction time was same in order of microseconds which is impossible.

Seven Segment Display

It consists of seven LEDs named a, b, c, d, e, f and g which when turned ON or OFF in a particular pattern displays a decimal number from 0 to 9 or alphabets A to F. The seven LEDs either have a common cathode or common anode configuration in order to reduce the number of pins.

Image showing pin diagram of Seven Segment Display

Fig. 1: Image showing pin diagram of Seven Segment Display

Pin Diagram for the two types are as follows

Pin Diagram of Common Anode and Common Cathode Seven Segment Display

Fig. 2: Pin Diagram of Common Anode and Common Cathode Seven Segment Display

Components, Code and Working

The table below shows the number/ alphabet displayed and its corresponding pattern.

Number

Displayed

g

f

e

d

c

b

a

Hexadecimal

Equivalent

0

0

1

1

1

1

1

1

0x3F

1

0

0

0

0

1

1

0

0x06

2

1

0

1

1

0

1

1

0x5B

3

1

0

0

1

1

1

1

0x4F

4

1

1

0

0

1

1

0

0x66

5

1

1

0

1

1

0

1

0x6D

6

1

1

1

1

1

0

1

0x7D

7

0

0

0

0

1

1

1

0x07

8

1

1

1

1

1

1

1

0x7F

9

1

1

0

1

1

1

1

0x6F

A

1

1

1

0

1

1

1

0x77

b

1

1

1

1

1

0

0

0x7C

C

0

1

1

1

0

0

1

0x39

d

1

0

1

1

1

1

0

0x5E

E

1

1

1

1

0

0

1

0x79

F

1

1

1

0

0

0

1

0x71

 

The hexadecimal value will be useful for us while interfacing the display with a microcontroller.

Note that the lowest pin number of the port (usually Px0) is connected to “a” pin and the highest (Px7) to “g” pin (Here x= A/B/C/D)

Use of Transistor

Microcontrollers are usually not capable of driving a Buzzer directly from its output pin and so we use a small circuit to amplify the signal coming from the output pin of the controller to drive the buzzer.

Note: Don’t try to connect the buzzer directly to the controller’s output pin. It may damage the controller permanently!

Code Explanation:

      ·         Initialize the input and output ports (PORTA as input, PORTD as output,PC0 as output for BUZZER and PB0 as input for RESET)

      ·         Enter into an infinite loop.

      ·         Check if any button connected to PORTA is pressed.

      ·         If pressed, stored the position of button pressed in a variable named ‘val’ and then send the value through display(val) function.

      ·         Turn ON the buzzer and display the number corresponding to the ‘val’ on the seven segment display.

      ·         Wait for the RESET button to be pressed. If pressed then turn OFF the BUZZER and reset the seven segment display also.

      ·         Go back to the infinite loop and keep checking for the button press

Prototype of 8051 Microcontroller based Fastest Finger First Game

Fig. 3: Prototype of 8051 Microcontroller based Fastest Finger First Game

      Note

I have used small tactile button switches on a breadboard for demo purpose but if you are actually making the circuit for a contest you may want to replace the button switch with big ones like the one shown below

Typical Image of Push Buttons

Fig. 4: Typical Image of Push Buttons

These are bit expensive when compared to the small button switches but are more reliable and also look professional!

 

 

 

Project Source Code

###

/*
 * fastestfing.c
 *
 * Created: 9/25/2013 8:17:35 PM
 *  Author: GANESH SELVARAJ
 */ 


#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
#define BUZZER PC0


void display(uint16_t val)
{
uint8_t disp[]={0,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F};
PORTC=(1<<BUZZER);

switch (val)
{
case 0b11111110:
PORTD=disp[1];
break;
case 0b11111101:
PORTD=disp[2];
break;
case 0b11111011:
PORTD=disp[3];
break;
case 0b11110111:
PORTD=disp[4];
break;
case 0b11101111:
PORTD=disp[5];
break;
case 0b11011111:
PORTD=disp[6];
break;
case 0b10111111:
PORTD=disp[7];
break;
case 0b01111111:
PORTD=disp[8];
break;
}
while((PINB & 0b00000001)!=0)
{
_delay_ms(100);
}
PORTC=(0<<BUZZER);
PORTD=0x40;
}
void Waiting(int j) // simple delay function
{
uint8_t i;
for(i=0;i<j;i++)
_delay_ms(200);
}
int main(void)
{
DDRA=0x00;
PORTA=0xFF;
DDRB=(0<<PB0);
PORTB=(1<<PB0);
DDRC=(1<<BUZZER);
DDRD=0xFF;
PORTD=0x40;
uint16_t val=0;
while(1)
{

if(PINA!=0xFF)
{
val=PINA;

display(val);

}
}
}

###

 


Circuit Diagrams

Circuit-Diagram-8051-Microcontroller-Based-Fastest-Finger-First-Game


Filed Under: Electronic Projects
Tagged With: atmega16, fastest finger first
 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Renesas delivers intelligent sensor solutions for IoT applications
  • Microchip Technology releases AVR-IoT Cellular Mini Development Board
  • Qualcomm acquires Cellwize to accelerate 5G adoption and spur infrastructure innovation
  • MediaTek’s chipset offers high-performance option for 5G smartphones
  • Nexperia’s new level translators support legacy and future mobile SIM cards

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Co-simulation setup in HFSS
  • How do we test an antenna for its receiver capability?
  • highest frequency capture with arduino input capture
  • Limits of duty cycle for ICM7555 IC?
  • Help identifying drop in ssignal

RSS Electro-Tech-Online.com Discussions

  • ICM7555 IC duty cycle limit at high frequency?
  • writing totals in Eprom
  • undefined reference header file in proteus
  • How to test phone socket?
  • intro to PI
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 © 2022 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
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • 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
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering