Automatic Card Dealer and Shuffler

by VUBGROUP1 in Living > Toys & Games

4081 Views, 24 Favorites, 0 Comments

Automatic Card Dealer and Shuffler

Automatic Card Shuffler and Dealer
Front.jpg
Back.jpg
Lateral.jpg
OtherLateral.jpg

Card games are very popular in many households and friendly gatherings. While playing cards, there often occur issues with manually shuffling and dealing cards. It's prone to errors, time-consuming and creates opportunities for cheating. On this page we are going to explain how we built a prototype of an automatic card dealer and shuffler to get rid of all these problems!

This project is built by electromechanical engineering students of the Bruface programme for both courses Mechatronics 1 and Design methodology.

Table of contents

  1. Project motivation
  2. Requirements
  3. Conceptual design
  4. High level design and Design of subsystems:
  5. Mechanical systems
  6. Circuitry and sensors
  7. Software
  8. Integration guide
  9. Quick start
  10. Review
  11. Sustainability
  12. Bill of materials (BOM)
  13. Team presentation
  14. Project repo

Project Motivation (need Identification)

AFbeelding5.png
Afbeelding1.png
Afbeelding4.png
Afbeelding3.png
Afbeelding2.png

This section discusses the problem at hand and the reasons for the development of the product. As previously noted, card games frequently involve laborious, bothersome, error-prone, and vulnerable manual shuffling and card dealing. The primary aim is to create an automated card dealer and shuffler to address these issues and enhance the overall player experience. Naturally, questions may arise, such as the necessity and demand for such a solution in the world. To investigate this, a survey was conducted with 122 responses from people with different ages. In this survey the following questions were asked

  • What’s your age-range?
  • Do you frequently participate in card games?
  • How often do you experience problems with manual card dealing and shuffling?
  • On a scale of 1-5, how important is fair and unbiased dealing for you?
  • Would you invest in an automatic card dealing and shuffling device?

The answers to these questions are summarised in the graphs you can see at the top of this block. 

As seen in the first figure, people with a very wide range of ages have responded to the survey. Most of these people often face problems with manual card dealing and shuffling, including misdealing and cheating, as seen on the second picture. In the third picture the fact if shuffling and dealing cards manually is perceived as time-consuming is examined. The data indicates that most people view it as such. Our product is designed to offer an efficient and swift card-dealing solution to minimize this issue. Following that, respondents were asked to assess the significance of fair and unbiased card dealing. The data consistently highlights that a substantial majority highly values fair dealing, a criterion our product is intended to meet. The concluding question in the survey centered on respondents' willingness to invest in our product. The data revealed that 71% of the participants would indeed consider investing in our product, motivated by the desire for fairness in the game and the prospect of enhancing the appeal of card games. In conclusion, it is evident that there is a promising market for our product, and it is likely to be well-received by potential customers.

But who is then going to but/use this product?

Often, family game nights and friends hanging out tend to want to play some card games since there due to the versatility of playing cards. So, if we think about people who are going to use our product, we automatically think about families and friends who wouldn’t want to shuffle, deal or to wait between games.

2.1 Who is going to use your product?

The user base for our product includes people that find card shuffling and dealing a laborious task and want to enhance their game experience and also, people that want to make sure the cards are shuffled and dealt with fairness. The user base will be comprised of people who like to play card and board games with family and friends.

2.2 Who is going to buy your product?

Our product is likely to be purchased by the same category of people that is going to use it. Home card game enthusiasts.

2.3 What or who does the product interfere with?

Our product will interact directly with the card game players. Additionally, it could interact with its immediate environment, such as the surrounding air and potentially liquids (e.g., beverages) that might be present during card games. Furthermore, it may require a relatively flat surface, like a table, for proper operation.

Based on the responses from survey participants we generated a few subjective and objective requirements for our product. Objectively, participants all listed fairness as a reason to want such a product to be developed. Fairness of card games encompass accuracy, randomization, card compatibility and speed. Accuracy here concerns the efficiency of the card shuffler and how error prone it is, randomization is about the arrangement of cards. Card compatibility is the objective need to ensure that all cards old or new can work with the machine. No one wants slow card shuffling and dealing, hence speed seems like the obvious criteria.

Subjectively, the user-interface, noise level and aesthetics were listed by survey participants. Most wanted a user friendly interface that was not only simple but also did not have a steep learning curve. Other users wanted a good looking shuffler and dealer, more or less a furniture piece. The noise level falls into both subjective and objective needs, most people wouldn't want a loud machine interrupting conversation during card games, however it may not be a big factor if the machine is being used at a party where noise is not an issue.

Requirements

Screenshot 2023-12-26 125218.png
RequirementList.png

Project Description:

The project aims to design and develop a mechatronic card-shuffling and dealing device, with a focus on efficiency and user-friendly operation. The primary functionalities include effective card shuffling and timely dealing to game players based on user input. Key constraints in achieving this goal revolve around the efficient shuffling of cards, a user-friendly interface, accurate card dealing mechanisms, and the overall arrangement of subsystems to create a cohesive machine.

Constraint Description and Justification:

  1. Efficient Card Shuffling: The challenge lies in selecting an optimal shuffling method among various options such as using two magazines, a splitting mechanism, an elevator mechanism, or a barrel/wheel mechanism. Each method presents unique constraints and trade-offs in terms of effectiveness, speed, and user experience.
  2. User-Interface: Designing a simple yet cost-effective user interface poses constraints in material selection, user interaction, and overall device ergonomics. The user interface also presents restriction in software implementation and requires an easy to use software that conveys the necessary information to the user. Care should also be taken to ensure that the software does not slow down the interface to prevent lagging.
  3. Accurate Card Dealing Mechanism: Research indicates that existing machines often use a static base for card dealing. Constraints arise in ensuring precision, reliability, and speed in the dealing mechanism. In addition to the aforementioned constraints, another critical consideration involves the judicious selection of components or parts that not only meet the functional requirements but also demonstrate effectiveness in performing the designated tasks.

Eco-Design Analysis:

