Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

Dorm Room DJ

Dorm Room DJ

Parts List/Cost

                276-1657 Photoresistor from Radioshack: $2.99 for pack of 5

                Carboard box (we used a pizza box)

                Carboard Circle (we cut out of a pizza box)

                Soda Can

                Scissors

                Duct Tape

                Opitcal Encoder Circle (circle.jpg attached)

                Total Cost: $2.99

Setup

HW

  1. You can use a simple voltage divider circuit to read variable voltage based on the changing resistance of the photoresistor. Refer to the following diagram:

Untitled.jpg

where R is a resistor with a known value.

Then the resulting voltage between Ai+ and Ai- is equal to 5 * R2 / (R1+R2)

Connect 5V wire to the +5V output pin of myDAQ; GND wire to +5V GND pin; AI+ wire to AI0+ pin; run another wire from GND to the AI0- pin.

2. Mount the cardboard circle in the middle of the box so it'll spin. Glue the circle encoder strip on top of it. Mount the can and photoresistor such that the photoresistor is over the edge of the encoder strip at a height of about 3-5 millimeters.

SW

  1. Open Dorm Room DJ.vi
  2. Select the songs in both file path controls.
  3. The Insert/Delete keyboard keys are mapped to Tempo Up/Down control;
    Home/End are mapped to Tempo 2 Up/Down control;
    Page Up/Down are mapped to the Mixer control

Explanation

myDAQ's constant 5 volt output goes across a series of a resistor and a photoresistor. Since the value of the resistor is known, we can measure a voltage drop across the photoresistor using an analog voltage input channel of myDAQ. The resistance of the photoresistor will change depending on the intensity of the light it sees. When the disc is rotated, the resistance of the photoresistor will vary, causing the volatege to change. When we detect this change in Labview, we output a random DJ scratch sound effect.

The VI uses two ActiveX controls to play two songs simultaneously using Windows Media Player. The user can change the volume and tempo for each song while being able to control the relative presence of each song with the mixer slider.

ATTACHED: VI Code, Documentation

Download All
Contributors