Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 1 
ABSTRACT 
The Nokia inspired Snake game implemented on 8051 platform. The game is built on AT89S51 Microcontroller. The game uses an 8 * 8 LED dot matrix display and five way keys for user interface. A dedicated delay settings key provides one touch access to the delay settings mode where the speed of the Snake can be adjusted. 
In our project we are implementing the snake game by using microcontroller. In this we are using switches one is Start for starting of the game and remaining switches for snake movements left, right, up and down these switches used like as a buttons in mobile. We are going to develop coding by using Embedded C according to that coding by using dot matrix the snake and egg will be display on 8*8 dot-matrix and by using switches the game will be operate according to our requirement.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 2 
INTRODUCTION:- Snake is a video game concept which originated during the late 1970s in arcades. The name applies to the general game design; the original was not named Snake, and there is no definitive version of the game. Its simplicity has LED to many implementations of the Snake concept. After it became the standard pre-loaded game on Nokia mobile phones in 1998, there was a resurgence of interest in the game as it found a larger audience. 
Artificial intelligence (AI) techniques have been proven highly successful at the problems of navigation, task prioritization, and problem avoidance. Traditionally, humans have encoded rule-based AIs to create the behaviors necessary to allow an automaton to achieve a specific task or set of tasks. Genetic programming (GP), however, has been proven to allow a computer to create human-competitive results. 
Specifically, examples such as the wall-following robot (Koza 1992) and Pac Man (Koza 1992) demonstrate the effectiveness of GP at evolving programs capable of navigation and task prioritization behaviors which are competitive with human-produced results. 
SPECIFICATIONS:- 
The specification of the ‘SNAKES GAME’ are, according to the 
Major components used, these include:- 
 230v/50Hz AC main. 
 Rated supply voltage : +5v 
 IC AT89S51 as our Microcontroller. 
 8*8 LED dot matrix. 
 Push button keys.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 3 