The use of wood and 3D-printed plastic introduces environmental considerations. An eco-design analysis will assess the sustainability of materials, potential recycling methods, and overall environmental impact throughout the device's lifecycle.

Quantification of Criteria:

In this section a table is provided, see Figure 2, with all the objectives and constraints our final product should meet to fulfil the user’s needs.

After establishing the requirements, the means to fulfill them were thoroughly examined:

-Geometry Requirements: Fine-tuning during the design phase.

-Signals: Configuration in the programming phase.

-Materials: In-depth examination and selection of available materials.

-Kinematics: Programming and selection of a sufficiently powerful stepper motor.

-Forces: Consideration of weight, aiming to utilize lightweight materials

-Safety Measures:

* Point 21: Implementation of rigid joints between parts, ensuring parallel surfaces, and compensating weight to prevent instability.

* Point 22: Selection of a DC motor with adequate power.

* Point 23: Ensuring holes are appropriately sized.

* Point 24: Addition of rubber pads to introduce more friction between the base and surface.

Conclusion:

In conclusion, our project focuses on developing a mechatronic card-shuffling and dealing device with specific attention to efficient shuffling, user interface design, and accurate dealing mechanisms. The outlined constraints underscore the complexity of these tasks, requiring careful consideration of various design options. The subsequent sections of this report will delve into an eco-design analysis, quantification of criteria, and a prioritized table of constraints, providing a comprehensive understanding of our project's objectives, challenges, and proposed solutions.

Conceptual Design

List of features.png
Morphological chart.png
Concept1_chart.png
Concept1_sketch.png
Concept_2_chart.png
Conncept_2_sketch.png
Concept_3_sketch.png
Comparison.png

3.1 Essential problem formulation and list of features

The initial phase in conceptual design involves a process of deliberate abstraction aimed at simplifying the device to its fundamental components. This abstraction helps to identify the essential problems that must be resolved to face the initial goals. Engaging in this process of simplification allows the team to focus on the central problems and break free from overly complex or inflexible thinking.

From the initial abstract requirements, consisting of the design of an automatic card dealer and shuffler to improve player experience and reduce cheating and dealing errors in card games, the following essential problems and the features linked to them arise as seen in figure 1.

3.2 Morphological chart

Once the list of features and essentials for our product is established, the morphological chart can be developed. The morphological chart is a table that outlines all the potential sub-solutions for each function. In our case, the chart takes the format as shown in figure 2.

Different means are proposed to achieve the features in the morphological chart:

  • Shuffle mechanism: The shuffle mechanism is responsible for shuffling the cards. A mechanism with gears and crank can be implemented to shuffle the cards manually. The same idea can be used to implement a solution substituting the crank for a motor.
  • Shuffling trigger: The shuffling mechanism can be triggered manually by pressing and holding a button or can be automatized with the help of sensors to stop shuffling in absence of cards.
  • Pre-shuffle cards storage: The cards need to be stored in the machine before being shuffled, depending on the shuffling mechanism, they can be stored vertically, horizontally, or inclined.
  • Pre-deal cards storage: Once the cards have been shuffled, they are stored in a compartment before being dealt by the machine. They can be stored horizontally as well as radially in individual slots as shown in concept 1 (figure 4).
  • Card ejection mechanism: To eject the cards to the players, a design taking advantage of gravity can be used. The use of motors attached to belts or rollers can be more convenient to eject the cards with enough speed.
  • Deliver cards to multiple players: to deal the cards to the position where the players are at, which can imply the rotation of the whole machine, only rotating the upper part over a static base or internally rotate the cards without rotating the external structure. 
  • User interface: The user interface is used to interact with the machine and be able to start dealing as well as modify the number of players and cards to be dealt. Different solutions can be implemented, such as: a screen with buttons, a touchscreen, or an IR remote controller.
  • Access to deck of cards: Cards must be accessible at any moment, in case they get stuck inside the machine, or the user wants to retrieve them all. 3 potential solutions for this: extractable storage units, open cavities, and the inclusion of doors to access the storage compartments.
  • Power supply: The machine needs to be powered by some low power electrical source. Solar panels can be used as well as an AC to DC power adapter or batteries. 


3.3 Concept generation

After selecting the methods for each feature, the main objective is to generate several concepts based on the means mentioned before. Three concepts were created:

3.3.1 First concept 

The first concept can be seen in figure 3 and 4.

This concept comprises four different parts:

1)       First card storage: there exists a left compartment for placing the deck of cards initially.

2)      Intermediate storage: it is comprised of a central wheel with inclined storage compartments spanning 360º.

3)      Dealing subsystem: it is formed by a card eject mechanism consisting of a motorized roller and an output belt on the right.

4)      User interface: it is equipped with an LCD panel and buttons for initiating random shuffling and selecting game parameters.

The operation of the device involves pushing each card into a random compartment within the central wheel. Once all the cards are within the wheel, it rotates to align the output with a random compartment, from which the card is dealt.


3.3.2 Second concept

The second concept can be seen in figure 5 and 6.

This second concept consists of four distinct subsystems:

1)     Shuffling Subsystem: it is comprised of automated tilt platforms designed for shuffling the cards.

2)     Dealing Subsystem: it consists of a motorized roller and an aperture in the external structure, enabling the card to pass through it.

3)     User Interface: this subsystem features an LCD screen and buttons for configuring game settings.

4)     Rotating Mechanism: it includes two differential wheels responsible for rotating the entire machine.

The execution begins by placing the decks of cards at the sides of the shuffling subsystem. The automated tilt platforms initiate the shuffling process, guiding the cards into the pre-dealing storage. Here, the roller ejects the cards through the hole at precise angular positions achieved through rotation by the differential wheels.


3.3.3 Third concept

The third concept is based on the same morphological chart as concept 2 (figure 5), the sketch can be found in figure 8.

Like the previous concept, this design also features four distinct subsystems:

1)      Shuffling subsystem: formed by inclined platforms in a fixed position and this subsystem employs motorized rollers to shuffle the cards.

2)      Dealing subsystem: it consists of a motorized roller and an aperture in the external structure, enabling the card to pass through it.

