Académique Documents
Professionnel Documents
Culture Documents
A capacitive liquid sponsor relies on the fact the the capacitance or charge
between 2 metal plates will change (in this case increase) depending on what
material is between them.
This allows us to create a level sensor that is safe for use with any liquid, this
one will be used in a buggy with gasoline (petrol).
One plate is hooked to ground. The other connects to pin 23. There is a 820K
ohm resistor from pin 22 to 23. The sensor works by charging the capacitor (the
water bottle) and measuring how long it takes to drain through the resistor.
Step 1: Parts
1. A solder-less bread board is strictly not needed but make it a lot easier,
especially if you plan to add other stuff later.
2. Arduino, I'm using an Arduino mega but a standard one should have just
enough pins.
3. LCD character display.
4. Some odds and ends including some wire and a 1M resistor.
5. A computer, you know, that thing your using to read my instructable
with.
6. Patience.
Like every step in this instructable there are many ways to do this. I will
show you my favorite.
Your lcd has 16 throe hole solder pads so the first thing is to attach
some pins. If your patent then I recommend purchasing a header like this
http://www.sparkfun.com/commerce/product_info.php?products_id=117.
But if you want to get done as fast as possible (like me) then you can use
wire.
Simple cut 16 pieces of wire at about 1/2" (13mm (longer is okay)). Then
solder them to the board.
Sins I'm using special characters I will be connecting all the wires.
Pin 1 Ground
Pin 2 +5 Volt
The usb port on you computer has enough power to run the Arduino and led
back-light so just connect the ground and power rails on you bread board to
the power out on the Arduino board.
For testing i used aluminum foil and a plastic water bottle, It will work with
any container so long as it isn't metal.
You can use any type of wire but any non shielded lines will provide poor
performance.
Step 7: Programming
void loop() {
long fuel;
lcd.createChar(2, block);
long start = millis();
fuel = cs_22_23.capSenseRaw(200);
//Temratue makes a bit of a difrence so let it run for 5 min before tuning.
//Adjust this number so that the output is as close to zero as posible.
fuel = fuel - 7200;
//Then fill up the conataner
//Un-comment and adjust this so that the output, when the container is
full,
//is as close to 100 as possible.
//fuel = fuel / 93;
lcd.setCursor(0,0);
lcd.print(" ");
lcd.setCursor(0,0);
lcd.print(fuel);
if (fuel >= 6) {
lcd.setCursor(1,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(1,3);
lcd.print(" ");
}
if (fuel >= 12) {
lcd.setCursor(2,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(2,3);
lcd.print(" ");
}
if (fuel >= 17) {
lcd.setCursor(3,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(3,3);
lcd.print(" ");
}
if (fuel >= 23) {
lcd.setCursor(4,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(4,3);
lcd.print(" ");
}
if (fuel >= 28) {
lcd.setCursor(5,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(5,3);
lcd.print(" ");
}
if (fuel >= 34) {
lcd.setCursor(6,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(6,3);
lcd.print(" ");
}
if (fuel >= 39) {
lcd.setCursor(7,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(7,3);
lcd.print(" ");
}
if (fuel >= 44) {
lcd.setCursor(8,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(8,3);
lcd.print(" ");
}
if (fuel >= 50) {
lcd.setCursor(9,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(9,3);
lcd.print(" ");
}
if (fuel >= 55) {
lcd.setCursor(10,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(10,3);
lcd.print(" ");
}
if (fuel >= 60) {
lcd.setCursor(11,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(11,3);
lcd.print(" ");
}
if (fuel >= 64) {
lcd.setCursor(12,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(12,3);
lcd.print(" ");
}
if (fuel >= 69) {
lcd.setCursor(13,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(13,3);
lcd.print(" ");
}
if (fuel >= 74) {
lcd.setCursor(14,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(14,3);
lcd.print(" ");
}
if (fuel >= 78) {
lcd.setCursor(15,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(15,3);
lcd.print(" ");
}
if (fuel >= 83) {
lcd.setCursor(16,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(16,3);
lcd.print(" ");
}
if (fuel >= 87) {
lcd.setCursor(17,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(17,3);
lcd.print(" ");
}
if (fuel >= 92) {
lcd.setCursor(18,3);
lcd.print(2, BYTE);
} else {
lcd.setCursor(18,3);
lcd.print(" ");
}
if (fuel >= 96) {
lcd.setCursor(19,3);
lcd.print("F");
} else {
lcd.setCursor(19,3);
lcd.print(" ");
}
delay (50);
}
Step 8: Stuff
This is perfect for measuring volatile liquids, even works inside a propane
tank.
Have fun.