Editing BioBoard/Documentation/Optical loss
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
In industrial production systems, such as large-scale alcohol fermentation, insulin production, etc., biological growth is often monitored using in-line ('live') sensors, which measure optical loss, usually at wavelengths in the [http://en.wikipedia.org/wiki/Infrared#Different_regions_in_the_infrared near-infrared] (NIR) or IR-A spectrum (700-1400nm). The inspiration for the home-built NIR probe described in the rest of this wiki is a [http://www.optek.com/Schematic_Single_Channel_NIR_LED_Probe.asp single-channel NIR sensor] from Optek, which emits and detects at 850nm, and is designed for in-line monitoring of yeast fermentations. | In industrial production systems, such as large-scale alcohol fermentation, insulin production, etc., biological growth is often monitored using in-line ('live') sensors, which measure optical loss, usually at wavelengths in the [http://en.wikipedia.org/wiki/Infrared#Different_regions_in_the_infrared near-infrared] (NIR) or IR-A spectrum (700-1400nm). The inspiration for the home-built NIR probe described in the rest of this wiki is a [http://www.optek.com/Schematic_Single_Channel_NIR_LED_Probe.asp single-channel NIR sensor] from Optek, which emits and detects at 850nm, and is designed for in-line monitoring of yeast fermentations. | ||
=Building a NIR probe= | =Building a NIR probe= | ||
Line 14: | Line 15: | ||
*how much can you afford to invest? | *how much can you afford to invest? | ||
This design uses an 850nm plastic LED (Everlight HIR204 - $0.43) as the photoemitter, and a matching phototransistor (Optek OP506B - $0.80) as the photosensor | This design uses an 850nm plastic LED (Everlight HIR204 - $0.43) as the photoemitter, and a matching phototransistor (Optek OP506B - $0.80) as the photosensor; the required circuitry is limited to a couple of resistors. | ||
==Things to keep in mind== | ==Things to keep in mind== | ||
Line 23: | Line 25: | ||
Last, but not least: this should go without saying, but make sure you ''don't'' get a glue with anti-fungal / bacterial / microbial properties - you want those critters to live so you can study them, right? | Last, but not least: this should go without saying, but make sure you ''don't'' get a glue with anti-fungal / bacterial / microbial properties - you want those critters to live so you can study them, right? | ||
==What you need== | ==What you need== | ||
Line 40: | Line 43: | ||
Optional: cell-phone motor (BubbleShaker Technology) | Optional: cell-phone motor (BubbleShaker Technology) | ||
==How to build it== | ==How to build it== | ||
Line 68: | Line 70: | ||
'''Step 5: Spacing''' | '''Step 5: Spacing''' | ||
Once the aquarium / hot glue has cured properly, take A3, place it between the two acrylic discs holding the LED and | Once the aquarium / hot glue has cured properly, take A3, place it between the two acrylic discs holding the LED and photoresistor, and glue the three parts together with acrylic cement, then leave to dry. | ||
Line 82: | Line 84: | ||
To build one yourself, the first thing you'll have to do is find an old cell phone somewhere, crack it open, and extract the motor - get as much of the wires as you can, it'll make life easier for you when you have to solder extensions on. Solder about 2 ft / 60cm of additional wire (remember the colours) to both leads. Then take a piece of acrylic tube big enough to fit the motor and about 1/2" / 13mm wire and plug one end with glue. Insert the motor in the tube - make sure fits tightly by wrapping the fixed part in electrical / gaffer tape, taking care not to block the rotor. Plug the other end of the tube carefully with glue, covering the soldered joint for extra strength. | To build one yourself, the first thing you'll have to do is find an old cell phone somewhere, crack it open, and extract the motor - get as much of the wires as you can, it'll make life easier for you when you have to solder extensions on. Solder about 2 ft / 60cm of additional wire (remember the colours) to both leads. Then take a piece of acrylic tube big enough to fit the motor and about 1/2" / 13mm wire and plug one end with glue. Insert the motor in the tube - make sure fits tightly by wrapping the fixed part in electrical / gaffer tape, taking care not to block the rotor. Plug the other end of the tube carefully with glue, covering the soldered joint for extra strength. | ||
Attach the BubbleShakerTM to your NIR probe by grinding one side of the tube flat, doing the same to the LED end of the probe, and glueing the two together with acrylic cement. There's a picture of a fully assembled unit [[Media: | Attach the BubbleShakerTM to your NIR probe by grinding one side of the tube flat, doing the same to the LED end of the probe, and glueing the two together with acrylic cement. There's a picture of a fully assembled unit [[Media:NIRprobe5.jpg|here]]. | ||
=Interfacing and measuring= | =Interfacing and measuring= | ||
Line 90: | Line 92: | ||
After assembling the probe, you'll need to wire it up to some kind of microcontroller; we've used an Arduino clone called [http://www.ladyada.net/make/boarduino/ BoArduino], and will use that as example, but you can use any type you like. Start out by connecting the 5V and GND pins on the Arduino to the power (+ / red) and ground (- / blue / black) strips on the breadboard. Then wire the LED to 5V and GND across a 150Ω resistor. Now connect the collector lead on the phototransistor to 5V, and the emitter lead to an empty strip on the breadboard, then wire that strip to the A1 pin on the Arduino with a connector, and to ground with a 100Ω resistor. If you've built the bonus version, you'll also need to wire your BubbleShaker to 5V and GND. Then you're ready to hook the Arduino board up to your computer, program it and start recording. | After assembling the probe, you'll need to wire it up to some kind of microcontroller; we've used an Arduino clone called [http://www.ladyada.net/make/boarduino/ BoArduino], and will use that as example, but you can use any type you like. Start out by connecting the 5V and GND pins on the Arduino to the power (+ / red) and ground (- / blue / black) strips on the breadboard. Then wire the LED to 5V and GND across a 150Ω resistor. Now connect the collector lead on the phototransistor to 5V, and the emitter lead to an empty strip on the breadboard, then wire that strip to the A1 pin on the Arduino with a connector, and to ground with a 100Ω resistor. If you've built the bonus version, you'll also need to wire your BubbleShaker to 5V and GND. Then you're ready to hook the Arduino board up to your computer, program it and start recording. | ||
In order to program the the BoArduino, you have to download and install the [http://arduino.cc/en/Main/Software Arduino software] first. Once this is done, you're ready to connect your board - in some cases, this requires a special cable, so make sure you've got the right one! Now open | In order to program the the BoArduino, you have to download and install the [http://arduino.cc/en/Main/Software Arduino software] first. Once this is done, you're ready to connect your board - in some cases, this requires a special cable, so make sure you've got the right one! Now open the Arduino program, copy the code in the box below into the blank sketch, and hit upload. Open the serial monitor to see the print-out of the data being transmitted from the probe, which ought to look more or less like this: @NIR:0:0.99$. | ||
// | |||
// This Arduino sketch reads our custom NIR absorption sensor. | |||
// | |||
// This code is part of the BioBridge Project. | |||
// | |||
// | |||
// author: rolf van widenfelt (c) 2011 | |||
// | |||
// revision history: | |||
// | |||
// apr 25, 2011 - rolf | |||
// identify this probe. (needed for BioBoard protocol) | |||
// | |||
// apr 17, 2011 - rolf | |||
// created. | |||
// ADC code seems to work.. still need to connect actual sensor and document connections! | |||
// | |||
// | |||
// code modification: | |||
// you will need to set some calibration points... (FILL THIS IN!!) | |||
// | |||
// description: | |||
// this sketch will periodically output a short string that contains the NIR transmittance | |||
// along with some other fields that indicate which probe (0) is being read. | |||
// the string should look like this for a transmittance of 99% : | |||
// | |||
// @NIR:0:0.99$ | |||
// | |||
// this is output periodically. (in this case, every 5 sec) | |||
// | |||
// In the case of an error, an "E" message is output instead of the temperature, like this: | |||
// | |||
// @TC:0:EBADVALUE$ | |||
// | |||
// note that these data packets are output to the serial console window at 19200 baud. | |||
// also, when the sketch first starts, it identifies the software and version, like this: | |||
// | |||
// @ID:BIOBOARD:TESTBATCH1:1.1$ | |||
// | |||
// that's it! | |||
// | |||
static const char ProjectName[] = "TESTBATCH1"; | |||
const int analogNIRPin = A0; // analog input pin that the NIR phototransistor circuit is connected to | |||
// CALIBRATION SETTINGS | |||
#define IMAX 4.9 /* max phototransistor current with IR LED on (no obstructions, just 1inch air) */ | |||
#define IMIN 0.02 /* dark current (NOTUSED) */ | |||
#define VMAX 5.0 /* arduino voltage = 5.0v */ | |||
#define ADCMAX 1023 /* highest ADC value */ | |||
#define IMAXI (ADCMAX*IMAX/VMAX) /* highest ADC value we expect from our sensor */ | |||
#define IMAXI_INV (1.0/(ADCMAX*IMAX/VMAX)) /* inverse (this avoids a divide during runtime) */ | |||
void setup(void) | |||
{ | |||
// start serial port | |||
//Serial.begin(9600); | |||
Serial.begin(19200); | |||
Serial.print("\n\r@ID:BIOBOARD:"); | |||
Serial.print(ProjectName); | |||
Serial.print(":0.1$\n\r"); | |||
// configure ADC to use external 5v reference (default) | |||
analogReference(DEFAULT); | |||
// just in case, throw away 1st ADC read | |||
(void) analogRead(analogNIRPin); | |||
// identify this probe | |||
Serial.print("@PR:NIR:0$\n\r"); | |||
} | |||
void printNIR() | |||
{ | |||
int sensor = analogRead(analogNIRPin); | |||
float sample = IMAXI_INV * sensor; | |||
if (sensor > IMAXI + 10) { | |||
Serial.print("EBADVALUE"); // oops, value is clearly wrong, so output an "E" message. | |||
} else { | |||
Serial.print(sample); | |||
} | |||
// XXX debug - we output raw ADC value as well | |||
Serial.print(":"); | |||
Serial.print(sensor); | |||
} | |||
void loop(void) | |||
{ | |||
delay(2500); | |||
Serial.print("@NIR:0:"); | |||
printNIR(); | |||
Serial.print("$\n\r"); | |||
} | |||
=Calibrating= | =Calibrating= | ||
Calibrating measuring equipment is an important part of any scientific pursuit, because the accuracy of your calibration determines the reliability of your data. However | Calibrating measuring equipment is an important part of any scientific pursuit, because the accuracy of your calibration determines the reliability of your data. However, determining absolute accuracy may be somewhat difficult, so you might want consider whether you actually need absolute values; in a lot of cases, you are likely to be less interested in the absolute biomass than in the relative change in biomass over time. | ||
To get an absolute measure of biomass in a live microbial culture, you can use several different techniques: | To get an absolute measure of biomass in a live microbial culture, you can use several different techniques: | ||
Line 103: | Line 192: | ||
* desiccating samples to measure total dry organic matter by weight | * desiccating samples to measure total dry organic matter by weight | ||
All of these techniques will require special equipment, though, and multiple measurements over time to create enough data to draw reliable calibration curves and compare your NIR probe values to those curves. We're not going to go into detail with any of | All of these techniques will require special equipment, though, and multiple measurements over time to create enough data to draw reliable calibration curves and compare your NIR probe values to those curves. We're not going to go into detail with any of those here, but merely describe the ways in which you can adjust your probe if you need to. | ||
The easiest way to calibrate this NIR probe is by tweaking the Arduino sketch. Use a voltmeter to measure the voltage coming off the leads from the phototransistor directly when the probe is just sitting in air (should be close to 5V), and simply enter that value instead of the default IMAX value in the calibration settings: | The easiest way to calibrate this NIR probe is by tweaking the Arduino sketch. Use a voltmeter to measure the voltage coming off the leads from the phototransistor directly when the probe is just sitting in air (should be close to 5V), and simply enter that value instead of the default IMAX value in the calibration settings: | ||
Line 119: | Line 208: | ||
If you have problems covering the whole spectrum, the other two things you can adjust relatively easily are the distance between the LED and the phototransistor, and the resistance on the circuit. A low resistance potentiometer instead of the 100Ω resistor on the emitter lead would allow you to adjust the sensitivity of the phototransistor directly, and provide a way of tuning it without having to disassemble and rebuild it. You can also decrease the light intensity of the LED by increasing the value of the resistor; 470Ω seems to be a good mid-level. | If you have problems covering the whole spectrum, the other two things you can adjust relatively easily are the distance between the LED and the phototransistor, and the resistance on the circuit. A low resistance potentiometer instead of the 100Ω resistor on the emitter lead would allow you to adjust the sensitivity of the phototransistor directly, and provide a way of tuning it without having to disassemble and rebuild it. You can also decrease the light intensity of the LED by increasing the value of the resistor; 470Ω seems to be a good mid-level. | ||
= | =Making it cooler= | ||
Tuning to different substances | |||
Multi-channel measurements | |||
=Geeking out= | |||
Reduction of light passing through a mass | |||
Absorbance vs. scattering | |||
=Links= | =Links= | ||
*Optek | |||
* | *Wikipedia | ||
*TruCell .pdf | |||
* | |||
* |