The six LEDs are driven through 3 I/O pins of PIC12LF1822 microcontroller using the Charlieplexing technique. Three 100 Ohm resistors are placed in series with the I/O lines to limit the LED currents. A horizontally placed tilt switch (also known as vibration switch) is used to sense the shaking of the dice. A tilt switch is simply a tube with a tiny conductive metal ball that rolls inside it, and has two electrical contacts that are accessible from external leads. When its tilted upright, the ball rolls onto the two metallic contacts, thus short-circuiting them together. The tilt sensor along with a pull up resistor generates an interrupt signal on GP2/INT pin of the PIC12LF1822 microcontroller and the dice is rolled. A power on/off slide switch is also included in the project. In case you forgot to turn it off, the PIC microcontroller will be programmed to automatically go to sleep mode to save the power consumption. A circular shape PCB is designed for this project. The CR2032 battery holder is placed on the bottom side of the PCB, whereas rest of the electronics and LEDs go on the top side. The design files can be downloaded from the link provided at the end of this section.
Circuit diagram
Circuit diagram
The six LEDs are driven through 3 I/O pins of PIC12LF1822 microcontroller using the Charlieplexing technique. Three 100 Ohm resistors are placed in series with the I/O lines to limit the LED currents. A horizontally placed tilt switch (also known as vibration switch) is used to sense the shaking of the dice. A tilt switch is simply aΒ tube with a tiny conductive metal ball that rolls inside it, and hasΒ two electrical contacts that are accessible from external leads.Β When its tilted upright, the ball rolls onto the two metallic contacts, thus short-circuiting them together. The tilt sensor along with a pull up resistor generates an interrupt signal on GP2/INT pin of the PIC12LF1822 microcontroller and the dice is rolled. A power on/off slide switch is also included in the project. In case you forgot to turn it off, the PIC microcontroller will be programmed to automatically go to sleep mode to save the power consumption. A circular shape PCB is designed for this project. The CR2032 battery holder is placed on the bottom side of the PCB, whereas rest of the electronics and LEDs go on the top side. The design files can be downloaded from the link provided at the end of this section
Circuit diagram
The six LEDs are driven through 3 I/O pins of PIC12LF1822 microcontroller using the Charlieplexing technique. Three 100 Ohm resistors are placed in series with the I/O lines to limit the LED currents. A horizontally placed tilt switch (also known as vibration switch) is used to sense the shaking of the dice. A tilt switch is simply aΒ tube with a tiny conductive metal ball that rolls inside it, and hasΒ two electrical contacts that are accessible from external leads.Β When its tilted upright, the ball rolls onto the two metallic contacts, thus short-circuiting them together. The tilt sensor along with a pull up resistor generates an interrupt signal on GP2/INT pin of the PIC12LF1822 microcontroller and the dice is rolled. A power on/off slide switch is also included in the project. In case you forgot to turn it off, the PIC microcontroller will be programmed to automatically go to sleep mode to save the power consumption. A circular shape PCB is designed for this project. The CR2032 battery holder is placed on the bottom side of the PCB, whereas rest of the electronics and LEDs go on the top side. The design files can be downloaded from the link provided at the end of this section.
Circuit diagram