Wednesday, December 12, 2012

Game Cube


Game Cube is an interactive cube with an[RGB]  LED on each face. Game Cube allows its users to appreciate the aesthetic qualities of light and color while implementing interaction with the cube through the rotations of the cube. Game Cube utilizes an accelerometer, as it's primary input, to change the colors of the LEDs dependent upon the position of the cube in the user’s hands, dependent upon the current setting.
 
 

Interacting with the Game Cube is fun and easy. The user can simply pick up the cube and begin by pointing any corner of the cube upward and holding in that position for 3 seconds. After you rotate the cube back to a face user will find his or herself menu interface where each face has a certain color corresponding to a different setting. To pick a setting you need only to rotate the cube such that the desired setting color is faceing upward. The user will know what face is currently selected by a blinking light on the current face that is pointing up. By holding this face in this upward position for 3 seconds, the user will enter the desired setting.
 
 

There are 6 faces and 5 settings. Two of the faces correspond to the same setting (Green).

·         Blue: LightCurrentFace—Lights the current upward face.

·         Red: RandomCube—Rotate the cube to a new upward face and watch as each face is lighted randomly

·         Green: PartyCube—Sit back and enjoy the light show

·         Cyan: ChangeCubeColor—Rotate the cube to a new upward face and watch as the entire cube lights up to the face’s corresponding color (there are 6 available colors)

·         Yellow: ChaseTheLight—Rotate the cube to the lighted face before time runs out! Hurry, you only have 5 lives!

To exit out of any setting, simply point any corner of the cube upward for 3 seconds and then rotate back to a face. This will return the user back to the Menu Interface.
 
 

Technical Details

Input
The only input to the Game Cube interactive system comes from the accelerometer attached to the inside of the Game Cube. The accelerometer works by tracking the x, y, and z positions of the cube in 3-dimensional space.

Output
The output of Game Cube are the light values that correspond to the color of each LED. The input of the accelerometer’s x, y, and z values correspond to the red, green, and blue values of each LED. Different positions of the cube for each of the settings can result in a variety of color combinations.

Construction
The components of Game Cube consist of the 6” acrylic cube, an inner cube composed of foam core to house electronics, an Arduino microcontroller to run the Game Cube program, an accelerometer to track the cube’s x, y, and z position in 3-dimensional space, a group of 6 RGB LEDs with the corresponding wires, 3 shift registers to  connect the abundance of electronics to the Arduino, and a battery to power everything.
 
                               
 

 

 
Software
The code for Game Cube is written in the Arduino programming environment and stored on the Arduino microcontroller attached to the inside of the Game Cube. The software consists of 650 lines of code—5 different settings, a Menu Interface, shift register control, LED control, accelerometer control, and testing/debugging statements.

 

Thursday, November 1, 2012

Interactive Technology Observation


For my interactive technology observation I chose the Coca-Cola freestyle located in Valhalla. It is essentially a device that allows you to choose from a large variety of drink combinations all from one drink dispensor. Generally, the people I observed using the device, who had clearly used it before, became impacient at some point during the process of getting their drink when pressing the screen because the response time to the next page was not as instantaneous as they would have liked. I did end up observing one lady who had no experience with the machine and had to figure out how it worked.  She discovered how the touch screen worked fairly quickly but when she decided she was going to fill her cup with the drink of her choice she pushed her cup against the ice lever which in turn scared her half to death.  It's really not that clear as to whcih button you are supposed to press for your drink because most fountain drinks today have levers for the drink, similar to the ice lever.  Perhaps if they labeled the drink button with another word other than push this confusion would have never come about.  The one major problem I have found with the machine is it's efficiency at getting multiple consumers their drinks in a timely manner. Because you do have to go through the process of choosing what beverage you want, and the fact that there is only one source from which to get your drink, which can in turn create a rather long line.

Tuesday, October 30, 2012

Final Project Proposal

For our final project, we propose a cube with which you can play various games with (a game cube if you will) that will at the same time be very esthetically pleasing. To accomplish this we will encase our arduino inside of the cube (making sure that it is stable) and run an RGB LED to each face of the cube. The cube will be controlled by an accelerometer which will inturn control the color values for each RGB LEDs. 

 
We are still brainstorming some of the games and/or settings that will be available for the cube but so far we have:
 
