Use of load cell for monitoring specific gravity of liquid over time/arduino uno

So I'm not sure if it is well known in the electronics/Arduino circuit, but the Arduinos are getting a big following in the home brewing world. I myself am not the most savvy person when it comes to utilizing the power of the Arduino, but I do recognize its ability along with its limitations.

So my goal:
To use a load cell to monitor the weight of an object suspended in a liquid to determine the change in specific gravity over time. This will be used for home brewing where I intend to monitor the fermentation of my beer until it has reached its "terminal gravity" as brewers would call it.

The Set up:
Arduino Uno (hopefully)
http://www.amazon.com/American-Weigh-Scale-Ac-100-Digital/dp/B003O5K3JQ/ref=sr_1_1?ie=UTF8&qid=1394680597&sr=8-1&keywords=ac-100+digital+scale (100 gram scale - capacity in .01 gram increments)
1NA125P Inst. Amplifier
Appropriate extras to accommodate circuit
LCD (For temperature/specific gravity readout)
SD card shield for data logging (Added for future use)

The question:
So really this is a multifaceted question, but my first question (and the point of this thread) involves the feasibility of this small project.

The facts:
First the AC-100. I broke it open and checked out the load cell. It is a four wire load cell that runs at 2.4v excitation, with 10.4mv output at full load. For testing purposes I have left the AC-100 intact.

Planning on running the excitation voltage to the load cell at 5v from the 1NA125P with a gain of roughly 250 to get a full 5v resolution from the sensor circuit to the Arduino. This will be adjusted from a trimmer pot before connecting to the Arduino.

Measuring different objects in air, then pure water, then a solution of sugar water. My observation from doing this is I am seeing roughly a .5 gram change for every 10 points of change in specific gravity from the object I am currently using. The unfortunate thing about this is this leaves the 10 bit resolution of the Arduino Uno just a little lacking in measuring the specific gravity for what I want. It would be able to measure every two points. I would like it to measure every one point of specific gravity, or 1.001.

My resolution is to take the 2.5vref pin from the 1NA125P to the aref pin on the Arduino. My logic says that should double my measured resolution from the load cell if I leave the gain from the 1NA125P the same. If I take an object, who's weight is 100 grams and has a density of 1.5. CPVC for example. Then suspend that object in pure water its weight should be roughly 33.33 grams measured from the load cell. If I were to change the density of the water to 1.001 my expected weight of the object in the water should be 33.2667.

Does this logic makes sense? I would love to hear that it could work, or if there is a better solution I would love to hear it.

Thank you in advance.

very cool! I'm interested to see if this works for you. It sounds like a great solution.
Sadly, I can't help you solve your problem with the load cell. :frowning:
Have you thought of optical recognition of a hydrometer? Perhaps you can use the end of a hydrometer to push up/pull down a linear potentiometer?

Thanks for your vote of confidence.

I have thought about various means to accomplish this little task. As for anything optical, unfortunately, it will not work as fermenting beer creates a foam which would destroy any possibility of an accurate reading. Along those lines placing an object, such as a hydrometer, in the liquid which is only partially submerged would have the same problems from the foam.

I did entertain the idea of using sound, but that method is not documented as well and would be a much greater effort on my part.

It certainly sound feasible from the Arduino/electronic point of view. I'd be interested to see how you would suspend the object in the wort without compromising the seal, and leaving yourself vulnerable to spoilage.

Also, thanks.

I have worked out the object suspension, and sealed enclosure that mounts to the conical for fermenting beer. Ultimately when I have a fully working product, I intend to post the project on Homebrewtalk.com. So if you were interested thats where I would post the project. Hopefully within a month and half or so.

I have cost goals for this as well, hence my use of the Arduino. My cost goal for a working product is $100. Once I achieve that I intend to add data logging as well, which I think will add about $50 bucks to the total cost.

You mentioned using sound. While you're testing your method, and logging (to a PC, no extra cost), it might be worthwhile testing a method using sound, to see if you can see a definite and consistent change in property (speed?, volume?) as the specific gravity changes. I can see where it might be preferable to use a method that is non-invasive.

Would the overall weight of the fermenter change with the decrease in specific gravity? Would it change enough to be measured?
Anyway, OP, please post a link to your homebrewtalk DIY when you complete this.

Thanks,
JR

Before settling on the INA125P you should consider either the ADS1231 (Texas Instruments) or HX711 (Chinese), both 24 bit amplifiers at around the same cost as the INA125P. The problem with the INA125P, as you mentioned, is that while you get an amplified signal you're still shortchanged by the max 10 bits of precision from the Arduino (as you mentioned), and then given the imperfect load cell and such you realistically take yourself down to about 8 bits or less.

