measuring capacity - water level measuring (CapitiveSense lib)


hi,

i want create water level meter based on measuring capacity.
proof of concept good, have following problem:

- when arduino starting , sensors connected (pins 8,9) values - sensor output giving ~0.
- when disconnect wiring pipes , connect again (arduino powered up), shows value.

how calibration in code? want correct number @ beginning no manual disconnecting , connecting.

hope explained well.

thanks

code: [select]
#include <stdlib.h>

#include <capacitivesensor.h>

/*
* capitivesense library demo sketch
* paul badger 2008
* uses high value resistor e.g. 10m between send pin , receive pin
* resistor effects sensitivity, experiment values, 50k - 50m. larger resistor values yield larger sensor values.
* receive pin sensor pin - try different amounts of foil/metal on pin
*/
capacitivesensor   cs_8_9 = capacitivesensor(9,8);     // 10m resistor between pins 4 & 2, pin 2 sensor pin, add wire , or foil if desired



void setup(void) {
  serial.begin(9600);
 
   cs_8_9.set_cs_autocal_millis(0xffffffff);
   
}

void loop(void) {
   
    long start = millis();
    long total1 =  cs_8_9.capacitivesensor(30 );
   
    serial.print(millis() - start);        // check on performance in milliseconds
    serial.print("\t");                    // tab character debug windown spacing

  serial.print("\n");
serial.print("capacity: ");
   serial.print(total1);   // print sensor output 1
  serial.print("\n");
 
}


capacities sensor - pipe , rod inside.
1 wire rod, 1 wire pipe (on picture 2 more wires, not connected)

ok. have use capacitivesensorraw instead of capacitivesensor.

long total1 =  cs_7_8.capacitivesensor(30 );
long total2 =  cs_8_9.capacitivesensorraw(30 ); //-> results

or there better solution?
   


Arduino Forum > Using Arduino > Project Guidance > measuring capacity - water level measuring (CapitiveSense lib)


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support