All I wanted was a simple yet long-lasting solution capable of achieving a decent measurement, at least to the tenth of meter, of the water level. The first options that came into my mind were based in submersed contacts (a lot of exposed contacts, where water is used to conduct electricity) or ultra-sound measurement.
The problem with water-contact based measurement is clear: besides the fact that a lot of contacts have to be made in order to achieve a reasonable resolution, the water is a polluted environment and the contacts are likely to accumulate stuff, increasing the resistance. That would shorten the sensor life-time, leading to erroneous measurements.
On the other side, the Ultra-sound method is not only expensive, but also challenging, since we are talking about a closed space, where multi-path reflections are likely to occur.
So I thought about another variable: pressure. Pressure would not be affected by any dirt from water, and will be continuous and analogue to the water level. After some googling, I figured that pressure sensors are quite expensive, so I tried to develop one of my own.
I quickly imagined a paint can, with a wide rubber working as lid, hermetically closed. With the right elasticity, the rubber would go in and out, according to the water pressure. After some calculations I figured out that the full-scale would be around 4200 kg/m^2, which meant a total 1.3kg for the paint can I had. The inner tube of a old car tire revealed to be a perfect rubber because it only deforms about 4cm with 1.5kg.
Then, all it is needed is to detect that change. The simpler idea I had was to make a variable capacitor like the one in the photo.
It is simply made of two isolated strips of kitchen aluminium foil, folded like those toys made by children. The final result is a variable capacitor, which capacitance changes from 1nF to 6nF, when it is compressed from 6cm to 2cm.
The method to measure the capacitance is simply by turning a current source on, and measuring the time it takes to reach a threshold. It is implemented using a MCU (a Microchip 12F675, which has an ADC), and two transistors (one for the current source @ 250uA, and other for the discharge circuit). The threshold is chosen so that the current source is kept in active mode.
Having the pressure-measurement solved, I wanted to challenge myself. I had the idea of implementing some kind of powerline communication for too long, and I wanted to implement something like that within this project, so that only two wires would be needed to power the sensor, and retrieve the measurements.
Having a micro controller, it would be easy to use the clock frequency as carrier, and mixing it with the UART output. On the receiver, some band-pass and envelope detection would be needed. That is a simple ASK system.
Transmitter. "DADOS" is the UART output of the MCU. CLKOUT is the clock output of the MCU, which is 1/4 of the crystal frequency. 1MHz in my case. |
VoilĂ ! It actually works... Pressing the membrane in, reflects a capacitance change, which is sent over the power line.
I am just afraid of placing it inside the tank :p ...but I will... after doing some measurements!
No comments:
Post a Comment