Mid-term Project Documentation

Mid-term Project Documentation

Project title: Go! Pinball!

Group members: Simon Liu, Avril Luo

Instructor: Gottfried Haider

CONTEXT AND SIGNIFICANCE

In the previous class, I learned how to use circuits to connect Arduino, various motors and components that would generate responses such as the buzzer and LEDs. I also learned about various motors, such as how to modify the codes to control the rotation time and angle. In my recitations, I practiced how to use different sensors and motors, as well as wrote a code myself. During my group research project, I also gained a new understanding of what interaction is. I defined interaction as dynamic change, which does not only exist between people and things but is also a continuous process consisting of lots of parts. I was inspired by a previous recitation class when we were exposed to different sensors, such as distance sensors, light sensors, and pressure sensors. Also, when I searched the previous projects, my inspiration came from the project called Singing Skee Ball by Malaine and Michelle. Maybe I could make a game with my partner. Our first idea was to build a small robot that collects things and transports them to a new place, which our instructor thought was too complicated for a midterm project. So, we put this idea aside and decided to make a pinball machine. It’s a very classic game and it could be really interactive. Actually, our group was remaking the existing pinball machine. We wanted it to be more interactive, so we designed some checkpoints with various visual effects to give a positive response to players. The aim of designing this machine was to relax and release stress for midterm weeks. We targeted stressful students who are surviving their projects and exams. I hope everyone can enjoy the game.

CONCEPTION AND DESIGN

My understanding of our project‘s interaction is that there are some visual and auditory changes in the process of the game. We have set up color-changing light strips and music. A checkpoint is set at the launch point to turn the light strip blue to show that the game has started. Our original idea was to use a pressure sensor where the ball is fired, but this would affect the speed of the ball so that it could not enter the main game area. However, the light sensor is not sensitive enough because the ball is going very fast. Our worry is that the light sensor is not sensitive enough to detect changes in light, and our own trials also confirm this problem. We even thought of using iron balls and magnetic sensors. However, the problem is that iron balls are far heavier than marble balls. The weight of the ball is likely to prevent it from running into our main game area. So we finally use marble balls, the laser sensor, and the light sensor together with the help of instructor Gottfreid Haider. When the ball passes by, it will cut off the laser light to detect the passage of the ball, proving that the game starts, the light strip turns blue, and the buzzer plays some tunes at the same time. When the ball falls, we use a piezo disc to detect the fall of the ball. When the sensor receives the collision signal, the light strip is turned off, and the game is over with a melody of “game over”. We have set up two checkpoints in the main game area. Both checkpoints fix the piezo disc behind the rubber band, which can detect that the ball touches the checkpoint, and the rubber band can bounce the ball in the other direction. Players change the movement route of the ball by operating the bumpers, making the ball hit the checkpoints, which changes the color of the light on the light and the tune of the music accordingly. Our main design principle is that the sensor we use cannot affect the movement state of the ball and cannot let the ball stop on a certain sensor. Secondly, these sensors must be sensitive. As mentioned, the light sensor as well as the distance sensor in our kit are not sensitive enough. We mainly use cardboard to make this pinball machine. Piezo disc and laser sensors, as well as a large number of wires, are borrowed from our learning assistants and instructors. We affix the piezo disc to the thin acrylic plate and increase the contact area between the ball and the sensor. Other materials, such as rubber bands and paints, are provided by the studio. We buy some marble balls to play the game.

( We are testing the sensors!)

FABRICATION AND PRODUCTION