LITERATURE SURVEY:- The Snake variety of games dates back to the arcade game Blockade, developed and published by Gremlin in 1976. In 1978, Atari, Inc. released, as an unofficial port, an early home console version of the Blockade concept, titled Surround. Surround was one of the nine Atari 2600 (VCS) launch titles, and was also sold by Sears under the name Chase. That same year, a similar game was launched for the Bally Astro cade as Checkmate. The first known personal computer version of Snake, titled Worm, was programmed in 1978 by Peter Trefonas of the US on the TRS-80computer, and published by CLOAD magazine in the same year. This was followed shortly afterwards with versions from the same author for the Commodore PET and Apple II computers. A microcomputer port of Hustle was first written by Peter Trefonas in 1979 and published by CLOAD. This was later released by Milton Bradley for the TI-99/4A in 1980. There were several versions of Snake on the BBC Micro. 1982's Snake by Dave Bresnen was different in that the snake was controlled using the left and right arrow keys relative to the direction it was heading in. The snake increases in speed as it gets longer, and there are no "lives", making achieving a high score or reaching higher levels relatively difficult as one mistake means starting from the beginning. An analog joystick-controlled variant of Snake, called Anaconda, was included as a hidden mini game in Time Splitters 2, which featured free rotation instead of a fixed 4- direction system, and multiple types of food. More recent versions include a Neopets version known as Meerca Chase. Snake can be played on YouTube videos that use the 2010 version of the player. When a video is selected, the user can press the 'left' key, the 'right' key, the 'home' key, or the 'end' key for any period of time before immediately pressing the 'up' key. The game will appear and can be played in the video screen. Until 2012, a version called Old Snake could be played inside Gmail.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 4 
BLOCK DIAGRAM:- 
Fig. block diagram of snakes game 
BLOCK DESCRIPTION:- 
We are implementing the snake game by using microcontroller. In this we are using switches one is Start for starting of the game. And remaining switches for snake movements left, right, up and down these switches used like as a buttons in mobile. 
We are going to develop coding by using Embedded C according to that coding by using dot matrix the snake and egg will be display on 8*8 dot-matrix and by using switches, the game will be operated according to our requirement.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 5 
CIRCUIT DIAGRAM:- 
Fig. circuit diagram of snake game
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 6 
CIRCUIT DESCRIPTION 
DESIGNING:- 
The main intension of this project is to design a SANKE GAME using 8*8 LED dot matrix. In order to fulfill this application there are few steps that has been performed i.e. 
1) Designing the power supply for the entire circuitry. 
2) Selection of microcontroller that suits our application. 
3) Selection of 8*8LED dot matrix. 
POWER SUPPLY DESIGN:- 
Fig. circuit diagram of power supply 
In-order to work with any components basic requirement is power supply. In this section there is a requirement one voltage level i.e. 5V DC power supply. 
Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step- down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we came to a conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 7 
than the required voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily available in the market. 
The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating DC. As we all know that there are 3 kind of rectifiers that is 
1) Half wave 
2) Full wave and 
3) Bridge rectifier 
Here we short listed to use Bridge rectifier, because half wave rectifier has we less in efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since there is no requirement for any negative voltage for our application, we gone with bridge rectifier. Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter. The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose output voltage is constant 5V DC irrespective of any fluctuation in line voltage. 
LIGHT EMITTING DIODE (LED) 
A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrow spectrum light when electrically biased in the forward direction of the pn-junction, as in the common LED circuit. This effect is a form of electroluminescence. 
Fig. LED (light emitting diode)
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 8 
Like a normal diode, the LED consists of a chip of semi-conducting material impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers electrons and holes flow into the junction from electrodes with different voltages. When an electron meets a hole, it falls into a lower energy level, and releases energy in the form of a photon. 
SELECTION OF MICROCONTROLLER:- 
As we know that there so many types of micro controller families that are available in the market. 
Those are:- 
1) 8051 Family 
2) AVR microcontroller Family 
3) PIC microcontroller Family 
4) ARM Family 
Basic 8051 family is enough for our application; hence we are not concentrating on higher end controller families. In order to fulfill our application basic that is AT89S51 controller is enough. 
. There are some requirements for proper operation of microcontroller. Those are: 
1) Power supply section 
2) Reset circuit 
3) Crystal circuit Vcc 
Reset circuit is used to reset the microcontroller. Crystal circuit is used for the microcontroller for timing pluses. In this project we are not using external memory that’s why EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used for this application.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 9 
PIN CONFIGURATION: 
Fig. pin diagram of MUC AT89S51 
Features: 
 Compatible with MCS-51 Products 
 4.0V to 5.5V Operating Range 
 Fully Static Operation: 0 Hz to 33 MHz 
 Three-level Program Memory Lock 
 256 x 8-bit Internal RAM 
 32 Programmable I/O Lines 
 Three 16-bit Timer/Counters 
 Eight Interrupt Sources 
 Full Duplex UART Serial Channel
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 10 
DOT MATRIX:- 
A dot matrix is a 2-dimensional array of dots used to represent characters, symbols and images. Typically the dot matrix is used in older computer printers and many digital display devices. 
A dot matrix display is a display device used to display information on machines, clocks, railway departure indicators and many and other devices requiring a simple display device of limited resolution. 
The display consists of a matrix of lights or mechanical indicators arranged in a rectangular configuration (other shapes are also possible, although not common) such that by switching on or off selected lights, text or graphics can be displayed. A dot matrix controller converts instructions from a processor into signals which turns on or off lights in the matrix so that the required display is produced. 
Fig. (a)
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 11 
Fig. (b) 
Fig. (c)8*8 LED matrix display 
FEATURES: 
 1.26 inch (32.0mm) matrix height. 
 Dot size 3.00mm. 
 Low power requirement. 
 Excellent characters appearance. 
 Multiplex drive, column cathode com. 
 And row anode com.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 12 
 Multi color available. 
 Categorized for luminous intensity. 
 Stackable vertically and horizontally.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 13 