Color Wheel - a setting that will allow you to create every color in the color wheel simply by rotating and moving the cube along the x, y, and z axis'.
 
Maze Game - a game in which you have to figure out the right combination of turns for the cube in order to reach the end of the "maze".
 
Simon^{3} - similar to simon but utilizing rotations to certain sides of the cube instead of pressing buttons (sound may be incorporated). Each side of the cube will also have it's own color. These six colors will be red, yellow, green, cyan, blue and magenta being that yellow, cyan, and magenta are all composed of equal values of two of the three primary colors (red, green, and blue).
 
Reflex Game - a game in which you must rotate the cube to the indicated side before time runs out, while your granted time limit between each rotation gets smaller and smaller as the game progresses.
 
Color Game - at the start of the game the cube will flash a random color and it will be your job to create an identical color to the one that was shown at the start of the game, which will inturn have some sort of response if you create the correct color.
 
(more soon to come...)
 
 
 

Monday, October 15, 2012

Motor Labs

In these labs we learned how transistors can be used to allow you to control a circuit that is carrying a higher current and voltage from the microcontroller and how an H-bridge can be used to switch the direction of a current that is flowing through a circuit.  An H-bridge is actually made up of several transistors aswell.  Here is a video demonstrating how the H-bridge allows for a change in dirrection of current as well as how the H-bridge acts as a transistor by allowing control of the circuit while it is carrying higher current and voltage from our power source.

 
We did have one minor issue while attempting to complete this lab.  On our first trial nothing would work.  At that point I decided I'd feel what I thought to be the H-bridge to make sure it was not heating up.  After almost burning my finger off I realized something must be wrong.  We checked the diagram, made sure everything was in the right place, switched wires away but nothing seemed to work.  At that point we realized that what we thought was a H-bridge was actually a shift register.  After a quick switch we had our circuit running.
 
 

Shift Out

In this lab we learned how shift registers work and how they can be used to control eight outputs at a time while taking up only a few pins on your micro controller.  This is done using a thing called "synchronous serial communication" which allows you to pulse one pin up and then down allowing you to communicate a data byte to the register bit by bit.  Once the whole byte is transmitted the HIGH, LOW messages located in each bit are then transmitted to its corresponding output pin.  Here is a diagram of the shift register we used for the lab:
 
PINS 1-7, 15 Q0 " Q7 Output Pins
PIN 8 GND Ground, Vss
PIN 9 Q7" Serial Out
PIN 10 MR Master Reclear, active low
PIN 11 SH_CP Shift register clock pin
PIN 12 ST_CP Storage register clock pin (latch pin)
PIN 13 OE Output enable, active low
PIN 14 DS Serial data input
PIN 16 Vcc Positive supply voltage
 
Our overall goal for this lab was to control a seven segment LED counter using .  We had a few problems while trying to figure out what pins controlled what on the counter but after we discovered that it was a common anode counter it was smooth from then on.  We were able to control the counter by using only 3 pins in our arduino.
 

Monday, October 8, 2012

Ninji Chop - Accelerometer controlled fruit slicer

For this project we were asked to design and prototype an object for the kitchen area so naturally we came up with the idea of a 'virtual' fruit slicer that we like to refer to as ninji chop.  My partner and I had done some experimenting with an accelerometer after lab one day and we thought it was pretty cool so we decided that we wanted to implement this into our project in some shape or form.  All of our first ideas incorporated the accelerometer in such a way as to cause some type of pouring action for perhaps a pitcher or a measuring cup.  This idea flopped after we realized that liquids handled in the kitched are generally too heavy for the type of devices we have access to in the lab and it just didn't seem very innovative.  After wrestling around with several other ideas that were simply preposterous we came up with the accelerometer controlled knife.
 
Here is a video of our first test to see if a servo could exert enough force to cut a banana.
 

Check.
 
After some brain storming we realized that our design process would circulate around the knife being controlled by our acceleromter, so clearly the next step was to get the thing chopping!  After mapping the values of the y-axis inputed from our accelerometer to the values outputed by the servo connected to the knife we came up with the following.
 


