Liars Die Bot

by JesseeRomero in Circuits > Arduino

145 Views, 0 Favorites, 0 Comments

Liars Die Bot

IMG_1568.jpg

"This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)"

The following instructable will provide everything you need to build your own Liars Die bot and begin playing with family and friends!

The Liars Die Bot is a device that will allow you to play a 1 v 1 game of liars die, a popular party game played with dice and cups. This device will allow you to play a miniature version of the game consisting of a 2 die per person duel.

Game rules:

Each player will begin with 2 dice. The game begins by rolling the dice to get two random numbers 1-6 virtually through the 1602 LCD display.

When beginning the round each player will have two fresh die with two fresh numbers. To actually begin the game the first player (decided by one round of rock paper scissors) will make a wager about the amount of dice on the table. i.e "I believe there are two 5's on the table" . Now remember that any 1's count as a joker and can be used with any number. In the example given above if player 1 has a 1 and a 5 the player has made a safe bet and player 2 will have to either call their bluff or make another wager by raising player 1's bet by any respective amount, either two 6's or three 5's.

The round will end when a person has called bluff and either lost the call or won in which the loosing player of the interaction will loose a die ( signified by the moving LCD screens explained later in the guide ).

The game will end when one of the players has lost both their die.

Supplies

Tools:

- access to a 3D printer

- screwdriver

- powered screw driver ( recommended )

- soldering kit

- soldering metal

Parts:

- Arduino Uno R3

- Jumper cables

- IR remote

- IR receiver module

- Sg90 micro sever x4

- 1602 LCD screen with I2C backpack adapter ( adapter strongly recommended )

- #6 x 1/4" screws x8

- M3 x 6mm screws x16

- 3D printing filament

Step 1: CAD Design / Printing

To begin our project we will first need to print out the required parts using a 3D printer. All the .stl files required for the Liar Bot are available below.

now to explain each component:

- Liar Bot chassis

The Liar bot chassis is the foundation of the device and will be holding the rest of the 3D printed parts as well as all the device wiring.

- Arduino enclosure

The Arduino enclosure will be holding the Arduino Uno R3 and also storing a majority of the device wiring. Enclosure comes with designed openings for wiring to breadboard

- LCD 1602 case

Case needed to hold the 1602LCD display. Designed with holes for I2c adapter wiring.

- sg90 micro Servo holder

sg90 Servo holder, designed with small opening for servo wiring.

Each of these components will be necessary for the building of a Liar Bot

Step 2: Soldering the 1602 LCD Screens

IMG_1562.jpg
Screenshot 2021-05-04 224009.png

In order for us to be able to use the four LCD screens simultaneously within our Arduino code we will have to manually change the addresses using the address bridges located on the back of the LCD display. As you can see in the photo above the 1602 LCD displays come with three address bridges that allow the user to create up to 8 different combinations of addresses including the x27 default address.

To change the address of the display you will have to solder the bridge between A0, A1, or A2 or a combination of either to grant you a new address.

After doing so you can use the Arduino sketch provided below to check the address of each of your newly soldered LCD displays. To correctly connect your LCD's to perform this step you can follow the diagram above. In order to connect all four at the same time you will have to just simply connect them in parallel and run a single connection to the SCL and SDA pins on the Arduino.

Step 3: Device Construction

IMG_1563.jpg

This portion will cover the steps of actually putting the 3D printed components together. a majority of the design construction is screwing things into place and putting the required hardware into their 3D printed cases.

Parts that will need construction:

LCD display case -

To construct the LCD Case we will be using the M3 x 6mm screws to screw in our displays and then close the box. this is quite self explanatory although you can reference the photo above for help.

SG90 servo holder -

using the screws that come with the SG90 servo you will screw the servo into the holders using the designated screw holes. You will be using the same screws that come with the SG90 to screw the servo horn onto the LCD display top.

Arduino enclosure -

Here we will use the #6 x 1/4" screws to screw in our Arduino Uno R3 as well as a screw to screw in our enclosure to the chassis.

Step 4: Wiring

Screenshot 2021-05-04 223846.png

Now the hard part! we must wire our device

The wiring is actually pretty simple once you get started.

components that must be wired:

Servo motors -

In order to wire our servo motors we will connect the three wire connection to our breadboard and Arduino, we start by connecting the ground and Vcc wires to their respective rails on the bread board. The third wire the signal wire is then connected to one of the following pins on the Arduino -> (3,5,10,11) as these are the designated servo pins in our Arduino sketch that is discussed later in the guide.

LCD Displays -

Using our nifty I2C backpacks we will be connecting four wires from each LCD display, these connections will be ground, Vcc, SDA and SCL. The ground and Vcc wires will be connected to their respective rails on the breadboard. We then take our SDA and SCL wires and connect them in parallel with our three other LCD displays. If this sounds confusing you can reference the diagram shown above, keep in mind the diagram is only showing two LCDs in parallel however four will work just fine.

IR Receiver -

The IR Receiver comes with three inputs -> Ground, Vcc and signal. The ground and Vcc are connected to their respective rails on the breadboard while the signal wire is then connected to the 9 pin on the Arduino as designated by our sketch.

Additional comments:

Wiring everything before construction is highly recommended and will help a lot with trouble shooting.

Step 5: Programming and Software

Image 5-4-21 at 11.11 PM.jpg

Now for the fun part, the coding!

Our code will begin by identifying the necessary libraries as well as the addresses needed for our four LCD's. we then move onto the assigning our Servos and the IR receiver to their respective pins.

After this we then initialize our LCDs and display the beginning game message. Our setup also sets our servos to their starting positions of 90 degrees.

If you notice the setup also declares a value for our heart character used later in the main loop assigning it the value of byte 0, this is done by using byte customization within the LCD display to add some fun to our design.

Within the main loop we have a series of if statements which set the conditions for each of our 7 button commands that can be activated by our IR remote.

1 - will eliminate the first die by rotating the servo

2- will eliminate the second die by rotating the servo

3- will eliminate the third die by rotating the servo

4- will eliminate the fourth die by rotating the servo

5- will reset all the die to their 90 degree initial position

6- will generate the 4 random numbers and begin a round

7- will reset the random numbers and end the round

Happy playing!

Downloads