Monday, April 03, 2006

ekgandpic

electrodes

electrode placement

differential amplifier

ekg

Saturday, March 18, 2006

interpretation of EKGs

Wednesday, March 15, 2006

electrodes

I'm interested in heart sensors (EKG) as a musical device. Right now I'm looking into a number of options, but believe I'll go with this OEM kit from ramsey electronics.

http://www.ramseyelectronics.com/cgi-bin/commerce.exe?preadd=action&key=ECG1C

These are the electrodes I'll be using:

http://www.medicalbuyer.com/category/Pain+Management+%3E+Electrodes

Sunday, February 26, 2006

brainwave logging

I'd like to investigate datalogging with the EEG device. I can forsee a couple of issues to tackle:

1...the data is not very interesting if it is only at a resolution of 3 seconds but the server can't handle the resolution the sensor needs (the atmel chip is programmed at a resolution of 256hz...way too fast for a server).

so how could this be logged? Is there a way to log it locally on the computer and then send the information that's been logged once every 3 seconds? This shouldn't be too difficult, though.

2...the eeg software we build is written around max/msp, but the work we've done so far is in processing, php and pic basic pro. How can I send this information onto the server from max? netsend/receive objects? I'm not sure at this point...need to look into this...

still, it would be great to do this and incorporate a data visualization that updates on the web...

something like this:

Saturday, February 25, 2006

datalogging extravaganza

Today is saturday and we had a class discussing the issues surrounding datalogging. I am happy to report that I have had some success with this assignment thus far...albeit, only with a potentiometer and not a sensor.

I used Tom's datalogging code

to produce a textfile that dynamically updated a textfile on the ITP server...here are some results:

2006-02-25 06:02:07 0
2006-02-25 06:02:11 24824
2006-02-25 06:02:15 28162
2006-02-25 06:02:19 61186
2006-02-25 06:02:23 61185
2006-02-25 06:02:26 60673
2006-02-25 06:02:30 61185
2006-02-25 06:02:34 59905
2006-02-25 06:02:38 60929
2006-02-25 06:02:42 61697
2006-02-25 06:02:45 61185
2006-02-25 06:02:49 60929
2006-02-25 06:02:53 41473

also....see here for the textfile:



now...why was it saying that the data was being logged at 6:02 when it was around 6:45...and the data I'm sending looks like it's 16 bit, not 8 bit. Odd. Is this because the high byte and low byte in the pic aren't being concatenated correctly?

Friday, February 10, 2006

Texas Advanced Optical Systems TSL 230 Light to Frequency Chip


I've decided to work with this programmable Light-To-Frequency Converter. I was hesitant at first because I thought Spencer Keiser had already worked with this sensor, but realized he'd been working witht the TCS 230 color sensor, not the TSL 230, which is sensing light. It's like an "electronic iris".

Here's a description from the Parallax website:

---------

The Texas Advanced Optical Systems (TAOS) TSL230 sensor precisely measures light using an array of photodiodes, with an output of digital square waves. The TSL230 has an input dynamic range of 160dB; that is, it can measure light over a range of 100,000,000-to-1.

The TSL230 programmable light-to-frequency converter combines a configurable silicon photodiode and a current-to-frequency converter on single monolithic CMOS integrated circuits. The output can be either a pulse train or a square wave (50% duty cycle) with frequency directly proportional to light intensity. The sensitivity of the device is selectable and the output frequency can be scaled by one of four preset values. An output enable (OE) is provided that places the output in the high-impedance state for multiple-unit sharing of a microcontroller input line.

Features:
High-resolution conversion of light intensity to frequency with no external components
Programmable sensitivity and full-scale output frequency
Communicates directly to a BASIC Stamp or SX microcontroller
Absolute output frequency tolerance of +/- 5%
Nonlinearity error (typically 0.2% at 100kHz)
Stable over wide variety of temperatures

-------

