| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Final Project - Daniel Zhang

Page history last edited by Daniel Zhang 12 years, 7 months ago

The Design

 

Intended Users

People who want to be able to interact with their music instead of just listening to it.

 

Original Design

The original idea was to create a device that would generate a track/load before playing a song and display it on a color LCD while it was playing. 

 

 

 

The Build

 

Hardware

Lab 6 mp3 board on the left. LEDs with individual pins assigned. Multiplexer connected to 6 buttons and a potentiometer. Testing out a demultiplexer and shift register.

 

Demultiplexer removed; swapped out by 5 shift registers (1 main, 4 to control each LED column). Swapped out buttons. Added capacitors from power to ground on the LCD and the ICs.

 

Swapped out button momentary switches again for level switches. Added in a PS2 joystick. Far right column of red LEDs swapped out with blue LEDs (casing is clear).

 

Beginning to set up perfboards.

 

Top left: "Main" board - to hold Teensy microcontroller, MP3 Decoder, potentiometer, and multiplexer.

Bottom left: Shift register board

Top right: SD card and headphone jack holders; perfboard waiting to be cut

Bottom right: LED board

 

Perf boards cut and wired for "floating" components (LCD, joystick, button, SD card).

More wires connectorized.

 

Components attached, spacers added. Spacers used to close circuit on battery cube in bottom of picture (3 batteries used instead of 4 to supply 4.5V to be stepped down) by the voltage regulator attached to the Teensy.

 

Side view. Empty level towards the right leaves space for a battery holder.

 

Acrylic cement was not working properly. With 15 minutes left, electrical tape and hot glue were used to assemble the case and attach the device inside of it.

 

Problems Along the Way

My previous experience with programming only dealt with running code on the computer. Because of this, RAM was pretty much disregarded as an issue while coding. With the microcontroller, however, RAM seemed much more finite, where the Teensy's 2.5 kB RAM is less than a millionth as large as most computers these days. Along with my inefficient coding, I was constantly tipping over the on-board RAM capacity. Less global variables and storing more things in EEPROM worked to help reduce some of that RAM usage. PROGMEM would have been great, but I was not dealing with very many constant variables. 

 

In retrospect, I regret for not having gone to Room 36 earlier because it turns out they have a good amount of parts you can buy. [For example: different kinds of switches, ICs, LED matrices from Sparkfun (I think that's where they're from), and even micro-controllers (Arduinos).]

 

The Code

The code used in the device can be found here:

http://pressplay.pbworks.com/w/page/44303092/MP3%20Code%20-%20Daniel%20Zhang

It's not exactly the best example of how to code. Also, some things in the code shouldn't actually be doing anything, but after having made some changes that caused it to not work, I ended up reverting to an older version of my code and building off of it whilst leaving most of its attributes in. Either way, the code needs a LOT of cleanup.

But I doubt you'll actually read, or at least want to read, through over 1000 lines of code.

 

The "Final" Product

 

 

 

Questions or Commments? Email me at daniel.da.zhang@gmail.com

 

Comments (1)

David S said

at 3:42 pm on Aug 16, 2011

Very nice job on executing your project Daniel! Games are always most welcome. :-)

We like that you noted your intended user, and included and initial sketch and state diagram. We would like to have seen a bit more detail in the Design section about your model for the player (Guitar Hero? Tap Tap?), which aspects of it that you borrowed, and those that you didn't (and why). Were there other design inspirations or challenges that you faced before building your prototype?

The Build section is very nice, with great example photos. A bit more explanation as to 'why' you made each decision along the way (swapping buttons for switches, or multiplexers, or the number of shift registers) would really help the reader understand how come you made the changes that you did at each step. Also, when so many distinct components are brought together on several boards, a circuit diagram can go a long way in helping you (and the future reader) to match what is actually happening on the boards with what's intended to happen on them. Do you have any helpful hints for readers who may be considering using shift registers? How easy or difficult were they to use and where did you find your sample circuits (on the datasheets maybe)?

We appreciate your explanation of the memory challenges that you faced while coding, but would have liked to see a bit more comments in your code. That might even help you sort out what parts of it are required and what parts aren't actually doing anything. ;-) Also, you don't describe your algorithm for mapping the music into lighting the LEDs, how much timing precision was needed to properly register a score, or how you arrived at those values. Consider adding them if you have time; it'll help future students!

As a thought experiment, if you could change 1 or 2 things about your design, or build, or game play at this point, knowing what you know now, what would it/they be?

Congratulations on a well-done project!

David, Akil and Ben

You don't have permission to comment on this page.