Ever lost the dice for your favourite game? Bored of the usual square non glowy piece of wood you throw around? Or want a fun kit to learn soldering for yourself or a loved one?! Well look no further here is the “Shake me like a Polaroid dice” kit!
This is a simple and fun little kit to make an electronic dice. It uses a vibration sensor to detect when the dice has been “rolled”, and using a carefully seeded random number generator, will roll a number between 1 and 6. The dice face is made up with 7 bright white LEDs which will light up randomly and slow down to the eventual number. After 5 seconds the LEDs will switch to a power saving fading on the middle left and right LEDs, this is conveniently designed to stop you forgetting it’s on so you can switch it off! All this glory is powered off a single CR2032 coin cell battery, which is included in the kit, and will last up to about 20 hours. (Plus are super cheap to replace off of eBay!)
For those of you worried how fair your game of Monopoly will be with these electronic dice, compared to the usual wooden variety, I went to the trouble of doing a little maths. So a true fair dice has a standard deviation of 1.707. Now if you are not familiar with statistics then don’t worry, the important thing is we want the electronic dice’s standard deviation to be as close to 1.707 as possible. So I set it up and performed 2075 rolls! Put the numbers in and we have a standard deviation of 1.732. Not bad, in fact if I performed more rolls it would probably be closer. So, yes this is a fair dice. Here’s a histogram of the results:
Dice assembly instructions:
The dice is simply to assemble, even for people how have never previously held a soldering iron. First off, check that you have all the parts. The kit should contain:
1 Metal battery contact
1 coin cell
7 white LEDs
1 vibration sensor
1 slide switch
1 10k resistor
1 8 pin socket
1 pre programmed ATtiny85 microcontroller
Step 1: Solder the battery contact to the PCB.
Take the metal contact and place the two legs through the holes in the board. Ensure the contact is the right way round so a battery can be slid in from the edge of the board. See pic:
Now with your soldering iron apply heat and a little solder to fill the hole, do this to both sides.
Step 2: Solder the slide switch.
Take the slide switch and slot it into the 6 holes on the board, making sure the plastic toggle is on the edge side of the board. Solder all 6 legs to the board.
Step 3: Solder 10k resistor
Take the 10k resistor and bend each leg at a 90 degree angle from the resistor body. Now slide the two legs through the board holes. It’s easier then to slightly move them outwards so it doesn’t move when you turn over the board. Solder the legs onto the board.
Step 4: Solder 8 pin socket
At this stage it is important that the socket is placed the right way round. On the board there is a white box printed, there is a small circle in the upper right corner. If you look at the socket one end has a dimple in the middle. This dimple must be at the same end as the circle. Push into the board and solder.
Step 5: Solder the LEDs
Again polarity is important at this stage. An LED has positive and negative leads. The Positive is represented by being slightly longer than the negative. Also the edge of the plastic LED housing is flat along one edge. This represents the negative side. The markings on the board show this flat edge and the LED needs to be inserted to match this. A small tip the ensure all the LEDs are flat against the board, solder one leg, then apply pressure with your figer to the top of the LED. Reheat the solder and the LED will pop down into place. Remove the heat and let the solder solidify. At this point solder the other leg.
Step 6: Solder the vibration sensor
The vibration sensor doesn’t have a polarity so simply push onto the board and solder into place.
Step 7: Insert the brains (ATtiny85 microcontroller)
In the last step you need to plug in the brains of the dice. This is a little microcontroller (small computer), this has come preprogrammed with the dice program. It will read the vibration sensor and light up the LEDs as appropriate. If you look carefully on the top of the conttroller you will see a small circle dimple in the same position that was on the board. Align this with the board and gently insert into the socket, making sure all the legs go in cleanly. The legs will need to be gently bent inwards slightly to fit. Push until it wont go any further. Lastly insert the battery in the back. The side with the dark ring goes against the board.
Switch on and shake!