Wednesday, May 15, 2013

Final Project!!!

SNAKE CHARMER


For my final project, I remade the retro arcade game snake in processing. The idea is simple, you move a snake around with a controller, and when you eat the white dots, the snake grows. You lose the game if you go out of the screen or run into yourself. In addition to making it look fantastic, I added a retro game controller using my Arduino. I originally planned to use foot-pedals to control the snake in a DDR fashion, however the foot pedals that I bought did not work for this project so I built the controller instead. The controller consists of four pushbuttons controlling the direction of the snake, and the entire thing is big enough to store the Arduino in and is thus self contained.  The part of the project I am most proud of is the movement of the snake, which I managed to make fluid. I did this by making each body member of the snake an object and averaging the x and y position of each object with the object in front of it each time the draw loop executed. The color of the snake is random but also gradual. Each new body object's color changes in a small but random amount when added to the snake, making the snake look beautiful.



Video 1: General Gameplay

Video 2: Toggling between circle and square view. (just for looks)

Opening Credits

Pause Screen

Game Over Screen

Inside the game controller




Thanks for a great semester! - Noah

Monday, April 29, 2013

Final Project - SnakeCharmer - Week 1

SnakeCharmer


For my final product, I will combine two classic videogames to create a new game with an interesting user experience. I will combine the retro arcade game "Snake" with the more modern dancing game "Dance Dance Revolution (DDR)" to create a truly unique interaction. 



The snake's movement will be controlled with the DDR pad instead of a keyboard. I will emulate a DDR pad (as shown above) with 4 foot pedals that I am buying from sparkfun. I will create the actual snake game in processing. 

•The intended audience is everyone!
•The project will not technically satisfy an existing need. It is intended to be fun. 
•The only parts I need besides the basic Arduino stuff is the foot pedals, which are pretty cheep. 
•I will be using Arduino and Processing.
•I have no electronics background outside of this class, and have taken the first two introductory programming classes at NYU.



Thanks!








Data Visualization Experiment #3

For experiment #3, I decided to visualize time. My timer grows every second and resets every ten seconds.

Data Visualization Experiment #2

New York City murder rates compared to Detroit murder rates for the last 13 years. Visualized in an overlapping bar-graph in processing.

Data Visualization Experiment #1

New York City Murder Rates for the last 13 years visualized in a bar graph in processing.

Monday, April 1, 2013

Cryptech Demonstration








The following videos show the final version of Cryptech (for now). The first video shows all the hardware, and the actions taken to unlock the safe (if you have the key and know the dial location). The second video shows an closeup of the servo motor while it unlocks and locks again.

Cryptech Questionaire


§  Introduce members of the team
§  Name – Noah X. Deutsch
§  Major and any special interests – I am a freshman at Gallatin, studying computer science and philosophy.
§  What background in electronics or programming you each have – My programming background is just the introductory courses in python and java. I had no electronics background before this class besides what I learned in high school physics.
§  Project Summary
§  Title – Cryptech 
§  Short pitch – for my project, I designed a small safe that required multiple inputs to open. The safe reads these various inputs, determines if these inputs meet the required conditions, and then unlocks the safe if they do (technical details in Hardware).
§  Does this fill a need? - Designing a safe that is fun and secure may not fill a need, but it certainly fills a desire. Many everyday items that we interact with have long strangers to inovation, and this often leads to a boring interaction between the user and the object. I wanted to redefine the safe because it is something that has for too long remained the same, and a fun yet secure safe is a product that I would buy.
§  Does this mediate or add to an existing behavior? - Cryptech adds to the behavior of opening a safe, but makes it more interesting and fun. 
§  Is this a project you intended to be more than just a class project?  - While my project is intended for class, I also made it for myself so that I would be building something that I would want to keep. The next step for me is making it secure and adding more fun components!
§  The target audience
§  Who are you making this for? - The safe is designed for anybody who would want a secure, yet fun way to interact with an everyday object like a safe. In particular, this product could be marketed to any homeowner.
§  What tendencies and/or limitations does this audience have that you took into consideration when designing your project? - The limitations to this audience are small, for it is applicable to must adults. Any homeowner could desire a product like this.
§  Did you do any user observation on your target audience when designing this project? - Since I am technically part of my target audience, you could say I observed myself when designing this product. Otherwise, not really.
§  Did you test your project with your intended audience? -  I tested the safe with my friends, just to make sure that they couldn’t open it (without using force). Even with the key, they failed every time. 
§  If yes, what did you learn - I learned that it was pretty hard for an outsider to open Cryptech without using force, which was good news! 
§  The technical system
§  What hardware did you use? - For the input used to unlock the solenoid motor, a number of things were used. A potentiometer was hooked up to an analog input pin, and this potentiometer acted as the dial for the safe. Two buttons were used for the final act of opening the safe, one of them being a retro arcade button. A key and lock attachment that I purchased from Sparkfun was also used as a final way to ensure the security of the safe. The output was far simpler, and consisted only of a solenoid and a green led. When all the conditions were met for the input, a transistor would "open", the solenoid would “unlock”, and the green led would turn on, symbolizing that the safe was ready to be opened.

