From the sound of the e-mail I got from Andrew about today's practice, it sounds like you got a lot accomplished.
I understand that you got his clone of the ASP-2 working and producing CO2 data. Is that correct? If so, then we're in a great position for our next practice (August 14th?) when I return! I'd love to see the data and the graphs that you're getting so we can compare them to Dr. Allen's and mine.
<FONT color=blue>Way to go team!
Mr. Kibler
Mr. Kibler,
Indeed, a lot was accomplished yesterday. I actually narrowed down the problem of the ASP-2 clone to a loose wire between Phidippides and the external breadboard with the ADC and CO2 module. It was that simple, yet I hadn't thought it would be that easy! I'll upload some of the graphs of the data we recorded yesterday shortly. Keep up the great work, team!
Andrew and Rocketeers, ··You keep up the good work, too!··· I've very pleased with how well you've brought your team together Andrew, and with all you're accomplishing.· You've succeeded in doing much more than some of your former NASA-SLI teammates and that says a lot about your leadership and maturity. Keep up the excellent work, Andrew. Your efforts will pay you dividends in the not-too-distant future. You can bank on that. There are two things are on the team's plate right now: 1) Please upload that data and graph(s) from your ASP-2 clone so that Dr. Allen, Sylvie and I can compare what you're getting to what we're getting. More information is better than less. 2) Keep your team pointed in the direction they're headed in and have them complete Dr. Allen's homework assignment (above.) It might be helpful to set a deadline (a homework due date) so that each Rocketeer can budget his time accordingly. This will ensure that the work gets done: accurately, completely, and on time. It goes without saying (but let's both say it anyway) that each Rocketeer should do the calculations and post their results individually. As you said so well in a previous post, "No cut-and-paste answers." Each Rocketeer will only learn and benefit by doing the calculations and thinking for them self. Some will take longer than others so setting a deadline date is important. I'm eager to see how well the answers compare to each other... and what the correct answer is! That's important for the next step in writing the program code to change millivoltage to CO2 ppm. Be sure to remind your teammates that it's OK, in fact expected, to ask for help on the forum when they need it. That's why the forum is here. Also be sure to compliment them on work that's well done, and firmly but tactfully hold anyone accountable that is not doing his part. This is a team effort: lead, encourage, and·motivate, Andrew. That's what you're doing so very well. I'm very pleased and proud of your leadership this year. Standing by in Ohio (but not for much longer... off to NH in a few days!), Mr. Kibler · ·
After this step^^^I could not figure out what to do next. Dr.Allen, Sylvie, or Mr.Kibler, am I on the right track so far?
ppm - 500 = -16.6667 * (mV - 318)
Now, plug in the values from the known point, (400,324) and (500,318), and see if they satisfy the equation. That is, the same number on both sides. Like 2 = 2, NOT 2 =1. If so, they are on the line. You can juggle that around by moving the 500 to the right hand side and combining terms.
ppm = -16.6667 * mV + 5800
How did you get 5800? You added 500 to both sides, but I don't understand how you got 5800 by adding.
Sean
First, I plugged in the variables to calculate the slope of the line....
(277- 281) / (5000 - 4000) = -0.004
But right after when you state in the first equation
Tracy Allen said...
mV / ppm
What do you mean by that exactly? Is it another part of the equation you want us to do? Is it a unit of measurement? I checked my answers with Sean and I believe that I am confused about where he went with this and if I should be doing the same. Also, when you are calculating slope2, you said, "...or if you...", does this mean that if we did not do this step would the equation still work fine? Or is it mandatory?
Good work. That's right, -0.004 is the slope of the line, and mV / ppm is the unit of measurement. "millivolts per part-per-million"
The units business is kind of like saying speed is "miles per hour" and abbreviating it miles / hour or mph for short. To get it you divide the miles you traveled by the number of hours it took you together, and the result is in a new unit of measure. That sort of thing is second nature to me now, but I can see where you might see the "mV/ppm" as another part of the equation that needs to be solved. But "-0.004 mV/ppm" is indeed just shorthand for saying "-0.004 in units of mV/ppm"
It says that if there is a 1 ppm change in CO2 concentration, the sensor output will change by -0.004 mV. The minus sign means decrease: ppm up, mV down. The change is small, only -0.004 milliVolts = -4 microVolts.
ASP-2 will measure mV, and from that we need to calculate ppm. So what we really need is how much change in ppm that is for each mV. It is easy to find that now, because it is just the reciprocal of the value we have in units of mV/ppm. As Sean found,
slope2 = 1 / -0.004 = -250 in units of ppm/mV
That says that for every change in 1 mV at the sensor output, the change at the input is -250 ppm. The minus sign means mV up, ppm down. Doing the reciprocal like that is like flipping the axes on the graph, so that mV becomes the x axis and ppm becomes the y axis. That is exactly what ASP-2 needs.
Sean got the next step by plugging the slope -250 and the coordinates of one point into the formula. Did you know that once you have the slope of a line and any one of the points on the line, you can immediately write down the equation of the line? I am letting you set the direction of how we solve this math problem, so I am feeling my way about how much math you know. If you are going on in science or math or engineering, this is a very important thing to know.
Given the slope and any one point x1 and y1, the equation of the line through that point on the x,y plane is,
(y - y1) = slope * (x - x1)
That is the generic formula, that lets you plug in a known slope and the coordinates of one point, to find the equation of the line. In answer to Sean's question, that can be rearranged, condensed, simplified as follows:
(y - y1) = slope * x - slope * x1 ' distribute slope over the parentheses
y = slope * x - slope * x1 + y1 ' bring y1 to the right hand side
Note x1 and y1 are constants, x and y are variables. When the slope is -16.6667 and the point on the line is (318, 500)...
y = -16.6667 * x + (-16.6667 * -318) + 500
= -16..6667 * x + 5300 + 500
= -16.6667 * x + 5800
That line passes through the point that you used to calculate the slope, also through infinity additional points on the line. You can plug either x2, y2 or x1,y1 or any other point in the line into the formula, and it will be the equation of the same line. By the way, the value 5800 is called the "x intercept" of the line. If you plug x=0 into the equation, you come up with y=5800. That is a point where the line crosses the x axis, (x,y)=(0,5800).
Sean, what is the next step, to simplify
ppm-4000=-250 * (mV-281)
?
Another homework question, What line would pass through both (318,500) and (281,4000)?
And the big question is, why are those equations different in terms of slope and x intercept? Aren't all of those points on the same line?
Dylan,
x and y are variables. On the other hand, the slope, x1 and y1 are givens. (x1, y1) are the coordinates of a point that we chose because we it is know is on the line. We found that from looking at the graph. The same with (x2,y2), which is another point on the graph. From those points, we found the slope of the line that connects them. Then the formula,
(y - y1) = slope * (x - x1)
gives the equation of the whole line. Now we can plug in a value for x, say x=10 or x=1234, and grind the crank and out comes a value for y. That includes plugging in x1 and out pops y1, or plugging in x2 and out pops y2.
The other points on the line are not necessarily on the graph. The line goes on forever, past any hint of physical meaning. Not only that, the graph is a curve, not a straight line. Sean, your answer to question 3 was right on. " The line is isn't completely straight." However, we can try to approximate a curve with a bunch of straight line segments, and that is what we are going to do.
Sean, your answer #1 is good. In question 2, I think you got confused by taking 1/slope.
The two points from the graph: (281mV, 4000ppm) and (318mV, 500ppm).
Slope (4000ppm - 500ppm) / (281mV - 318mV) = 3500ppm / -37 = -94.5945945945946 in units of ppm per mV.
.......... There is no need to take the reciprocal of that. (interesting repeating fraction, 594594594......)
The line: (y - 4000) = -94.5946 * (x - 281)
Simplify: y = -94.5946 * x - (281 * -94.5946) + 4000
. = -94.5946 * x + 30581
Check using x2: y = -94.5946 * 318 + 30581 = -30081 + 30581 = 500 = y2 !correct!
So that line does pass through both of those points.
I think where I am getting confused is the fact that we are dealing with X and Y coordinates, and we are using x and y as variables. So x and y do not represent any coordinates, they are just variables? And x1 and y1 are the coordinates. Sorry if I am just missing something and/or are asking meaningless questions.
It's great to see that you have been posting to the forum and keeping track of the discussion. Keep it up. Mike and Justin, are you following this too?
Mr. Kibler and others,
Here is the graph of data that I had meant to post to the forum the other day. This was recorded over a time period of about twelve minutes and definitely seems promising. However, obviously the CO2 level isn't correct just yet, and the data seems "spiky" as you have experienced. You can download the Excel data here (http://files.me.com/awmahn/445v38), and the graph itself is below.
( All data, minus altitude )
Andrew
Post Edited (Andrew (ARLISS)) : 7/28/2010 1:04:53 PM GMT
For some reason, in my question 2, I did 300 instead of 500. Also, how do you know when you don't need to do the reciprocal? Do you only do it when it comes out a decimal in the first slope?
Thanks for the graph Andrew. Am I correct in assuming that this 12 minutes of data immediately follows turning on the power? Please attach the current ASP program that is collecting the data.
Before talking about the math more, here is the homework. You know how we already took some points off of the graph. Your homework is to fill in the following table. I attached the graph again. I know it is hard to read the points because the graph is small. But take your best guess, and look again at our previous guesses. You will have to extrapolate at the low end for 200 and 300 ppm.
Andrew's graph shows the reading settling in at something around 2700 mV (I assume that's the reading taken from the ADC chip's connection to TP1).
If you divide that by 7.67 (the sensor buffer's amplification), you get a raw sensor reading of around 350 mV. Way back near the start of this thread we agreed that air is about 387 ppm CO2. On the graph, that corresponds to a raw sensor reading of about 325 mV, so if I'm reading things correctly, Andrew's graph shows a reading that's in the ballpark, but a bit high.
Is that all correct? This is very different from the graphs we saw on page 23 of this thread, where the reading was about 450 mV, corresponding to a raw sensor reading of only about 60 mV, which is completely off the scale.
I'd be curious to see what happens if he blows some CO2 onto the sensor after it settles in.
Tracy Allen said...
Thanks for the graph Andrew. Am I correct in assuming that this 12 minutes of data immediately follows turning on the power? Please attach the current ASP program that is collecting the data.
Dr. Allen,
As requested, attached is the program that recorded the data. Indeed, the 12 minutes is approximate time from powering on the device.
Here are the data points that Sean read off the MG811 spec sheet, graphed on linear XY coordinates.
Does everyone understand the difference, and why they plotted this data on a semilog graph? Semilog means that one axis is linear (millivolts), while the other axis is on a scrunched up logarithmic scale. The reason is that the voltage output of the sensor is proportional to the logarithm of ppm. Have you studied logarithms in school yet, or did you ever think you would need one?
mV = a * log(ppm) + b
Where a and b are constants. I think back a few pages, Sylvie actually made an estimate of those constants. Sylvie, I think there may be considerable variation from one sensor to the next. One may put out 324 mV at 400 ppm (*7.6667 = 2.484 Volts), while another one puts out 195 mV at 400 ppm (*7.6667 = 1.5 Volts). We need a larger sample size.
Andrew, one thing that puzzles me about the sensor graph you posted above for ~12 minutes of data is that at the start it goes almost all the way up to 4 Volts. But the sensor is powered internally by a 3.3 Volt supply that limits the output at TP1 to less than 3.3 Volts. It may be something amiss in the code that converts the ADC raw count into Volts. I haven't had a chance to check it yet, but maybe you can take a look too.
Andrew, one thing that puzzles me about the sensor graph you posted above for ~12 minutes of data is that at the start it goes almost all the way up to 4 Volts. But the sensor is powered internally by a 3.3 Volt supply that limits the output at TP1 to less than 3.3 Volts. It may be something amiss in the code that converts the ADC raw count into Volts. I haven't had a chance to check it yet, but maybe you can take a look too.
Doh! I should have noticed that too.
That's a promising find. Sounds like a simple glitch in the code, hey?
··· Yes, good work indeed! The graph line you calculated-- the 'semilog' graph as Dr. Allen explained-- is the portion of the graph we're interested in.·I·didn't know·that sort of a·graph line is called a semilog graph and so I learned something new today, thanks to both of you. You did a good job with the calculations, Sean. Good work indeed. Andrew, Mike, Justin, and Dylan, I'm looking forward to seeing your calculations too.
Now you're (all) seeing how the math you studied last year can be used for practical purposes.·Were you and your math class mates introduced to logarithms last year? Don't confuse a logarithm with an algorithm...they're two different things that are somewhat related. We need the semilog numbers so we can use them in the algorithm that goes in the program code... I think!
I have the ASP-2 running right now. It'll run for about 20 more minutes before I adjust the millivoltage to 1,0000 mV and then put CO2 on the sensor to see what happens. Hopefully the millivoltage will decrease...! The numbers are rising steadily and I can·visualize·a graph line developing already. What to do if I blast the sensor with CO2 and nothing happens...?
+++++++++++++++++++++++++++++++++++++++
Andrew,· Sylvie, and Dr. Allen,
·· Do you think we should all be using the same version of the program? The version I'm running right now Andrew, is not the same version that you used to get the data and graph you posted.
I'll update everyone with the results, graph, and data·from the trial I'm running right now a little later·in the·evening.
I have about 200 pounds of excellent Ordovician fossils that I found for class this fall. I even found Phacops rana...!
Now you're (all) seeing how the math you studied last year can be used for practical purposes. Were you and your math class mates introduced to logarithms last year? Don't confuse a logarithm with an algorithm...they're two different things that are somewhat related. We need the semilog numbers so we can use them in the algorithm that goes in the program code... I think!
I haven't really learned a lot about logarithms yet. I believe we will be learning more about them this upcoming year.
Mark in NH said...
Do you think we should all be using the same version of the program? The version I'm running right now Andrew, is not the same version that you used to get the data and graph you posted.
Mr. Kibler,
It would indeed be logical for consistency for everyone to use the same program. Now that I think about it, I'm not exactly sure why we used this program at our last practice to capture the data, but thank you for pointing it out. For consistency, could you please upload the program you are using?
[noparse][[/noparse]Looking over the code that Andrew attached, which was used to collect the data]
It looks to me as though that code never turns on the heater. There are two "HIGH 4" commands in the code, but both are commented out, and shouldn't do anything. Does it look that way to you? Am I correct that pin 4 is the one driving the CO2 sensor's heater?
There is a call to Carbon_collect which seems to simply read the status of pin 3. This is leftover from when you were just simply reading whether or not the alarm on the sensor was active. It is immediately followed by a call to MCP_get, which is meant to read the 3202's output into that same variable (CO2pp), and this happens before CO2pp is written to the logger, so it shouldn't be affecting anything, but it should be removed from the program, assuming Tracy agrees.
MCP_get has this:
MCP_get:
'read channel 1 first, potentiometer, will NOT be logged
'HIGH 4 'This activates the Heat Switch (HSW)
LOW CS ' Enable ADC
SHIFTOUT DataIn, Clock, MSBFIRST, [noparse][[/noparse] %1111\4] ' Select CH1, Single-Ended
SHIFTIN DataOut, Clock, MSBPOST, [noparse][[/noparse] CO2pp\12] ' Read ADC
HIGH CS ' Disable ADC
CO2pp = CO2pp */ Cnts2Mv ' Convert To Millivolts
DEBUG TAB, DEC CO2pp ' shows the potentiometer voltage
' read channel 0, CO2 voltage, variable CO2pp will be logged on flash drive
LOW CS ' Enable ADC
SHIFTOUT DataIn, Clock, MSBFIRST, [noparse][[/noparse] %1101\4] ' Select CH0, Single-Ended
SHIFTIN DataOut, Clock, MSBPOST, [noparse][[/noparse] CO2pp\12] ' Read ADC
HIGH CS ' Disable ADC
CO2pp = CO2pp */ Cnts2Mv ' Convert To Millivolts
DEBUG TAB, DEC CO2pp ' show the CO2 voltage
' mVolts1 writes mV for CO2 potientiometer
RETURN
So you're reading Channel 1 into CO2pp, printing it on the screen, then reading Channel 0 into CO2pp, and printing that on the screen. There's a comment that says "variable CO2pp will be logged on flash drive" after the read of Channel 1, but it is not·logged·until after the Channel 0 reading has been put into CO2pp. If I'm reading your code correctly, it's the reading from Channel 0 of the 3202 that you're logging. Is that the one you meant to have in the log file? That is, is Channel 0 of the 3202 the one that is attached to TP1 of the CO2 sensor?
At a higher level, this is what's happening:
Read Pin 3 status into CO2pp
Read Channel 1 output from the 3202 into CO2pp and convert to mV
Read Channel 0 output from the 3202 into CO2pp and convert to mV
Write the current value of CO2pp to the datalogger
Repeat over and over again.
Post Edited (sylvie369) : 7/29/2010 11:23:20 PM GMT
Don't worry if you don't hear from me for a couple of days. I'm headed off for a little camping and hiking in the mountains.
I suggested reusing the one variable, CO2pp, for several different measurements in succession. We were running out of variables, but for purpose of debugging we still wanted to recycle that one variable to look at the alarm status and then the TP2 potentiometer voltage, and then the real deal, the CO2 concentration from TP1. That is the value that is left in the variable at the point where it writes to the thumb drive. The EXCEL file that Andrew posted does look like the file from the thumb drive that would be written by this program. The multiplier to convert the MCP3202 raw counts to milliVolts looks okay. So I have to wonder where the readings near 4V are coming from. And especially, I see what Sylvie observed in the program. HIGH 4 should be turning on the heater, but that line is commented out. Maybe there is a slightly different version of the program floating around.
There is no need to think about the logarithm right now, except to see that it manages to reduce a very steep curve on the XY plane to what looks like a straight line on the MG811 data sheet. When you see it next year in school, now you can say, "aha! I've see that before!" Anyway, for now we are just going to make an approximate the steep curve by taking it in sections. If I don't get to send anything for a couple of days, I'll get back to it on Monday. In the meantime I'll be out among the rocks of the Sierra. No fossils here, Mark. All sweeps of granite.
··· Safe hiking and enjoy the mountains. Igneous rocks are just as pretty as fossils. Just be careful not to trip and fall on them though, or you'll get a new perspective on what "hard rock" really is...! See you when you get back. We're (still) crunching numbers.
· Attached is the program I'm using. It's·the most complete and·up-to-date program we have and I don't think any components and/or·essential progarm code·is missing.
===============================================
Tracy and Sylvie,
·OK, here's the latest bugaboo:
1) When I run the attached progam with "HIGH 4" not commented out, the millivoltage for "CO2 ppm" plummets to '0' and stays there. Checking the voltage at the test point (TP) confirms this and the voltages are in agreement.
2) When I comment out both "HIGH 4" commands the millivoltage for "CO2 ppm" is·stable. It jumps around for 30 seconds or so but then it increases and stabilizes as it did in Tracy's graph (over 20 -30 minutes.) Otherwise the program is functional... except that it doesn't respond to CO2 because the heater isn't on!
Puzzled about what to do now,
Mark
Post Edited (Mark in NH) : 7/30/2010 4:40:59 PM GMT
Attached is the program I'm using. It's the most complete and up-to-date program we have and I don't think any components and/or essential progarm code is missing.
===============================================
Tracy and Sylvie,
OK, here's the latest bugaboo:
1) not</I> commented out, the millivoltage for "CO2 ppm" plummets to '0' and stays there. Checking the voltage at the test point (TP) confirms this and the voltages are in agreement.
2) It jumps around for 30 seconds or so but then it increases and stabilizes as it did in Tracy's graph (over 20 -30 minutes.) Otherwise the program is functional... <FONT color=blue>except that it doesn't respond to CO2 because the heater isn't on!
Puzzled about what to do now,
Mark
Mr. Kibler,
I'll be sure to test the program you are using on Phiddipidies shortly and let you know the results. What you are encountering seems rather interesting. I'm rather curious to know whether it's a problem with how the ASP-2 is currently configured or if the problem is lurking in the program.
··· OK, whatever the glitch was it seems to be remedied. I think it was one of two things:
1) A loose wire (likely), or
2) The program doesn't like it when P4 is used for the HSW (heat switch) wire.
··· I reassigned P4 as P14 and then I changed the line in the program to read 'HIGH 14' instead of 'HIGH 4'. This command turns the HSW on. After I did that, I ran a 1 hour,·2 minute trial and the graph and data look great (see attached graph and data.) Right now I'm running the second trial. The heat switch is definitely on, the raw data looks good coming out, and I'm almost ready to expose the sensor to CO2 again to see if we get the same result. I suspect we will.
Again, I think it may have simply been a loose wire all along and so it's important that we solder the wires onto perfborad to remedy the problem permanently. Christopher and I started soldering today-- our first-ever try at soldering perfboard-- and·suffice it to say that our first attempt was ugly and it didn't work. I have everything we need to·solder at our next practice.
Sylvie , I'm headed to town shortly to get the·'Solder Off' you suggested weeks ago, for obvious reasons.
=====================================
Sylvie,
·· While this seems a little confusing at first glance:
CNTL···· PIN 4······ ' Wire comes from the CH1 pin on the ADC breadboard to TP3 on the CO2 sensor
I believe it is correct. In any event the ASP-2 works with it wired like this. Here's how the sensor is wired:
A) The wire from CH-0 on the breadboard/ADC is soldered to TP-1 on the CO2 sensor.
The wire from CH-1 on the breadboard is soldered to TP-3 on the CO2 sensor.
C) The wire from the HSW (CNTL) pin on the CO2 sensor goes to P4 (currently P14) on the BOE.
D) The wire from the ALM pin on the CO2 sensor goes to P# on the BOE.
E) VIN goes to VIN.
F) Vss goes to Vss.
Later this evening we'll change the wire back from P14·to P4 to see what happens.
========================================
You think Tracy will be OK hiking way up in the mountains? I didn't know he was a Mountain Man ('Jeremiah Johnson Allen'?)
What have you been up·having survived the Storming of the Bastille? Which great holiday is next?!
·· What if we put the ASP in a vacuum chamber and·evacuated all the gases? Would that·work to give us a zero point for·CO2 concentration/ millivoltage? The CO2 concentration in a vacuum should be O ppm, right. We do have a·bell jar/ vacuum·chamber. We used it last year to trigger the MAWd altimeter.·When pressure in the bell·jar decrease the MAWd activated. That's how we·knew it worked before we flew it in Nevada.
If we do use the vaccum chamber to determine millivoltage at 0 ppm, what would we use for the second (third, etc.) data points so we can draw a graph line?
++++++++++++++++++++++++++++++++++
Christopher and I did troubleshooting today since we have one operational and one 'troublesome" ASP-2 clone. We determined that, of the three CO2 sensors we have, two are bad. So we ordered two more.·We also had a faulty ADC chip and so we replaced it. After we figured out what works and what doesn't we started the hardwired (solder) the components onto perfboard (again.) Today's work was easier since we had a better idea what we were doing (and the Solder Wick stuff really worked well!) We also bought one of those adjustable gizmos with a magnifying glass, alligator clips, etc., which made holding the parts we were soldering much easier. But after an afternoon's work the ADC chip board didn't work. We got 2500 for CO2 mV, and also 2500 for CO2 ppm. When we disconnected the Vss (ground) wire from the perfboard the 2500's went away, replaced by seemingly random numbers...
Today was a real learning curve·about soldering. We have one less ADC chip (soldered permanently onto perfboard), one less piece of perfboard, a few less resistors and wires, but a wealth of new knowledge! Onward and upward. We're getting there (*and the breadboard/ ASP-2 clone still runs flawlessly.)
What are you up to? How do you think Tracy is faring in the wilderness? I wonder how cold it is up in the mountains?
Mark
What if we put the ASP in a vacuum chamber and evacuated all the gases? Would that work to give us a zero point for CO2 concentration/ millivoltage? The CO2 concentration in a vacuum should be O ppm, right. We do have a bell jar/ vacuum chamber. We used it last year to trigger the MAWd altimeter. When pressure in the bell jar decrease the MAWd activated. That's how we knew it worked before we flew it in Nevada.
If we do use the vaccum chamber to determine millivoltage at 0 ppm, what would we use for the second (third, etc.) data points so we can draw a graph line?
Mr. Kibler,
I believe someone mentioned a pure helium environment to get a zero point for CO2 levels / millivoltage. However, I am not sure why pure helium was chosen. Could someone perhaps explain this to me? It has me curious ...
Mark in NH said...
Christopher and I did troubleshooting today since we have one operational and one 'troublesome" ASP-2 clone. We determined that, of the three CO2 sensors we have, two are bad. So we ordered two more. We also had a faulty ADC chip and so we replaced it. After we figured out what works and what doesn't we started the hardwired (solder) the components onto perfboard (again.) Today's work was easier since we had a better idea what we were doing (and the Solder Wick stuff really worked well!) We also bought one of those adjustable gizmos with a magnifying glass, alligator clips, etc., which made holding the parts we were soldering much easier. But after an afternoon's work the ADC chip board didn't work. We got 2500 for CO2 mV, and also 2500 for CO2 ppm. When we disconnected the Vss (ground) wire from the perfboard the 2500's went away, replaced by seemingly random numbers...
That sounds like quite a bit of defective parts for one day, eh? Do you think we fried some of them during our "experiments" or perhaps defective upon arrival? I may have missed in a previous post, but which wiring schematic are you using as a reference?
Mark in NH said...
Today was a real learning curve about soldering. We have one less ADC chip (soldered permanently onto perfboard), one less piece of perfboard, a few less resistors and wires, but a wealth of new knowledge! Onward and upward. We're getting there (*and the breadboard/ ASP-2 clone still runs flawlessly.)
I hope some of those extra MCP3202's I ordered came in handy! I'm eager to see what the ASP-2 components look like on a perfboard, as I believe this will be the first time we haven't used a breadboard in our projects.
Comments
Mr. Kibler,
Indeed, a lot was accomplished yesterday. I actually narrowed down the problem of the ASP-2 clone to a loose wire between Phidippides and the external breadboard with the ADC and CO2 module. It was that simple, yet I hadn't thought it would be that easy! I'll upload some of the graphs of the data we recorded yesterday shortly. Keep up the great work, team!
Andrew
·· You keep up the good work, too!·· · I've very pleased with how well you've brought your team together Andrew, and with all you're accomplishing.·
You've succeeded in doing much more than some of your former NASA-SLI teammates and that says a lot about your leadership and maturity. Keep up the excellent work, Andrew. Your efforts will pay you dividends in the not-too-distant future. You can bank on that.
There are two things are on the team's plate right now:
1) Please upload that data and graph(s) from your ASP-2 clone so that Dr. Allen, Sylvie and I can compare what you're getting to what we're getting. More information is better than less.
2) Keep your team pointed in the direction they're headed in and have them complete Dr. Allen's homework assignment (above.) It might be helpful to set a deadline (a homework due date) so that each Rocketeer can budget his time accordingly. This will ensure that the work gets done: accurately, completely, and on time.
It goes without saying (but let's both say it anyway) that each Rocketeer should do the calculations and post their results individually. As you said so well in a previous post, "No cut-and-paste answers." Each Rocketeer will only learn and benefit by doing the calculations and thinking for them self. Some will take longer than others so setting a deadline date is important. I'm eager to see how well the answers compare to each other... and what the correct answer is! That's important for the next step in writing the program code to change millivoltage to CO2 ppm.
Be sure to remind your teammates that it's OK, in fact expected, to ask for help on the forum when they need it. That's why the forum is here. Also be sure to compliment them on work that's well done, and firmly but tactfully hold anyone accountable that is not doing his part. This is a team effort: lead, encourage, and·motivate, Andrew. That's what you're doing so very well. I'm very pleased and proud of your leadership this year.
Standing by in Ohio (but not for much longer... off to NH in a few days!),
Mr. Kibler
·
·
Here are my answers to your questions. I was having trouble with these questions, so I am not fully confident that my answers are completely correct.
Slope=(y2-y1) / (x2-x1)= (277-281)=-4·········(5000-4000)=1000·················· -4 / 1000= -0.004 mV/ppm
Slope2= 1 / -0.004=-250
ppm-4000=-250 * (mV-281)
After this step^^^I could not figure out what to do next. Dr.Allen, Sylvie, or Mr.Kibler, am I on the right track so far?
How did you get 5800? You added 500 to both sides, but I don't understand how you got 5800 by adding.
Sean
First, I plugged in the variables to calculate the slope of the line....
(277- 281) / (5000 - 4000) = -0.004
But right after when you state in the first equation What do you mean by that exactly? Is it another part of the equation you want us to do? Is it a unit of measurement? I checked my answers with Sean and I believe that I am confused about where he went with this and if I should be doing the same. Also, when you are calculating slope2, you said, "...or if you...", does this mean that if we did not do this step would the equation still work fine? Or is it mandatory?
The units business is kind of like saying speed is "miles per hour" and abbreviating it miles / hour or mph for short. To get it you divide the miles you traveled by the number of hours it took you together, and the result is in a new unit of measure. That sort of thing is second nature to me now, but I can see where you might see the "mV/ppm" as another part of the equation that needs to be solved. But "-0.004 mV/ppm" is indeed just shorthand for saying "-0.004 in units of mV/ppm"
It says that if there is a 1 ppm change in CO2 concentration, the sensor output will change by -0.004 mV. The minus sign means decrease: ppm up, mV down. The change is small, only -0.004 milliVolts = -4 microVolts.
ASP-2 will measure mV, and from that we need to calculate ppm. So what we really need is how much change in ppm that is for each mV. It is easy to find that now, because it is just the reciprocal of the value we have in units of mV/ppm. As Sean found,
That says that for every change in 1 mV at the sensor output, the change at the input is -250 ppm. The minus sign means mV up, ppm down. Doing the reciprocal like that is like flipping the axes on the graph, so that mV becomes the x axis and ppm becomes the y axis. That is exactly what ASP-2 needs.
Sean got the next step by plugging the slope -250 and the coordinates of one point into the formula. Did you know that once you have the slope of a line and any one of the points on the line, you can immediately write down the equation of the line? I am letting you set the direction of how we solve this math problem, so I am feeling my way about how much math you know. If you are going on in science or math or engineering, this is a very important thing to know.
Given the slope and any one point x1 and y1, the equation of the line through that point on the x,y plane is,
That is the generic formula, that lets you plug in a known slope and the coordinates of one point, to find the equation of the line. In answer to Sean's question, that can be rearranged, condensed, simplified as follows:
That line passes through the point that you used to calculate the slope, also through infinity additional points on the line. You can plug either x2, y2 or x1,y1 or any other point in the line into the formula, and it will be the equation of the same line. By the way, the value 5800 is called the "x intercept" of the line. If you plug x=0 into the equation, you come up with y=5800. That is a point where the line crosses the x axis, (x,y)=(0,5800).
Sean, what is the next step, to simplify
?
Another homework question, What line would pass through both (318,500) and (281,4000)?
And the big question is, why are those equations different in terms of slope and x intercept? Aren't all of those points on the same line?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 7/26/2010 3:34:09 PM GMT
Here are my answers to your recent questions:
1) ppm-4000=-250*x (mV-281)
ppm= -250*x·+ (-250*-281) +4000
ppm= -250*mV + 74250
·
2) Slope= (4000-300) = 3700········ (281-318) = -37········ 3700/-37= -100
·
Slope2= 1/-100= -0.01 ppm/mV
·
ppm-318=-0.01*(mV-300)
·
ppm= -0.01*x + (-0.01*-300) +318
·
ppm= -0.01*mV+321
·
3) Is it because the line isn't completely straight throughout the entire line?
·
Sean
·
If I may ask, in "(y - y1) = slope * (x - x1)", what is the difference between x1 and x, same with y1 and y?
x and y are variables. On the other hand, the slope, x1 and y1 are givens. (x1, y1) are the coordinates of a point that we chose because we it is know is on the line. We found that from looking at the graph. The same with (x2,y2), which is another point on the graph. From those points, we found the slope of the line that connects them. Then the formula,
(y - y1) = slope * (x - x1)
gives the equation of the whole line. Now we can plug in a value for x, say x=10 or x=1234, and grind the crank and out comes a value for y. That includes plugging in x1 and out pops y1, or plugging in x2 and out pops y2.
The other points on the line are not necessarily on the graph. The line goes on forever, past any hint of physical meaning. Not only that, the graph is a curve, not a straight line. Sean, your answer to question 3 was right on. " The line is isn't completely straight." However, we can try to approximate a curve with a bunch of straight line segments, and that is what we are going to do.
Sean, your answer #1 is good. In question 2, I think you got confused by taking 1/slope.
The two points from the graph: (281mV, 4000ppm) and (318mV, 500ppm).
Slope (4000ppm - 500ppm) / (281mV - 318mV) = 3500ppm / -37 = -94.5945945945946 in units of ppm per mV.
.......... There is no need to take the reciprocal of that. (interesting repeating fraction, 594594594......)
The line: (y - 4000) = -94.5946 * (x - 281)
Simplify: y = -94.5946 * x - (281 * -94.5946) + 4000
. = -94.5946 * x + 30581
Check using x2: y = -94.5946 * 318 + 30581 = -30081 + 30581 = 500 = y2 !correct!
So that line does pass through both of those points.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
It's great to see that you have been posting to the forum and keeping track of the discussion. Keep it up. Mike and Justin, are you following this too?
Mr. Kibler and others,
Here is the graph of data that I had meant to post to the forum the other day. This was recorded over a time period of about twelve minutes and definitely seems promising. However, obviously the CO2 level isn't correct just yet, and the data seems "spiky" as you have experienced. You can download the Excel data here (http://files.me.com/awmahn/445v38), and the graph itself is below.
( All data, minus altitude )
Andrew
Post Edited (Andrew (ARLISS)) : 7/28/2010 1:04:53 PM GMT
For some reason, in my question 2, I did 300 instead of 500. Also, how do you know when you don't need to do the reciprocal? Do you only do it when it comes out a decimal in the first slope?
Sean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
ppm mV
200
300
400 324
500 318
600
700
800
900
1000
1500
2000
3000
4000 281
5000 277
6000
7000
8000
9000
100000
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
If you divide that by 7.67 (the sensor buffer's amplification), you get a raw sensor reading of around 350 mV. Way back near the start of this thread we agreed that air is about 387 ppm CO2. On the graph, that corresponds to a raw sensor reading of about 325 mV, so if I'm reading things correctly, Andrew's graph shows a reading that's in the ballpark, but a bit high.
Is that all correct? This is very different from the graphs we saw on page 23 of this thread, where the reading was about 450 mV, corresponding to a raw sensor reading of only about 60 mV, which is completely off the scale.
I'd be curious to see what happens if he blows some CO2 onto the sensor after it settles in.
Dr. Allen,
As requested, attached is the program that recorded the data. Indeed, the 12 minutes is approximate time from powering on the device.
Thank you,
Andrew
Here are my answers to your table:
ppm ·· mV
200 ·· 336
300 ·· 330
400 ·· 324
500 ·· 318
600 ·· 314
700 ·· 310
800····307
900··· 305
1000 ·303
1500 ·299
2000 ·293
3000 ·286
4000 ·281
5000 ·277
6000 ·274
7000 ·271
8000 ·269
9000 268
100000 264
Sean
Here are the data points that Sean read off the MG811 spec sheet, graphed on linear XY coordinates.
Does everyone understand the difference, and why they plotted this data on a semilog graph? Semilog means that one axis is linear (millivolts), while the other axis is on a scrunched up logarithmic scale. The reason is that the voltage output of the sensor is proportional to the logarithm of ppm. Have you studied logarithms in school yet, or did you ever think you would need one?
mV = a * log(ppm) + b
Where a and b are constants. I think back a few pages, Sylvie actually made an estimate of those constants. Sylvie, I think there may be considerable variation from one sensor to the next. One may put out 324 mV at 400 ppm (*7.6667 = 2.484 Volts), while another one puts out 195 mV at 400 ppm (*7.6667 = 1.5 Volts). We need a larger sample size.
Andrew, one thing that puzzles me about the sensor graph you posted above for ~12 minutes of data is that at the start it goes almost all the way up to 4 Volts. But the sensor is powered internally by a 3.3 Volt supply that limits the output at TP1 to less than 3.3 Volts. It may be something amiss in the code that converts the ADC raw count into Volts. I haven't had a chance to check it yet, but maybe you can take a look too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 7/29/2010 6:11:36 PM GMT
That's a promising find. Sounds like a simple glitch in the code, hey?
··· Yes, good work indeed! The graph line you calculated-- the 'semilog' graph as Dr. Allen explained-- is the portion of the graph we're interested in.·I·didn't know·that sort of a·graph line is called a semilog graph and so I learned something new today, thanks to both of you. You did a good job with the calculations, Sean. Good work indeed. Andrew, Mike, Justin, and Dylan, I'm looking forward to seeing your calculations too.
Now you're (all) seeing how the math you studied last year can be used for practical purposes.·Were you and your math class mates introduced to logarithms last year? Don't confuse a logarithm with an algorithm...they're two different things that are somewhat related. We need the semilog numbers so we can use them in the algorithm that goes in the program code... I think!
I have the ASP-2 running right now. It'll run for about 20 more minutes before I adjust the millivoltage to 1,0000 mV and then put CO2 on the sensor to see what happens. Hopefully the millivoltage will decrease...! The numbers are rising steadily and I can·visualize·a graph line developing already. What to do if I blast the sensor with CO2 and nothing happens...?
+++++++++++++++++++++++++++++++++++++++
Andrew,· Sylvie, and Dr. Allen,
·· Do you think we should all be using the same version of the program? The version I'm running right now Andrew, is not the same version that you used to get the data and graph you posted.
I'll update everyone with the results, graph, and data·from the trial I'm running right now a little later·in the·evening.
I have about 200 pounds of excellent Ordovician fossils that I found for class this fall. I even found Phacops rana...!
Back from safari in Ohio.
Mr. Kibler
I haven't really learned a lot about logarithms yet. I believe we will be learning more about them this upcoming year.
Mr. Kibler,
It would indeed be logical for consistency for everyone to use the same program. Now that I think about it, I'm not exactly sure why we used this program at our last practice to capture the data, but thank you for pointing it out. For consistency, could you please upload the program you are using?
Welcome back to New Hampshire!
Thanks,
Andrew
It looks to me as though that code never turns on the heater. There are two "HIGH 4" commands in the code, but both are commented out, and shouldn't do anything. Does it look that way to you? Am I correct that pin 4 is the one driving the CO2 sensor's heater?
There is a call to Carbon_collect which seems to simply read the status of pin 3. This is leftover from when you were just simply reading whether or not the alarm on the sensor was active. It is immediately followed by a call to MCP_get, which is meant to read the 3202's output into that same variable (CO2pp), and this happens before CO2pp is written to the logger, so it shouldn't be affecting anything, but it should be removed from the program, assuming Tracy agrees.
MCP_get has this:
So you're reading Channel 1 into CO2pp, printing it on the screen, then reading Channel 0 into CO2pp, and printing that on the screen. There's a comment that says "variable CO2pp will be logged on flash drive" after the read of Channel 1, but it is not·logged·until after the Channel 0 reading has been put into CO2pp. If I'm reading your code correctly, it's the reading from Channel 0 of the 3202 that you're logging. Is that the one you meant to have in the log file? That is, is Channel 0 of the 3202 the one that is attached to TP1 of the CO2 sensor?
At a higher level, this is what's happening:
- Read Pin 3 status into CO2pp
- Read Channel 1 output from the 3202 into CO2pp and convert to mV
- Read Channel 0 output from the 3202 into CO2pp and convert to mV
- Write the current value of CO2pp to the datalogger
Repeat over and over again.Post Edited (sylvie369) : 7/29/2010 11:23:20 PM GMT
I have not yet learned about logarithms either. I had Algebra my freshman year, and my upcoming sophomore year I will be in Geometry.
Sean
I suggested reusing the one variable, CO2pp, for several different measurements in succession. We were running out of variables, but for purpose of debugging we still wanted to recycle that one variable to look at the alarm status and then the TP2 potentiometer voltage, and then the real deal, the CO2 concentration from TP1. That is the value that is left in the variable at the point where it writes to the thumb drive. The EXCEL file that Andrew posted does look like the file from the thumb drive that would be written by this program. The multiplier to convert the MCP3202 raw counts to milliVolts looks okay. So I have to wonder where the readings near 4V are coming from. And especially, I see what Sylvie observed in the program. HIGH 4 should be turning on the heater, but that line is commented out. Maybe there is a slightly different version of the program floating around.
There is no need to think about the logarithm right now, except to see that it manages to reduce a very steep curve on the XY plane to what looks like a straight line on the MG811 data sheet. When you see it next year in school, now you can say, "aha! I've see that before!" Anyway, for now we are just going to make an approximate the steep curve by taking it in sections. If I don't get to send anything for a couple of days, I'll get back to it on Monday. In the meantime I'll be out among the rocks of the Sierra. No fossils here, Mark. All sweeps of granite.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
··· Safe hiking and enjoy the mountains. Igneous rocks are just as pretty as fossils. Just be careful not to trip and fall on them though, or you'll get a new perspective on what "hard rock" really is...! See you when you get back. We're (still) crunching numbers.
Mark
· Attached is the program I'm using. It's·the most complete and·up-to-date program we have and I don't think any components and/or·essential progarm code·is missing.
===============================================
Tracy and Sylvie,
·OK, here's the latest bugaboo:
1) When I run the attached progam with "HIGH 4" not commented out, the millivoltage for "CO2 ppm" plummets to '0' and stays there. Checking the voltage at the test point (TP) confirms this and the voltages are in agreement.
2) When I comment out both "HIGH 4" commands the millivoltage for "CO2 ppm" is·stable. It jumps around for 30 seconds or so but then it increases and stabilizes as it did in Tracy's graph (over 20 -30 minutes.) Otherwise the program is functional... except that it doesn't respond to CO2 because the heater isn't on!
Puzzled about what to do now,
Mark
Post Edited (Mark in NH) : 7/30/2010 4:40:59 PM GMT
There's a line in the constant declaration section that reads
Now, if that's really where the wire goes, that's a problem. The control from Pin 4 to the sensor should go to the CNTL pin on the sensor, not to TP3.
[noparse][[/noparse]Continuing to look...]
Mr. Kibler,
I'll be sure to test the program you are using on Phiddipidies shortly and let you know the results. What you are encountering seems rather interesting. I'm rather curious to know whether it's a problem with how the ASP-2 is currently configured or if the problem is lurking in the program.
Stay tuned,
Andrew
··· OK, whatever the glitch was it seems to be remedied. I think it was one of two things:
1) A loose wire (likely), or
2) The program doesn't like it when P4 is used for the HSW (heat switch) wire.
··· I reassigned P4 as P14 and then I changed the line in the program to read 'HIGH 14' instead of 'HIGH 4'. This command turns the HSW on. After I did that, I ran a 1 hour,·2 minute trial and the graph and data look great (see attached graph and data.) Right now I'm running the second trial. The heat switch is definitely on, the raw data looks good coming out, and I'm almost ready to expose the sensor to CO2 again to see if we get the same result. I suspect we will.
Again, I think it may have simply been a loose wire all along and so it's important that we solder the wires onto perfborad to remedy the problem permanently. Christopher and I started soldering today-- our first-ever try at soldering perfboard-- and·suffice it to say that our first attempt was ugly and it didn't work. I have everything we need to·solder at our next practice.
Sylvie , I'm headed to town shortly to get the·'Solder Off' you suggested weeks ago, for obvious reasons.
=====================================
Sylvie,
·· While this seems a little confusing at first glance:
CNTL···· PIN 4······ ' Wire comes from the CH1 pin on the ADC breadboard to TP3 on the CO2 sensor
I believe it is correct. In any event the ASP-2 works with it wired like this. Here's how the sensor is wired:
A) The wire from CH-0 on the breadboard/ADC is soldered to TP-1 on the CO2 sensor.
The wire from CH-1 on the breadboard is soldered to TP-3 on the CO2 sensor.
C) The wire from the HSW (CNTL) pin on the CO2 sensor goes to P4 (currently P14) on the BOE.
D) The wire from the ALM pin on the CO2 sensor goes to P# on the BOE.
E) VIN goes to VIN.
F) Vss goes to Vss.
Later this evening we'll change the wire back from P14·to P4 to see what happens.
========================================
You think Tracy will be OK hiking way up in the mountains? I didn't know he was a Mountain Man ('Jeremiah Johnson Allen'?)
What have you been up·having survived the Storming of the Bastille? Which great holiday is next?!
Ciao,
Mark
·· What if we put the ASP in a vacuum chamber and·evacuated all the gases? Would that·work to give us a zero point for·CO2 concentration/ millivoltage? The CO2 concentration in a vacuum should be O ppm, right. We do have a·bell jar/ vacuum·chamber. We used it last year to trigger the MAWd altimeter.·When pressure in the bell·jar decrease the MAWd activated. That's how we·knew it worked before we flew it in Nevada.
If we do use the vaccum chamber to determine millivoltage at 0 ppm, what would we use for the second (third, etc.) data points so we can draw a graph line?
++++++++++++++++++++++++++++++++++
Christopher and I did troubleshooting today since we have one operational and one 'troublesome" ASP-2 clone. We determined that, of the three CO2 sensors we have, two are bad. So we ordered two more.·We also had a faulty ADC chip and so we replaced it. After we figured out what works and what doesn't we started the hardwired (solder) the components onto perfboard (again.) Today's work was easier since we had a better idea what we were doing (and the Solder Wick stuff really worked well!) We also bought one of those adjustable gizmos with a magnifying glass, alligator clips, etc., which made holding the parts we were soldering much easier. But after an afternoon's work the ADC chip board didn't work. We got 2500 for CO2 mV, and also 2500 for CO2 ppm. When we disconnected the Vss (ground) wire from the perfboard the 2500's went away, replaced by seemingly random numbers...
Today was a real learning curve·about soldering. We have one less ADC chip (soldered permanently onto perfboard), one less piece of perfboard, a few less resistors and wires, but a wealth of new knowledge! Onward and upward. We're getting there (*and the breadboard/ ASP-2 clone still runs flawlessly.)
What are you up to? How do you think Tracy is faring in the wilderness? I wonder how cold it is up in the mountains?
Mark
·
Mr. Kibler,
I believe someone mentioned a pure helium environment to get a zero point for CO2 levels / millivoltage. However, I am not sure why pure helium was chosen. Could someone perhaps explain this to me? It has me curious ...
That sounds like quite a bit of defective parts for one day, eh? Do you think we fried some of them during our "experiments" or perhaps defective upon arrival? I may have missed in a previous post, but which wiring schematic are you using as a reference?
I hope some of those extra MCP3202's I ordered came in handy! I'm eager to see what the ASP-2 components look like on a perfboard, as I believe this will be the first time we haven't used a breadboard in our projects.
Andrew