Project tutorial

Light-Up Poker Chip © GPL3+

This whole circuit is the same size as a regular poker chip, but with an added surprise: lights!

  • 2,455 views
  • 3 comments
  • 12 respects

Components and supplies

Osh park
OSH Park Custom fabricated PCB
Link: https://oshpark.com/projects/RmkVGeN9/
×1
08377 02 l
Resistor 330 ohm
1/8w or 1/6W should be sufficient
×5
Microchip ATtiny85 SOIC
×1
0805 SMD LED
×5
Adafruit industries ada654 image 75px
Coin Cell Battery CR2032
×1
CR2032 Holder
×1
SPDT Slide Switch
×1
A000066 iso both
Arduino UNO & Genuino UNO
Only needed for programming the ATtiny
×1
Panasonic eca1hm2r2
Capacitor 10 µF
Only needed for programming the ATtiny
×1
Adafruit industries ada1008 image 75px
Alligator Clips
Only needed for programming the ATtiny
×6

Necessary tools and machines

09507 01
Soldering iron (generic)
tweezer
Multimeter
Must have diode mode

Apps and online services

About this project

Spice up your poker games with these cool blinking chips. They can be programmed on the fly to have a certain number of the LEDs illuminated to indicate value, or you can have the lights blink in a cool pattern. They make great playing chips for championships or great prizes to hand out to the winners. Let's get started!

Step 1: Ordering the PCB

In order to get this circuit as small as it is you'll need to order the printed circuit board I designed. You can breadboard it, but this would defeat the purpose; the whole point is that the design is the size of a poker chip. Here's the order link for OSH park: https://oshpark.com/shared_projects/RmkVGeN9.

Step 2: About the Board

This printed circuit board has a few tricks up its sleeve. The brains of the operation is an SOIC-8 ATtiny85. In order to program the ATtiny, six pads are needed to connect to an Arduino Uno. I'll discuss this a bit more later, but you can connect to these with alligator clips. A 3V CR2032 provides more than enough power for the entire circuit. No voltage converters are needed; the ATtiny is more than happy to run off of the battery as-is.

Step 3: Soldering the "Hard Stuff"

This circuit is a great introduction to surface-mount soldering if you've never done it before. I would definitely say that the hardest part about the project is correctly soldering the small 0805 LEDs. The first step to soldering them is determining their polarity, as LEDs are polarized components. I used the following link to do this: http://www.limetrace.co.uk/how-to-determine-the-polarity-of-an-smd-led.

LEDs

You can then start soldering the LEDs. I watched this video to help me do this with a soldering iron:

For all of the horizontally-oriented LEDs, the positive side of the pads is pointed towards the rest of the board, not towards the outside. For the vertically-oriented LED the positive pad is pointing downwards, or closest to the label "7." When I'm done soldering SMD LEDs soldering I always like to do a continuity check with my multimeter to see if both pads are making good contact. For the ground of the LED you can touch the other probe of your meter to the pad labelled "4." For the positive side of the LED you can touch your other probe to all the pins on the ATtiny and see if one of them makes contact with the LED you're testing.

Step 4: Soldering the "Easier Stuff"

The rest of the components that you need to solder should be very easy. In comparison to the LEDs, soldering the SOIC ATtiny85 is a piece of cake. Just make sure that the dot on the chip is closer to the LEDs and not the resistors.

I made a little mistake on the battery connector's silkscreen. The arrow that indicates which way the battery should slide in is facing in the wrong direction. When soldering the battery connector, make sure that the switch doesn't block you from being able to slide in the battery. I also like to put a small bit of solder on the ground pad to make sure the battery makes proper contact with it.

The remaining resistors and slide switch are regular non-polarized through-hole components. Solder them as you would any normal component.

Step 5: The Sketch

Included in the attachments section of this build is a demo sketch that displays the capabilities of the Light-Up Poker Chip. If you let it sit for 10 seconds without doing anything a demo of lights flashing around the outside will start. You can also set the state of the lights on the chip to be on or off without needing to re-upload software to the chip. To see how to do this, watch the video I linked at the beginning of the story section of this build.

Step 6: Programming (i.e. a mess of alligator clips)

The pads that line the exterior of the board are used for programming purposes. I could have used regular female or male headers, but I wanted to keep the whole package as low-profile as possible. This tutorial shows you how to program the chip: https://create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829. The pads are labelled with the pin number of the ATtiny (8 is VCC, 4 is ground, 1 is reset, etc). Use alligator clips to connect the male jumper wires from the Arduino Uno to the pads.

Going Further

Those are all the instructions you should need! If you have any questions don't hesitate to message me or post them below in the comments. If you're looking for some way to extend this project you could try designing and printing a case for your chips, or designing a PCB that uses RGB LEDs instead of monochromatic ones like I did. Good luck! To see more of my stuff check out my Hackster profile and my website www.AlexWulff.com.