WORKING:- 
The 8x8 dot-matrix 8 cathodes and 8 anodes for our purpose. For displaying any particular LED we make the port pin connected to the anode of the LED high and the corresponding cathode low. 
We have switches connected to the microcontroller for control of the game. We are constantly monitoring the port pins to which the switches are connected and if the left button is pressed then the snake moves left, if right button is pressed, then the snake moves right otherwise up or down according to the switch which is pressed. Also start switches are available. Start switch is used to start the game and this switch is not monitored during the game. 
The game will be over if:- 
 The snake head hits itself. 
 By reaching its maximum length of the snake. 
 Hit the wall of LED matrix. 
CIRCUIT SIMULATION:-
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 14 
Fig. Circuit simulation of snake game 
PCB DESIGN:-
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 15 
Fig. PCB LAYOUT OF MICROCONTROLLER BOARD 
PCB MAKING:- 
When the master diagram probable twice the size of real PCB has been evolved, the text major step consists of etching or dissolving the unwanted metal from copper gladded board to create the circuit as depicted by master diagram. It must be stressed that very accurate checking of master is essential at this stage. Then the master point is mounted on a special frame on easy facing of a larger camera and with aid of the very powerful 
illumination a master diagram is clearly photographed on a glass sensitive plate. This is developed to give photographic negative. In case of simple and need of number of less PCB, economic and advisable to use the following lab method of PCB making. 
PLANNING THE CIRCUIT:-
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 16 
There are several important factors that need not be taken into account, if the finished device is to work properly we must consider gain factor and ensure that the input and output parts are sufficiently well isolated to avoid the possibility. We are also to make sure that all components need to return to earth are properly connected and that possibility of common impedance arising in earth returned. Other factors that have to successfully studied include availability of adequate return points on board and its mounting from accessibility of switch connection made for mechanical fixing ventilation effect of vibrato. 
CLEANING THE BOARD:- 
The copper side of the board must be thoroughly cleaned before circuit plan is transferred to it. This is very important because even slightest trace or graze will impure the etching process and when the circuit plan has been neatly transferred to copper in this manner the board is held under, running tap and is allowed to dry before resist is applied. 
TRANSFORMING THE PLAN:- 
Now, once cleaning is done plan has transfer on copper surface of PCB material. A convenient way to do this is simply put a carbon paper between a copper surface of the board and working plan and carefully trace the lines of original plan with a ball pen. 
RESIST:- 
Resist is nothing more than a substrate that is unaffected by presence etching chemicals. It is usually colored so that copper surface can be easily seen. It is essential to resist through hardening before etching is started. Nail polished are better as they are less difficult to remove. To overcome this drying effect and to sharp the edges of the trace on PCB. Now a day’s etching taps along with IC pads are commonly used, to this, changes of short circuiting due to paints are completely avoided, etching taps and pads are available in different sizes. 
ETCHING:-
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 17 
Next comes etching of unwanted copper and whether a small single is all that required as quantity of board to be produce certain precautions must be taken before operation is commenced the most use etch ant I ferric chloride and to this is added small quantity of HCL to accelerate. Mixing 10 grams of ferric chloride and 25 grams of HCL with 15 grams of water can produce a good etchant. 
AGITATION:- 
Small plastic bath is ideal for storing the etchant process. The depth of liquid must be sufficient to complete cover elimination, the laminated board carrying, the resist pattern circuit is then dropped into etchant bath gently, agitation takes 5 to 20 minutes to complete, depending on the strength of the etchant temperature and thickness of copper foil. 
FINISHING OFF:- 
When all unwanted copper is dissolved from areas between conductors, board should be taken from etchant and washed in water. The resist must be removed using proper solvent. After this the copper surface must be polished with any kind of cleaner. It should be seen that there is no slight incomplete etching between the conducting paths of the PCB.PCBs coated coating material for protection in lab coating material itself is a solder .This process 
Is called tinning. This process of coating involves tracks with solder. Advantages of tinning is the effect of environment of conductors, then PCB is drilled that is holes for fillings and mounting the components on PCB are drilled with suitable drill bit. 
ASSEMBLING OF PCB:- 
After the holes are drilled, the components have to be assembled on PCB before assembling the components. It is necessary to clean soldering iron in order to get easy and accurate soldering iron in order to get easy and accurate soldering. Removing impurity particles that are gathered on iron bit due to repetitive use clean soldering iron.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 18 
SOFTWARE SPECIFICATION:- 
1) KEIL SOFTWARE: 
Many companies provide the 8051 assembler, some of them provide shareware version of their product on the Web, Kiel is one of them. We can download them from their Websites. However, the size of code for these shareware versions is limited and we have to consider which assembler is suitable for our application. 
2) PROTEUS: 
Proteus is the embedded system simulation and developing platform developed by Britain Lab center Company, this software has the following characteristics: 
 Can carry on the intellectual principle Butut; The ones that paid software debugging and one-chip computer and peripheral circuit of the one-chip computer, in coordination with emulation; Meet the standard of the one-chip computer software simulation system. 
 Support common one-chip computer type and PHILIPS Co. ARM7 (series LPC) Processor and common peripheral device, like 8255, ADC0809. 
 Can with 3 Kiel Version, ADS l two integrated development environment combine, until and after the program compiling that language C write with collect, carry on the system simulation that the software and hardware combines. 