I completed the whole project with my partner. First of all, my partner and I designed the draft of this pinball machine together, and then we measured the length together, cut the cardboard, fixed the cardboard with glue, and built the most basic frame. Then we needed to design the operating part and the main game area. We designed the operating part first. Our original idea was to control the bumper by operating a plunger, so we made bumpers on both sides of the cardboard and fixed them together with a part of a chopstick to achieve coaxial rotation. However, in the process of our own testing, we found that the force of using the plunger to drive the bumper is very small, not enough to make the ball roll far away. It’s because the force we exert causes the rubber band to deform; the rubber band will have resistance to prevent us from changing its shape. But when the rubber band returns to its original state, it will produce a greater force, so we should use this force to roll the ball. We have made some simple changes to the bumper so that we can take advantage of this greater force. But this had a big problem during user testing: players may not have enough time to react. The time for the ball to slide down to the bumper is too short for the player to operate two plungers to drive the bumper. And Plunger may not be able to accurately drive the bumper, resulting in the insensitivity of the whole system. So we took the advice from one of the testers that we finally gave up the idea of using a plunger and controlled the bumper directly by hand. We added some notes to the bumper to remind players to control it directly with their hands.

 
Our building process:



Then we designed a device for launching marble balls on the operating table, and the design and installation of this device were relatively smooth. Then we needed to design the main play area. We first designed the launch route and then installed several triangles made of rubber bands in the middle part to change the direction of the ball. Then we designed a ramp, which was intended to set a challenging checkpoint, but in the end we did not set the checkpoint on the ramp. When we did user testing, we did not design and put interactive contents such as circuits, light strips and music, so our testers gave us a lot of interactive suggestions, such as adding light strips, adding checkpoints, playing music, and decorating this pinball machine and so on. We had taken most of their suggestions. Their suggestions were a great help to our project. The only regret is that we didn’t have more materials and time to adjust the length of the bumper, resulting in a large gap between the two bumpers, and the marble ball could easily slide down from the interval and cause the game to fail.

The machine we had during the user testing.

After user testing, we began to think about what sensors to use and where to design them. This part is mainly in the charge of Avril. I am mainly responsible for decorating the whole machine, and of course I will also want to use some sensors with her. I helped her design the circuit and correct her errors when connecting the circuit. The whole line is very complicated and dazzling. She is responsible for writing all the code. Fortunately, our code runs smoothly, and there are basically no major errors.



 

CONCLUSION AND REFLECTION

The goal of our project is to release stress during midterm weeks. We expected our audience to enjoy playing with the pinball machine and get relaxed during the midterm weeks. During the presentation, all the sensors and LED strips were working well. Testers enjoyed playing them and I remembered that one saying that she could play this whole afternoon. So, I think the response from testers is in line with our goal to let them relax. However, I didn’t think our machine had enough interaction with our audience. It’s a pity. My definition of interaction is dynamic changes, while the LED strips that represent the interaction with players failed to satisfy this definition. Our LED strips would change only when the game started, when the ball hit the checkpoint, or when the game was over. Also, we didn’t stick the LED strips in the best position so that players, who were playing attentively, hardly got the response from our machine. I think it’s where I can have a lesson. For this project, we should design the interactive part first and then the main game area. In terms of the overall design and making process, there are many uncertainties during the process. What we can do is try it out, test it and decide whether to use it. If it’s not the best choice, just try another option. It’s a time-consuming process but it’s where I can learn and accumulate valuable experience for my future work. Also, it’s unavoidable to encounter problems that we didn’t think of before during the process of making everything work. Setbacks won’t kill me or my project, but they are there to make me stronger and my project better. So, it’s important to make a modification or adjustments in time, or the problem will be amplified in the next steps. If we have more time, we will design more interactive parts for the game. For example, we can add more sensors to detect the movement of the marble ball. We can connect an amplifier to make the melodies louder. We can change the place where we stick the LED strips to make them more eye-catching to players. Also, we will modify the code and make the LED strips work in a more fancy way.

APPENDIX

Final Documentation:



The circuits inside the machine. We hide it under the surface:)

A short video that shows how to play the game, mainly triggering the change of the LED strips.

Our Code:

#include <FastLED.h>
#define NUM_LEDS 120
#define DATA_PIN 3
CRGB leds[NUM_LEDS];
#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define BRIGHTNESS 255
#include "pitches.h"
void setup() {
Serial.begin(9600);
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS)
.setCorrection(TypicalLEDStrip)
.setDither(BRIGHTNESS < 255);
FastLED.setBrightness(32);
}
void pride() {
Serial.println("Running pride()");
static uint16_t sPseudotime = 0;
static uint16_t sLastMillis = 0;
static uint16_t sHue16 = 0;
uint8_t sat8 = beatsin88(87, 220, 250);
uint8_t brightdepth = beatsin88(341, 96, 224);
uint16_t brightnessthetainc16 = beatsin88(203, (25 * 256), (40 * 256));
uint8_t msmultiplier = beatsin88(147, 23, 60);
uint16_t hue16 = sHue16; //gHue * 256;
uint16_t hueinc16 = beatsin88(113, 1, 3000);
uint16_t ms = millis();
uint16_t deltams = ms - sLastMillis;
sLastMillis = ms;
sPseudotime += deltams * msmultiplier;
sHue16 += deltams * beatsin88(400, 5, 9);
uint16_t brightnesstheta16 = sPseudotime;
for (uint16_t i = 0; i < NUM_LEDS; i++) {
hue16 += hueinc16;
uint8_t hue8 = hue16 / 256;
brightnesstheta16 += brightnessthetainc16;
uint16_t b16 = sin16(brightnesstheta16) + 32768;
uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536;
uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536;
bri8 += (255 - brightdepth);
CRGB newcolor = CHSV(hue8, sat8, bri8);
uint16_t pixelnumber = i;
pixelnumber = (NUM_LEDS - 1) - pixelnumber;
nblend(leds[pixelnumber], newcolor, 64);
}
}
void state0() {
int n = 0;
while (n < 120) {
leds[n] = CRGB::Blue;
FastLED.show();
delay(5);
n += 1;
}
pride();
FastLED.show();
Serial.println("Running pride1()");
int melody[] = {
NOTE_C1, NOTE_C2, NOTE_C3, NOTE_C4, NOTE_C5, 0, NOTE_C6, NOTE_C7
};
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
for (int thisNote = 0; thisNote < 8; thisNote++) {
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void state1() {
int n = 0;
int melody[] = {
NOTE_C7, NOTE_C5, NOTE_C3, NOTE_C1, NOTE_C1, 0, NOTE_G3, NOTE_G1
};
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
while (n < 120) {
leds[n] = CRGB::Black;
FastLED.show();
delay(5);
n += 1;
}
for (int thisNote = 0; thisNote < 8; thisNote++) {
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void state2() {
int n = 0;
while (n < 120) {
leds[n] = CRGB::Green;
FastLED.show();
delay(10);
n += 1;
}
int melody[] = {
NOTE_C6, NOTE_C7
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 4
};
for (int thisNote = 0; thisNote < 2; thisNote++) {
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void state3() {
int n = 0;
while (n < 120) {
leds[n] = CRGB::Pink;
FastLED.show();
delay(10);
n += 1;
}
int melody[] = {
NOTE_C6, NOTE_C7
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 4
};
for (int thisNote = 0; thisNote < 2; thisNote++) {
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void loop() {
int sensorvalue1 = analogRead(A0);
int sensorvalue2 = analogRead(A1);
int collision1 = analogRead(A2);
int collision2 = analogRead(A3);
delay(1);
if (sensorvalue1 < 700) {
Serial.println("DetectedA0");
delay(100);
state0();
}
if (sensorvalue2 > 200) {
Serial.println("DetectedA1");
delay(100);
state1();
} else if (collision1 > 100) {
Serial.println("DetectedA2");
delay(100);
state2();
} else if (collision2 > 200) {
Serial.println("DetectedA3");
delay(100);
state3();
}
}
*************************************************Public Constants
************************************************* /
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978

The drafts:

 

 

 We also get inspirations from this YouTube video and this video

The circuits:

Acknowledgements

Avril and I have been working on this for a week. And I want to express my heartfelt thanks to all IMA people.

Special thanks to:

My partner: Avril Luo

Instructors: Gottfried Haider, Andy Garcia, and Shengli Wen

Learning Assistants: Rachel Li and Amelia Shao

My friends: Wendy Fang and Freddie Yang

Leave a Reply

Your email address will not be published. Required fields are marked *