Thursday, April 9, 2015

Eye Detection _ Update 2 _ April 3 - 9

This past week I've been working on building a circuit to process the EOG signal without using biopac. First of all, everyone has been telling me that I might get my eyes fried. The reason is that sometimes there might be large AC voltage in main power ground. So if I connect my eyes to the ground of main power, my eyes might be exposed to high AC voltage. The solution is easy, just keep the entire EOG circuit away from main power supply. I used batteries for my sensing circuit to power up the op-amps and the mbed. This mbed is going to use a zigbee chip to send the processed signal to another mbed that is connected to oscilloscope.

The first few days were not easy. I used a Duracell USB instant charger to power my circuit. Therefore my circuit was single-powered (0-5V), which was such a big mistake that I didn't realize at first. The circuit just wouldn't work, because the op-amps I was using were LM-741 and they had a input voltage range of power supply range minus 4V. Considering that my power supply from USB charger is not exactly 5V but around 4.5V instead, I only got an input voltage range of 0.5 volts! So I borrowed another charger to make the circuit split-powered.



The circuit is not very different from what I built for biopac. The V+ and V- electrodes signals will first go into an instrumentation amplifier. The output would be gain * (V+ - V-). Then this signal will go through a bunch of low-pass filters and amplifiers. Most of the AC noise will be filtered out and the DC component will be amplified to a much larger extent than the noise. Considering that the EOG signal would only be 3uV to 3.5mV, I set the DC gain at 20 and the AC gain of 10Hz signal at 1/2 for the instrumentation op amp.

It is not as easy as it seems. Sometimes the output voltage level drifts slowly from 0 to 5V and then from 5V to 0, which I just couldn't explain. Later I found some possible explanations for that:
1. My electrodes were slowly falling off of my face
2. Maybe I was just using some bad op-amps.
3. Voltage supply was not stable.

To eliminate these three possible causes for the problem, I...
1. wore a band to keep the electrodes on my face.
2. switched to LTC 1050 op amps from BioEngineering Labs. Compared to LM741 they seem to be much better for tasks that aim at small voltage and high accuracy.
3. Got chargers fully charged before using them. Put capacitors in parallel with power supply.

Also the noise seems to be much much bigger than the EOG signal. Fortunately they are at high freq and they seem to be repetitive. Therefore I did the following:
1. Add a bunch of low-pass filters. Alternatively I could just use a low-pass filter at a very low cut-off frequency. But then there comes the problem of low slew-rate, which means that the reaction of the system would be too slow. (When I set cut-off frequency at 1Hz, the half-period reaction time was about 1 second. Unacceptable!)
2. Use average algorithm in mbed to eliminate noise. I let the mbed calculate the average voltage of the all the measurements in past 15ms.

And after a long time of fine-tuning the circuit, I got this video:
You can see that there was a buggy moment in the video when the voltage level incorrectly stayed at maybe 5V. I still need to work on that. But anyway I've got my circuit working. And tomorrow Yifan and I are going to connect the sensing unit to the robotic unit. Something amazing is gonna happen!!

No comments:

Post a Comment