I don't know anything about brewing beer so I might be worrying about a non-issue, but if the weight is going to be suspended in the liquid, is there any risk of bubbles forming on the surface of the weight? If so, I think this would skew your weight measurement.

lar3ry:
You mentioned using sound. While you're testing your method, and logging (to a PC, no extra cost), it might be worthwhile testing a method using sound, to see if you can see a definite and consistent change in property (speed?, volume?) as the specific gravity changes. I can see where it might be preferable to use a method that is non-invasive.

I was thinking about the concept of sound after having mentioned it in this thread. Got me thinking a bit. I looked up some quick facts about the speed of sound in water. I need to do more investigation in this though before I can provide an answer at to whether I think it could work or not.

jrubins:
Would the overall weight of the fermenter change with the decrease in specific gravity? Would it change enough to be measured?
Anyway, OP, please post a link to your homebrewtalk DIY when you complete this.

Thanks,
JR

Yes, the overall weight of the entire fermenter would change due to the release of co2 from the yeast. The yeast basically take a sugar chain and break it into pieces, which produces ethanol and co2. The release of co2 could provide a means of monitoring fermentation, as I have read many discussions involving this concept. There are many factors that would have to accounted for beyond the simple co2 release though.

Chagrin:
Before settling on the INA125P you should consider either the ADS1231 (Texas Instruments) or HX711 (Chinese), both 24 bit amplifiers at around the same cost as the INA125P. The problem with the INA125P, as you mentioned, is that while you get an amplified signal you're still shortchanged by the max 10 bits of precision from the Arduino (as you mentioned), and then given the imperfect load cell and such you realistically take yourself down to about 8 bits or less.

Thanks so much for this. This could prove very valuable. I looked into it a bit also. Though I am not afraid of messing around with what I don't know. I am not super educated about digital signals. So incorporating an ADC will take more education on my part to use the device. This does look very promising though. I'll have to look around and see what information I can pull up on using this with an arduino.

PeterH:
I don't know anything about brewing beer so I might be worrying about a non-issue, but if the weight is going to be suspended in the liquid, is there any risk of bubbles forming on the surface of the weight? If so, I think this would skew your weight measurement.

Yes, there is the co2 leaving the fermenting beer will be something I will have to compensate for. Though I don't know to what degree until I get to that point of testing. Thanks for asking though.

I must admit I really appreciate all of your comments. It has made me think about this project from different angles. I really appreciate that.

Facinerous:

PeterH:
I don't know anything about brewing beer so I might be worrying about a non-issue, but if the weight is going to be suspended in the liquid, is there any risk of bubbles forming on the surface of the weight? If so, I think this would skew your weight measurement.

Yes, there is the co2 leaving the fermenting beer will be something I will have to compensate for. Though I don't know to what degree until I get to that point of testing. Thanks for asking though.

PeterH, Typically when you measure your specific gravity, you spin the hydrometer as you add it to the beer . That shakes off any bubbles.
Facinerous , you could just add a little "jiggle" to your suspended weight to shake off any bubbles before taking the measurement. A small servo would provide the necessary motivation , I suspect.

The yeast basically take a sugar chain and break it into pieces, which produces ethanol and co2.

Or, as the head of the Guiness brewery once said (paraphrased, not quoted)…

Yeast is a wonderful thing, a little creature that eats sugar, pees alcohol, and farts CO2.

jrubins:
A small servo would provide the necessary motivation , I suspect.

That sounds like a good idea - maybe one of those haptic vibration motors?

I'm not sure about inducing vibrations into the weight in order to shake loose any attached co2 bubbles. It may be worth it if I see a major effect from the co2 though. Thanks for supplementing that idea. I don't think it would take much additional code, and simply mounting the load cell itself to some type of vibrator (who blushed?) could possibly suffice. It would be additional money, building, design. So if I can avoid it I would rather.

I've been looking into the ADS1231 more. Looks rather simple actually. I think for the fun of it I'm going to try and stick with the INA build first and see what results I can get. That ADS1231 is very inexpensive though, so it wouldn't be to much to go in that direction if I have to. the ADS1231 would simplify the actual circuit, but require a bit more coding at the gain of a massive increase in resolution.

Getting the last parts of the actual build now. Unfortunately I need a specialized weight in order to make this project happen. So that has taken a bit of time designing that. Fortunately I found a good glass worker who could be more enthusiastic than I am, if that is possible. Hoping to have the items required by the weekend, and built by the end of sunday. Then off to testing.

Going back a little bit. For a few numbers, to see if some of you would agree that my numbers are sound.
The scale that I am robbing the load cell from is a 100 gram scale, so I am semi-expecting the total load capacity of the load cell to be around 200 to 250 grams. The excitation voltage of the scale is 2.4v, and the output is 10.4mv. So if I supply 5v excitation to the load cell I should expect roughly 21.67mv. So if I run the 1NA125P at a gain of 230 my output voltage should be 4.98v. The gain will be adjusted through a trimmer pot.

