Small Capacitance Measurements (analog capacitive sensor)

I offer the community a small capacitance sensor, operating from almost 0 pF. It can be used in amateur electronics, robotics.

When developing a hobby electronics, I needed some simple distance sensor with a capacitive effect. Searching the Internet, I found only touch sensors, but they have a short response distance and a digital output. Other sensors are too complex or with a long setup. I needed a very simple and cheap, working from a microcontroller. What happened - under the cut ...

Scheme


After several experiments , the circuit appeared in Fig. 1.

image
Fig. 1. The scheme. Microcap 10

How does it work


The principle of operation is based on measuring the charge that has accumulated on the capacitor plate during charging. The second cover is an object brought to the sensor. For modeling, it is shown connected to the "earth", but this is not important.

The capacitor plate is connected to the output of the microcontroller, which is configured to issue a meander frequency of 120 - 180 kHz, in the diagram it is a voltage source V2. Also, the lining is connected to the base of transistor Q1. The emitter is connected to the same generator. Since the MK output is complementary, this means that the output is alternately connected to the β€œ+” power source, then to β€œ0”. What happens during these half-periods:

  • . 1: R1, R2. , , R2 , . , U<0.
  • . 0: 1 R3, Q1 . Β«0VΒ», . , 1.

image

Diode D1 and capacitor C2 form an amplitude detector - a voltage proportional to the capacitance C1 is created on R5. Transistor Q2 is needed to match the resistances with the ADC MK. The output voltage is removed from R6.

The simulation results (Fig. 2) at the ratings shown in the diagram. The linear relationship is approximately maintained up to 10 pF.


Fig. 2. Graph capacitance - voltage.

When R3 is reduced to 2 kOhm, sensitivity increases and the linear section decreases to approximately 0 ... 4 pF.


Fig. 3. Capacitance – voltage graph

Note : a graph rise of about 0 pF is a simulation error, linearity actually continues there. Tested in hardware.

The given circuit differs from others (with diode isolation or bridges and constant inclusion of the BE transistor) in that the capacitance / voltage ratio is available with almost 0 pF, without a dead zone. Also, only one capacitor plate is involved in the circuit.

When executed on the board, the circuit's own capacity is much less than the capacity of one cover - a plate of 20 cm 2 . Sensitivity of the sensor: for a raised hand about 50 mm to the plate - change in the output signal is more than 10%. The estimated change in capacitance is about 2 pF. The sensor does not respond to network interference, EMF and GSM.

Refinements for implementation


  • Transistors should be with an operating frequency of 100 MHz, and a minimum base capacity (here 2 pF).
  • Diode D1 - high-frequency type BAV99, the capacity of a unit pF.
  • C2 in the range of 10 - 30 nF, no longer needed, the output current of the MK increases. To smooth the pulses, you can put a capacitor parallel to R6
  • A 100 ohm resistor R1 limits the output current of the MK, pulse 5mA, an average of 0.2 mA.
  • The microcontroller in this circuit is Atmega8A, the output is a 166 kHz square wave, its ADC. Increasing the frequency above 300 kHz is not recommended, due to the influence of stray capacitances.

Who implements and applies in their crafts - unsubscribe, interesting.

Alternative use.


In the comments under the article, the use of soil moisture as a sensor is discussed. I decided to check if it is possible.

He took the sensor plate 40x60 mm, well wrapped in 4 layers of plumbing tape (for example, sealed). Own capacitance increased, I had to change the ratings in the circuit, reducing the sensitivity to the level of 15 pF. The new diagram is here :
image
Fig. 4. Scheme for soil moisture sensor.

Experiments


I don’t have flat land, there is sand that I poured into a jar with a volume of about 300 ml. I added water every time about 15 ... 20 ml.
image1
Dry sand. Own sensor capacity.

image
Sand + 20ml of water.

image
He also added water and rammed a little.

image
... and more water.

image
... and more water.

image
... and more water.

image
... and more water. It became quite tropical moist.

The voltage was removed from R5, so with an increase in capacity, the voltage increases.
It can be seen that the capacity increases with each topping. However, either this sand, or I don’t know what, but the readings increase immediately when topping up. I expected a smoother change in U when soaking sand with water.

Yes, I know about touch sensors for Arduino with Ali. But I wanted to figure it out myself and do it with the given parameters.

All Articles