3. FLOW CHART:-
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 19 
Fig. flow chart of snake’s game flow
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 20 
APPLICATION:- 
The techniques used for navigating the snake could be generalized to apply to various other problems of interest. Possibilities include automated navigation of multiple robots through a crowded workspace, an automaton for tracking fleeing police suspects through harsh environments, or a control scheme for an exploratory vehicle seeking a particular goal on a harsh alien planet. The possibilities are only limited by the imagination. 
FUTURE SCOPE:- 
The work presented in this paper provides innumerable opportunities for further investigation into the evolution of a task prioritization scheme within a dynamically changing, randomly updated environment. 
Specific to the snake problem, modifications can be made to create completely new and interesting problems, such as a non-rectangular game board, obstacles within the game board, or multiple pieces of food. Multiple snakes could be co-evolved to competitively pursue the food. The function set could be modified to feature enhanced detection capabilities and more advanced navigational options.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 21 
CONCLUSION:- 
We have completed our knowledge of embedded system design after we finished the project and obtained more experience of hardware/software co-design. Since it was the first time that we built an embedded system, a lot of problems were encountered during our work on the project. 
For the hardware part, we took a long time to familiar with the power supply design, microcontroller (AT89S51), 8*8 LED matrixes and some other component use in this. 
For the software part, we test our program by applying embedded C, and simulate the game on proteus.
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 22 
COST OF PROJECT:- 
Serial Number. 
Component used 
Cost 
1. 
Microcontroller 
180.00 
2. 
Crystal oscillator 
20.00 
3. 
8*8 LED matrix 
120.00 
4. 
Transformer 
95.00 
5. 
Switch 
30.00 
6. 
Pull-up’s register 
10.00 
7. 
Capacitor 
30.00 
8. 
Register 
10.00 
9. 
PCB 
540.00 
10. 
Connecting wire 
40.00 
11. 
Other 
150.00 
TOTAL 
1485.00
Snakes Game using microcontroller 
DYPCOE, AKURDI (T.E, E&Tc ) Page 23 
REFERENCE:- 
 www.google.com 
 www.electronicsforu.com 
 www.wikipedia.com 
 www.atmel.com 
 www.beyondlogic.com 
 www.maxim-ic.com 
 www.alldatasheets.com 
 www.howstuffworks.com 
 Electronics the king of hobbies. 
 Muhammad Mazidi, The 8051 Microcontroller and 
