Introduction: Die Randomiser

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

Supplies

    • 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)

    Tools:

    • 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.