Die Randomiser

Introduction: Die Randomiser

In this instructable you will find information on how to build a die randomiser using a coil.


    • 100 meter of 2,5 mm^2 Installation wire
    • 230Vac to 12Vac transformer
    • 20 mm diametre PVC pipe
    • 30x30 cm wooden plate
    • Arduino Uno by Velleman with integrated buttons
    • 3 male to female breadboard wires
    • 5 male to male breaboard wires
    • 1 kOhm resistor
    • red LED
    • Small magnets
    • Multiplex 122x61 cm 9 mm
    • Multiplex122x61 cm 4 mm
    • Relay (we used an SRD-05VDC-SL-C)
    • Extension cord
    • Hinges Connectors
    • Power strip with an on/off switch
    • USB to Arduino cable
    • A small hinge
    • Smal wooden beam (1,7x1,7x300 cm)


    • 3D-printer
    • Saw
    • Drill
    • Screwdriver

    Step 1: Making the Coil

    First, you need to make two disks with a diameter of ~15 cm (a large role of ducktape did the job for us) form the 4 mm multiplex plate. Drill two holes of 20 mm in the centre of the wooden disks so that the PVC pipe fits through it exactly. After this, saw the 20 mm PVC pipe so that you are left with a piece of 20,8 cm. Glue each of the disks to either ends of the PVC pipe. Make sure the disk's is as perpendicular to the pipeas possible.

    Now it's time to start winding the installation wire around the PVC pipe. Take in to account that installation wire can suffer from internal breaking when being bent too much. To start winding the wire, glue one end of the installation wire to the PVC pipe at the bottom of the construction making sure to leave some space to connect the installation wire to the remainder of the setup (say 15 cm, see picture). Once the glue has dried, start spinning the installation wire around the PVC pipe evenly. Once you get to the top, start making a second layer back to the bottom and so forth. Do this until you have 8 layers of windings (a little over 500 windings). Next cut the remainder of the installation wire, again, leaving some space.

    Now the coil

    Step 2: Testing the Relay Circuit

    Important for setting op the relay is to test that is works first. To do this built the circuit shown in the picture above on the left and upload the following code to your Arduino:

    boolean SW08=LOW;

    int led = 10; int sw = 9;

    void setup() { pinMode(led, OUTPUT); digitalWrite(led, LOW); pinMode(sw, INPUT_PULLUP); }

    void loop() { SW08 = digitalRead(sw);

    if(SW08 == LOW){ digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); }


    Some things to take in consideration that we used an Arduino Uno made by Velleman, which has integrated buttons on pins 8 through 11 and that the relay output is connected on the COM and NC pins.

    Now check wether the light lights up for a second when the button is pushed. To change the time the led lights up, change the delay in the if statement. Now you know how to use the relay you can disassemble the output part of the relay, creating the circuit shown above on the right.

    Step 3: Powering the Coil

    To power the coil using wall power, cut the socket of the extension cord and strip the cord until you see three wires. Determine which one of the wires is the ground wire (usually the multicoloured yellow and green one) and leave this one as it is. Strip the other two wires and then attach them to a connecter. On the other side of this connector, connect the 230Vac side of the transformer.

    On the 12Vac side of the transformer, connect one of the wires to the COM pin on the relay and the other wire to the coil. Now connect the remaining loose wire of the coil to the NC connector on the relay. Now were done with all the electronics.

    Step 4: Building the Box

    The base of the box is formed by the 30x30 wooden plate. For the sides we made four plates out of the 9mm sheet multiplex of 30,9x21,8 cm. This 21,8 is chosen so the coil fits snugly between the top plate and the bottom plate. To make the top plate we sawed the 4mm sheet of multiplex down to 30,9x30,9 cm. For easy acces on the internals we made a small door in one of the sides (see picture) by cutting out the middle and attaching a hinge. Since we're only using 9mm wood, we used small beams to make the construction easier. Don't mount the top plate yet since the electronics need to go in first.

    To mount the electronics inside the box start with screwing the coil in the middle of the bottom plate after which you can mount the transformer in one of the corners. We choose the corner next to the hinge for easy wiring to the Arduino, which we mounted on the door along with the relay so that the button can easily be reached.

    Step 5: 3D-printing the Dice

    The last step is to make the die with the smal magnet, we used the tinkercad template for a die, cut it in half en made a cavity were the magnet can be hidden in. Make sure to make the cavity a bit (1mm) larger than the magnets because the filament will shrink a little. After the two halves are done being printed, you can put in the magnet in glue the to halves together.

    Be the First to Share


      • Anything Goes Contest

        Anything Goes Contest



      3 years ago

      Really well made project, but what is its purpose? What does it do? I'm guessing that the electromagnet coil causes the die to jump around and essentially roll itself?

      Unfortunately your 3D printed die is not evenly weighted- the only way it could be is if the magnet inside were a cube or a sphere at the exact center of the die. You also may have an undesired effect since the pole of the magnet only runs through one axis of the die. The north (or south) end of the magnet may be naturally attracted to the coil as the power is turned off.

      You should try an experiment- run the machine 100 different times and keep track of how many times the die lands on each side. I bet that some numbers will come up a lot more frequently than others. I'd wager that the die will land most frequently on the two sides where the magnet is flat. I'd love to see the results of this experiment!

      Nice work and well documented project!

      Def 56
      Def 56

      Reply 3 years ago

      This project was a school assignment with the only guideline being: “demonstrate a physics phenomena.” We wanted to demonstrate Eddy currents by using a similar setup as described, but swapping the magnet for a conducting ring, making something called a ring shooter. However, as soon as we hooked up the coil for a test, the magnetic field turned out to be way smaller than we had calculated it to be. This meant that the induced currents could not even levitate a piece of aluminum foil.

      So after having convinced the prof that our design flaw was due to a difference in real physics and the ideal physics we used to predict the field, we could stick to the setup but use a magnet instead of a conductor demonstrating the effect that a current generates a magnetic field. The addition of hiding a magnet inside a die was just because we thought it would make it a bit more interesting.

      So it does exactly what you guessed it would do and you’re totally right about having a statistically biased die due to the unevenly weight distribution and the alignment of the poles. Although I do not yet have a sufficient amount of throws to make proper conclusion, it does seem to land on a edge were the magnet is curved more often.