Very exciting stuff. The chip has some accompanying literature besides just the datasheet, which is particularly useful. The pdf entitled "look into the eye, from TI" says that the TSL230 has some very microcontroller-friendly featres: It's OE (output enable) pin lets you disconnect the output so that it can share a data bus with other devices. I'll try working on this with the PIC chip. The TSL230's output is essentially a train of square wave pulses, so it's easy to measure with a microcontroller...using the PulseIn command.
z

Monday, January 30, 2006

sensor workshop: sensors and time

Last semester I worked quite a bit with the issue of representing sensors and time with the eeg project I had with Toshi Ozawa and Heather Dewey-Hagburg. I decided to go with max/msp in that case because I'm more familiar with that particular software environment than processing or java. Here's a link to the project, there's a screenshot a little bit down on the page with a max/msp representation of the 'sensors and time' idea:

http://itp.nyu.edu/~zl316/PCOMP/thoughtpatterns/thoughtpatterns.htm

I decided to work with a photocell for this semester's sensor and time assignment. I had a difficult time getting my breadboard to function properly. First I thought my board might have had a short in it or that some of my components weren't working properly or I don't know what. I basically went through every possible problem I could have had and replaced it with a new part and STILL had problems. It seemed to boil down to the issue of a power supply. Tom and Todd both suggested that I just try and see if I could get my PIC chip to blink an LED just to make sure that my chip wasn't fried. It did seem to blink, but only if I held the power jack in my hand. So Tom suggested I just use a bench supply and feed it directly into the breadboard so I wouldn't have to worry about my bad soldering or whatever might have been the problem...which was a great suggestion because for the first time in about 6 hours of non-stop headache and disbelief, the PIC began to blink as planned.

So from there I took some code from Todd (his simple ADC in code) and matched it with some code from Tom (his processing 'datalogger' code) and was able to see some sensor/time action with a 1k ohm resistor and a photocell. This is the first step...I'm just glad I debugged my setup...next I'll take it from here and try to finesse the data and get a much hipper display.

For now...here's the PIC code:

--------------------------------------

DEFINE OSC 4
start:
INCLUDE "modedefs.bas"
' Define ADCIN parameters
' Set number of bits in result
DEFINE ADC_BITS 10
' Set clock source (3=rc)
DEFINE ADC_CLOCK 3
' Set sampling time in microseconds
DEFINE ADC_SAMPLEUS 10
' Set PORTA to all input
TRISA = %11111111
' Set up ADCON1 analog and right justify the result
adcon1 = %10000010
'define adc vars
adcVar1 VAR WORD ' ir Create variable to store result

pause 500
main:
'Read channel 1
ADCIN 1, adcVar1
'print the variable - notice the variable name is preceded by DEC
serout2 portc.6, 16468, [DEC adcVar1, 10, 13]
GoTo main

----------------------------------

and the processing code:


/*
Datalogger
by Tom Igoe
(only very slightly modified by zach layton)

This program takes raw bytes from the serial port at 9600 baud and graphs
them.
To start/stop the graph, click the mouse.

No graphing is done when the incoming value is below a constant
threshold.
You can only change the threshold in code. I haven't made a UI for that.

Created 20 April 2005
Updated 5 July 2005
*/

import processing.serial.*;

Serial myPort; // The serial port

// initial variables:
int i = 1; // counter
int inByte = -1; // data from serial port

void setup () {
size(400, 300); // window size

// List all the available serial ports
println(Serial.list());
// I know that the third port in the serial list on my mac
// is always my Keyspan adaptor, so I open Serial.list()[2].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);

// set inital background:
background(0);
}
void draw () {
if (myPort.available() > 0) {
inByte = myPort.read();
serialEvent();
}
}

void serialEvent () {
// draw the line:
stroke(255,255,inByte);
point(i, inByte);
// at the edge of the screen, go back to the beginning:
if (i >= width) {
i = 0;
background(0);
}
else {
i++;
}
}