At full scale (assuming full scale being 200 grams) I think I should expect to see a readable weight resolution of about 0.2 gram increments. I intend to use the full scale at 5v to calibrate the device. (note: this is why I needed to reduce the reference voltage from 5 to 2.5)

My special weight I am having made will be 120 grams, and displace 100 ml of liquid. So when the weight is fully immersed in water it should weight about 20 grams.

The specific gravity scale is directly related to density, and typical brewers hydrometers range from 1.200 to 0.90. The typical specific gravity of a beer before fermentation can range from 1.020 to 1.130, and the final specific gravity of the beer would range from 0.95 to 1.020, or there a bouts.

At a change in specific gravity of 0.001, or from 1.000 (water) to 1.001, I can expect to see a change of 0.1 gram from my weight.

From the 5 reference voltage calibration I intend to use, I then plan to change over to a 2.5v for taking readings from the fermentation cycle. The range of weight should vary from 21 grams at a specific gravity of 0.90, and 0.0 grams (or floating) at a specific gravity of 1.200

[edit] I forgot noise filtration:
My idea for noise filtration is to take multiple samples and reduce them to one. My idea for this is to take roughly two samples a second for one minute and store them in an array. I then plan to average all the samples for a basic average. Then throw out all samples taken that are +-10% of the average. This should eliminate noise spikes. Then just take the remaining samples and average them out. I think that should give me a fairly good overall sample through code without including a low pass filter in the circuit.

Of course, with this math. I am right at the threshold of the maximum potential of what the arduino can sense. I could reduce the aref voltage even further to increase my sensitivity. Which is not my original plan, but may just happen. If my plan fails me... Then its off an on the some of the awesome suggestions supplied on in this thread.

On a side note
I just want to say thank you to you all. I have never participated in the arduino community before as this is the first question I have posted, but I am extremely happy with the active people on this forum. I have seen nothing but good support in all the threads I have come across, including this one.

If anyone see any flaws in my logic, please let me know. I know I already posted the concept in the original post. I figured I would supply some raw numbers as well though which is the intent of this post.

The INA125P doesn't output a full 0-5V range. See page 2 of the datasheet (Output). The maximum output "swing" given 5V operation is .4V to 4.1V, typical. Now that means that, given a perfectly manufactured load cell, you're down to a 3.7V range. Of course no load cell is perfect and will always be showing some voltage offset so that 3.7V range will be reduced even more.

Also, when you're adjusting the gain, make sure you have a 50 or 100 ohm potentiometer available. When you're off by just a couple ohms in your gain you quickly lose precision (because you'll be multiplying the aforementioned, imperfect load cell offset) so you'll need low value pots to get things set optimally.

Thanks Chagrin. I've been looking more at the ADS1231. A little confused on the overall method of interface between it and the arduino. Mostly because it appears to use a SPI style interface, but its not true SPI.

I went ahead and put together the 1NA circuit to start the trial testing. I think the chip burned up though. It doesn't give me any proper output, inconsistent at best, and does not change with a varied load on the cell. Plus the actual 1NA chip gets burning hot. Ha ha. Not a good sign at all.

I'm not sure if it was just a bad chip straight up, or if I had wired something poorly. Inspecting the wiring though I suspect the former.

I figured I would just throw this out there. I'm working on it, but sounds like I need a new chip. Along with that I'll just go ahead and get the ADS1231 as well.

Hello, I am also a home brewer and considering building something like yours. Have you thought about using a CO2 sensor for that? As the yeast "farts" the CO2, it produces alcohol at a very precise relation, so the rate of CO2 liberation may give you an indirect reading of gravity. Well, that's how I am going to try to do it, maybe this adds even more angles to your view.

non-arduino question. total noob with brewing.

if you have a mixture and add nothing, just allow the mixture to alter itself, where does the weight come from ?
I can see that off-gassing CO2 would have a change of molecules from one location to another, but I am having a hard time seeing how the weight can change.

density, sure, but the changing of mass eludes me.

PeterH:
I don't know anything about brewing beer so I might be worrying about a non-issue, but if the weight is going to be suspended in the liquid, is there any risk of bubbles forming on the surface of the weight? If so, I think this would skew your weight measurement.

Bubbles do form and make this kind of measurement tricky - some sort of automatic
tapper to dislodge bubbles before a measurement could be an answer... Using a large
volume float would increase the volume to area ratio making bubbles less important.

If the liquid were clear then measuring optical rotation would be another method
as sugar is optically active but water and alcohol are not. This assays sugar directly
of course. The liquid however won't be clear!

The OP intended to suspend a ball, with a density slightly greater than that of beer, into the beer and then watch the weight of the ball. The load cell would report more weight as the density of the beer decreases.