Code

Demo.inoArduino
//Code produced by Alex Wulff: www.AlexWulff.com

//Pin definitions for Rev. 1
#define led1  0
#define led2  1
#define led3  4
#define led4  2
#define led5  3

bool enableOne = true;
bool enableTwo = false;
bool enableThree = false;
bool enableFour = false;
bool enableFive = false;
bool programmingLightMode = false;
bool lightMode = false;

bool dotMode = false;

void setup() {
  pinMode(led1, INPUT_PULLUP);
  pinMode(led2, INPUT_PULLUP);
  pinMode(led3, INPUT_PULLUP);
  pinMode(led4, INPUT_PULLUP);
  pinMode(led5, INPUT_PULLUP);
}

void loop() {

  //This means the user wants to enter programming mode
  if (digitalRead(led1) == 0 && !programmingLightMode) {
    programmingLightMode = true;
    pinMode(led1, OUTPUT);
    for (int i = 0; i < 4; i++) {
      digitalWrite(led1, HIGH);
      delay(300);
      digitalWrite(led1, LOW);
      delay(300);
    }
    pinMode(led1, INPUT_PULLUP);
  }

  //This means the user wants to enter the demo mode
  if (digitalRead(led2) == 0 && !programmingLightMode) {
    dotMode = true;
  }

  //This will check to see if any of the lighs have been selected
  if (programmingLightMode) {
    if (digitalRead(led1) == 0) {
      lightMode = true;
    }
  
    else if (digitalRead(led2) == 0) {
      enableTwo = true;
    }
  
    else if (digitalRead(led3) == 0) {
      enableThree = true;
    }
  
    else if (digitalRead(led4) == 0) {
      enableFour = true;
    }
  
    else if (digitalRead(led5) == 0) {
      enableFive = true;
    }
  }
  
  //This is displayed at the end of the programming mode
  if (lightMode) {
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    pinMode(led4, OUTPUT);
    pinMode(led5, OUTPUT);
    digitalWrite(led1, enableOne);
    digitalWrite(led2, enableTwo);
    digitalWrite(led3, enableThree);
    digitalWrite(led4, enableFour);
    digitalWrite(led5, enableFive);
    while(true); //Should sleep here
  }

  //If dot mode is selected or the chip has been sitting, enter demo mode
  if (dotMode || (millis() >= 10000 && !programmingLightMode)) {
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    pinMode(led4, OUTPUT);
    pinMode(led5, OUTPUT);

    //Do the demo forever
  	while (true) {doDotMode();}
  }
}

void doDotMode() {
	for (int i = 0; i < 5; i++) {
    switch (i) {
      case 0:
        setLow();
        digitalWrite(led1, HIGH);
        break;
      case 1:
        setLow();
        digitalWrite(led2, HIGH);
        break;
      case 2:
        setLow();
        digitalWrite(led3, HIGH);
        break;
      case 3:
        setLow();
        digitalWrite(led4, HIGH);
        break;
      case 4:
        setLow();
        digitalWrite(led5, HIGH);
        break;
    }
    delay(50);
  }

  for (int i = 4; i >= 0; i--) {
    switch (i) {
      case 0:
        setLow();
        digitalWrite(led1, HIGH);
        break;
      case 1:
        setLow();
        digitalWrite(led2, HIGH);
        break;
      case 2:
        setLow();
        digitalWrite(led3, HIGH);
        break;
      case 3:
        setLow();
        digitalWrite(led4, HIGH);
        break;
      case 4:
        setLow();
        digitalWrite(led5, HIGH);
        break;
    }
    delay(50);
  }
}

void setLow() {
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
  digitalWrite(led4, LOW);
  digitalWrite(led5, LOW);
}

Schematics

Comments

Similar projects you might like

The Annoy-O-Bug: A Chirping Light-Up Throwie

Project tutorial by Alex Wulff

  • 12,024 views
  • 15 comments
  • 39 respects

Motion-Activated Musical Trophy

Project tutorial by Alex Wulff

  • 1,306 views
  • 3 comments
  • 3 respects

Integrated Solar ChargeController, Inverter, PowerBank, Lamp

Project tutorial by Shahariar

  • 7,739 views
  • 16 comments
  • 30 respects

MorseCard - A Tiny Telegraph Station

Project tutorial by Alex Wulff

  • 5,921 views
  • 1 comment
  • 22 respects

3D-Printed RGB Wallet

Project tutorial by Alex Wulff

  • 1,920 views
  • 0 comments
  • 8 respects

ATmega Alien Themed Slot Machine

Project tutorial by Dan Murphy

  • 1,081 views
  • 5 comments
  • 14 respects
Add projectSign up / Login