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.

Tuesday, February 16, 2010

Do Want

Today I stumbled upon a link involving information about Lego Technic. For those of you unfortunate enough to be ignorant about it, Technic was Lego's line of, well, technical models. That is, they had motors, pulleys, gears, beams, pneumatics, and all sorts of other nifty parts that meant you could build models that actually, you know, did stuff.

Anyways, after reading up on the newer Technic sets (I haven't played with legos since I was in middle school, and I think I may have to start up again), I decided to research some of the new fancy-shmancy "Mindstorms" kits- basically, a programmable microcontroller that can interface with lego motors and sensors (yeah, they have sensors now!).

This all reminded me of a much older kit called the Control Center (I'll find the part number sometime). The Control Center was, in my mind, the predecessor to the Mindstorms line of controllers. It featured three independent motor controls, and was "programmable" in the sense that it could be made to memorize certain motor commands; the motors were controlled using buttons on the front surface. The models one could build with it were amazing- a drawing machine, a dinosaur, all kinds of stuff. I ended up incorporating mine into pretty much all of my models that I came up with. Since most of these were cars, this usually involved using what was called the "East-West" motor port to drive a micromotor for a rack-and-pinion steering system, and a regular high-RPM 9V Technic motor to drive the rear wheels was controlled by the "North-South" motor port. There was a third port, and that usually went unused, unless I had some power accessory I wanted to incorporate (usually, that would be a pneumatic pump for something like a pneumatic arm).

This set brings back a lot of memories; before my parents moved us all out to Forsythe, I had seen this set in the Lego catalog (yeah, I got the lego catalog. My parents got me hooked when they bought me the 9V motor starter kit). Anyways, the set listed for something like $250.00, which for an eight-year-old kid may as well have been $∞.99. Well, I started saving up my allowance, and by the time we moved to Forsythe I had something like $100 saved up for this set that I pretty much dreamed about every night.

Well, on one of our frequent trips to Billings (or we were stopping in Billings on our way back from Missoula, I can't remember), we stopped at Toys-R-Us. Now, we usually stopped there, even though we didn't normally come away with anything- looking back on it, I think my parents used it as a treat to get us to behave well, which makes sense; trips to Billings were all-day affairs, and I can only imagine how grating it must have been to try and manage two (and, eventually, three) young children for a whole day and 200 miles of driving.

So we stop at this Toys-R-Us, and I'm looking at all the Lego sets inside all dejected-like, because they don't have any sets that I both want and do not own. We walk outside, and on the curb is all of their clearance merchandise- inventory that has failed to sell well and that they need to move. Lo and behold, there is my dream set, sitting on the curb, the box somewhat dinged up from being moved around-- and it has a clearance price of $100.

I bought the set, and the rest is history. I literally cannot explain how much joy that brought me, especially when combined with the rest of my (already considerable) lego inventory. After building the models in the book, I used it as the electronic basis for pretty much every creation I had; I even used it to add additional motor controls to sets that didn't originally accommodate them.

Anyways, I thought I'd share. I can think of no other single item that I have owned throughout my life, excepting my first computer and my first car, that have brought me such joy. Looking back on it now, of course, I realize what a simple piece of electronic equipment it was- I could build it myself, now, with way more features- but at the time, it enabled me to do things with my Legos which had previously remained only dreams. This is significant because as a child, my legos were my canvas- they were the medium through which I expressed myself, and through which I explored my own creative abilities.

I am thoroughly convinced that legos and, via subsumption, the Control Center, are a significant reason why I have the interests that I do, or at least caused me to pursue those interests.

Tuesday, January 12, 2010

New Year's Resolution

One of my New Year's resolutions: post more frequently.

Maybe I should put a sticky note on my laptop...

Sunday, April 26, 2009

Holy Shit...

Wow, I haven't posted at all this semester, and it's drawing to a close.

Hopefully I'll write something interesting once all the chaos has died down...

Saturday, December 6, 2008

Gay Marriage

So, the lawful marriage of homosexual couples under the eyes of the government is a subject I'm passionate about. Not because I am gay (do I even need to qualify that?), but because I simply cannot stand aside and watch as ignorance and superstition feed the ravenous hatred and bigotry that is so prevalent right now.

I have come to conclusion that I am not pro gay marriage; I'm anti- straight marriage. I don't believe that gay couples should be able to marry so much as I think that straight couples should only be able to be granted civil unions. Marriage is a religious institution; leave it to the houses of superstition to perform the ceremony.

However, the above statement is really just an argument in semantics. A couple, in either Civil or Matrimonial Union, should have equal rights regardless of the sexes of the individuals involved; otherwise, it's sexism.

Interestingly, I've heard the argument that gays do, in fact, have the same right to marry as straights: they are perfectly free to marry a member of the opposite sex, just like everybody else.

The argument falls back on the definition of marriage; the troglodytes who oppose gay marriage provide the following criteria for marriage; you may marry somebody:

  • of marriagable age,

  • who consents,

  • is unmarried,

  • and of the opposite sex



What we need to change is the fourth criterion, the one about the opposite sex.

The argument that I've been hearing lately from the assholes on the other side of Proposition 8 could almost be the definition of slippery slope fallacy.

Basically, they contend, if we can "arbitrarily" change on criterion-- the one about being the opposite sex-- why do we retain the others? Generally, you'll hear something along the lines of: "I want to marry my dog, a tree and a couple 3-year-olds. Surely this is equally as valid as arbitrarily removing the sex requirement of the traditional definition?"

Turns out they're wrong. Myriad arguments can be made as to the necessity of the other three criteria: age and consent assure that nobody is being married against their will, and that children are not being molestet; the "unmarried" criterion simply ensures that monogamy remains the norm. This, too, is a candidate for deletion, but let's just assume the monogamy is necessary for the proper functioning of society with respect to government and taxation.

Before we continue, it will be instructive to define the purpose of marriage.

Is marriage designed for the production of children? Not exclusively so, or else couples would need to pass a fertility test before partaking of nuptials; being childfree would be grounds for forced separation and probably legal action on behalf on the part of the state.

Is marriage designed to raise children? Again, not exclusively so; childrearing is sufficient but not necessary reason to be united in legal matrimony. Even if it was, gay couples have been shown to be equally as effective as parents when it comes to raising children.

Is marriage designed to give people who love each other? No. People have been married not because the participants were willing, but because there were advantages to their respective families for doing so, and punishments for refusing. European nobility comes to mind immediately as an example, but this phenomenon is not exclusive to rich inbred whitefolk.

It is this last point that I would like to emphasize. Gay-marriage opponents point out that marriage is not dependent upon "love"; this is both a sad preview of their view of human relationships, and straw that breaks their argument-camel's back.

Very well. Supposing, for the moment, that this is somehow relevant, the opponents have just flushed the relevance of one of their favorite (fallacious) arguments down the drain; that is, the argument that homosexuality is a choice is now entirely irrelevant to the matter.

Because it is pretty well concurred that sexual orientation is not a choice, gay-marriage proponents win the argument either way: believing that homosexuality is voluntary and denying couples the right to marry based on sex is overt discrimination; stating that love is immaterial to the institution of marriage means that you have no reason for maintaining heterosexual-only marriage.


To summarize, here is a list of everything that will happen if gays are allowed to marry:

  • Gay couples will get married.



Notice how "holocaust", "persecution of heterosexuals", and "end of the world" are not included on that list?


The reason that there is no "slippery slope" as a result of allowing gays to marry is because removal of the other critera actually leads to bad things. I have provided a list of the remaining three criteria, and what would happen if they were to be removed:

  • Age of Consent: Removing this criteria means that babies and small children are molested. If you can't see why this is bad, kill yourself. Seriously.

  • Individual gives Consent: non-cooperative marriage is a unique combination of kidnapping and rape. In this instance, the two-for-one is not a good deal. Again, if you don't understand this, I strongly encourage self-termination.

  • Individual Is Not Married: This is in place to prevent polygamy and/or polyamory. While pluralistic marriage arrangements are not necessarily bad, they do tend to lead to unfavorable power distributions and the easier exploitation/abuse of the weaker individuals within the marriage group. At this time, I have no comment on whether or not this should be made illegal. I'm leaning towards "not".



In addition to these three, some states have restrictions on the consanguinity of the potential couple; ostensibly, this is to prevent incestuous relationships from ever producing children. While this is a noble goal, the same reproductive restrictions are not placed on other factors, such as drug and alcohol usage or financial stability. These factors are far more likely to negatively impact a child's health, so I have not included incest laws in my criteria.