Wireless Die and Wireless Receiver Using ESP-Now (Mental Die)
by Naufuu in Circuits > Microcontrollers
2154 Views, 8 Favorites, 0 Comments
Wireless Die and Wireless Receiver Using ESP-Now (Mental Die)
The primary function of this die is to perform a magic trick.
The Trick: Give this die to a friend or observer and ask them to keep it under a glass, while you have turned your back on them. And you will correctly guess the number on top.
The die wirelessly transmits the die number to a small display. You can see the number on the display and correctly guess it.
The die is 99% accurate, with the exception of the battery running out.
The die is designed on tinkercad and 3D printed using ABS filament. The print time was approximately 45 minutes.
It contains an esp-01, mpu 6050 gyro sensor, a small battery and a reed switch.
Dimensions: 20mm x 20mm
Weight: < 50 grams
Supplies
Components:
NO/NC Reed Switch
3.7V 160mah battery (401018)
NodeMCU ESP-8266
Tools:
Soldering Iron
Solder
3D printer
3D Designing the Die
I have designed the die from scratch on tinkercad but you can also download it from thingsverse.
I have not calculated the probability of getting each number.
3D models
https://www.tinkercad.com/things/4dxnMm4n2IQ
https://www.thingiverse.com/thing:1688174
Programming the ESP-01
Assuming you know how to program esp-01.
Upload the attached code to your esp 01.
After uploading the code it is recommended to remove the header pins of the esp-01 to make it smaller in size.
NOTE: It is not required to replace the mac address here.
Connecting MPU6050
We will use a NC Reed Switch to turn on and off the circuit.
Programming the Receiver
The code here will just allow you to receive the three axis (X,Y,Z) in serial monitor, you can further process them to get desired outputs.
Assembly
To make the circuit smaller, I cut the esp-01's antenna and soldered the mpu6050 at right angle.
The reed switch and the battery are connected too.
Final Output
You can see that as the die is rotated the dice number is correctly displayed in serial monitor.
A 7-segment display can be used here in order to display the number.
The battery lasts for about 30 mins.