Tuesday, March 8, 2011

Plant Science, continued

Well, I was hoping to give y'all an update about the science fair project I was hoping to help my sister with. I recruited a very talented friend of mine to help build the sensor/amplifier interface that would allow my sister to use my labjack to gather CO2 concentration data from the plant sample container.

Kevin and I actually had the sensor working relatively well. I think it was still breaking in, even after about 48 hours of operational time. We logged some data from it over the course of about 36 hours as it just sat in a room, and the voltage it gave off varied dramatically over that time; it appeared to be an exponential approach to a steady value.

Qualitatively, the sensor behavior was what we expected; an increase in CO2 concentration yielded a drop in voltage, with the voltage drop increasing inversely with concentration. We tested this relationship using our breath, as well as a soda bottle filled with vinegar and baking soda.

Unfortunately, something went wrong between the time we shipped it to Missoula, and the time my sister and my dad finished assembling the device and interfacing it with the labjack. The voltage divider we chose for the photosensor appeared to have been poorly designed, as even mild darkness would peg the labjack reading (the labjack analog inputs max out at 2.44 volts).

I went down to Missoula to try and fix things, but I think it's possible I actually ended up being the one to finally destroy it all. I hooked up the OPA-111 amplifier, but I fear that I may have reversed the voltage rails; the positive rail was supposed to receive about 14V, and the negative about -6 (relative to ground, of course).

I think I may have reversed the connections, which fried the opamp; I actually saw the smoke escaping from it, as well as the insulating tape we'd carefully wrapped around it begin to melt. So yeah, that got fucked.

This heat, I think, also destroyed the CO2 sensor, because afterwards there was an infinite resistance across the heater terminals- implying that the heater circuitry was fried. The reason it was possible for the opamp to fry the sensor was proximity: in order to minimize noise (which is a very real concern when you are dealing with currents that are less than a trillionth of an ampere), we mounted the OPA111 directly to the sensor pins.

