Tom -You can't have the sketch because it is mostly all my infrastructure code, but here is the sampling code:
Can I get your sketch to look over? Also, the new eTape only has three pins, not 4 so I am not sure this would work for me.
#define SCALE_OFFSET 700UL // beginning of reading @ 0.700 inches
#define SCALE_MULT 11300UL // amount of scale to reach 12.000 inches
#define SCALE_DIV 872UL // divisor to convert reading to inches (872 over the 11.300 inch range)
unsigned long measure=0;
...
/******************************************************************************
*
* readLiquidLevel()
*
******************************************************************************/
void readLiquidLevel(void) {
unsigned int reading;
analogReference(EXTERNAL);
digitalWrite(VSenseEnable, HIGH); // turn on the Amp and Sensor
delay(20);
reading = analogRead(VSensePin);
digitalWrite(VSenseEnable, LOW);
diff=1023-reading;
measure = (((unsigned long)diff*SCALE_MULT)/SCALE_DIV)+SCALE_OFFSET;
}
Thanks Tom, your setup seems a lot more complicated than mine so for now I will stick with trying to see what is sucking my battery dry :-)You need to sleep everything and keep all sensors very low power or even cut power to them when not in use. That's really the main thing that dries your batteries.
Tom,
Can you post the circuitry? It was a little hard to digest for me mentally, my transistor theory is a bit rusty.
Tom,I did post the pdf, but attached is a zip file with the Eagle files. Note that this was implemented on a PCB with another circuit so the PCB dimensions are about 2X the size needed for the liquid level sensor.
Can you post the circuitry? It was a little hard to digest for me mentally, my transistor theory is a bit rusty.
One of the biggest prolems with arduino's is the measurement of resistive sensors. It's nearly impossible to use the full range of the ADC. This results in very poor resolution that requires a ton of filtering to account for. In low power scenarios that filtering is expensive.You are right, if you don't use the ARef input, it is very difficult to get a full range reading and, given the relatively low input resistance of ARef pin, you need the voltage follower Op Amp for any circuit with any appreciable source resistance.
If I'm understanding the way your setup works it sounds like am amazing way to measure any resistive element (photo resistor, thermistor, etc) at a high resolution and at low power.