For the actual safe, I used a small box which I purchased from home depot. The locking hook I built my self out of a hanger and electrical tape, and this was the hardest part of the hardware for me to create. It was surprisingly challenging to build a hook that was rigid enough that it would lock every time you closed the box, yet flexible enough that I could manually open it if I needed to. 

§  What software did you use? The only software used was the Arduino software. The code essentially consisted of a series of nested if-statements: If this input is on, and this input is on, and the dial is turned to this value.....then unlock the safe and turn on the light. 
§  Did you use any Arduino or Processing libraries? I did not.
§  Any new types of circuits or electronic components you had to learn to use? I had to brush up on my transistor knowhow, but otherwise no.
§  What aspect of developing the project took the most time? – Building hook for the locking mechanism definitely took the most time. I did not anticipate this to be a problem at the beginning, and had to go through 5 prototypes until I made a hook that locked every time I closed the safe but that I could still manually override.  
§  Problems
§  What difficulties did you expect to have when you first started, and did they occur? I expected my most difficulties to be building the actual safe. These difficulties occurred  but almost exclusively in the hook/locking mechanism. 
§  What did you struggle the most in this project? I had a lot of problems with breaking equipment. I originally bought a hall effect sensor, that would create a new condition required to open the safe. You would have to use a magnet as a key to unlock the safe. However, this sensor broke during the final stages of testing and it was too late to order a new one. I also fried my super-bright red led and broke a transistor in the late stages of building the safe.
§  How did you overcome these problems?Or why didn’t you, if you didn’t? - These problems were not completely essential to the project as a whole. However, I think losing them (particularly the broken hall effect sensor) did detract from the "magic" and appeal of the safe. In the near future, I am going to repurchase these items and implement them, taking special care not to damage them!
§  Lessons learned
§  Was this project more or less work than you imagined at the beginning? It was about the same amount of work as I imagined it would be.
§  Did you have to learn any new software or hardware techniques to make this? I didn’t have to learn any new software techniques, but I had to be very resourceful when building the actual locking mechanism
§  Did you learn anything interesting from working on this project? I learned a lot from this project. Mainly, I learned that you have to allocate a lot of time for unexpected problems when working on large projects. I also learned that I need to take very good care of my components or they will break. In addition, I learned that I absolutely need to learn how to solder!
§  The future
§  Do you think this project has a use outside of class? This project has a use outside of class (for me at least). I intend to work on the project until it is secure, and then use it as my personal safe!

§  Do you intend to continue working on this? As I said above, I do intend to continue working on the safe, making it more fun with interesting sensors (including the hall effect sensor, which I initially intended to use). Sparkfun sells a biometric fingerprint scanner that I think would make an excellent addition to this project. I would also like to add a couple more lights and maybe some sound to Cryptech.

Cryptech Proposal