Unfortunately, this arrangement means that when I messed up with the amplifier wiring, I also killed the sensor and now I have nothing to show for all of my (and kevin's) hard work. It's really quite frustrating, because I was looking forward to seeing the kind of values that Shannon recorded, as well as maybe trying some scientific trials of my own.

Honestly, I'm frustrated enough with myself that I feel compelled to buy another sensor and opamp, just to prove to myself that I can't make such a sensitive circuit actually work. It's not like it was overly complicated- the OPA111 was simply acting as a non-inverting voltage follower; this design was chosen so that we could make the cable between the sensor electronics and the interface electronics fairly long, without having to worry about noise. Any other signal conditioning we could do with a cheap Radioshack opamp package.

I don't really have much more to say on the subject for right now, other than that I'd like to get the setup working someday. One of my plans for this summer is to begin establishing myself a hydroponic garden; it would be interesting to measure the effect of CO2 and humidity on plant growth (I'm going to be aiming mostly for strawberries and tomatoes).

Sunday, February 20, 2011

Plant Science

So, my little sister wants to do a science experiment involving the CO2 uptake of various plants. She's asked for my help getting things setup, and will be using some of my equipment (most notably, my LabJack) to collect data.

Our original plan was to use a ppmCO2 sensor (the extraordinarily crappy datasheet can be found here). This sensor is basically an electrolytic cell whose voltage (not current) is proportional to the logarithm of CO2 concentration.

Unfortunately, this thing produces a signal that ranges only between 0 to 50 mV, and can source no more than one pico-amp (pico means "* 10^-12", or one trillionth). This meant that the LM324 quad opamp I was planning on using would be inadequate- it has an input bias current of a couple nano-amps, which is of course three orders of magnitude too much.

My original plan was to use one op-amp in a non-inverting configuration to boost the sensor voltage into the range of the LabJack's single-ended ADC range, which is about 2.44 V.

Unfortunately, we've run into several problems. First, at the minuscule currents we're dealign with, noise is a huge issue so I can't really effectively use my breadboard. Second, my soldering skills still need a lot of work. Third, the TL082 op-amp that I found at radioshack is not a rail-to-rail amplifier, meaning that I'll have to use two power supplies to get any maningful data from it.

I have managed to get the heater control circuit working. This isn't much of a victory, since it's just a transistor switch and some carefully arranged power resistors, but seeing as to how I can't even get a non-inverting amplifier to work I guess I need to take what I can get. I was originally hesitant to even build this circuit, but because the heater for the sensor produces about 1200 mW of heat, which can add up quickly inside an insulated glass jar, I decided to implement it to allow the labjack to control the heater and activate it only when it is about to take a reading.

I'm super tired at the moment so I'm going to hit the sack. I plan on working on this more tomorrow before I have to head back to Bozeman to see my lovely lady, and if I make any headway I'll update this entry. If things don't work out and Shannon ends up needing to choose an alternative science experiment, I'm still going to take the CO2 sensor back home with so that I can prove to myself that I can get it working. Once I have that, I'll probably couple it with my ethanol sensor to built a "fermentation telemetry" rig.

Monday, February 7, 2011

A New Direction

So, I just looked at this thing and realized that I've had an active-but-mostly-unused blog for about four years.

Holy shit.

The past couple years have just not been conducive to blogging on my usual topics; it's not that my opinions have changed, it's just that one can only repeat one's self so often before writing becomes a chore. So while I wasn't typing up long screeds on why the republican party is just evil, or why PHP is a poorly implemented programming language here, I was (probably) doing so somewhere else on teh interwebz.

In a similar vein, I recently discovered Reddit and have been doing a lot of reading and commenting there (mostly in the atheism, science, advice, and DIY-oriented subreddits).

As I approach graduation, however, I've been acquiring more and more toys tools with which to do my own science experiments and begin (or finish) various projects I've been thinking about for a long time. These tools include a LabJack U3 data acquisition device, which is probably the single most useful piece of electronic equipment (other than my computer) that I've ever owned. It's got a neat little Python API and has drivers available for Linux, Mac OS X and Windows, so it's easy to work with from a software perspective. It also has support for interfacing with I2C and SPI ICs, so if it doesn't have a certain functionality that I want, I can find the IC that does and just talk to it through the labjack. Infinite Power!

Other important tools that I've acquired include the following:

  • Tektronix 2-channel analog oscilloscope: Needs some TLC, but a good scope is invaluable for electronic testing and debugging.

  • Protoboard: What you find in every electronics lab in every university, used for rapidly prototyping circuits in an easily-modifiable way.

  • 12-volt low-ripple power supply: I scored this beauty as surplus from MSU's Facilities Services. It gives off high-quality DC power and can source something like 11 amps.

  • Sensors: These are cool. I've managed to get my hands on an ethanol sensor, some LM335 temperature sensors, and a phototransistor for fairly cheap. I got my current batch from Sparkfun, and will hopefully be branching out to other vendors for different kinds of sensors sometime soon.

  • Commodity electronic components: These are things like resistor, capacitors, wires, and various kinds of LEDS (from the standard low-power green/yellow/red to a high-intensity green Luxeon, as well as some high-intensity RGB packages).



I still need some other tools, most importantly a good bench power supply (I'll probably end up using a computer power supply until I can afford a better one) and a temperature-controlled soldering iron that I can use for high-precision work. Once I've acquired those, here's a (non-exhaustive) list of projects that I want to do in the near future:


  • Learn to do surface-mount soldering

  • Microcontroller programming; I'll probably start with the Atmel Atmega328, since it seems easy enough to program and it's powerful enough for beginner projects

  • Breathalyzer/ethanol concentration sensor. I've actually already started this one, I have the ethanol sensor I got from sparkfun wired up and I've interfaced it with the labjack; I just need to calibrate it and write an interface application to make it easy to use.

  • O2 production/CO2 uptake measurement for various plants. This is actually a science experiment my sister wants to do for her school's science fair, and I thought I could help her out with getting some good data and building a good experimental setup. I'll write more on this soon.

  • Aluminum-air or zinc-air fuel cell. I want to try building one of these bad boys (I'd really like to get a zinc cell working) because they have a ridiculous energy density, and could very well be used in an EV conversion project later on. Zinc cells have the benefit of being "rechargable" by me using a zinc-plating technique.

  • Home power monitoring. This mostly involves reading currents and voltages, and calculating their real vs. apparent power consumption and integrating against time. Still, it could be really useful for calculating an energy-saving strategy once I live somewhere that is more conducive to me expressing my inner energy-Nazi

  • Automated beer brewing: basically using a combination of the ethanol and CO2 sensors mentioned previously to get some data on alcohol fermentation. Maybe throw a pH sensor in there somewhere, I think it could be pretty cool.

  • Synthesis gas fermentation. I want to see how difficult it is to get acetogenic bacteria to metabolize CO and H2 into ethanol. Supposedly it's possible and it's actually fairly efficient, I just need to figure out how to generate the CO and H2 via gasification first. The gasifier itself is probably deserving of its own project.



So, those are my desired projects. I'm sure I forgot one or two. My plan is to write detailed blog entries on the progress of each one, so that other people can learn from my experience and/or give any helpful suggestions that come to mind.