Greg's Notebook, Spring 2008
Jan 23 (Wed)
Sent out weekly nose update to Pietro and Nate.
Some upcoming issues:
- How to go about getting sensors
- Constructing box w/ builtin nose board, computer, sniffer and battery
- Need to find a small, low-power pump that's not too noisy
- Temperature-control the sensors?
- Canister of nitrogen for blowing on sensors?
- New laptop to replace dead laptop
- Maybe one of these (they're only $220, extremely portable and run linux + python).
- I'm starting to see those RS232 bugs that Michael mentioned
- Need some way to recover from them
- Burn-in test (should be able to operate without crashing for 24 hours straight)
Jan 22 (Tue)
The good news
I can now write data to a file with my first version of enose.py. I can also see resistance values change as I adjust a 100kohm pot, plugged between pins 16 and 18 of on connector #1, bank #1.
Example: column 2 changes as I dial around an attached 10-100kohm resistor pot (1st column is time in seconds):
1.604 4095 4095 4095 4095 4095 4095 ... other columns omitted ... 2.406 2373 4095 4095 4095 4095 4095 3.208 2328 4095 4095 4095 4095 4095 4.010 2745 4095 4095 4095 4095 4095 4.812 3521 4095 4095 4095 4095 4095 5.614 4095 4095 4095 4095 4095 4095 6.516 4095 4095 4095 4095 4095 4095 7.318 3778 4095 4095 4095 4095 4095 8.120 1277 4095 4095 4095 4095 4095 8.923 15 4095 4095 4095 4095 4095 9.725 15 4095 4095 4095 4095 4095
Modifications needed:
- Read offset and gain-adjustment voltages V1 and V2 (as they are called in the documentation)
- Convert 12-bit values V3 to resistance, using V1 and V3
The bad news:
That old toshiba laptop we had sitting around in the lab just died. Its disk drive went clickity clickity click for a while and now it no longer boots. Unfortunately this happened after I got it all set up with the programs I needed for eNose control(minicom, cutecom, python, stty tools, xemacs, matlab, etc).
For now I'm continuing to do development on my macbook, which has a usb-to-serial connector that works fine. Meanwhile I'll search for a replacement laptop we can use during testing.
Jan 21 (Mon)
Now I need to write a routine which inherits serial.py and has methods for talking to the eNose, such as:
r=enose.getresistance()
enose.setrange()
This means reading the offsets/gains, parsing the hex A2D values and then applying Michael's formula and seeing if it gives sensible output.
At this point then all it needs to do is keep reading resistances and writing them to a text file, re-setting the range when necessary. Then I'm ready to take data.
Jan 19 (Sat)
Progress:
- Writing serial communications code in python, starting with serial.py.
- Starting"stripchart" for plotting the resistances real-time
- Need to have a tool like this for debugging
- uses wxPython
- Using a 100K resistor pot as my simulated sensor
- Michael says sensors are roughly 10-100Kohm
Jan 18 (Fri)
Progress:
- Kubuntu 7.10 now on Toshiba Satellite, installed minicom, cuteterm, PySerial etc.
- Built 12V power cable to supply power to ENose digital board
- At first, could not talk to board over kubuntu laptop's external serial port
- Switched to macbook w/ USB-to-serial converter
- minicom communication successful over /dev/tty.modem
- OSX drivers for the USB-to-serial dongle can be found at the link above
- Moved USB-to-serial converter to kubuntu laptop
- One-way communication after I
chgrp root /dev/ttyUSB0
- Two way only after I
chmod a+rwx /dev/ttyUSB0
- One-way communication after I
So right now, the laptop's built-in com port does not seem to be working (shared IRQ problem?) but the USB-to-serial port works fine.
In addition to minicom
I've found cutecom
is pretty nice and easy to configure.
Useful command-line utilities are stty
and setserial
.
Jan 17 (Thu)
TODO:
- Find 12V supply and solder to a connector
- Install kubuntu on laptop
- Laptop battery is dead, order another one from Dell
- Power on the nose and communicate via. terminal emulator
- Try basic commands and confirm that it's working
- Implement (python)
- communication
- stripchart - for watching data realtime
- Hookup potentiometer and make sure values make sense
- Calibrate bucking
- Does
Voltage => Resistance
formula give consistent results, even after bucking?
- Does
Jan 16 (Wed)
Met with Michael Gibson today for about 2-3 hours out at Next Dimension Technologies, which is at the corner of Fair Oaks and Mountain.
It sounds like one of the biggest challenges with the eNose is to create learning, analysis and chopping strategies that are robust to systematics. The characteristics of the instrument can change greatly from day to day or even hour to hour.
Michael gave me some documentation which I put on the Olfaction page. We discussed the instrument characteristics for a while, here's a brief outline:
- Command set for communicating with the board
- Read values
- Set gain and DC offset (manually or automatically)
- Turn on heaters and/or pump
- Systematics such a temperature drift, polymer saturation etc.
- Need to find better ways to correct for non-linear drift
- Sampling
- Convert hex values to resistances (this is a formula involving gain, DC offset and ADC readouts)
- In practice the polymers tend to be in the range 10-100Kohm
- Convert resistances to concentrations: dR/R ~ concentration
- Weaknesses of this system
- 12-bit ADC is adequate for high concentrations dominates the noise for low concentrations
- Sampling is about 1Hz. This is adequate (but not great) for drift removal and measuring dR.
- DC offset needs to be "bucked" frequently, effectively slowing the sampling rate to >1 Hz
- Analysis
- A hand-tuned decision tree
- First level of tree detects a few really obvious chemicals
- Further down the tree, uses separating hyperplanes in a PCA or Fisher space for more subtle discrimination between chemicals
- Advantages
- Simple and gets pretty good performance
- Disadvantages
- Whenever you add new chemicals or a new set of detectors, you have to hand tune the tree all over again
Pictures
Just ome pictures I took for Pietro's talk on olfaction in DC: