Saturday, February 2, 2013

Multichannel Signal Processing - Take Two

Instead of stringing up four signal generators across the space between benches in the BE lab to get multichannel inputs and create a tripping hazard, we decided to create different signals by passing a single signal through a couple of resistors, and then reading the signal before it passes through each resistor. Therefore each A-D channel on the Arduino receives a sine wave with a different voltage amplitude. We used a common ground all the readings, so the voltage fell in steps at each reading across our resistor circuit.

The other option we considered was to use a LC circuit to modulate the frequency, but we do not have inductors, so bleh.

Here is a picture of the circuit:
(Karen/Rachel post the picture)

Materials we used:
4 0.5Mohm resistors
big breadboard
wires, so many wires

Final signal generator settings:
Waveform: Sine Wave
Amplitude (Peak2Peak?): 3V
Offset: 1.5V
Frequency: 20Hz

We used the MultiChannelExample Arduino sketch to receive the data, delimiting the values using a comma:
    Serial.print(sensorValue0);      
    Serial.print(",");                       
    Serial.print(sensorValue1);  
    Serial.print(",");                       
    Serial.print(sensorValue2);  
    Serial.print(",");                       
    Serial.println(sensorValue3);

Baud rate: 115200
Delay: 20 microseconds

We then plotted the data in Processing, using the Graph sketch:
Conveniently, Processing has a function to split strings!
String[] list = split(inString, ',');

We plotted the points in different shapes and colors, and it looked like a aluminum Christmas tree (which we don't really see anymore because of the Charlie Brown Christmas Special). Effectively, the plot looked like four sine waves of different amplitudes stacked on top of each other.

We then found some code to overclock our Arduino processor here. Not really sure what the code means yet, and not sure if there was even an improvement on the graph... work in progress.

Next time, plotting using a different library (Python perhaps?) and more studies in overclocking.

We also investigated how we could emulate the multichannel A-D conversion on our ECG chip before we solder it onto the breadboard.

Options:
1) Buy 6 MCP3002 A-D converters from Sparkfun
- Good: 75 kHz sampling rate
- Bad: breadboard nightmare, still only 10-bits

2) Buy an ATMega32 from Sparkfun
- Good: not a nightmare
- Bad: same as processor on Arduino, still only 10-bits, and same sampling rate and other restrictions

Maybe it's just better to solder the ECG chip. That only costs ~$50 anyways...

No comments:

Post a Comment