Yet Another Smart Dice (YASD)

209

1

2

What is YASD?

Another new electronic dice with smart features? Yes and no.

Yes - YASD uses LEDs to display randomly generated numbers in a dice style.

No - YASD is not in itself a finished product. It should rather show which printed circuit board technologies are possible.

Features:

  • Microcontroller controlled generation and display of random numbers on an LED array in a dice style.
  • The circuit contains an accelerometer. This sensor serves as a trigger for the generation of random numbers. The dice is no longer rolled, a simple tap on the dice or the table generates a random number.
  • YASD is powered by a CR2032 coincell.
  • YASD can also be configured with the accelerometer. For example, you can turn YASD upside down when switching it on. YASD recognizes this with the help of the accelerometer and changes to another operating mode.

There are two operating modes:

  • Energy saving mode.The generated random number is displayed for 3 seconds in a flashing rhythm. Then the display of the number on the LED array goes out.
  • Fancy Mode. An animation is displayed on the LED array. The random number generated is then displayed statically for 5 seconds. Then the display of the number on the LED array goes out.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Circuit Description

The circuit consists of the components:

  • Power supply

A standard button cell CR2032 is used.To save power the circuit can bes switched on/off by a slideswitch.

  • Microcontroller

The microcontroller is an ATTiny84A from Microchip/Atmel. The ATTiny84A has the Picopower power saving mode and is therefore very suitable for battery operation.

  • Accelerometer

LIS3DH from ST Microelectronics. The LIS3DH also has an ultra low power power saving mode.The LIS3DH comes in a very little footprint. To avoid difficulties on soldering i choosed a breakoutboard to adopt the accerlerometer to the circuit.

  • LED display

The LED display consists of seven LEDs arranged in the manner of a dice. The series resistors are set to a LED current of approx. 2mA.

The total power consumption of the circuit is approx. 16mA while running with 6 leds turned on. In powerdown mode (no leds turned on, microcontroller sleeping) total power consumption is less than 1mA. The maximum number of "dice rolling" cycles has to be determined.

Step 2: PCB Description

The printed circuit board consists of a complete printed circuit board, which is divided into six individual printed circuit boards by milling:

  • Baseboard with power supply, microcontroller and accelerometer.
  • LED display matrix
  • Side walls I - IV

Step 3: PCB

Insert link to eagle-files

Step 4: Seperate the Six Single Pcb

With a sidecutter seperate the six single pcb.

Use a file to remove the remains of the milling. All edges of the printed circuit boards must be smooth otherwise the pcb will not fit together.

Step 5: Assemble Baseboard With Components

Solder on components. Start with the capacitor. Then solder the switch and the microcontroller. The LIS3DH breakout board follows. In my setup I used socket connectors for the LIS3DH breakout board to remove it easily. Finally solder on the battery holder.

Step 6: Program Microcontroller

To program the microcontroller you need an appropriate programmer. I use the AVR ISP mkII. Other programmers from Atmel should also work. Solder the wires according to the photo.

ISP header pin-> YaSD pin

VTG / VCC-> VCC

GND-> GND

MOSI-> MOSI

MISO-> MISO

SCK-> SCK

RESET-> RESET

Then program the microcontroller with the hex file. After programming of the software the fuses must be set. You can leave nearly all of them unchanged. Only fuse "LOW.CKDIV8" must be disabled.

Unsolder the wires for programming.

Step 7: Assemble the Dice

Solder baseboard with side panel II. Make sure that the baseboard is perpendicular. I set both pcb to a right angle and soldered them. Other objects like bookends work as well. The pcb are marked with letters on the pages that belong together. As you can see in the photo, side A is soldered to side A. Do not solder all pads on one side. Just solder one or two pads so that you are able to resolder them in the case the dice is not perpendicular at all.

Go on with side panel I. Now the dice should have a U-shape (baseboard and the two side-panels.

Next solder the led display to the two side-panels. Leds have to be on top ;-)

Make some corrections if the dice is not perpendicular at all then solder all pads on each side.

Now you can place in a coincell and swith on the dice. Have fun!

Beware! Before soldering the last side-panel III, make sure that all components are soldered and placed correctly.


Step 8: Please Pay Attention to This!

The reproduction requires some knowledge and skills especially when soldering and programming the microcontroller.

  • Soldering such small components requires some experience in soldering and a suitable soldering station. Therefore I decided to use the LIS3DH breakoutboard to avoid soldering the LIS3DH directly onto the PCB. With the small package of the LIS3DH this is unfeasible to do with a soldering station. Soldering the pcbs to each other is not easy either.
  • If you set some of the fuses in the microcontroller the wrong way it´s bricked.
  • The photos always show version 0.1 of the PCB (except photo showing the programming pads). This is the first version of the printed circuit board that has been produced. It had a few things that needed to be improved. So I decided to create a new version. The repository on github contains the latest version.

The photo shows the first paper mockup i made before i ordered the pcb.

PCB Contest

Participated in the
PCB Contest

Share

    Recommendations

    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    2 Discussions

    0
    None
    DIY Hacks and How Tos

    6 months ago

    Nice design. With a dice like this,you would never have to worry about them rolling off the table.

    1 reply