3)      User interface: featuring an LCD Screen and buttons for configuring game settings, this subsystem enhances user interaction.

4)      Rotating mechanism: the upper part rotates on a stationary base.

The process starts with the placement of card decks at both sides of the shuffling subsystem. Then, motorized rollers initiate the shuffling operation, directing the cards into the pre-dealing storage area. At this point, the dealer roller ejects the cards through the hole at specific angular position achieved via the upper part’s rotation within the system.


3.3.4 Comparison between concepts

After designing the concepts, they must be compared based on several criteria to select the most suitable one. These criteria have been chosen based on the most important qualities that our device must possess:

-Simplicity of mechanism: the simpler the mechanism, the more cost-effective it is.

-Durability: ensure the device’s longevity.

-Stability: preventing falls and ensuring reliable performance. This is a very valuable criterion for the users.

-Surface compatibility: this criterion studies the device’s ability to function on different surfaces to provide flexibility for users.

-Easy card removal from the storage: in case cards get stuck in the machine, it is necessary to have access to the deck of cards to answer the problem. Also, if the player wants to stop in the middle of a game and start again, it would be possible to remove the deck.

-Portability: evaluating based on size and weight, with larger and heavier devices receiving lower scores.

-Capacity (number of decks allowed): this is crucial for games that involve multiple decks.

-Shuffling speed: the speed at which the device can shuffle is important for maintaining a smooth and timely flow of the game. Faster shuffling means less downtime between rounds, keeping the game dynamic and engaging.

-Shuffling randomness: is key for preventing any predictability or bias in the dealt hands.

-Cards damage: cards can wear out over time. A good device should minimize card damage to prolong the lifespan of the playing cards.

-Ease of use: it should be user-friendly, particularly in settings. Clear instructions and simple operation contribute to the overall efficiency.

-Proper arrival distance of dealt cards: this ensures that everyone at the table can easily access and view their cards without any disruptions to the game.

Finally, after computing the points, it seems that the third concept is the most favorable as seen in figure 9.

High-Level Design / Embodiment Design/ Design of Subsystems

High level diagram.png
Overall CAD Mecha.png
Rotatary subsystem.png
whole base.png
Base with hole.png
Wiel base.png
Disk to hold wheels.png
rotating platform.png
Deal mechanism.png
Back panel deal .png
Shuffle mechanism.png
Back panel shuffle mechanism.png
LCD case op shuffle.png
LCD Case.png
Gat voor kabels LCD.png
Power supply.png
Card Shuffler and Dealer Flow.png
GearMechanism.jpg
Schematic_shuffling_circuit_2023-12-26.png
Schematic_User_interface_2023-12-26.png
Sheet_1.png
Sheet_2.png
Schematic_Complete circuit_2023-12-26.png

In this section all the subsystems are shown and it's discussed how they are connected to each other and how they communicate with each other. In the first picture you can see a high level block diagram showing the relations between each subsystem. The main tasks in are shuffling the cards, dealing them and rotating the whole device to deal the cards to different players. Beside that there is also the user interface and the Arduino that will function as the brain of the device.

Let's start with the user interface, which is formed by an LCD and different push buttons that will be used by the user to interact with the device and set and visualize the number of players and cards to deal. There is also one button that is not connected to the arduino and that's the one that will trigger the DC motor that will shuffle the cards, so as long as you push this button, the cards will be shuffled.

Secondly there is shuffling subsystem. The input for this subsystem is, of couse, the deck of cards that need to be shuffled that will be placed in 2 piles and the user pressing the button to trigger the DC motor. This motor will be attached to 2 rollers that will shuffle the cards and send them to de dealing subsystem.

So the dealing subsystem will have the shuffled cards and the signal coming from the Arduino to activate the dealing DC motor as an input.

Finally, we have the Rotary Distribution subsystem that basically consists in a Stepper motor rotating the device to face the players.

In the second picture you can see a CAD file of the whole device. If we start from the bottom, we can see our first subsystem, namely the rotating part. In the middle there is the deal part that will eject the right amount of cards to each player. On top there is the shuffle part with the user interface.


Material selection

So, the device has four main components to be manufactured: base structure, gears, rollers, and LCD case.

-Base structure: It comprises all the structure and flat surfaces of the device: the external case, the internal fixed walls of the devices such as the columns for the pre-deal card storage, the inclined platforms for the pre-shuffle storage and the card blockers. These components need to be rigid and strong enough to keep each part in place and provide a good impact resistance in case the device is hit accidentally. It is also intended to make it as light as possible to make it more portable and easier to rotate. Therefore, the most suitable material is Medium-Density Fiberboard (MDF). The device's geometry, designed primarily with planar walls in mind, aligns well with the capabilities of MDF. The fablab's lasercut machine provides precision in cutting and shaping MDF sheets, allowing for the creation of rigid and robust components. The use of MDF also contributes to maintaining the device's portability by keeping it lightweight while ensuring sufficient strength to withstand accidental impacts. On Figure 2, MDF parts are in brown.


-Gears: The gears used in the shuffling mechanism need to hold a very low torque, as they will only transmit the torque from the DC motor to the opposite roller to shuffle the cards. Nevertheless, they need to be rigid, precisely manufactured, and durable to perform properly.

-Rollers: The rollers are used to push the cards, so they are not submitted to high bending forces as they only hold the weight of a deck of cards. Nevertheless, they need to be rigid, precisely manufactured, and durable to perform properly.

-LCD case: The LCD case serves as an enclosure for the display component within the shuffling mechanism. It should be designed to protect and showcase the LCD display, ensuring visibility and accessibility while maintaining structural integrity.

As for the gears used in the shuffling mechanism, and the rollers responsible for pushing the cards, both components can be effectively manufactured using plastic, specifically Polylactic Acid (PLA). It is a suitable material for the LCD case, too.

PLA is an economical material choice, and the relatively simple geometry of gears, rollers and LCD case makes them suitable for fabrication using 3D printers available at the fablab. The use of plastic in these components not only meets the cost-effectiveness criterion but also allows for intricate designs and precise manufacturing. On the above Figures, grey parts are made of PLA.

