Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

1 wire and adc water sensor

Status
Not open for further replies.

Dr_Doggy

Well-Known Member
Was thinking about purchasing one of these:
https://www.miniinthebox.com/water-...iquid-level-sensor-circuit-board_p903356.html

but does not suit my dimensions, so i am thinking of doing my own, but i want to confirm that the circuit is 3 verticals wires, +/gnd, and analog point in between, and when the level changes so does the adc value? i just want to confirm since i dont really get how the change in water level in both resistances causes a change in adc, I just have feeling its not as straight forward as it looks,

also since i need to do my own , i was thinking about putting a PIC right on the board, and use the icsp dat as a data pin for 1 wire.... will use clk pin and serial protocol if i need to...
but if i can use 1 wire that would be great, but i wonder if there is source code for 1-wire slave device , lots out there on 1-wire host, but nothing for slave, even arduino code could help that i can translate

thanks!
 
i just want to confirm since i dont really get how the change in water level in both resistances causes a change in adc, I just have feeling its not as straight forward as it looks,
Could be a pretty primitive circuit. Looks like 3 resistors, 1 transistor, 1 LED. Perhaps 2 resistors bias the transistor base near 0.6V, the interdigitated electrode array bridges one of those bias resistors, and the third resistor plus LED are the collector load? But looks can be deceptive. Hopefully someone here knows how it works.
 
i noted transistor too, was like what!?
so a typical volt divider with bjt?,
if R2 is constant resistor,
***would r1 value change with submersion level of probes?
maybe this R1 change is so low it needs transistor?

maybe i should start from scratch? how should i approach for analog output?

i have considered other sensor types, such as ultrasound and shift register methods, but my height is max 1.5 ft , diameter 1" max, plus would like good resolution, specifically at top and bottom.

any low cost ideas for substitutes maybe?
 
yes, but a bit of fear with ac signal

was thinking about using perf board with stripped phone wire "stitched" through it, and maybe i could detect capacitance discharge time with timer and digital input?
 
a bit of fear with ac signal
No worries. The capacitance is likely to be small. It can be made the frequency-determining component in a simple Schmitt-based oscillator. A MCU could readily sense the frequency and compute liquid level.
The perf board is worth a try. It would need to be non-absorbent.
 
.... actually in my search i found this:
https://i.stack.imgur.com/oWIi9.png

with some pvc pipe i could coat the OD with anode tin foil & glue and then the ID with a small chunk of foil for cathode to supply electrons to the water level... that would make a good capacitor(even if water flows)?

.. and if water flow changes capacitance , could I exploit that to have a flow meter as well on another pipe?


also i have heard of leds that can act as touch photo sensors for fingers on a digital line if the output pin is reversed to input , something about capacitance in the LED there too.

if not then could you provide details of how Schmitt-based oscillator can be applied with micro controller?
 
good idea about capacitance Alec,
it really was as simple as some pvc pipe and foil, hooked directly to a digital I/O pin and ground, along with simple code:
while(1){
setpin1 output;
setpin1 on;
delay(1000);
setpin1 input;
counter = 0;
while (pin1=1){counter++;}
}

I tried 2 configurations:
1) OD wrapped foil anode and foil ball for cathode
2) two foil balls at each end of pipe

pipes.jpg

I found the first one to work better, plus with the OD foil wrapped over to the ID it causes immediate drop to 0v in the event of overflow, the only thing i notice as a problem is that the discharge time varies when my hand gets too close to either of the nodes, I worry that other outdoor environment factors may cause similar problems

any way i can compensate for this, maybe something like another foil layer tied to ground to act as Faraday cage?

also/or maybe it will be better if i move ground wire of pipe to another digital pin so i can truly flip polarities?
 
could you provide details of how Schmitt-based oscillator can be applied with micro controller?
Here you go :-
CapacitiveSensorOsc.JPG
any way i can compensate for this, maybe something like another foil layer tied to ground to act as Faraday cage?
Worth a try. If you can connect one of the two electrodes to ground (as per my circuit) that should help, but body capacitance to ground might still affect results.
 
With your measurements, did you manage to get values for probe capacitance as a function of immersion depth?
 
yes, it worked surprisingly well, as water depth changed, discharge times changed, only problem was that when i would touch it, the discharge time would drop significantly

will try more tonite...!
 
lol, ya, i think that too, but if my fingers can cause such huge anomalies, maybe i need to worry about grasshoppers and rain too..?
 
Why is rain a problem? I thought this was a water sensor! Don't know how the dielectric constant of grasshoppers compares to that of water. That's an experiment for you to do :). Market this as a grasshopper sensor?
 
or a fly, or other outdoor things, it just seems very sensitive like it may respond if i even blow on it, which i'll try later too!

my fingers cause such huge anomalies, the average count output with the water is about 12000 - 22000 ticks, when i touch it count dropps to 6000, when water gets between contacts it dropps to 0. i just know it needs another protective layer...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top