Mental Dice

This is an electronic dice for performing a magic trick.
The magic trick proceeds as follows:
1) Magician gives the dice to the spectator and turns his/her back to the spectator.
2) The magician asks the spectator to place the dice on the table showing the desired number and to place a coffee cup upside down over the dice.
3) The magician turns back and does not see the dice under the coffee cup. However, the magician is able to tell the number on the dice.
4) When the coffee cup is removed from the dice, the number on the dice is exactly the one the magician mentioned.
Technical structure:
The content includes the dice, the case and an Android mobile phone with the specific app.
The dice's dimension is 14.6 x 14.6 x 14.6 mm. Inside the dice, there is a Bluetooth module, a coin battery, an accelerometer and a reed switch.The 3D printed case has integrated a small metal plate and a magnet bar. The purpose of the metal piece, together with the magnet, is to keep the lid of the case closed. The magnet also keeps the dice circuitry powered off.
The dice is stored in its own case, which has an integrated magnet. The magnet keeps the reed switch open, and it prevents the coin battery from draining by itself. When the dice is taken out of the case, the reed switch closes, and the Bluetooth module boots up. The accelerometer provides position information to the Bluetooth module, which then transmits the data to a mobile phone. The mobile phone has a special app that vibrates in the specific way to indicate the number on the dice.
The next video, Dice.mp4, shows how it works in practice.
Downloads
Supplies






HARDWARE:
- Bluetooth module: BL652 Series Bluetooth v5 + NFC Module | Ezurio
- Accelerometer: LIS2HH12 Datasheet
- Coin battery: e.g. Panasonic CR-1220/HFN Lithium Battery with solder tabs
- Reed switch: SPST-NC_Datasheet
- Passive components: a few SMT capacitors and resistors
- Soldering wire: an ultra thin, isolated copper wires for signal routing
- 3D printed parts: HR103 | Printables dice, case base, case lid, hinge bar
- A small magnet bar ~(18x5x5mm), and and a small piece of metal plate ~(20x6x3mm).
SOFTWARE:
- Smart basic FW in Bluetooth module
- MIT App Inventor SW in Android mobile phone
Circuitry

See the above schematic. Because the available space inside the dice is very limited, there is no PCB. The accelerometer is glued with hot glue to back of the Bluetooth module. The circuitry has been finalized by soldering wires.
Unfortunately, I do not have any pics because the circuitry is now inside the dice.
Softwares





$autorun$.noppa_ver2.txt is the FW for Bluetooth module. (rename the file from .txt to .sb). See details about the programming from here BL652 Series Bluetooth v5 + NFC Module | Ezurio
noppa_v3.aia would be the source code for the Android app. AIA files are not supported file type in this web page. This is the reason, why the code is shared as five pic captures.
The home page about Android app creation, like above, can be found here: MIT App Inventor
Downloads
3D Printing
The stl files are attached. The printing processes were paused at a certain phase, additional items (circuitry, magnet or metal plate) were added, and then printing was continued.