Now every subsystem will be explained in detail.


A. Mechanical systems


a. Rotary subsystem

As seen in the third picture the rotating part consists of a firm base, a rotating platform, a stepper motor and the electronics. The base itself consists again out of two different parts as seen in picture 4. It's a square out of MDF with a length of 10cm and a height of 2cm that will be lasercutted because it has an easy geometry. In the middle there is a 3D printed cube with in the middle a hole with the exact same shape as the shaft of the stepper motor as seen in picture 5.

On top of this base there is the rotating platform where the electronics and the stepper motor will be screwed to as seen in picture 3. The shaft of the stepper motor is fitted in the hole of the base to lock the shaft in place. And then the walls and the shaft of the wheels are screwed to each other and to the rotating platform as seen in picture 6. Finally the wheels itself that will be bearings are held in place with a small disk ( picture 7) that is screwed to the shaft.

In picture 8 it's shown what the rotating platform looks like. It’s a rectangle of 20,4 cm by 10,4 cm. It has several protrusions to fit the walls and cavities to fit screws to fasten the walls. The use of this protrusions and cavities can be seen in picture 2. 


b. Dealing subsytem

The dealing subsystem is formed by the front wall and back wall. Between those two walls, two pre deal storage walls are clamped in the holes foreseen in the back panel as you can see in picture 10. In these pre deal storage walls, there are some holes foreseen to screw the DC motor to this wall and to fit a roller on the shaft of the motor and in the wall on the other side. The bottom of the pre deal storage is fitted in the back wall and glued to the bottom surfaces of the pre deal storage walls. The roller wil be 3D because it's geometry can not be lasercutted. The walls are lasercutted. The dimensions of the pre deal storage is based on the size of a card. It measures a length of 8.7cm and a width of 5.6 cm, taken into account some margin, gives us the dimensions of the pre deal storage.


c. Shuffling subsystem

In picture 11 and 12 the shuffling subsystem is shown. Again the front and back walls are also used in this subsystem. The shuffling subsystem consists of two inclined platforms where the card should be put, which are clamped between the front and back walls. Further are there also two 'blockers' to prevent the cards from sliding into the pre deal storage that are glued to the front and back wall. The shuffle mechanism itself is formed by a gear train that is driven by a DC motor that is screwed to the front wall. This gear train will let two rollers spin that will grab the cards from both sides and shuffle them. The gears and rollers are attached using the same technique as with the weels of the rotary subsystem. Again the dimensions of the shuffling subsystem are based on the dimensions of a card.


d. User interface

In picture 13,14 and 15 you can see the user interface. It’s a box that will be 3D printed and that is screwed to the front panel so it will protect the gears from the outer environment. Further the LCD screen will be screwed to the case and the buttons will be glued to it. Finally we also made a hole in the front panel (as seen in picture 15 in the bottom left corner) that will be covered by the case, so we can pass the cables from the arduino to the LCD. 


e. Power supply

As seen in picture 16 there will be one side of the device that have a power switch to turn on the device. We also foresaw a USB-C connector to recharge the batteries but in the end we agreed powering the device with a power supply so we will not use the connector.


B. Circuitry and sensors


a. Rotary subsystem.

The rotary subsystem was designed using an arduino UNO R3, a NEMA 17 42A02C stepper motor, an A4988 stepper motor driver and a 100uF capacitor. The cicuit schematic is shown in figure 22. The arduino UNO (it is the used in almost all subsystems of the project) served as the brains of the system. The stepper motor was also selected due to its precision and control since it can move in discrete steps, positional accuracy without the need for feedback, repeatability and high torque at low speeds. Most importantly it is a cost effective device.

Torque calculation:

In determining whether the motor selected was suitable, the total weight of 2kg was used to calculate the friction and the torque required to overcome the opposing force. In doing so we found that the stepper motor was more than capable for this task.

F_friction=μ×N=0,1×9,81×2kg=1,962 N

Torque= F_friction × distance = 0.01[m]×1.962[N] = 0.2Nm

T_Stepper = 200N·mm < Max Torque, where max torque = 420 Nmm.

The stepper motor is driven by a special pcb the A4988 stepper motor driver which served as the intermediary between the arduino and the stepper motor. the capacitor is added to decouple the motor from the circuit. Decoupling capacitors are commonly used in electronic circuits to stabilize the power supply and prevent noise or voltage spikes from affecting the performance of sensitive components. When using a stepper motor with a motor driver circuit and Arduino, adding decoupling capacitors can be beneficial.


b. Shuffling subsystem.

The shuffling subsystem much like the dealing system was made using a 12V 400rpm DC motor, an L298N DC motor driver connected to arduino. The circuit shown in Figure 19 shows how the connections are made. The driver was connected to the arduino, not to access any of the pins but to be enabled and disabled using a push button to start and stop the shuffling.

Torque calculation:

In determining whether the motor selected was suitable, the required DC motor torque must be computed. In order to do it, the applied forces while ejecting a card should be calculated:

-Friction between the cards (cardstock) and rubber (roller): F_friction,card=μ·(m_deck)·g=0.4422·(0.004·52)·9.81=0.9023N

 -Acceleration force to eject a card: (F_accelerate,card)=(m_card)·(a_1 card)=0.004·1=0.004N

-Total force: F_total= (F_friction,card)+(F_accelerate,card)=0.9023+0.004=0.9063N

After it, the torque needed can be finally computed by seeing Figure 18 and considering the ratios between the gear transmission (see Figure 18) number of teeth, the total force applied on the roller when ejecting one card and the radius of the roller:

-Roller torque: as both rollers have the same size and performance:

T_roller=(T_roller, R1)=(T_roller, R2)=(F_total, R)·(Radius_roller)=0.9063·9=8.1586N·mm

 -Motor torque from roller 1: T_motor, R1=(T_roller, R1)·(Z_m/Z_R1) = 8.1586·(22/12)=14.9575N·mm

 -Motor torque from roller 2: T_motor, R2=(T_roller, R2)·(Z_m/z_R1) ·(Z_R1/z_G1) ·(Z_G1/Z_G2)·(Z_G1/Z_R2) =(T_roller, R2)·(Z_m/z_R2)=8.1586·(22/12)=14.9575N·mm

 -Total torque: T_totalmotor=(T_motor, R1)+(T_motor, R2)=29.915N·mm