Embedded Systems using Assembly and C.

snake game

  • 1.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 1 ABSTRACT The Nokia inspired Snake game implemented on 8051 platform. The game is built on AT89S51 Microcontroller. The game uses an 8 * 8 LED dot matrix display and five way keys for user interface. A dedicated delay settings key provides one touch access to the delay settings mode where the speed of the Snake can be adjusted. In our project we are implementing the snake game by using microcontroller. In this we are using switches one is Start for starting of the game and remaining switches for snake movements left, right, up and down these switches used like as a buttons in mobile. We are going to develop coding by using Embedded C according to that coding by using dot matrix the snake and egg will be display on 8*8 dot-matrix and by using switches the game will be operate according to our requirement.
  • 2.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 2 INTRODUCTION:- Snake is a video game concept which originated during the late 1970s in arcades. The name applies to the general game design; the original was not named Snake, and there is no definitive version of the game. Its simplicity has LED to many implementations of the Snake concept. After it became the standard pre-loaded game on Nokia mobile phones in 1998, there was a resurgence of interest in the game as it found a larger audience. Artificial intelligence (AI) techniques have been proven highly successful at the problems of navigation, task prioritization, and problem avoidance. Traditionally, humans have encoded rule-based AIs to create the behaviors necessary to allow an automaton to achieve a specific task or set of tasks. Genetic programming (GP), however, has been proven to allow a computer to create human-competitive results. Specifically, examples such as the wall-following robot (Koza 1992) and Pac Man (Koza 1992) demonstrate the effectiveness of GP at evolving programs capable of navigation and task prioritization behaviors which are competitive with human-produced results. SPECIFICATIONS:- The specification of the ‘SNAKES GAME’ are, according to the Major components used, these include:-  230v/50Hz AC main.  Rated supply voltage : +5v  IC AT89S51 as our Microcontroller.  8*8 LED dot matrix.  Push button keys.
  • 3.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 3 LITERATURE SURVEY:- The Snake variety of games dates back to the arcade game Blockade, developed and published by Gremlin in 1976. In 1978, Atari, Inc. released, as an unofficial port, an early home console version of the Blockade concept, titled Surround. Surround was one of the nine Atari 2600 (VCS) launch titles, and was also sold by Sears under the name Chase. That same year, a similar game was launched for the Bally Astro cade as Checkmate. The first known personal computer version of Snake, titled Worm, was programmed in 1978 by Peter Trefonas of the US on the TRS-80computer, and published by CLOAD magazine in the same year. This was followed shortly afterwards with versions from the same author for the Commodore PET and Apple II computers. A microcomputer port of Hustle was first written by Peter Trefonas in 1979 and published by CLOAD. This was later released by Milton Bradley for the TI-99/4A in 1980. There were several versions of Snake on the BBC Micro. 1982's Snake by Dave Bresnen was different in that the snake was controlled using the left and right arrow keys relative to the direction it was heading in. The snake increases in speed as it gets longer, and there are no "lives", making achieving a high score or reaching higher levels relatively difficult as one mistake means starting from the beginning. An analog joystick-controlled variant of Snake, called Anaconda, was included as a hidden mini game in Time Splitters 2, which featured free rotation instead of a fixed 4- direction system, and multiple types of food. More recent versions include a Neopets version known as Meerca Chase. Snake can be played on YouTube videos that use the 2010 version of the player. When a video is selected, the user can press the 'left' key, the 'right' key, the 'home' key, or the 'end' key for any period of time before immediately pressing the 'up' key. The game will appear and can be played in the video screen. Until 2012, a version called Old Snake could be played inside Gmail.
  • 4.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 4 BLOCK DIAGRAM:- Fig. block diagram of snakes game BLOCK DESCRIPTION:- We are implementing the snake game by using microcontroller. In this we are using switches one is Start for starting of the game. And remaining switches for snake movements left, right, up and down these switches used like as a buttons in mobile. We are going to develop coding by using Embedded C according to that coding by using dot matrix the snake and egg will be display on 8*8 dot-matrix and by using switches, the game will be operated according to our requirement.
  • 5.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 5 CIRCUIT DIAGRAM:- Fig. circuit diagram of snake game
  • 6.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 6 CIRCUIT DESCRIPTION DESIGNING:- The main intension of this project is to design a SANKE GAME using 8*8 LED dot matrix. In order to fulfill this application there are few steps that has been performed i.e. 1) Designing the power supply for the entire circuitry. 2) Selection of microcontroller that suits our application. 3) Selection of 8*8LED dot matrix. POWER SUPPLY DESIGN:- Fig. circuit diagram of power supply In-order to work with any components basic requirement is power supply. In this section there is a requirement one voltage level i.e. 5V DC power supply. Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step- down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we came to a conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher
  • 7.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 7 than the required voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily available in the market. The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating DC. As we all know that there are 3 kind of rectifiers that is 1) Half wave 2) Full wave and 3) Bridge rectifier Here we short listed to use Bridge rectifier, because half wave rectifier has we less in efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since there is no requirement for any negative voltage for our application, we gone with bridge rectifier. Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter. The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose output voltage is constant 5V DC irrespective of any fluctuation in line voltage. LIGHT EMITTING DIODE (LED) A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrow spectrum light when electrically biased in the forward direction of the pn-junction, as in the common LED circuit. This effect is a form of electroluminescence. Fig. LED (light emitting diode)
  • 8.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 8 Like a normal diode, the LED consists of a chip of semi-conducting material impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers electrons and holes flow into the junction from electrodes with different voltages. When an electron meets a hole, it falls into a lower energy level, and releases energy in the form of a photon. SELECTION OF MICROCONTROLLER:- As we know that there so many types of micro controller families that are available in the market. Those are:- 1) 8051 Family 2) AVR microcontroller Family 3) PIC microcontroller Family 4) ARM Family Basic 8051 family is enough for our application; hence we are not concentrating on higher end controller families. In order to fulfill our application basic that is AT89S51 controller is enough. . There are some requirements for proper operation of microcontroller. Those are: 1) Power supply section 2) Reset circuit 3) Crystal circuit Vcc Reset circuit is used to reset the microcontroller. Crystal circuit is used for the microcontroller for timing pluses. In this project we are not using external memory that’s why EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used for this application.
  • 9.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 9 PIN CONFIGURATION: Fig. pin diagram of MUC AT89S51 Features:  Compatible with MCS-51 Products  4.0V to 5.5V Operating Range  Fully Static Operation: 0 Hz to 33 MHz  Three-level Program Memory Lock  256 x 8-bit Internal RAM  32 Programmable I/O Lines  Three 16-bit Timer/Counters  Eight Interrupt Sources  Full Duplex UART Serial Channel
  • 10.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 10 DOT MATRIX:- A dot matrix is a 2-dimensional array of dots used to represent characters, symbols and images. Typically the dot matrix is used in older computer printers and many digital display devices. A dot matrix display is a display device used to display information on machines, clocks, railway departure indicators and many and other devices requiring a simple display device of limited resolution. The display consists of a matrix of lights or mechanical indicators arranged in a rectangular configuration (other shapes are also possible, although not common) such that by switching on or off selected lights, text or graphics can be displayed. A dot matrix controller converts instructions from a processor into signals which turns on or off lights in the matrix so that the required display is produced. Fig. (a)
  • 11.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 11 Fig. (b) Fig. (c)8*8 LED matrix display FEATURES:  1.26 inch (32.0mm) matrix height.  Dot size 3.00mm.  Low power requirement.  Excellent characters appearance.  Multiplex drive, column cathode com.  And row anode com.
  • 12.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 12  Multi color available.  Categorized for luminous intensity.  Stackable vertically and horizontally.
  • 13.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 13 WORKING:- The 8x8 dot-matrix 8 cathodes and 8 anodes for our purpose. For displaying any particular LED we make the port pin connected to the anode of the LED high and the corresponding cathode low. We have switches connected to the microcontroller for control of the game. We are constantly monitoring the port pins to which the switches are connected and if the left button is pressed then the snake moves left, if right button is pressed, then the snake moves right otherwise up or down according to the switch which is pressed. Also start switches are available. Start switch is used to start the game and this switch is not monitored during the game. The game will be over if:-  The snake head hits itself.  By reaching its maximum length of the snake.  Hit the wall of LED matrix. CIRCUIT SIMULATION:-
  • 14.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 14 Fig. Circuit simulation of snake game PCB DESIGN:-
  • 15.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 15 Fig. PCB LAYOUT OF MICROCONTROLLER BOARD PCB MAKING:- When the master diagram probable twice the size of real PCB has been evolved, the text major step consists of etching or dissolving the unwanted metal from copper gladded board to create the circuit as depicted by master diagram. It must be stressed that very accurate checking of master is essential at this stage. Then the master point is mounted on a special frame on easy facing of a larger camera and with aid of the very powerful illumination a master diagram is clearly photographed on a glass sensitive plate. This is developed to give photographic negative. In case of simple and need of number of less PCB, economic and advisable to use the following lab method of PCB making. PLANNING THE CIRCUIT:-
  • 16.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 16 There are several important factors that need not be taken into account, if the finished device is to work properly we must consider gain factor and ensure that the input and output parts are sufficiently well isolated to avoid the possibility. We are also to make sure that all components need to return to earth are properly connected and that possibility of common impedance arising in earth returned. Other factors that have to successfully studied include availability of adequate return points on board and its mounting from accessibility of switch connection made for mechanical fixing ventilation effect of vibrato. CLEANING THE BOARD:- The copper side of the board must be thoroughly cleaned before circuit plan is transferred to it. This is very important because even slightest trace or graze will impure the etching process and when the circuit plan has been neatly transferred to copper in this manner the board is held under, running tap and is allowed to dry before resist is applied. TRANSFORMING THE PLAN:- Now, once cleaning is done plan has transfer on copper surface of PCB material. A convenient way to do this is simply put a carbon paper between a copper surface of the board and working plan and carefully trace the lines of original plan with a ball pen. RESIST:- Resist is nothing more than a substrate that is unaffected by presence etching chemicals. It is usually colored so that copper surface can be easily seen. It is essential to resist through hardening before etching is started. Nail polished are better as they are less difficult to remove. To overcome this drying effect and to sharp the edges of the trace on PCB. Now a day’s etching taps along with IC pads are commonly used, to this, changes of short circuiting due to paints are completely avoided, etching taps and pads are available in different sizes. ETCHING:-
  • 17.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 17 Next comes etching of unwanted copper and whether a small single is all that required as quantity of board to be produce certain precautions must be taken before operation is commenced the most use etch ant I ferric chloride and to this is added small quantity of HCL to accelerate. Mixing 10 grams of ferric chloride and 25 grams of HCL with 15 grams of water can produce a good etchant. AGITATION:- Small plastic bath is ideal for storing the etchant process. The depth of liquid must be sufficient to complete cover elimination, the laminated board carrying, the resist pattern circuit is then dropped into etchant bath gently, agitation takes 5 to 20 minutes to complete, depending on the strength of the etchant temperature and thickness of copper foil. FINISHING OFF:- When all unwanted copper is dissolved from areas between conductors, board should be taken from etchant and washed in water. The resist must be removed using proper solvent. After this the copper surface must be polished with any kind of cleaner. It should be seen that there is no slight incomplete etching between the conducting paths of the PCB.PCBs coated coating material for protection in lab coating material itself is a solder .This process Is called tinning. This process of coating involves tracks with solder. Advantages of tinning is the effect of environment of conductors, then PCB is drilled that is holes for fillings and mounting the components on PCB are drilled with suitable drill bit. ASSEMBLING OF PCB:- After the holes are drilled, the components have to be assembled on PCB before assembling the components. It is necessary to clean soldering iron in order to get easy and accurate soldering iron in order to get easy and accurate soldering. Removing impurity particles that are gathered on iron bit due to repetitive use clean soldering iron.
  • 18.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 18 SOFTWARE SPECIFICATION:- 1) KEIL SOFTWARE: Many companies provide the 8051 assembler, some of them provide shareware version of their product on the Web, Kiel is one of them. We can download them from their Websites. However, the size of code for these shareware versions is limited and we have to consider which assembler is suitable for our application. 2) PROTEUS: Proteus is the embedded system simulation and developing platform developed by Britain Lab center Company, this software has the following characteristics:  Can carry on the intellectual principle Butut; The ones that paid software debugging and one-chip computer and peripheral circuit of the one-chip computer, in coordination with emulation; Meet the standard of the one-chip computer software simulation system.  Support common one-chip computer type and PHILIPS Co. ARM7 (series LPC) Processor and common peripheral device, like 8255, ADC0809.  Can with 3 Kiel Version, ADS l two integrated development environment combine, until and after the program compiling that language C write with collect, carry on the system simulation that the software and hardware combines. 3. FLOW CHART:-
  • 19.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 19 Fig. flow chart of snake’s game flow
  • 20.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 20 APPLICATION:- The techniques used for navigating the snake could be generalized to apply to various other problems of interest. Possibilities include automated navigation of multiple robots through a crowded workspace, an automaton for tracking fleeing police suspects through harsh environments, or a control scheme for an exploratory vehicle seeking a particular goal on a harsh alien planet. The possibilities are only limited by the imagination. FUTURE SCOPE:- The work presented in this paper provides innumerable opportunities for further investigation into the evolution of a task prioritization scheme within a dynamically changing, randomly updated environment. Specific to the snake problem, modifications can be made to create completely new and interesting problems, such as a non-rectangular game board, obstacles within the game board, or multiple pieces of food. Multiple snakes could be co-evolved to competitively pursue the food. The function set could be modified to feature enhanced detection capabilities and more advanced navigational options.
  • 21.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 21 CONCLUSION:- We have completed our knowledge of embedded system design after we finished the project and obtained more experience of hardware/software co-design. Since it was the first time that we built an embedded system, a lot of problems were encountered during our work on the project. For the hardware part, we took a long time to familiar with the power supply design, microcontroller (AT89S51), 8*8 LED matrixes and some other component use in this. For the software part, we test our program by applying embedded C, and simulate the game on proteus.
  • 22.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 22 COST OF PROJECT:- Serial Number. Component used Cost 1. Microcontroller 180.00 2. Crystal oscillator 20.00 3. 8*8 LED matrix 120.00 4. Transformer 95.00 5. Switch 30.00 6. Pull-up’s register 10.00 7. Capacitor 30.00 8. Register 10.00 9. PCB 540.00 10. Connecting wire 40.00 11. Other 150.00 TOTAL 1485.00
  • 23.
    Snakes Game usingmicrocontroller DYPCOE, AKURDI (T.E, E&Tc ) Page 23 REFERENCE:-  www.google.com  www.electronicsforu.com  www.wikipedia.com  www.atmel.com  www.beyondlogic.com  www.maxim-ic.com  www.alldatasheets.com  www.howstuffworks.com  Electronics the king of hobbies.  Muhammad Mazidi, The 8051 Microcontroller and Embedded Systems using Assembly and C.