Beer Die Table

For our final project, I wanted to make something that I would use often. A treasured game within my friends is Beer Die, which you can see above. One of the major parts of the game is the actual die hitting the table. I thought that it would be awesome to sense the impact, and then give feedback to whether or not you hit the table. After researching vibration sensors, it seemed as though regular Piezos were mostly used for music, but then I viewed an Instructable which used a Piezo film strip to detect seismic activity. After more browsing I found something similar on Amazon which I bought. I connected this to my Arduino, along with an RGB Neopixel Strip, and when the impact of the die is detected, the Arduino has the strip light up. Lastly, the rubric of the project called for a 3D Printed aspect, so I thought that creating a custom scoreboard and connecting it to 2 buttons and a 16x2 display screen would be perfect. In order for the buttons to be within reaching distance of the player, I used an NRF to wirelessly connect the buttons from the end of the table, to where the scoreboard will be in the middle of the table. Unfortunately, the 3D Printing Labs were all booked, so I plan to add the scoreboard cover within the next week.

Step 1: Detecting Impact

In order to detect the impact, I used a Piezo Film Vibration Sensor:

https://www.amazon.com/gp/product/B06W57XBJL/ref=o...

The sensor is in the middle of the table, attached to the underside of the top piece of wood. I soldered wires to it so that it could reach my Arduino which is at the side of the table. The sensor is held up using hot glue, and a penny was hot glued on the end of it so that the weight would make it more receptive to vibration. When a vibration is detected, it sends a message to the Arduino, which then can use that to turn on the RGB Neopixel strip.

Step 2: RGB Neopixel Light Strip

Now that the table has detected impact, the white and blue wires connect to the same Arduino as the RGB Neopixel Light Strip:

https://www.amazon.com/gp/product/B014QZNC1S/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

The Neopixel Light Strip is connected using the green as the information wire, the black as ground, and the red as power. Pardon the poor picture, as it was taken before I soldered everything onto the Arduino; however, below the connections are listed for the pins. There should also be a 1 MOhm resistor connecting the white and blue wire pins.

Connections:

Blue- A0

White- Ground

Red- 5v

Black- Ground

Green- 6

The code that I have compiled senses when there is an impact on the table (using an adjustable threshold), and then lights the Neopixels up Green for one second if an impact is detected.

Step 3: Powering the Table

In order to power the table, I used a AC to DC power converter:

https://www.amazon.com/gp/product/B019P1F4E6/ref=o...

I used a MacBook charger that my dog had chewed in half, stripped the wire, and plugged it into the outlet in order to power the converter. From there, the RGB strip has a positive and negative to connect to the other part of the converter.

*DO NOT PLUG IN AC POWER AND THE USB FROM THE ARDUINO TO YOUR COMPUTER AT THE SAME TIME*

Step 4: Scoreboard

Although the 3D Printed scoreboard face was not able to be printed in time, all the wires are in place for it to function.

The 16x2 LCD Screen is connected to the Arduino using GND, VCC, SDA, and SCL (in order from black to green). Each of those plugs into the ports with the same name, with the exception being that VCC plugs into the 3.3V power supply.

Separately, the nRF24L01 has also been wired to the Arduino, using the schematic and picture as displayed. It is connected to another nRF on the Arduino that controls the impact and the Neopixel Light Strip. There are two buttons connected using a 20k Ohm resistor and a breadboard, schematic roughly interpreted from Googling "two button Arduino schematic".

EDIT:

Currently I do not have the funds to 3D Print and add that element to my project, but above shows the front to the scoreboard.

Step 5: Code for Sensor to NeoPixel

//DieTable

#include #ifdef __AVR__ #include #endif

// Which pin on the Arduino is connected to the NeoPixels? // On a Trinket or Gemma we suggest changing this to 1 #define PIN 6

// How many NeoPixels are attached to the Arduino? #define NUMPIXELS 150

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. // Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest // example for more information on possible values. Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

//constant variables: const int knockSensor1 = A0; // the piezo is connected to analog pin 0 const int knockSensor2 = A1; //the piezo is connected to analog pin 1 const int threshold = 100; // threshold value to decide when the detected sound is a knock or not

//changing variables: int sensorReading1 = 0; int sensorReading2 = 0; int ledState = LOW;

void setup() {

pixels.begin(); // This initializes the NeoPixel library. }

void loop() { sensorReading1 = analogRead(knockSensor1); sensorReading2 = analogRead(knockSensor2) if (sensorReading1 || sensorReading2 >= threshold) { TurnOn(); delay(1000); TurnOff(); // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one. }

} void TurnOn() { for (int i = 0; i < NUMPIXELS; i++) {

// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255 pixels.setPixelColor(i, pixels.Color(0, 150, 0)); // Moderately bright green color.

} pixels.show(); // This sends the updated pixel color to the hardware.

} void TurnOff() { for (int i = 0; i < NUMPIXELS; i++) {

// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255 pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Moderately bright green color.

} pixels.show(); // This sends the updated pixel color to the hardware. }

Step 6: NRF Incorporation

My final incorporation into this project is the nRF component. I added this in order to be able to wirelessly control the scoreboard, and to be able to wirelessly adjust the sensitivity of the Piezo strip sensor. Although I have not yet gotten my two Arduino's talking to each other, each button should adjust each team's score and the potentiometer will provide a much easier means of adjusting the threshold than having to reconnect my laptop to the table every time.

Share

    Recommendations

    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest
    • First Time Author

      First Time Author

    Discussions

    0
    None
    rybitski

    7 months ago

    Your video isn't working.