As T_totalmotor=29.915N·mm<Max_torqueDCmotor=490.33N·mm, then we can conclude that the DC motor was more than capable for shuffling the cards.

c. Dealing subsytem.

The dealing subsystem was made using a 12V 400rpm DC motor, an L298N DC motor driver connected to arduino. The circuit shown below shows how the connections are made. The depicted circuit illustrates the card dealing mechanism, featuring the integration of an L298N dual motor driver IC, DC motor, Arduino Uno, A4988 stepper motor driver, and a stepper motor within the rotary subsystem, as previously detailed. In establishing communication between the Arduino and the L298N, specific pin connections have been meticulously configured. Arduino pins D09, D10, and D11 are respectively linked to the L298N's ENA (Enable A), IN1, and IN2 pins, facilitating seamless coordination between the microcontroller and the motor driver.

The connection between the L298N and the DC motor involves precision in wiring, with L298N's OUT1 (pin 5) and OUT2 (pin 6) connected to the corresponding terminals of the motor (terminal 1 and terminal 2). To power the motor reliably, a dedicated power supply interfaces with the L298N through connections to VMOT (pin 8) for the positive terminal and GND (pin 7) for the negative terminal, ensuring stable and efficient motor operation. The circuit schematic is shown in figure 21.

Torque calculation:

As the same roller size, materials and the performance is the same as in the shuffling subsystem, the torque needed on the roller is the same:

Moreover, the roller is directly connected to the motor, so we get a value of T_totalmotor=8.159N·mm<Max_torqueDCmotor=490.33N·mm.

It can be concluded that the DC motor was more than capable for the dealing task.

d. User interface.

The user interface was made with simplicity in mind. Using five push buttons to increase, decrease, make selections and to confim selections , shown in figure 20. The LCD used with the 16×2 LCD using the I2C interface. The LCD has four pins namely, VIN,GND, SDA and SCL which correspond to the 5V in, ground, the data signal and finally the clock signal. SDA (Serial Data Line) is the line used for sending and receiving data between the Arduino and other devices on the I2C bus. It's the line through which information is transferred. SCL (Serial Clock Line. is responsible for providing the clock signal that synchronizes the data transmission between devices connected on the I2C bus. It dictates the timing of data bits being transferred. The arduino SDA and SCL pins A4 and A5 were used as the connection points for the 16×2 LCD.

e. Power supply.

The initial plan was to include a battery to operate the device, however, during our penultimate presentation the panel adviced the use of a laboratory power supply to power up the system. The machine was powered with 12.20V and 1.20A, since all the motors required 12V, a buck converter was used to limit the voltage to 5V for the arduino and the LCD.

f. Complete circuit.

The circuit shown in figure 23 is the complete circuit used for our system. This combined all the individual subsystems into one cohesive system and along with the software discussed next, controlled the device.

C. Software

  • Requirements

First, the software of this robot, together with the user interface, must provide an easy interaction between the user and the device. Users must be able to select the number of players, who do they want to deal the cards to and how many cards per player do they want to deal.

There is no software involved in the shuffling process as the DC motor to shuffle cards is directly connected to the H-Bridge driver and triggered by a push button.

Regarding the dealing process, the sofware must control the speed, direction and timing of the DC motor to eject the right amount of cards and it has to control the stepper motor in order to rotate the device and deal to the different players.

All the code in this project is written for an Arduino UNO, although it could be easily adapted for any other board.

Required libraries:

  • LiquidCrystal_I2C.h and Wire.h for the LCD Screen
  • Accelstepper.h for the stepper motor

  • Design process and considerations of components

To design the software of the user interface, we wanted to make it very intuitive, comfortable and simple. First we ask for the number of players so the robot knows how to divide the 360º around it into the number of players. We define 200 steps per revolution, so the number of steps between consecutive players is defined by 200 / number_of_players. With the number of players it can also create a list containing the possible players to deal to. This list will be used to show the After the selection of players, the user interface remains in the same state during the whole game. It shows on the left side of the screen the player(s) to deal to, and on the right side of the screen the number of cards to deal to the player(s). Next to the screen, on the each side of the screen there are 5 buttons in total. On the left side, two buttons are used to increase or decrease the number of players first, and then to navigate through the players list. On the right side, two buttons are used to increase or decrease the amount of cards to deal and one button is used to confirm the selection. We could have implemented another software solution using less buttons but we chose this one because it allows the user to visualize and change the players and cards selection anytime simultaniously, so it's more comfortable and quicker than having to select first the player to deal and then the amount of cards.

We defined the GPIO pins for the buttons as INPUT_PULLUP to avoid using extra resistors and implemented a delay to debounce them through software.

To control the DC motor for ejecting the cards, we implemented a function that writes HIGH or LOW to the IN1 and IN2 pins of the H-Bridge driver in order to rotate in one direction or the other. First, it rotates backwards (IN1=HIGH, IN2=LOW) during 400ms to make sure all the cards stay inside the storage compartment, then it rotates to the other direction (IN1=LOW, IN2=HIGH) for a certain amount of time depending on the number of cards to deal n, this amount of time is given by the function delay(n * 525 - (n - 1) * 140). This function was found experimentaly.

Finally, the Arduino controls the stepper motor through the AccelStepper library and a A4899 driver. This simplifies the code as we only need two functions from the library to drive it: moveToPosition(targetPosition) to set the target position and runToPosition() to rotate the stepper until reaching the desired position. This last function is a blocking function, which means that the arduino does not execute the next line of code until the stepper reaches the desired position. This is normally an undesired behavior when you want to execute simultaneous actions, but in our case, this is exactly what we need, as the robot does not have to deal the cards until it reaches the next player position.


  • Code flow diagram

