MonthNovember 2015

Final Project Idea: Design A Toy

minesweeperpreviewPosed with the challenge to make a toy that will keep a child occupied for hours on end, we settled upon what we refer to as “Advanced Minesweeper”. As a board game borne from the depths of our childhood, the game will feature the following aspects:

  • REPLAYABILITY: With a randomized system of ‘mines’, no two rounds are ever the same.
  • STRATEGY: Teaches children to think creatively to win against their opponent.
  • EASY SET UP: With most of the components attached to the board, parents don’t need to worry about losing dozens of intricate pieces.

Minesweeper: Our game’s concept is based off minesweeper except now there is an opponent as opposed to single player. One now must sweep mines while also fighting your opponent.

-Checkers: Our game also draws from Checkers where your pieces eat the other opponent’s pieces and your pieces can level up.

-Electronic Battleship: The board game itself is going to be similar to this game board where your interactions trigger certain signals, lights, and audio.

Our system consists of a game board and game cubes:

Game Board – a plexiglass game board that is divided into a 10×10 grid. Each square in the grid is wired to an individual reed switch that can be activated by a game cube. (qty: 1)

Game Cubes – plastic game pieces that contain a magnet inside to activate a reed switch on the game board. (qty: 2)

 

Arduino Light Theremin

I was looking through my parts bin and stumbled upon the piezo. The book says that it is “A small element that vibrates when it receives electricity. When it moves, it displaces air around it, creating sound waves.”

This sounds a lot like a speaker to me, but I heard in lab that a piezo can be used as an input sensor as well as for output (which I think a speaker can do as well, however most speaker cones are probably too heavy to be useful as a microphone).

Just for fun I decided to build the Arduino Light Theremin project. It was fairly straightforward and required a photoresistor as a light sensor to control the piezo. Here is the completed circuit:

IMG_3265

Next, I followed the book’s code example and setup my Arduino code. The program will first calibrate the light sensor during the first 5 seconds of plugging it in. Then, it uses these calibrated values to control the piezo’s output on digital pin 8.

Virtual Drumsticks Completed

Click here to see the beginning stages of this project.
Click here to read the initial project proposal.

After testing with one drumstick and verifying that I could turn an LED on and off, I ordered additional ball tilt switches (the Arduino kit only comes with one). I purchased this lot of 10 from Amazon: Gikfun ball tilt switches. These new switches only have 2 posts instead of 4 like the one included with my kit.

When the new switches arrived, I constructed another drumstick and tested. I decided to wrap the sticks in white electrical tape so that they would be able to withstand more use.

IMG_3228

Next I setup Processing 3 by uploading the Firmata protocol to my Arduino. This allows you to interface with the Arduino from Processing (you must have the Arduino Library for Processing folder added to your Processing libraries folder for this to work). Then I experimented with some code.

Screen Shot 2015-11-08 at 8.55.59 PM

I set digital pins 2 and 3 on the Arduino to INPUT. I also wired my drumsticks/switches from +5V power to pins 2 and 3. When the ball tilt switches are level, they complete the circuit and send a HIGH signal to Processing. When the switches are not level, such as when striking a virtual drum, the circuit is broken and the Arduino sends a LOW signal to Processing.

IMG_3316

Next, I found some drum sound effects (WAV files) online to use as drum beats. I imported the Minim sound library for Processing and was able to use the play() function to play my sounds whenever there was a LOW signal detected by the Arduino.

Screen Shot 2015-11-08 at 9.01.49 PM

The reason I chose to play the sound effect on a low signal was to prevent the sounds from going off while the drumsticks were being held in the vertical position. Each time the user swings the drumsticks, it breaks the circuit, sends a LOW signal to Processing, and my program plays the sound.

This was a fun experiment and obviously there are likely other types of switches that would be more accurate to use as virtual drumsticks, but for the price and simplicity, I was happy with the results I achieved.

© 2017 dauclair.com

Theme by Anders NorénUp ↑