Firmware System

Overview

Firmware System Overview

An overview of the Firmware System of the Automatic Card Dealer.

The overall firmware system of the entire project was written in C++ for Arduino sketches and controls the DC motor, Stepper motor, and LCD Screen. All the code is located in this github repository. The main firmware run on the final card dealer is called main_poker_deal.ino.

DC Motor & Stepper Motor

The cards are dealt using a DC motor with an encoder. The encoder allows for fine-tuning. Once the motor reaches a certain number of ticks (defined by the length of a playing card, wheel diameter, the encoder itself, and a tuning factor), it stops, then reverses to catch any cards that might slip out with the one card being ejected. The speed chosen allows the cards to shoot out a good distance, while also being slow enough that the card accurately shoots out one card. Spinning the roller too fast can cause cards to stick together more, inconsistently shooting two cards out instead of one.

We also calculate the amount of degree that the stepper motor needs to turn based on the number of players (to allow us to have a modular number of players). We then multiply that by a factor of 4~ since the gear ratio is about 1:4.

Testing Setups

Throughout the entire design and build process firmware was created to allow the team to quickly test the hardware. For each component, (Motors, LCD Screen, Buttons), testing firmware was written that would allow us to pinpoint whether the error was hardware or firmware related depending on if the hardware produced the expected results. These testing firmware came in handy multiple times during integration when all code was integrated into a single main C++ file and multiple moving parts were integrated together physically.Furthermore, when we had to switch out new parts, like motors, we’d run the testing firmware to check that the new part worked. For almost all integrity checks we’d used communication over Serial with the Arduino to eliminate even more hardware points of failure.

All testing firmware is located in a folder called Testing Setup.

There is a testing file that is used to correctly tune the encoder, an old main code that could perform basic tasks dealing, and code to test each component (LCD Screen, Stepper & DC motor, dealing/turning).