The code flow diagram can be found on the top of this section. It is a helpful tool to develop before writing the code. It helps to visualize the intended behaviour the software and to take into account all the required steps and functions that will need to be followed sequentially. By following the code flow diagram, anyone can understand the functioning of the robot without having to deepen into the code, which can be hard in some cases.


  • Code

Let's break through the code of our robot. As in all the Arduino codes, we start by including the required libraries and defining all the needed variables. Then, inside the setup() function, we initialize the screen, set up the pin modes and the stepper speed and acceleration. Afterwards, before leaving the setup(), we execute 4 functions:


  • startUp() : Prints a welcome message on the screen.


  • helloCards(): If there is already any card inside the dealing storage, it ejects and stores the tip of the first card two times. Useless but a cool electromechanical welcome to the players :)


  • selectNumberOfPlayers(): Allows the user to select the number of players from 1 to 8. Stores the selection in a variable.


  • fillPlayersList(): It creates the list that contains the players to deal to. The first element of the list is "All players" followed by "Player 1", ..., "Player n".


Inside the loop function we only have the selectPlayersAndCards() function:

  • selectPlayersAndCards(): As you can imagine with this convoluted name, this function is meant for choosing players and number of cards to deal.

Once the player confirms the selection, the function calls the "moveStepper(int player, int n_card)" function. This function rotates the stepper to the desired position(s) and once there calls the "dealCards(int n_card)" to eject the right amount of cards. If "All Players" is selected, the steppe moves first to the first player position.


Here is a mock code to see its structure:

//import libraries
//define variables

void setup() {
//set pinModes
//set stepper speed and acceleration
startUp(); //welcomes the player with the LCD
  helloCards(); //welcomes the player electromechanically
  selectNumberOfPlayers(); //sets the number of players
  fillPlayersList(); //creates the players' list
}

void loop() {
selectPlayersAndCards(); //select player(s) to deal to and the amount of cards
}

selectPlayersAndCards() {
//Players and cards selected through user interface
...
moveStepper(player, n_card); //after user confirmation
}

moveStepper(int player, n_card) {
//rotates the device to the desired position(s)
...
dealCards(int n_card); //ejects the cards
}

dealCards(int n) {
//controls the DC motor to rotate for a certain amount of time and deal the cards
}


And here is the full code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>  // Library for LCD
#include <AccelStepper.h>       //Include accelstepper library


LiquidCrystal_I2C lcd(0x27, 16, 2);  // I2C address 0x27, 16 column and 2 rows


const int dirPin = 2;
const int stepPin = 3;


const int pl_incButtonPin = 4;   // Pin for the button to increase players
const int pl_decButtonPin = 5;   // Pin for the button to decrease players
const int cd_incButtonPin = 6;   // Pin for the button to increase cards
const int cd_decButtonPin = 7;   // Pin for the button to decrease cards
const int confirmButtonPin = 8;  // Pin to confirm selection


#define IN1_PIN 10
#define IN2_PIN 9
#define EN1_PIN 11


int pl_number = 1;  // Initial player number
int player_to_deal = 0;
int cards_to_deal = 1;
String* players;

int stepsPerRevolution = 200;


// Define motor interface type
#define motorInterfaceType 1


int currentPosition = 0;


AccelStepper myStepper(motorInterfaceType, stepPin, dirPin);


void setup() {
  lcd.init();       // initialize the lcd
  lcd.backlight();  // turn on the backlight


  pinMode(pl_incButtonPin, INPUT_PULLUP);   // Set pin for the increase button as INPUT_PULLUP
  pinMode(pl_decButtonPin, INPUT_PULLUP);   // Set pin for the decrease button as INPUT_PULLUP
  pinMode(cd_incButtonPin, INPUT_PULLUP);   // Set pin for the increase button as INPUT_PULLUP
  pinMode(cd_decButtonPin, INPUT_PULLUP);   // Set pin for the decrease button as INPUT_PULLUP
  pinMode(confirmButtonPin, INPUT_PULLUP);  //Set confirm pin as INPUT_PULLUP


  pinMode(EN1_PIN, OUTPUT);
  pinMode(IN1_PIN, OUTPUT);
  pinMode(IN2_PIN, OUTPUT);


  myStepper.setMaxSpeed(1000);
  myStepper.setAcceleration(800);
  myStepper.setSpeed(200);


  startUp();
  helloCards();
  selectNumberOfPlayers();
  fillPlayersList();
}


void loop() {
  selectPlayersAndCards();


}


void fillPlayersList() {
  players = new String[pl_number + 1];  // +1 for "All Players"
  players[0] = "All Players";


  for (int i = 1; i <= pl_number; i++) {
    players[i] = "Player " + String(i);
  }
}


//this is the startUp screen
void startUp() {
  lcd.clear();
  lcd.setCursor(4, 0);
  lcd.print("Welcome");
  delay(700);
  lcd.setCursor(7, 1);
  lcd.print("to");
  delay(300);
  lcd.clear();
  lcd.setCursor(4, 0);
  lcd.print("Welcome");
  lcd.setCursor(5, 1);
  lcd.print("to the");
  delay(500);
  lcd.clear();
  lcd.setCursor(3, 0);
  lcd.print("Automatic");
  delay(700);
  lcd.clear();
  lcd.setCursor(1, 0);
  lcd.print("Card");
  delay(500);
  lcd.print(" Shuffler");
  delay(500);
  lcd.setCursor(3, 1);
  lcd.print("and");
  delay(400);
  lcd.print(" Dealer");
  delay(2000);
}


//this loop allows players to make selections from the first screen
void selectNumberOfPlayers() {
  boolean selected = false;
  lcd.clear();
  while (!selected) {
    lcd.setCursor(0, 0);
    lcd.print(" Players number");
    lcd.setCursor(7, 1);
    lcd.print(String(pl_number));


    if (digitalRead(pl_incButtonPin) == LOW && pl_number < 8) {
      pl_number++;
      delay(200);
      lcd.clear();
    } else if (digitalRead(pl_decButtonPin) == LOW && pl_number > 1) {
      pl_number--;
      delay(200);
      lcd.clear();
    } else if (digitalRead(confirmButtonPin) == LOW) {
      lcd.clear();
      selected = true;
      delay(500);
    }
  }
}