Cryptech:
Reimagining the Household Safe

         For my midterm project, I will build a safe, but not just any ordinary safe. Why should a safe’s “user interface” be limited to a simple dial? For my project, I plan to reimagine the conventional lockbox, creating a new, dynamic and interactive way to open a safe. My safe – Cryptech – will use various sensors, variable resisters, knobs, buttons, (and anything else I can find) to make opening the safe a fun yet secure activity.

         The target audience for this project is anyone who is bored with the monotony of daily life. Rarely do we see examples of innovation in home appliances; toasters, mousetraps, toilets and safes have all remained virtually unchanged over the last few decades. Cryptech rebels against this stagnant lack of innovation, envisioning the safe as a fun-to-use product.

         Cryptech will work in the following way. First Cryptech will read the output from the various sensors. If these sensors all are turned to the correct level (as will be determined by the customizable code), then a green led will light up and a servomotor will rotate and unlock the latch for the safe. Then the safe will be accessible. If the sensors are not taking in the proper information, a red led will light up, signaling a failed attempt to access the safe. There will be a separate button for locking the safe once it is closed again.

List of Parts:
1.    Large wooden or metal box with hinge
2.    Some sort of locking mechanism that can be controlled by servomotor.
3.    Arduino microcontroller
4.    Breadboard and Wires and Resistors
5.    Servomotor
6.    Various sensors, including some of the following: Hall Effect Sensor, Capacitive Touch Sensor, Potentiometer, Photoresistor
7.    Various Switches and Buttons
8.    Various LEDs
9.    External power supply(?)
10.Other Sensors may be used…

Possible Issues: I think the hardest part for me will be creating the actual hardware: the safe itself. 

Monday, March 4, 2013

Baby Toy Assignment


For my project I built a toy designed to help put a baby to sleep. The concept is similar to the picture below, but on a very basic level. 



To build this toy, I attached two output devices to my Arduino. The first was a piezo speaker element, which I programmed to hum the tune of "Twinkle Twinkle Little Star". The second was a servo motor, which I programmed to sway back and forth to the rhythm of the song. I then attached a rope the servo motor and a tiny pillow to the end of the rope, causing the pillow to sway back and forth. Ideally, this soothing combination of auditory and visual stimuli would help put an infant to sleep.


My toy is limited in that it doesn't accept much user input, but this is hard when the target audience is an infant. In general, all toys of this nature are limited in that an infant easily "interact" with a toy. Usually, he/she is just a passive observer or interacts on a basic level by touching the object. Infants are good at "listening", but are challenged when it comes to "thinking" and "speaking". 

My project is also limited because of the speaker I have (I'm not sure how soothing the screeching noise of a piezo element would really be).

I didn't have a baby to test it on, so I decided to "simulate" the toy's use with the help of a few of my friends. In the demo is also a view of the circuit I used for this project. The demo can be seen below.

(Sorry for the bad sound quality! You have to listen very closely to hear the melody.)



Servo motor controlled by potentiometer with Arduino

1

Servo motor controlled by Pulse Width Modulation from an Arduino

Questions:

1. We add delay so we can see the incremental changes on the servo motor. Without delay, it would appear to move fluidly.

2. to get a 45 degree rotation, you must simply write toyServo.write(45);

3. It can... see my toy assignment for proof!

Transistor controlled by Arduino


Transistor as Amplifier


Questions:
1. Maximum resistance makes the sensor less sensitive. Minimum resistance makes the sensor more sensitive.

Transistor as Switch


Questions:

1. Because it is connected to a 10k Ohm resister instead of a 560 Ohm Resistor.
2. 1st Led = .005 I, 2nd Led = .0089I.

Temperature Sensor and LED Circuit with Arduino


Force-sensitive Resistor and LED with Arduino






Questions:

1. This sensor could definitely improve accessibility for handicapped people in a number of ways. Two examples would be: A. Using the sensor to activate an automatic door for someone in a wheelchair. Using the sensor to communicate for someone who has lost a lot of movement and can only move their hands.

Wednesday, February 20, 2013

Photoresistor and Speaker Circuit

Whoops! I lost my photoresister! Will update when I find a replacement.

Potentiometer and Speaker Circuit





Questions:

1. No, the speaker drops whatever voltage you put into it.
2. To make it louder, simply up the voltage!
3. Yes! But I wish the speaker didn't sound so horrible!

Potentiometer and LED Circuit

Questions:

1. 1023
2. 0
3. It must drop 2.5 V
4. It is outside of the LED's range of output