Checkers Using IoT
Kanchan1 , Kratika2 , Dhairya Hans2, Dhruv Rastogi2, Jatin21 Assistant Professor of Computer Science Engineering Department, MIT College, Uttar Pradesh, India
2 Student of Computer Science Engineering, MIT College, Uttar Pradesh, India
Abstract - Board games have been a popular pastime among people of all ages and have been widely played. Many board game developers have been working oncreating games based on artificial intelligence, such as tictac-toe and chess. However, developing and building a board game fromscratch can be a challenging task, requiring a high level of programming skills to understand the graphics and physics that must be implemented in the game. The proposed research focuses on an IoT-basedversionof the popular board game checkers, which is similar to chess but has its own set of rules. The game is played between two players, with each player starting with 12 pieces on an 8 by 8 board. The objective of the research is to make the game more interactive for children, by incorporating a programme onboard that can predict the best moves for the computer to win or lose the game. By providing children with an interactive andengaging experience, this IoT-based checkers game aims to foster their interest in technology and problem-solving skills.
Key Words: Arduino Uno, Hall Sensor, LEDs, PCB
1. INTRODUCTION
TheInternetofThings(IoT)isasystemofinterconnected physicaldevicesthatcaninteractandsharedatawithoutthe need for human involvement. Because IoT allows us to gather information from all kinds of mediums, such as humans,animals,automobiles,andhouseholdappliances,it hasbeenexplicitlycharacterizedasan"Infrastructureofthe Information Society." By integrating electronic hardware withinanyphysicaldevicethatmaybegivenanIPaddress, includingdetectors,application,andnetworkinggear.The project'sobjectiveistodevelopacheckersBoardgameusing IoT on a physical board that can predict and show the possiblemovesofpieceswiththehelpofLEDs.
InternetofThingsisone ofthe areas incomputerscience that can be used to create a range of intelligent games whether board games, video games or educational games that would react to a human and would not be noticeable thatitisbeing reacted by a computer machine.
IoT is one of the fields in computer science that can be utilizedtocreateavarietyofintelligentgames,includingboardgames,videogames,andeducationalgamesthatcan react to human input in a natural way. One such game is checkers, a popular board game that requires strategic thinking and techniques to win. The game's mechanics
involve physically moving game pieces and thus, players mustunderstandhowtomovethemeffectivelyandatthe right time in order to capture their opponent's pieces. Checkersconsistsof24round,colouredpieces,typicallyin brownandblackcolours.Eachplayerstartswith12pieces andthegameisplayedonan8by8board.Towinthegame, players must capture all 12 of their opponent's pieces. Figure1illustratesascreenshotofthecheckersboardgame.
2. NEED OF THE PROJECT
The need for this project on "Checkers Game Using IoT" stemsfromthepopularityofboardgamesamongpeopleof allagesandtheongoingdevelopmentofboardgamesbased on IoT. However, the development of a board game from scratch requires a high level of skill in programming languagesandanunderstandingofthegraphicsandphysics thatmustbeimplementedinthegame.Theproposedproject aims to address this need by utilizing IoT technology to create an interactive checker game that utilizes magnetic sensorsandRGB(RedGreenBlue)LEDstodisplaypossible moves when a magnetic chess piece is lifted from its location.Thistechnologywillmakethegamemoreengaging for children and allow for the computer to determine the stepsnecessarytowinorlosethegame.Furthermore,the useofapowerbankwillmakethegameportableandallow foreasysetup.Thisprojectnotonlyfillsthegapinthefield of board games development but also will be a great educational tool for children to learn and train their problem-solvingandstrategicthinkingskills.
3. RELATED WORK
Theconceptofcreatingasmartgameboardfortraditional boardgamessuchascheckersandchesshasbeenexplored byvariousresearchersanddevelopersinrecentyears.One exampleistheworkofBogdanBerg,whocreatedasmart game board using a microcontroller and wireless communicationcapabilitiestoallowforremoteplayandthe recordingofgamestatistics.Thisprojectaimedtoenhance the traditional board game experience by incorporating technologyandincreasingthelevelofinteractivity.
4. STRUCTURE OF THE PROJECT
InthisprojectitisdividedintotwopartsfirstisMechanical structureandsecondisElectronicstructure.
4.1 Mechanical Structure
4.1.1 Design
Fig.1illustratestheconfigurationofthesensorunitfor theelectroniccheckerset.Thesensorisplacedunderneath the checkerboard and receives signals from the magnet located within each checker piece. This allows for the detectionofthepiece'spositionandfunctionontheboard. In this project, a plywood box is used that have all the structureofcomponents.
Checkersgameisdevelopedusinganacrylicsheetasa cover for the checkerboard. The board was built into a plywoodbox,andtheacrylicsheetwasusedasaprotective cover for the checkerboard, as well as for aesthetics. The acrylic sheet provided a durable and clear surface for the checkerboardandallowedfortheuseofmagneticsensors andRGBLEDstodetectanddisplaypossiblemoveswhena magneticchesspieceisliftedfromitslocation.Thismaterial waschosen foritstransparency, durability,it’scheapness and resistance to impact which made it suitable for the game.Thecombinationoftheacrylicsheetandtheplywood boxalsoprovidedasturdyandprofessional-lookinggame board,makingitsuitableforbothpersonalandcommercial use.
4.2 Electronic Structure
4.2.1 Project Parts
Arduino Uno
The Arduino Uno is a microcontroller board based on the ATmega328microcontroller.Ithas14digitalinput/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection,apowerjack,anICSPheader,andaresetbutton. Inthisresearch,theArduinoUnoisutilizedastheprimary controller for the checkers game using IoT. Its digital input/output pins are utilized to connect the magnetic sensors and RGB LEDs, which detect the position and movements of the checkers pieces and display possible moves respectively. The Arduino Uno's programming capabilityallowsfortheimplementationofthegame'srules and logic, making the interaction between the physical checkers board and the player possible. In the context of checkers, the Arduino Uno can be used to control the movementsofthecheckers,receiveinputfromHallsensors, andcommunicatewithacentraldevicetoprovidereal-time informationaboutthegame.
Hall Sensors
Hall sensors are widely used in a variety of applications, includinginthefieldofIoT.Inthecontextofanelectronic checker game using IoT, Hall sensors can be utilized to detect the movement of magnetic checker pieces on the board.Whenacheckerpieceisliftedfromitslocation,the magneticfieldaroundthepiecechangesandthischangeis detectedbytheHallsensor.Thesensorthensendsasignal to the microcontroller, such as an Arduino Uno, which processes the information and updates the game state accordingly. This allows for a seamless and interactive gamingexperience,asthecomputercaninstantlyreact to the players' moves and display possible moves or the outcome of the game. The use of Hall sensors in this application not only enhances the player's experience but also allows for a more accurate and efficient detection of piece movement, as compared to other methods such as opticalormechanicalsensors.TheuseofHallsensorsand IoT technology in checkers not only enhances the playing experience but also provides a new platform for data collection and analysis. In conclusion, the combination of HallsensorsandIoTtechnologyhassignificantpotentialfor thedevelopmentofinnovativeapplicationsinvariousfields, includinggaming.
LEDs
WeutilizedWS2812BLEDstripsasavisualindicatorforthe possiblemovesofthecheckerpiecesontheboard.TheLED
strips were placed under the acrylic sheet cover of the checkerboard, which was built into a plywood box. The WS2812B LED strips are able to display a wide range of colours and are controlled by an Arduino Uno microcontroller,whichreceivesinputfromtheHallsensors placed under the board to detect the movement of the magnetic checker pieces. This allows for a dynamic and interactive checkers experience, as the LED lights will updatetoshowthepossiblemovesofthecheckerpieceasit isliftedbytheplayer.
Magnets
Magnetsareanimportanthardwarecomponentusedinthe developmentofthecheckersgameusingIoT.Thesemagnets are embedded within the checker pieces and are used in conjunctionwithHallsensorstodetectthemovementand positionofthepiecesontheboard.TheHallsensorsdetect changesinthemagneticfieldcausedbythemovementofthe checker pieces and relay this information to the microcontroller,allowingthegametotrackthemovementof thepieces andmakedecisionsbased onthecurrentgame state. The use of magnets in this application allows for a moreaccurateandefficientwayofdetectingthemovement of the checker pieces, as compared to other traditional methods.
Power Supply
Inthe"CheckersgameUsingIoT"project,a5Vpowersupply isusedtoprovidepowertoalltheelectroniccomponentsof thegame.Thepowersupplyisessentialfortheoperationof thegameasitensuresthatallthesensors,LEDs,andother componentshavethenecessaryvoltagetofunctionproperly. The power supply is connected to the PCB board, which distributes power to all the components on the board. Withoutthepowersupply,thegamewouldnotbeable to function, making it a crucial component of the "Checkers gameUsingIoT"project.
PCB
Resistors
Intheproposed"CheckersgameUsingIoT"project,resistors areutilizedasanessentialcomponentofthecircuitonthe PCBboard.Theuseofresistorsinthisprojectistocontrol thecurrentflowingthroughtheHallsensors,whichareused todetectthemovementofthecheckerpiecesontheboard.A totalof8resistorsareusedinasinglePCBboardandthere istotal4PCBboards,witheachoneplacedinparallelwitha Hall sensor. These resistors work together with other components such as a shiftregister chip to distribute and control thecurrentflowing throughtheHall sensors.This ensures that the Hall sensors operate at optimal levels, providing accurate and reliable detection of the checker pieces on the board. The use of resistors in this project is crucialfortheproperfunctioningoftheIoT-enabledchecker game.
In the "Checkers game Using IoT" project, a PCB (Printed Circuit Board) is used as the foundation for the circuit design.ThePCBboardservesasaplatformtoconnectand organize the various electronic components, such as the microcontroller, Hall sensors, resistors, LEDs, and power supply,thatmakeupthegame'sfunctionality.Theuseofa PCBallowsforacompactandorganizeddesign,aswellasa stable and reliable performance. Additionally, PCB manufacturingtechniquessuchassurface-mounttechnology (SMT)canbeutilizedtofurtherreducethesizeofthecircuit andincreaseitsrobustness.TheuseofaPCBboardinthis project is a crucial element in ensuring a successful and functionalimplementationofthe"CheckersgameUsingIoT" system.
Shift Registers
In the "Checkers game Using IoT" project, 74hc165 shift registers are utilized as a key component in the circuit design. These shift registers are used to control the equal currentflowintheHallsensors,whichareresponsiblefor detectingthemovementofthecheckerspiecesontheboard. The 74hc165 is a high-speed parallel-in/serial-out shift register that allows for multiple inputs to be read simultaneouslyandthenshiftedoutserially.Itscompactsize andhigh-speedcapabilitiesmakeitanidealchoiceforthis application,asitallowsforefficientandprecisedetectionof checkerpiecemovementontheboard.
Additionally,theuseofshiftregistersinthecircuitdesign allowsforamorestreamlinedandorganizedlayoutofthe
variouscomponentsonthePCBboard,makingiteasierto troubleshootandmaintainthedevice.
4.2.2 LEDs Assembly
Inthisprojectthe32LEDsareconnectedinsuchaway allareaboveeachhallsensor,showninFig.6.
4.2.4 PCB Board Assembly
4.2.3 Hall Sensors Assembly
Inthisprojectthe32hallsensorsareconnectedinsucha wayallareundereachLEDsandconnectedinparallelinthe circuit,allthesensorsarecontrolledbytheshiftregisterthat isintegratedinPCBboard,showninFig.7.Furthermore,the parallelconnectionofthehallsensorsandLEDsensuresthat allsensorsareworkingsimultaneouslyandprovidingrealtimedata.Thisparallelconnectionmakesthecircuithighly responsiveandprovidesaccurateresults.Theintegrationof theshiftregisterintothePCBboardmakesthedesigneven more compact and efficient, as it eliminates the need for additionalcomponents.Overall,the4PCBboardsconnected in this project are a critical component of the system and playacrucialroleinthedetectionofthemovementsofthe checkers. The use of multiple PCB boards, along with hall sensors,resistors,andshift registers,makesthisprojecta primeexampleofhowadvancedtechnologycanbeusedto createinnovativeapplicationsinthefieldofIoT.
Inthisproject,atotalof4PCBboardsareconnectedto eachotherinordertoachievethedesiredresults.EachPCB boardcontainsanumberofhallsensors,resistors,andshift registersthatworktogethertodetectthemovementsofthe checkers.Thehallsensorsareresponsiblefordetectingthe magnetic fields generated by the checkers, while the resistorsareusedtoregulatetheflowofelectriccurrentin thecircuit.thewinnerofthegame.Theshiftregistersplaya crucialroleincontrollingthehallsensorsandensuringtheir optimalfunctioning.
5. FLOW CHART
TheflowchartofcheckersusingIoTdescribedasfirstthe condition is at initial position. Going with the arrow the condition is checked between the turn and after that the directiongoestoshowtheplayablepiecesontheboard.If thevalidpieceislifted,thenthegamecontinuesifnotthen thesystemthrowsanerror.Themovesthenanalysedbythe Arduino as it is valid or not and for that valid piece the movesareavailableonboardornotifyesthenthegames continueinloopifnottheboardshowsanerror.Afterthat the condition is checked that if the pieces or moves are availableforanypieceornotonboard,ifthereisnomoves orpieceleftthengamewill end butifnot,thegameagain startfrompreviousstate.Themovesarethenevaluatedby theArduinotoseewhethertheyarelegitimateornot,and whethertheyareavailableontheboardforthatvalidpiece ornot.Iftheyare,thegameloopsforward;otherwise,the boarddisplaysanerror.
6. CIRCUIT DESIGN
The circuit is designed with the 8 hall sensors, 1 Arduino Uno, 1- 74HC165 8-bit shift register and 8 10K Ohm resistors.Thereisoneclockpin,clockenablepin,loadpin, datapininshiftregistersandconnectedtotheArduinoand thereisparallelinputandoutput.Pin1,2,7,15areconnected to the Arduino for controlling the 8 sensors via shift registers. Middle 8 pins of shift register upper 4 pins and lower4pinsareconnectedtothe4hallsensorsofoneside andother4pinsareconnectedtothe4hallsensorsofother side.Allthe8hallsensorsareconnectedtoeach10Kohm resistersforcontrollingtheamountofcurrentineachsensor forproperworking.Andtherearetwootherpins(1and2) ofshiftregisterthatareconnectedtotheArduinoforsupply 5vcurrent.
7. SYSTEM FLOW 7.1 System Flow
The system flow of the checkers game using IOT is a crucialaspectofthisresearch.Thefirststepinthesystem flow is to detect the initial positions of the pieces. This is done to keep track of the game and to ensure that each player'spiecesareplacedintheirproperstartingpositions. Thesystemthenmovesontodeterminingwhoseturnitis. Thisinformationisnecessarytoensurethattheplayersare awareofwhoseturnitistomakeamove.
Thesystemthenhighlightsthepiecesthatcanbemoved bytheplayer.Thisincludespiecesthathaveapossiblemove andanyopponent'spiecesthatcanbecutbyapieceofthe currentplayer.[5]Ifanyopponent'spieceisbeingcutbyany piece of the current player, then the system will only highlight those pieces. On the other hand, if there is no opponent'spiecebeingcut,thesystemwillshowthenormal movespieces.
Once the player lifts a piece, the system validates the chosen piece. If the chosen piece is one of the highlighted pieces,itwillshowallthepossiblenextmovesofthatchosen piece. If the chosen piece is not a highlighted piece, the system will show an error message, indicating that the chosenpiececannotbemoved.
Aftertheplayerhasselectedapiece,theycanmoveitto theirdesiredlocation.Thesystemthenvalidatesthemoveto ensurethatitisavalidmove.Ifthemoveisnotvalidated,an errormessagewillbethrown.Ifanopponent'spieceiscut duringthemove,theturnwillnotchangeanditwillkeepon looping through the flow starting from, highlighting the possible next moves of the chosen piece. However, if an opponent's piece is not cut, the turn will change to the opponent,andthesystemwillloopbacktohighlightingthe piecesthatcanbemovedbytheplayer.
In addition, the system flow of the Checkers Using IoT projectisdesignedtodetectthechangeofapieceintoaKing piece and to update the game board accordingly. This eliminates the need for manual intervention and ensures thatthegameisplayedinafairandconsistentmanner.
Thesystemflowoftheplayeralsoincludesthevalidation of all moves, including those made by the King piece, to ensure that the game is played according to the rules. In conclusion,thesystemflowofthecheckersgameusingIOT isacomplexprocessthatinvolvesmultiplestepstoensurea fairandenjoyablegame.
Thesystemmustkeeptrackofthegameanddetermine whose turn it is, highlight the pieces that can be moved, validatethechosenpiece,andvalidatethemove.Thesystem mustalsodetectifanopponent'spiecehasbeencut,change
theturnifnecessary,andloopbacktothebeginningifthe gamecontinues.
7.2 Winning Condition
Thewinningconditionofaplayerinthecheckersgame using IOT is a critical aspect of this research. The system flowmustbedesignedtoaccuratelydeterminethewinnerof thegame.Therearethreepossiblewaysforaplayertowin thegame.
Firstly,ifallthepiecesofoneplayerarecut,theopposite playerwins.[2]Thismeansthatifaplayerhasnopiecesleft ontheboard,theotherplayerisdeclaredthewinner.This ruleisstraightforwardandensuresthataplayerisdeclared the winner if they have successfully captured all of their opponent'spieces.
Secondly,atimercanbeintegratedintothegametoadd anextralayerofexcitement.Ifthetimeisover,theplayer with more pieces on the board wins. This means that if a playerhascapturedmoreof theiropponent'spieces,they will be declared the winner, even if the other player has somepiecesleft.Thisruleaddsanextralevelofstrategyto the game, as players must consider the number of pieces theyhave,andtheamountoftimelefttomaketheirmoves.
Finally, if the number of pieces is the same for both players, the game is a draw [2]. This means that if both playershavethesamenumberofpiecesleftontheboard, neitherplayerwins,andthegameendsinadraw.Thisrule ensures that if neither player has an advantage over the other,thegameendsinatie.
In conclusion, the winning condition of the checkers gameusingIoTisacomplexandmulti-facetedprocessthat requirestheintegrationofadvancedtechnologyandawelldesignedsystemflow.Thesystemmustbeabletoaccurately detect the movements of the checkers, store information about the game in real-time, and determine the winner basedonthethreepossibleoutcomes.Theintegrationofthe KingpieceintothesystemflowoftheCheckersgameadds anextra layerofcomplexity tothesystem but isa critical component of the system that must be designed and integrated correctly in order to accurately determine the winner of the game and loser of the game with more precision.
8. CONCLUSION
Inconclusion,theCheckersUsingIoTprojectisaremarkable example of how technology can be used to enhance traditional games. The integration of IoT devices and systems provides an interactive, intelligent, and user friendlyexperienceforplayers.Thesystemflowofthegame hasbeendesignedtoaccuratelydetecttheinitialpositionsof thepieces,determinewhoseturnitis,highlightthepieces thatcanbemoved,validatethechosenpieceanditsmoves, anddeterminethewinnerofthegame.Thegame'swinning conditionhasbeendefinedbythreepossibleoutcomes:ifall thepiecesofoneplayerarecut,ifthetimeisoverandthe
playerwithmorepiecesontheboardwins,orifthenumber of pieces is the same for both players, and the game is a draw.
TheCheckersUsingIoTprojectshowshowIoTtechnology may be used to enhance conventional games and provide playersadistinctiveandinterestingexperience.Itshowsthe significance of integrating IoT into numerous elements of our daily lives and opens up a world of possibilities for future developments in gaming technology. The development team's ingenuity and inventiveness are demonstrated by the project's successful completion, and the prospect of further developments in this area is intriguing.
9. FUTURE SCOPE
ThefuturescopeoftheCheckersgameusingIoTpresents excitingopportunitiesforinnovationandgrowth.Onearea offocusistheintegrationofArtificialIntelligence(AI)into the game. The use of AI in Checkers will allow for a more challenging and dynamic experience for players. The AI algorithm can be trained to play at a high level, allowing playerstocompeteagainstachallengingopponent.Thiswill makethegamemoreengagingandentertainingforplayers ofallskilllevels.
Anotherareaoffocusistheintegrationofremoteplayinto theCheckersgameusingIoT.Thegamecanbeplayedboth onaphysicalboardandvirtually,withoneplayerplayingon theboardandtheotherplayingremotely.Thisopensupnew possibilitiesforplayerstoenjoythegame,regardlessoftheir physical location. With the integration of remote play, playerscannowcompeteagainsteachotherfromanywhere in the world, making the game more accessible and convenient.
Inadditiontotheseexcitingdevelopments,thefuturescope of the Checkers game using IoT will likely include advancements in game graphics, sound effects, and other sensory experiences that will make the game more immersive and engaging. The integration of new technologies, such as augmented and virtual reality, will further enhance the player experience and provide new opportunities for players to engage with the game in innovative ways. Overall, the future of the Checkers game usingIoTisbrightandoffersawealthofopportunitiesfor growthandinnovation.WiththeintegrationofAI,remote play,andnewtechnologies,theCheckersgameusingIoTis poised to become one of the most exciting and dynamic gamesintheworld.
REFERENCES
[1] Research Paper on chess by Siti Zarina Mohd Muji, Mohd Helmy Abdul Wahab, Radzi Ambar-Embedded ComputingSystem(EmbCoS)ResearchFocus,Group, Department of Computer Engineering, Faculty of
ElectricalandElectronicEngineering,86400,ParitRaja, BatuPahat,Johor,Malaysia.
[2] Research Paper on Checker Is Solved by Jonathan Schaeffer, Neil Burch, Yngvi Björnsson, Akihiro Kishimoto,MartinMüller,RobertLake,PaulLu,Steve Sutphen,DepartmentofComputingScience,University ofAlberta,Edmonton,AlbertaT6G2E8,Canada.
[3] Similar smart board game project from https://www.bogdanberg.com/2017/04/21/smartgeboard-updates/
[4] ResearchPaperonStudyofArtificialIntelligenceinto CheckersGameusingHTMLandJavaScriptbyKIdzham K1,WNKhalishahM1,StevenYW1,MFAminuddinM S1 , N Syawani H1 , Zain AM1, 2 and Y Yusoff1, 2 1 SchoolofComputing,FacultyofEngineering,Universiti TeknologiMalaysia,81310UTMSkudai,JohorBahru, Johor,Malaysia.
[5] Research paper on Design and Implementation of a Wireless Remote Chess Playing Physical Platform by Divye Bhutani1, Yusuf Ali2 , Pratyush Gupta3 Delhi Technological University, Shahbad Daulatpur, Delhi, India.
[6] Research Paper on Solving the Game of Checkers Jonathan Schaeffer Robert Lake Department of Computing Science University of Alberta Edmonton, AlbertaCanadaT6G2H1.