void selectPlayersAndCards() {
  lcd.setCursor(0, 0);
  lcd.print("Deal to    cards");
  lcd.setCursor(0, 1);
  lcd.print(players[player_to_deal]);
  lcd.setCursor(14, 1);
  if (cards_to_deal < 10) {
    lcd.print(" ");
  }
  lcd.print(String(cards_to_deal));


  if (digitalRead(pl_incButtonPin) == LOW) {
    player_to_deal = (player_to_deal == pl_number) ? 0 : player_to_deal + 1;
    delay(200);
    lcd.clear();
  } else if (digitalRead(pl_decButtonPin) == LOW) {
    player_to_deal = (player_to_deal == 0) ? pl_number : player_to_deal - 1;
    delay(200);
    lcd.clear();
  } else if (digitalRead(cd_incButtonPin) == LOW) {
    cards_to_deal++;
    delay(200);
    lcd.clear();
  } else if (digitalRead(cd_decButtonPin) == LOW && cards_to_deal > 1) {
    cards_to_deal--;
    delay(200);
    lcd.clear();
  } else if (digitalRead(confirmButtonPin) == LOW) {
    moveStepper(player_to_deal, cards_to_deal);
    delay(200);
  }
}


void dealCards(int n) {


  digitalWrite(IN2_PIN, HIGH);  //Deal cards
  digitalWrite(IN1_PIN, LOW);
  delay(n * 525 - (n - 1) * 140);
  digitalWrite(IN2_PIN, LOW);  //Rotate backwards
  digitalWrite(IN1_PIN, HIGH);
  delay(400);
  digitalWrite(IN1_PIN, LOW);


}


//this part handles the dealing part with stepper
void moveStepper(int player, int n_card) {
  if (player == 0) {  //deal to all players
    myStepper.moveTo(0);
    myStepper.runToPosition();
    for (int p = 0; p < pl_number; p++) {
      int targetPosition = p * (stepsPerRevolution / pl_number);
      myStepper.moveTo(targetPosition);
      myStepper.runToPosition();
      dealCards(n_card);
    }
  } else {
    int targetPosition = (player - 1) * (stepsPerRevolution / pl_number);
    myStepper.moveTo(targetPosition);
    myStepper.runToPosition();
    dealCards(n_card);
  }
}


void helloCards() {
  analogWrite(EN1_PIN, 255);
  digitalWrite(IN1_PIN, HIGH);
  digitalWrite(IN2_PIN, LOW);
  delay(400);


  for (int i = 0; i < 3; i++) {
    digitalWrite(IN1_PIN, LOW);
    digitalWrite(IN2_PIN, HIGH);
    delay(150);


    digitalWrite(IN1_PIN, HIGH);
    digitalWrite(IN2_PIN, LOW);
    delay(200);
  }
  digitalWrite(IN2_PIN, LOW);
}

Integration Guide

WhatsApp Image 2023-12-19 at 12.58.22 (1).jpeg
WhatsApp Image 2023-12-19 at 12.58.22.jpeg
WhatsApp Image 2023-12-19 at 12.58.23 (1).jpeg
WhatsApp Image 2023-12-19 at 12.58.23 (2).jpeg
WhatsApp Image 2023-12-19 at 12.58.23.jpeg
WhatsApp Image 2023-12-19 at 12.58.24.jpeg
WhatsApp Image 2023-12-19 at 12.58.24 (1).jpeg
WhatsApp Image 2023-12-19 at 12.58.25 (1).jpeg
WhatsApp Image 2023-12-19 at 12.58.26.jpeg
WhatsApp Image 2023-12-19 at 12.58.25.jpeg
WhatsApp Image 2023-12-19 at 12.58.26 (1).jpeg
1bafadef-b9fe-4779-bd5e-eb4d258b78b0.jpg

As seen in the first couple of pictures, we started building the device from the bottom to the top. The first step was to glue the lasercutted squares out of MDF to each other and to the red beam, as seen on picture 1 and 2. Once this was set, we made the rotating platform where the stepper motor is screwed to together with the blue 'boxes'. These boxes had two holes to fix it to the rotating platform and then a shaft with a hole to slide the bearings over these shafts and a hole to fix the white things that will prevent the bearing from falling off. The results of this can be seen in picture 3 to 6. In picture 7 you can see the front panel where the gears are shown. The black gear is slided over the shaft of the shuffle motor while the other gears are slided over the rollers (in blue) or over the dark grey little shafts that will hold the gears in place. Next to the gears you can see a the holes where the inner walls will be slided into. Like this the walls get clamped between the back and front panel and will be locked in place. This can be seen in picture 8, 9 and 10. In picture 10 you can see every wall and motor in his final place. The back panel will then close this 'box'.


In picture 9, you can see the electronics in the user interface box and in the last picture the other electronics. The H-bridge, arduino and so on are placed on the rotating platform with some double sided tape and the user interface box is screwed to the front wall.

As can be noted from the picture on top of this section, some are a little bit different from the CAD model since we faced some issues with fitting all the parts together. For example in the middle of the dealing subsystem we added a small steel bar that makes sure we deal 1 card at a time. In step 11 you can find the final used CAD files.

Demo Project Show

GUIDED VOICE OVER- AUTOMATIC CARD SHUFFLER AND DEALER

In the following video you will see how to use the device. As you can see in the video the rotating part is not working as it should. At the end of the video you can see that if the device is lifted up from the table, the rotating part is working as it should. Probably the weight of the device is to high for the stepper to move and that's why it's not behaving well.

Review Your Project Critically

Critical Review:

