Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

NI myDAQ Light Show

Synchronize Lights to music!

This will allow you to time any lights to any music. A quick and easy way to time Christmas lights to music. Switches power on and off depending on frequency and magnitude of the sound. Anything you can plug into a regular US power socket can be used.

Equipment:

·         MyDaq

·         Computer

·         Speakers

·         Lights

Set up Hardware:

·         NTE3047 optoisolator

·         BTA316 Power Triac

·         8 Outlets

·         Switch

·         Circuit breaker

1.       Connect all of the heat sinks of the BTA316 Power Triacs to a large heat dissipating conductive bar. This bar will double as the common node and serve to dissipate extra heat.

2.       Solder heavy gauge insulated wire to pin 1 of the BTA316 Power Triac then connect the other end of the wires to the return (common) side of your power outlet.

3.       Solder smaller wire to pin 3 of the BTA316 Power Triac and connect the other end to pin 6 of the NTE3047 optoisolator.

4.       Connect a resistor (~100homs)  from pin 4 of the NTE3047 optoisolator to common.

5.       Connect a digital I/O line from the my daq to pin 1 of the NTE3047 optoisolator

6.       Finally Connect a resistor (~100homs) between pin 2 of the NTE3047 optoisolator and the mydaq digital ground.

Software Instructions:

·         Load the VI- Make sure both ‘Light Show.vi’ and ‘Ctrl.vi’ are in the folder.

This VI takes in an audio signal from a mydaq device using the 'audio in' line

The VI then converts the signal to the frequency domain and turns certain lights on for specific frequencies

The VI has some correction for volume intensity ‘correction factor’

Change 'Beat threshold" to adjust lowest frequency light

Change 'Range threshold' to adjust the range for the rest of the lights

Loop 1: (Producer)

The DAQ assistant reads in the audio signal from the audio input jack in 2500 sample chunks.

This signal is split into its right and left components then added together.

Then the signal is divided by the correction factor to adjust the volume level.

The signal is then put into the queue to be read by the second loop

Loop 2: (Consumer)

The signal is pulled out of the queue and sent to the FFT and to the audio output

The FFT (fast fourier transform) converts the signal into  magnitude and frequency

The control sub VI uses a peak detection system that sends commands for each light based on a certain frequency

The light control signals are then sent to the DAQ assistant to control the digital I/O pins

Finally the signal brought out of the queue is also sent to the DAQ assistant to control the audio output jack.

Errors:

·         Stopped to prevent reusing old data: the computer cannot process the data fast enough, close other programs running on the computer.

Images in word file

Comments
FredPr
NI Employee (retired)
on

Hi, sfullman. How download you program? I like it!

andiPi
Member
Member
on

Yes, Shane I'd like to study your programm in detail 'cause it isn't fully documented in your report.

Thanks andi Pi

Contributors