Notice the "glove of power".

The idea of a 'virtual' fruit chopper in which every physical action exerted by the device could be controlled from a glove raised one design question after another when we realized that there were more factors at play here other than a simple chopping motion.  We of course wanted to make it as interactive as possible.  As you can see in this next video we mounted our knife/servo to our main platform in order to keep it stable, as to apply the maximum amount of force on the food item being sliced, but we needed a way to pull the food along to create uniform cuts.

 
You would not believe the number of systems we thought of to pull our little cutting board along.  From linear actuators to complex systems of gears we knew there had to be a perfect design out there that could fulfill our needs. We finally realized the elegance of simplicity when we setteled on a dual spindle/pulley system that would give the operator ultimate control over the cutting board, anywhere from thinly sliced to chunky.  In order to mount the servos that would control the spindels we had to raise the main platform that the cutting board would slide on.  This was done using blocks of wood.  The peice of wood you can see mounted to the knife servo was placed there for added support.
 
 
We then mounted two buttons to our "glove of power" in order to control what directions the the spindels would pull.  We had to run through trial and error in order to figure out what values would cause the servos to spin in certain directions at certain speeds.  We then fixed a block of wood with a hole drilled through the middle to each end of the cutting board.  Next we hot glued some string from each spindle to it's corresponding block.  Here is a video of the first demonstration of one of our spindels in action.
 

We then had to coordinate each spindel such that they would spin in the same direction when a button was pressed (depending on which button was pressed) such that one would pull the cutting board along while the other would release it's line.  We ran into a minor problem in our code while sorting this out when we could only get it to pull one way.  We actually created an if statement for each button when instead we simply needed to apply both buttons to one if statement.  In doing so our program no longer skipped checking to see if the second button was pressed.  Our cutting board also ended up in several "truck pulls" before we got the rotations figured out as well.
 
Another element we needed to think of was a way to keep the slices of fruit from falling off of the cutting  board.  This problem was solved by fixing two "walls" on both sides of the path that the cutting board would take, helping to contain the fruit and to funnel the cutting board at the same time.    


 
Next we needed a way to stop our spindels if they were to reach the end of the platform. This was done by placing a switch at both ends of the platform.  When one switch is pressed our program skips the part of the if statement that checks to see if the button that would pull the cutting board toward the currently pressed switch and simply checks to see if the other button is pressed, and this will of course loop until the other button is pressed.
 

After we got both servos that control the spindels functioning we experienced a problem with our servo controlling our knife, that being it became nonresponsive.  After some research we discovered that the arduino power source is simply not enough when it comes to powering multiple servos. We then found an external power source as you can see below.

 
We did however experience the persisting problem of our knife randomly locking up, usually happening whenever you hold the glove (with the accelerometer attatched of course) still for a few moments.  The knife would become responsive again from a simple tap but it is simply annoying.  If you have any comments on the matter feel free to indulge us on what it is that you think the problem may be.
 
Last but not least here is a video of our final project.  Our final design implemented a blade gaurd as to stop any slices of fruit from getting stuck to the blade.  We think it turned out pretty well.




Wednesday, October 3, 2012

Analog Output Lab

In this lab we learned how to utilize Pulse Width Modulation or PWM even more in order to demonstrate analog output. PWM can allow digital devices to produce analog output by simply turning the digital device on and off very quickly. The pulses of "on" time that are part of each period of PWM are referred to as duty cycles.
 
 
 
During the first part of lab we constructed the following circuit in which to control a motor from a potentiometer.  We wrote a program in which we could manipulate the duty cycle of the motor by twisting the potentiometer. We also incorporated an LED in which is manipulated in the same manner as the motor.
 

Next we uploaded some started code provided to us in order to become more familiar with servos.
This one being a 360 degree servo:

 
And this one being a 180 degree servo:
 
 
Next we added a potentiometer to our circuit and mapped the analog input values of the potentiometer to the analog output values of the 180 degree servo.
 
 
In the final portion of lab we got to play with a small piezo speaker.
 
 
My partner being gifted in the art of music making looked up the frequencies for certain notes online in order to demonstrate another melody.