To enhance the gaming experience, real dice can be made to wirelessly transmit their face values to remote devices. Here's a design concept.
Dice based games have always been popular. Games like Snakes and Ladders, Monopoly, Craps and Back-Gammon are the most played games across the globe. Implementations of the electronic dice were mostly a random number generator circuit often using IC-555 timer meshed with wires around it. Even though they were able to generate unbiased numbers from 1 to 6, they were far from creating the feel of throwing the dice.
To make these games more fun today and to add an augmented gaming experience, real tiny dice can be made electronically capable of transmitting their face values wirelessly to a remote device, like a phone, PC or electronic display, enabling numerous possibilities for games based on them. Such e-dice can be used in the high-tech casinos.
Accelerometer for electronic dice
These dice could be miniature gadgets based on ST's accelerometer, the LIS3DH, a wireless connectivity module for Bluetooth Low Energy (BLE), such as BlueNRG-MS, or Wi-Fi module like the SPWF01SAx and an MCU along with the required battery recharging circuit.
Electronic dice works on the basic principle of the accelerometer's orientation. The accelerometer placed inside the dice determines the number facing UP using the accelerometer's X, Y, Z axes values and the lookup table as shown below (Figure 1). The MCU reads this information and sends it over BLE/Wi-Fi to the remote device (phone or tablet). The device receives the number and processes the game logic.
The accelerometer can be calibrated easily by remotely sending a command from the Android device over BLE/Wi-Fi or by shaking the dice to start the calibration. Calibration removes offsets accumulated over time. In this case, calibration is done for each axis and calculated offsets saved in the MCU flash and applied when the dice is powered ON.
Equation 1: Offsets are calculated for each axis and saved to the MCU flash.
Table 1: Dice output interpretation using the accelerometer. See accelerometer axes reference in figure 1 below.
Figure 1: The dice interacting with a dice-based game over BLE or Wi-Fi.
The figure above shows the sequential steps (1, 2, 3) in which the dice current face values "6" and "5" are sent to the smartphone/tablet. In case of BLE, data is sent over BLE protocol stack through its GAP and GATT profiles. The GAP profile is used to initialise the stack and set up connection with the mobile device, while the GATT profile defines the transmitted data (dice values, calibration command, etc.) known as "attributes" over Bluetooth Smart Link. It creates the related accelerometer service on which the dice values are sent.
In case of Wi-Fi, firmware running on dice gets connected to the AP (access point) and tries to open a socket connection with a remote server socket, acting as a socket client. A server running on the remote device gets connected to the same AP as the dice and starts listening for any data sent by the dice on a given port number. Once the connection gets established, the dice firmware writes data to the socket, which is received by the remote device and used to process the game logic. The remote device name/IP address can be configured in the dice firmware.
When designing games for the visually challenged, the design can be modified to embed a voice player inside the dice to sound out the number shown on the dice besides sending this data wirelessly to remote devices. The design can also be modified for "n-faced" dice by taking the accelerometer components perpendicular to the faces of the dice.
Authors Rosarium Pila, Saurabh Rawat and Salil Jain work with STMicroelectronics Pvt. Ltd India.