A proximity sensor is an electronic device, used to sense or detect the presence or approach of nearby objects without physical contact. So these sensors change the data on the object’s presence or movement into an electrical signal. Generally, detection systems are available in three types of systems that perform this conversion. The systems that utilize the eddy currents that are generated within metallic sensing objects through electromagnetic induction, the systems that notice changes within electrical capacity whenever approaching the detecting object, and finally the systems that utilize magnets as well as reed switches. Thus, there are different kinds of proximity sensors like; inductive, capacitive, photoelectric, and magnetic. This article provides an overview of a capacitive sensor, its workings, types, and applications.
What is a Capacitive Sensor?
A type of proximity sensor used to detect nearby objects through an electric field strength effect produced by the sensor is known as a capacitive sensor. These proximity sensors are related to radar because they detect electrical components when monitoring & insulating wood or plastic materials.
Thus, a capacitive proximity sensor detects and measures different things like; movement, displacement, electric field, and chemical properties.
Thus, it can also detect many other variables indirectly that can be changed into dielectric constant (or) motion like; pressure, acceleration, fluid level & fluid composition. So this sensor will produce an electrical field from the detecting end of the sensor to detect these targets and also detect any object that can interrupt the electrical field.
Examples of capacitive sensors are; Human interface devices like touch pads. Sometimes, mobile phones, tablet computers, and Digital audio players use capacitive sensing touch screens like input devices. So these sensors replace mechanical buttons.
Capacitive Sensor Formula:
A capacitance sensor includes two metal plates which are separated by a ‘d’ distance and an ‘A’ area. So, the ‘C’ capacitance between two junctions can be measured with the below expression.
C = ϵ0×ϵr×Ah
Where,
‘C’ is the capacitance in Faradays.
‘‘ϵr’ is the relative dielectric constant of an insulator.
‘ϵ0’ is a dielectric constant for open space
‘A’ is the overlapping region of two capacitor plates.
‘h’ is the gap width between two capacitor plates.
Capacitive Sensor Working Principle
The capacitive proximity sensor has an HF oscillator with a sensing surface that is shaped by two metal electrodes. Whenever a target approaches the sensing surface, then it penetrates the electrode’s electrostatic field & alters the oscillator’s capacitance. Thus, the oscillator circuit begins oscillating and alters the output condition of the capacitive sensor once it attains a certain amplitude. When the object leaves the sensor, the amplitude of the oscillator will be reduced by switching the capacitive sensor back to its early condition.
A capacitive proximity sensor’s typical sensing range is from a few mm to about 25 mm but some type of sensor range can be extended up to 2 inches. This sensor detects the target’s larger dielectric constant easily, so this makes the detection of the material in nonmetallic containers because the liquid contains a much higher dielectric constant as compared to the container. So it provides the ability of to sensor to observe through the container to detect the liquid. For proper function, they must be utilized in quite constant temperature & humidity environments.
Types of Capacitive Sensors
There are different types of capacitive sensors analog, miniature, high temperature, and cylindrical which are discussed below.
Miniature Capacitive Sensor
Miniature capacitive sensors are available in a cylindrical or wafer shape which can be arranged within the smallest of spaces. The main function of this sensor is to check machine processes constantly & function as detectors mainly for job counting. To afford the finest fit within fixed spaces, these sensor heads need an external amplifier where the potentiometer on this amplifier permits sensitivity adjustment.
Analog Capacitive Sensor
The analog capacitive sensor working is the same as a normal capacitive sensor, although it provides extra benefits based on its usage. These types of capacitive sensors are outstanding for thickness monitoring, concentration difference & material selection as compared to other applications.
High-Temperature Type
High-temperature type capacitive sensor is applicable wherever the sensor head is subjected to very high temperatures. So these sensors can detect liquids, bulk goods, and temperature levels even in the most severe conditions whenever it is in direct contact with temperatures and hot materials.
Cylindrical Type
The cylindrical type sensor is bigger as compared to miniature sensors which range from 6.5 ∅ to M12 & M12 to M30. This capacitive sensor has an uneven sensing distance, different housing widths, and flush & non-flush mounting options. So these sensors mainly detect level (or) give direct contact-free closeness detection throughout a container wall.
Capacitive Sensor Alarm Circuit Diagram
The capacitive sensor alarm circuit is shown below which utilizes electrical capacitance to notice the existence of close by objects by triggering an alarm whenever someone approaches a particular range. Thus, it is an extremely efficient method to detect intruders & defend your property.
The required components to make this circuit mainly include; a 12 V Relay, BC107 & BC517 transistors, capacitors like; 10 nF polyester, 100 μF electrolytic, 10 nF polyesters, 680 pF ceramic, and 10-60 pF. Resistors like; 1k, 470k, 10k & 3.3k, Diodes like; 1N4148, 1N4007 & 1N1448 and self 1 mH coil.
Connect the circuit as per the diagram shown above. First, connect the circuit to a power source and make sure that the relay is turned off or not. Situate a metal dish close to the capacitive sensor and notice if the relay is switched on. Change the variable capacitor value to modify the frequency of the oscillator & again test the circuit.
Test the sensitivity of this circuit by shifting the metal dish nearer to the sensor and check if the relay switches are turned on/off accordingly. At last, test the capacitive sensor circuit with someone approaching & touching the metal dish and observe if this circuit switches off the relay.
Working
This is a simple circuit that utilizes a transistor like an oscillator to activate a relay. This circuit simply works with the transistor like an HF oscillator, where its frequency is decided by the JAF1 choke & the parasitic metal dish capacitance is connected simply to its collector. After that, the high-range frequency signal is removed from the emitter throughout the C3 capacitor & transmitted to a pair of DS1 & DS2 diodes, which change it into a positive DC voltage.
After that, this DC voltage is sent to the base terminal of a TR2 transistor so that it activates the relay. Whenever an object approaches near (or) contacts the capacitive sensor dish, then the oscillator stops & the base terminal of the TR2 transistor no longer gets positive voltage, so it turns off the relay.
To regulate the oscillator’s operating position, a C1 adjustable capacitor is arranged in between the emitter and collector terminals of the TR1 transistor. So a DL1 diode can also be connected with the relay winding in parallel to specify whenever the relay is turned off. This circuit functions at approximately 500 kHz frequency because of the JAF1 1 mH choke. But, by regulating this component value, the circuit works at various frequencies.
Capacitive Proximity Sensor Interfacing with NodeMCU
The capacitive proximity sensor is an electronic device that detects the occurrence or nonexistence of liquid or solid objects without touching them physically. So this sensor works simply by emitting an electrical field. Whenever any object approaches the capacitive sensor, then it changes the electrical field to change the sensor’s capacitance.
So this change can be noticed & changed into an electrical signal that can be utilized by other electronic type devices. Generally, these sensors are used in touch screens & other applications wherever a non-contact sensing technique is necessary. Thus this circuit operates with a +12V to +24V AC/DC power supply.
Thus, the required components of this interfacing include; a capacitive sensor, Arduino board, resistors; 12K & 4.7K, and connecting wires. The connections of this interfacing follow as;
- The capacitor sensor’s Vin pin is connected to a +12V supply.
- The GND pin of the sensor is connected to the GND pin of NodeMCU.
- The OUT pin of the sensor is connected to the D0 pin of NodeMCU.
Code:
The required code for capacitive sensor interfacing with NodeMCU for detecting solid (or) liquid objects is shown below.
const int SENSOR_OUTPUT_PIN = D0; /* Capacitive sensor O/P pin */
void setup() {
pinMode(SENSOR_OUTPUT_PIN, INPUT);
Serial.begin(9600); /* Define baud rate for serial communication */
delay(1000); /* Power On Delay */
}
void loop() {
int sensor_output;
sensor_output = digitalRead(SENSOR_OUTPUT_PIN);
if( sensor_output == HIGH) {
Serial.print(“Object detected\n\n”);
}
delay(100);
}
The above code begins by defining the pin of NodeMCU to the capacitive sensor’s data pin.
Initially, need to set the baud rate at 9600 for serial communication.
After that, we have to declare the capacitive sensor pin as INPUT to get the data from the sensor.
Thus, in the loop function, utilizing the digitalRead function, the sensor output is detected & stored within the sensor_output variable.
So, once the sensor’s output goes HIGH, we will print the output as Object Detected on the Serial Monitor.
Difference b/w Capacitive Sensor Vs Inductive Sensor
The difference between a capacitive sensor and an inductive sensor includes the following.
Capacitive Sensor |
Inductive Sensor |
A capacitive sensor is a proximity sensor that detects solids or liquid targets without any physical contact. | An inductive sensor detects ferrous metal targets exclusive of physical contact. |
A capacitive sensor uses a capacitive plate to produce an electrostatic field. | An inductive sensor uses a coil to produce an electromagnetic field. |
This sensor detects any material like conductors and insulators. | It detects metals like iron, copper, aluminum, etc. |
This sensor works at a low switching frequency. | This sensor works at a faster switching frequency. |
A capacitive sensor detection range is from 2 to 50mm. | An inductive sensor detection range is from 0.8 to 100mm. |
It is not flexible to contaminants. | It is flexible to contaminants. |
This sensor includes a plate, an oscillator, a trigger circuit & output circuit. | This sensor includes a ferrite core including coils, an oscillator, a Schmitt trigger & an output amplifier. |
The capacitive sensor uses electric fields to sense objects. | This sensor uses magnetic fields to sense objects. |
These sensors are expensive. | These sensors are much cheaper. |
Characteristics
The capacitive sensor characteristics include the following.
- These sensors detect Non-metallic targets.
- It detects small and lightweight objects.
- This sensor in object counting applications provides a higher switching rate for quick response.
- This sensor helps in detecting liquid targets throughout non-metallic barriers.
- It has a long operational life with almost limitless operating cycles.
- These are perfect for high-volume sorting and high-bandwidth measurement applications.
- This sensor provides an extremely high resolution which is only matched by the laser interferometer.
- Its common resolutions range from 0.1 nm to 50 nm.
- Its operating ranges are normally < 3 mm.
Advantages & Disadvantages
The advantages of capacitive sensors include the following.
- The capacitive sensor detects various kinds of materials like liquid, metal, plastic, and skin.
- It is contactless & wear-free.
- This sensor is capable of sensing up to a large distance with tiny sensor sizes.
- It is a less powerful solution.
- This sensor detects non-metallic targets through certain kinds of containers.
- It is very simple to design & adjustable.
- It identifies solid targets & liquids.
- This sensor is not expensive.
- This sensor sensitivity is greater & operates with a small force.
- It measures pressure, humidity, and force among other things.
- This sensor has high resolution & a broad frequency response.
The disadvantages of capacitive sensors include the following.
- Capacitive sensors are very sensitive to changing ecological conditions like humidity & temperature which affect their performance.
- Capacitance measurement is not easy as compared to resistance measurement.
- These sensors are not accurate as compared to inductive sensors.
- It has high output impedance and poor load capacity.
- Parasitic capacitance impact is large.
Applications
The applications of capacitive sensors include the following.
- Capacitive sensors are used frequently to detect changes within a conductive target position. So these can also be quite helpful in measuring existence, density, thickness, and non-conductor location.
- These sensors detect velocity, proximity, position, fluid level, humidity & displacement.
- Capacitive sensors are utilized in the wood-processing industries & agriculture for solids and liquids level querying.
- Wind turbines need different control & monitoring data. These sensors are utilized in different applications for transmission lubrication level detection & coolant within wind turbines.
- This sensor is used for non-mechanical manual detection within mechanical control units in the material and storage handling sector.
- It is used in different medical devices which range from defibrillators to cardiac monitors to measure if the medical device is properly arranged & provide feedback to the staff. So that engineers use this data to decide what adjustments need to be taken to enhance its operation.
- Thus, these are used in current smartphones, laptops, or tablets to recognize the human finger positioning on the display and allow gesture recognition.
- It can be incorporated into machinery or industrial robots to sense various objects mainly for switching. So these are easier & cheaper to incorporate into automation solutions as compared to other frequently used sensors.
Thus, this is an overview of a capacitive sensor, its working, and its applications. This is an electronic device used to detect solid (or) liquid targets exclusive of physical contact. Thus, for detecting these targets, this sensor emits an electrical field from the detecting end of the capacitive sensor. So any target that can interrupt this electrical field can be noticed by this sensor. These sensors are robust and fast to measure the existence of an object. So, here is a question for you, what is the inductive sensor?