Laboratory #1 Sensors/Signal Conditioning/Data Acquisition System

1. Force Sensing Resistor

1.1 Measuring Position Using an FSR

First, we will use the Force Sensing Resistor to measure position. The circuit shown in Figure 1-1 will be used to measure the output of the FSR.

Undisplayed Graphic

Figure 1-1: Sensor Measurement Circuit

1. Connect the four pin connector of the long FSR to the circuit making sure to match the black dots.

2. Connect the output wires of the circuit to the National Instruments input block by connecting the black wire (ground) to pin 67 and the red wire (signal) to pin 68.

3. Connect the two 9V batteries to bias the circuit.

4. Load the program called scope.prj in LabWindows CVI and run it.

1.2 Measuring Force Using an FSR

1. Remove the long FSR and connect the four pin connector of the square FSR to the circuit making sure to match the black dots.

2. Stop running scope.prj.

3. Launch MATLAB

4. Load the program called daqstart.prj in LabWindows CVI and run it.

5. Set the number of samples to 1000

6. Set the sampling rate to 500

7. While slowly increasing the pressure on the sensor, start the data collection

8. Click on the Matlab button. This sends the acquired samples to MATLAB.

9. In Matlab, execute the plot(cvi_data) command to see the acquired data.

10. Write a function in MATLAB to linearize the relationship between pressure on the sensor and the plotted result.

11. Go back to CVI and acquire 1000 more sampled with the sensor at rest.

12. As before, plot the result in MATLAB.

13. Repeat steps 11 and 12 while simply holding the sensor, but applying no pressure.

14. Remove the batteries from the signal conditioning circuit

15. Disconnect the FSR circuit.

2. Accelerometer

1. Connect the output wires of the accelerometer circuit to the National Instruments input block by connecting the black wire (ground) to pin 67 and the red wire (signal) to pin 68.

2. Connect the two 9V batteries to bias the circuit.

3. Point the tab of the accelerometer directly toward the floor.

4. Acquire 1000 points of data at 500Hz sampling rate as you did previously with the FSR..

5. In Matlab: take the mean of the data and store it into maxavg :

maxavg = mean(cvi_data)

6. Point the tab of the accelerometer directly toward the ceiling.

7. Acquire 1000 points of data at 500Hz sampling rate as you did previously.

8. In Matlab: take the mean of the data and store it into minavg :

minavg = mean(cvi_data)

9. Point the tab of the accelerometer level with the floor.

10. Acquire 1000 points of data at 500Hz sampling rate as you did previously.

11. In Matlab: take the mean of the data and store it into zeroavg :

zeroavg = mean(cvi_data)

12. Quit Matlab

13. Write a formula to convert the acquisition levels to acceleration in g's.

14. Load scope.prj in CVI

15. Modify scope.c beginning on line 80 to convert the sensor output to acceleration in g's and save the file in your directory.

16. Run the new scope program.

3. The BioMuse System

3.1 Measuring Force Using an FSR and EMG

In this section we are going to use the FSR and the EMG to measure finger pressure as a computer input.

1. Connect the square FSR to the data acquisition board as described previously.

2. Load the program called scope.prj in LabWindows CVI and run it.

3. Make sure the FSR is working as it did previously and then exit the scope program.

4. Connect the BioMuse (or MiniMuse) to the PC serial port.

5. Plug in the BioMuse (or MiniMuse) to the wall.

6. Snap in the electrodes into the arm band.

7.. Place the arm band on the arm so that the center electrode is on the back of the forearm about 3/4 of the way up toward the elbow.

8. Plug the armband into the box.

9. Run Matlab

10. Load the program called bio-daq.prj in LabWindows CVI and run it. This program collects two channels of EMG envelope data. Remember from the notes that the EMG energy is extracted using a signal conditioning circuit built into the BioMuse (or MiniMuse). This signal conditioning circuit takes the absolute value of the raw EMG waveform and then smooths out (lowpass filters) the result. This is the EMG envelope.

11. Set the gain on channel 1 to 127, and set the gain on channel 2 to 0. Set the "device" to 1 and the "channel" to 0.

12. Click on the start button. A green light should appear.

13. Flex your muscle on the back of your arm by either bending your wrist backwards or using your index finger to push on the table. You should see VU meter #1 move when you flex and go to zero when relaxed.

14. Click the stop button.

15. Set the number of points to 2500 and the sampling rate to 500Hz. These set the aquisition of the FSR data.

16. Press on the FSR with increasing pressure and record the data by clicking on start.

17. After the "points acquired" reaches 2500, press "stop"; wait a moment, then click on the

"mat-lab" button.

18. Typing "who" in matlab should reveal "muse_data1, muse_data2, and fsr_data"

19. Then type:

20. Repeat steps 16-19 except this time tap your finger at various rates. You may want to experiment with other sensor positions.

21. Collect and plot the data like before.

1.2 Measuring a Gesture Using the EMG

1. Place the other arm band on the front of your forearm with the center sensor approximately opposite of the other band.

2. While still running bio-daq, increase the gain on channel 2 to 127. You should see both meters going up and down

3. Press the start button and bend your hand forward and then backward. You should see both meters going up and down.

4. Press the stop button.

5. Press the Mat-Lab button and wait a few seconds.

6. typing "who" in matlab should reveal "muse_data1, muse_data2, and fsr_data"

Then type:

4. The RadioBaton System

4.1 Measuring X-Y Position Using the RadioBaton

1. Connect the RadioBaton to the soundblaster card. Make sure the cable marked Midi In is connected to the RadioBaton plug marked Midi Out. Make sure the cable marked Midi Out is connected to the RadioBaton plug marked Midi In.

2. Plug the radio baton power cord into the wall.

3. Run Matlab

4. Launch CVI

5. Load the project Baton1.prj and run it.

6. The blue light should turn on and the message "radiobaton: setting Jaffe Schloss mode" should appear at the bottom.

7. Click on the start button. Notice as you move the batons that the data changes. Make a note of which baton corresponds to the left hand data. This will be called the left baton.

8. Place the left baton on the far left corner of the base. Click on the Mat-Lab button.

9. In Matlab, type:

This saves the data in Matlab to a variable called baton1.

10. Repeat step 8 except place the left baton on the front left corner.

11. In Matlab, type:

This saves the data in Matlab to a variable called baton2.

12. Repeat step 8 except place the left baton on the rear right corner.

13. In Matlab, type:

This saves the data in Matlab to a variable called baton3.

Repeat step 8 except place the left baton on the front right corner.

14. In Matlab, type:

This saves the data in Matlab to a variable called baton4.

15. In Matlab type:

16. Change the view to different perspectives. (Type "help view" to understand this command).

4.2 Measuring Height Using the RadioBaton

1. Collect Radiobaton data as in section 4.1. Except this time, instead of collecting the data at the four corners of the RadioBaton mat, place the baton in the following 4 positions:

2. Plot the data as in section 4.1, but this time use the following matlab commands to plot only the z data: