Introduction: Mason Jar Dice Roller

About: Born as a farmer, studied electronics ,working as a Consultant and a 3D printing enthusiast by night..

Here is a great weekend project to undertake, if you plan on playing any board/dice related games. To build the project you will need a continuous rotation servo, an arcade button and a arduino nano or ESP8266 board, in addition you will need a 3D printer.

You have a couple of options, you can either use the arcade button to drive the continuous servo to roll the dice, or you can use a web app hosted on the ESP8266 NodeMCU.The web app has 4 buttons, which spin the servos at various speeds..

Follow the steps below to make your own Dice roller...

Step 1: Components You Need to Complete the Build

Here are the list of components you will require to complete build

  • Mason Jar
  • 3D printer
  • 3D printing filament, I am using Hatchbox 1.75 mm PLA
  • Dice, I have also include an STL file to 3D print Dice if you need a couple more.
  • Hot glue gun and sticks

And for the electronics, you will need

  • NodeMCU ESP8266, or any WiFi enabled Arduino board
  • Continuous rotation servo -FS90R
  • Arcade button
  • Jumper wire
  • Small breadboard

Step 2: 3D Print the STLs Attached

Download the STL files attached and using 3D printing software slice, and 3D print the files.If you don't have a 3D printer handy you can use one at your local maker club, or library, or use a 3D printing service like 3D hubs.

In my case, I printed the STL files using the Flashforge creator pro and 1.75 mm yellow, white and green PLA. In addition, for slicing I am using Slic3r with the layer height set to 0.3mm and fill density to 25 %. All the parts should take about 5 to 6 hours to 3D print, and will depend on your 3D printer and slicer settings.

After 3D print the Dice I used a red Uni-Paint pen for colour the numbers, as you see in the picture above.

Step 3: Circuit

For the circuit I am using a mini size breadboard, so that it fits nicely in the 3D printed base, just below the mason jar.

  • The continuous rotation servo is attached to pin D4(GPIO2) on the NodeMCU - ESP8266
  • And the +ve arcade button to 3.3V and centre pin which corresponds to the the button to pin D2(GPIO4)

Once done, go to the next step to setup the Arduino IDE on you computer to upload code to the NodeMCU.

Step 4: Uploading Code to the ESP8266

Install Arduino IDE on your computer, and got to preference in the Arduino IDE, and add the URL below in the additional Boards Manager URLs

Then go to Tools - Board Manager and search for ESP8266 , and select the ESP8266 Community and install. Once done restart the Arduino IDE and upload the default Blink sketch to check that everything is working as expected.

Now download the sketch attached, based on you preference if you would like to use the Arcade button, or go touch-less by taking advantage WiFi capability of the ESP8266 NodeMCU and using a web app to control the dice roller.

For the web App sketch, dont forget to update the ssid and password of your WiFi router, and you will see the IP address in your serial monitor, which you can use with your phone/tablet.

Step 5: Putting All the Components Together

Once you have successfully tested the Arduino sketch, it is now time to put the electronic components and 3D printed parts together. First start of by putting arcade button and the mason jar on the top 3D printed part.

Once done add the breadboard to the lower 3D printed part buy removing the sticker from the bottom of the mini bread board, the use the screws that came with the continuous servos to attach servo horn, and add the servo to bottom 3D printed holder.Then use hot glue to secure the top and bottom part.

Mason Jar Speed Challenge

Participated in the
Mason Jar Speed Challenge