This section undertakes a meticulous review of the project, highlighting areas necessitating improvement and addressing key considerations for refinement.

  • Custom PCB Design:
  1. Propose the development of a custom PCB to consolidate all circuitry, aiming to minimize the electronics' footprint and simplify wiring complexities.
  2. Evaluate the potential advantages, including space efficiency, streamlined assembly, and heightened system reliability, associated with the implementation of a custom PCB.
  • Shuffling Mechanism Enhancement:
  1. Advocate for the adoption of a barrel or wheel shuffling mechanism, precisely timed to significantly mitigate the occurrence of card jams.
  2. Scrutinize alternative shuffling mechanisms, emphasizing efficiency and reliability, with the objective of optimizing the overall performance of the card-dealing system.
  • Motor Power Optimization:
  1. Suggest the exploration of a more powerful stepper motor or the consideration of weight reduction to enhance compatibility with the stepper motor.
  2. Assess the trade-offs between motor power, energy consumption, and system stability, ensuring the chosen configuration aligns with the project's objectives.
  • Effective Time Management:
  1. Emphasize the importance of efficient time management practices to facilitate comprehensive testing of equipment.
  2. Prioritize testing phases systematically, ensuring thorough identification and resolution of potential issues, ultimately contributing to the development of a seamlessly functioning and cohesive machine.

At theend, the robot did not function as expected. Given additional time, there was a clear possibility of rectifying its performance. Unfortunately, the stepper motor lacked the necessary strength for proper device rotation. In an extended project timeframe, a decision to employ a more potent replacement motor would have been made.

Another aspect requiring attention was the card-dealing process. The robot generally dispensed cards one per one, but not at all times. The small size of the cards, demanded extra time to ensure consistent one-card-at-a-time dispensing by the robot (by for example making a new design of the front panel).

Sustainability

Our project, featuring Medium Density Fiberboard (MDF) and Polylactic Acid (PLA), demonstrates a robust commitment to sustainability. The use of MDF, derived from recycled wood fibers and incorporating waste wood, showcases efficient resource utilization and adherence to circular economy principles. Despite challenges in MDF's recyclability, specialized centers ensure responsible disposal. PLA, chosen for its renewable and compostable nature, contributes to a reduced carbon footprint, although limited composting facilities pose challenges. Advances in PLA production technology enhance energy efficiency. Our project prioritizes environmental considerations, emphasizing recycled content, renewable sourcing, and improved production processes, aligning with circular economy principles for a sustainable material life cycle. Ongoing efforts to address end-of-life considerations will further enhance overall sustainability.

In terms of additional materials, sustainability considerations extend to the selection of screws and rubber in our project. Prioritizing durability in screws minimizes the need for replacements, reducing overall resource consumption. Metal screws, generally recyclable, undergo responsible disposal methods, promoting a circular economy through material reuse. Additionally, the use of rubber to increase friction with cards and prevent slippage demonstrates a commitment to durability and resource efficiency. By limiting the quantity of rubber to necessity, the project mitigates its contribution to environmental degradation associated with synthetic rubber. These choices collectively reflect our dedication to responsible resource management and contribute to the long-term environmental and economic sustainability of the project.

Bill of Materials

BillOfMaterials.png

In this section, an analysis of the costs associated with all the components required for the project was conducted. The outcome is depicted in the image above.

As mentioned in Step 4, the materials employed included Medium-Density Fiberboard (MDF) and Polylactic Acid (PLA).

For MDF, after taking into account all the laser-cut pieces, the required dimension was determined to be 750x530mm of 3mm MDF. Consequently, MDF pieces of 300x210mm were found, leading to a necessity for three MDF boards.

Regarding PLA, the Prusa software provided the filament usage, amounting to 0.13303kg.


Finally, the total estimated price is: 104.32€

Present Your Team

Ruben Van den Houte

My name is Ruben. I did my bachelor at the VUB with Electromechanical Engineering as study choice. Currently I'm doing my first master Electromechanical Engineering Mechatronics - Robotics in the BRUFACE program. In this project I mainly focussed on the mechanical systems and the CAD designs together with Marc and Laila. The most difficult part of the project concerning the mechanical systems was to design the dealing subsystem because it was very difficult to design it in a way that only one card was dealt at a time. The most fun part of this project was for me to assemble all the parts together and see that everything fitted.

Nana Kwame Ainoo

I am Nana and I worked on the electronics, circuit design and software for this project. I am currently an MA1 Electromechanical Engineering student focusing on Robotics in BRUFACE. I have a BSc in Mechatronics so this seemed like the obvious choice. My main focus was on the electronics and software side of the project. The main difficulty is ensuring the seamless communication of all the subcomponents and ensuring that the mechanical design fuses well with the electronics used to power it.

Laila Boukyaou Delgado

I am Laila Boukyaou Delgado, and I am currently enrolled as a dual-degree student at the Polytechnic University of Valencia (UPV) and ULB, pursuing Electromechanical Engineering with a specialization in Mechatronics Construction and Robotics under the BRUFACE program. My primary focus has been on the design and mechanical aspects of the device. At UPV, I didn't have many opportunities to make practical projects, so learning how to laser cut and 3D print was particularly enjoyable for me.

Marc Prat Plana

Hi! My name is Marc, I'm from Barcelona, I pursued a BSc in Industrial Technologies Engineering at Universitat Politècnica de Catalunya (UPC - ETSEIB) and afterwards worked as a software engineer and project manager in a power electronics company. Eventually, I landed in Brussels where I'm studying the MSc in Electromechanical Engineering - Robotics and Mechanical Constructions. Throughout this project, I played a role in various aspects, from the mechanical side to software development. The most challenging part for me was the design of the dealing mechanism. I'm a big fan of DIY projects, and the coolest aspect of this experience has been getting hands-on with a laser cutter for the first time and having access to 3D printers as well.

Saad Rekiek

Hello, my name is Saad, I'm from Belgium, I did my bachelor at the ULB in Electromechanical Engineering option. I chose to do a master's degree in robotics because it interested me since I was little. Computer science, electronics and mechanics are three sciences that I love, so the opportunity to do all three at the same time is perfect. In this project I focused on the electronics and software part which was very interesting. The main difficulty was to make the electronic part work as a whole after having verified that all the sub-circuits for the sub-systems were working correctly.


Project Repo

With the link below you can acces all the files we used to make this project: 

https://drive.google.com/drive/folders/1EEbKFd9ZrBEtS2MoBe2lzjqyH7bFwvqy?usp=drive_link