Sensors are sources of primary information. Classification of sensors. Types and types of sensors. Shock sensor alarm how to adjust sensitivity

Automation of various technological processes, effective control of various units, machines, mechanisms require numerous measurements of various physical quantities.
Sensors (in the literature often also called measuring transducers), or in other words, sensors, are elements of many automation systems - with their help, information about the parameters of the controlled system or device is obtained.
Sensor is an element of a measuring, signaling, regulating or control device that converts a controlled quantity (temperature, pressure, frequency, light intensity, electrical voltage, current, etc.) into a signal convenient for measurement, transmission, storage, processing, recording, and sometimes to influence controlled processes. Or more simply, a sensor is a device that converts the input effect of any physical quantity into a signal convenient for further use.
The sensors used are very diverse and can be classified according to various criteria:
Depending on the type of input (measured) quantity distinguish: mechanical displacement sensors (linear and angular), pneumatic, electrical, flow meters, speed, acceleration, force, temperature, pressure sensors, etc.
Currently, there is approximately the following distribution of the share of measurements of various physical quantities in industry: temperature - 50%, flow (mass and volume) - 15%, pressure - 10%, level - 5%, quantity (mass, volume) - 5%, time – 4%, electrical and magnetic quantities – less than 4%.

By type of output quantity , into which the input value is converted, non-electric and electrical are distinguished: sensors direct current(EMF or voltage), alternating current amplitude sensors (EMF or voltage), alternating current frequency sensors (EMF or voltage), resistance sensors (active, inductive or capacitive), etc.
Most sensors are electrical. This is due to the following advantages electrical measurements:
- it is convenient to transmit electrical quantities over a distance, and the transmission is carried out at high speed;

Electrical quantities are universal in the sense that any other quantities can be converted into electrical quantities and vice versa;

They are accurately converted into a digital code and allow you to achieve high accuracy, sensitivity and speed of measurement instruments.

By operating principle Sensors can be divided into two classes: generator and parametric (modulator sensors). Generator sensors directly convert the input value into an electrical signal.
Parametric sensors convert the input value into a change in some electrical parameter(R, L or C) sensor.
Based on the principle of operation, sensors can also be divided into ohmic, rheostatic, photoelectric (optoelectronic), inductive, capacitive, etc.

There are three classes of sensors:

Analog sensors, i.e. sensors that produce an analog signal proportional to the change in the input value;

Digital sensors that generate a pulse train or binary word;

Binary (binary) sensors that produce a signal of only two levels: “on/off” (in other words, 0 or 1); have become widespread due to their simplicity.

Requirements for sensors:

Unambiguous dependence of the output value on the input value;

Stability of characteristics over time;

High sensitivity;

Small size and weight;

Absence of reverse impact on the controlled process and on the controlled parameter;

Work at different conditions operation;

Various installation options.

Parametric sensors.

Parametric sensors(modulator sensors) the input value X is converted into a change in any electrical parameter (R, L or C) of the sensor. It is impossible to transmit changes in the listed sensor parameters over a distance without an energy-carrying signal (voltage or current). A change in the corresponding sensor parameter can only be detected by the sensor’s response to current or voltage, since the listed parameters characterize this reaction. Therefore, parametric sensors require the use of special measuring circuits powered by direct or alternating current.

Ohmic (resistive) sensors– the principle of operation is based on a change in their active resistance when the length l, cross-sectional area S or resistivity p changes:

R=pl/S

In addition, the dependence of the active resistance value on the contact pressure and illumination of the photocells is used. In accordance with this, ohmic sensors are divided into: contact, potentiometric (rheostat), strain gauge, thermistor, photoresistor.

Contact sensors- This simplest form resistor sensors that convert the movement of the primary element into an abrupt change in the resistance of the electrical circuit. Contact sensors are used to measure and control forces, movements, temperature, dimensions of objects, control their shape, etc. Contact sensors include travel and limit switches, contact thermometers and so-called electrode sensors, used mainly for measuring limit levels of electrically conductive liquids .

Contact sensors can operate on both direct and alternating current. Depending on the measurement limits, contact sensors can be single-limit or multi-limit. The latter are used to measure quantities that vary within significant limits, while parts of the resistor R connected to the electrical circuit are sequentially short-circuited.

The disadvantage of contact sensors is the difficulty of continuous monitoring and the limited service life of the contact system. But due to the extreme simplicity of these sensors, they are widely used in automation systems.

Rheostatic sensors They are a resistor with varying active resistance. The input value of the sensor is the movement of the contact, and the output value is the change in its resistance. The moving contact is mechanically connected to the object whose movement (angular or linear) needs to be converted.

The most widely used is a potentiometric circuit for connecting a rheostatic sensor, in which the rheostat is connected according to a voltage divider circuit. Let us recall that a voltage divider is an electrical device for dividing direct or alternating voltage into parts; A voltage divider allows you to remove (use) only part of the available voltage through elements of an electrical circuit consisting of resistors, capacitors or inductors. A variable resistor connected according to a voltage divider circuit is called a potentiometer.

Typically, rheostatic sensors are used in mechanical measuring instruments to convert their readings into electrical quantities (current or voltage), for example, in float liquid level meters, various pressure gauges, etc.

A sensor in the form of a simple rheostat is almost never used due to the significant nonlinearity of its static characteristic In = f(x), where In is the current in the load.

The output value of such a sensor is the voltage drop Uout between the moving and one of the fixed contacts. The dependence of the output voltage on the movement x of the contact Uout = f(x) corresponds to the law of resistance change along the potentiometer. The law of resistance distribution along the length of the potentiometer, determined by its design, can be linear or nonlinear. Potentiometric sensors, which are structurally variable resistors, are made of various materials - winding wire, metal films, semiconductors, etc.

Strain gauges(strain gauges) are used to measure mechanical stress, small deformations, vibration. The action of strain gauges is based on the strain effect, which consists in changing the active resistance of conductor and semiconductor materials under the influence of forces applied to them.

Thermometric sensors (thermistors) - resistance depends on temperature. Thermistors are used as sensors in two ways:

1) The temperature of the thermistor is determined by the environment; The current passing through the thermistor is so small that it does not cause the thermistor to heat up. Under this condition, the thermistor is used as a temperature sensor and is often called a "resistance thermometer".

2) The temperature of the thermistor is determined by the degree of heating by a constant current and cooling conditions. In this case, the established temperature is determined by the conditions of heat transfer from the surface of the thermistor (movement speed environment– gas or liquid – relative to the thermistor, its density, viscosity and temperature), therefore the thermistor can be used as a sensor for flow rate, thermal conductivity of the environment, gas density, etc. In sensors of this kind, a two-stage transformation occurs: the measured quantity first is converted to a change in temperature of the thermistor, which is then converted to a change in resistance.

Thermistors are made from both pure metals and semiconductors. The material from which such sensors are made must have a high temperature coefficient of resistance, a linear dependence of resistance on temperature, good reproducibility of properties, and inertness to environmental influences. Platinum satisfies all of these properties to the greatest extent; in slightly less - copper and nickel.

Compared to metal thermistors, semiconductor thermistors (thermistors) have higher sensitivity.

Inductive sensors are used to obtain contactless information about the movements of the working parts of machines, mechanisms, robots, etc. and converting this information into an electrical signal.

The operating principle of an inductive sensor is based on changing the inductance of the winding on the magnetic circuit depending on the position of the individual elements of the magnetic circuit (armature, core, etc.). In such sensors, linear or angular movement X (input quantity) is converted into a change in inductance (L) of the sensor. Used for measuring angular and linear movements, deformations, dimensional control, etc.

In the simplest case, an inductive sensor is an inductive coil with a magnetic core, the moving element of which (the armature) moves under the influence of the measured value.

The inductive sensor recognizes and reacts accordingly to all conductive objects. The inductive sensor is non-contact, does not require mechanical action, and works contactlessly due to changes in the electromagnetic field.

Advantages:

No mechanical wear, no contact-related failures

There is no contact bounce or false alarms

High switching frequency up to 3000 Hz

Resistant to mechanical stress

Disadvantages - relatively low sensitivity, dependence of inductive reactance on the frequency of the supply voltage, significant reverse effect of the sensor on the measured value (due to the attraction of the armature to the core).

Capacitive sensors- the principle of operation is based on the dependence of the electrical capacitance of the capacitor on the size, relative position of its plates and on the dielectric constant of the medium between them.

For a two-plate flat capacitor, the electric capacitance is determined by the expression:

where Eо is the dielectric constant; Es is the relative dielectric constant of the medium between the plates; S is the active area of ​​the plates; H is the distance between the capacitor plates.

Dependences C(S) and C(h) are used to convert mechanical movements into changes in capacitance.

Capacitive sensors, like inductive sensors, are powered by alternating voltage (usually at high frequency - up to tens of megahertz). Bridge circuits and circuits using resonant circuits are usually used as measuring circuits. In the latter case, as a rule, they use the dependence of the oscillation frequency of the generator on the capacitance of the resonant circuit, i.e. the sensor has a frequency output.

Advantages capacitive sensors- simplicity, high sensitivity and low inertia. Disadvantages - the influence of external electric fields, the relative complexity of measuring devices.

Capacitive sensors are used to measure angular movements, very small linear movements, vibrations, speed, etc., as well as to reproduce specified functions (harmonic, sawtooth, rectangular, etc.).

Capacitive transducers, the dielectric constant e of which changes due to movement, deformation or changes in the composition of the dielectric, are used as level sensors for non-conducting liquids, bulk and powdery materials, the thickness of a layer of non-conducting materials (thickness gauges), as well as monitoring the humidity and composition of a substance.

Sensors are generators.

Generator sensors carry out direct conversion of the input value X into an electrical signal. Such sensors convert the energy of the source of the input (measured) quantity directly into an electrical signal, i.e. they are like generators of electricity (hence the name of such sensors - they generate an electrical signal).

Additional sources of electricity for the operation of such sensors are not fundamentally required (however, additional electricity may be required to amplify the output signal of the sensor, convert it to other types of signals, and for other purposes). Thermoelectric, piezoelectric, induction, photoelectric and many other types of sensors are generator types.

Induction sensors convert the measured non-electrical quantity into induced emf. The operating principle of the sensors is based on the law of electromagnetic induction. These sensors include direct and alternating current tachogenerators, which are small electric machine generators whose output voltage is proportional to the angular speed of rotation of the generator shaft. Tachogenerators are used as angular velocity sensors.

A tachogenerator is an electrical machine operating in generator mode. In this case, the generated EMF is proportional to the rotation speed and the magnitude of the magnetic flux. In addition, with a change in rotation speed, the frequency of the EMF changes. Used as speed (rotation frequency) sensors.

Temperature sensors.

In modern industrial production the most common are temperature measurements (for example, at a medium-sized nuclear power plant there are about 1,500 points at which such measurements are made, and at a large enterprise chemical industry there are over 20 thousand similar points). A wide range of measured temperatures, a variety of conditions for using measuring instruments and requirements for them determine the variety of temperature measuring instruments used.

If we consider temperature sensors for industrial applications, we can distinguish their main classes: silicon temperature sensors, bimetallic sensors, liquid and gas thermometers, temperature indicators, thermistors, thermocouples, resistance thermal converters, infrared sensors.

Silicon sensors temperatures use the dependence of semiconductor silicon resistance on temperature. Measured temperature range -50…+150 0C. They are mainly used to measure the temperature inside electronic devices.

Bimetallic sensor made of two dissimilar metal plates fastened together. Different metals have different thermal expansion coefficients. If the metals connected to the plate are heated or cooled, it will bend, while closing (opening) the electrical contacts or moving the indicator arrow. The operating range of bimetallic sensors is -40…+550 0C. Used to measure the surface of solids and the temperature of liquids. Main areas of application are the automotive industry, heating and water heating systems.

Thermal indicators- these are special substances that change their color under the influence of temperature. The color change can be reversible or irreversible. Produced in the form of films.

Resistance thermal converters.

The operating principle of resistance thermal converters (thermistors) is based on the change in the electrical resistance of conductors and semiconductors depending on temperature (discussed earlier).

Platinum thermistors are designed to measure temperatures in the range from –260 to 1100 0C. Cheaper copper thermistors, which have a linear dependence of resistance on temperature, are widely used in practice.

The disadvantage of copper is its low resistivity and easy oxidation at high temperatures, as a result of which the final limit of use of copper resistance thermometers is limited to a temperature of 180 0C. In terms of stability and reproducibility of characteristics, copper thermistors are inferior to platinum ones. Nickel is used in low-cost sensors for measurements over a range of room temperatures.

Semiconductor thermistors (thermistors) have a negative or positive temperature coefficient of resistance, the value of which at 20 0C is (2...8) * 10–2 (0C)–1, i.e. an order of magnitude greater than that of copper and platinum. Semiconductor thermistors, with very small sizes, have high resistance values ​​(up to 1 MOhm). As a semi-wire The material used is metal oxides: semiconductor thermistors of the KMT types - a mixture of cobalt and manganese oxides and MMT - copper and manganese.

Semiconductor temperature sensors have high stability of characteristics over time and are used to change temperatures in the range from –100 to 200 0C.

Thermoelectric converters (thermocouples)- the principle of operation of thermocouples is based on the thermoelectric effect, which consists in the fact that when there is a temperature difference between the joints (junctions) of two dissimilar metals or semiconductors, an electromotive force appears in the circuit, called thermoelectromotive (abbreviated thermo-EMF). In a certain temperature range, we can assume that thermo-EMF is directly proportional to the temperature difference ΔT = T1 – T0 between the junction and the ends of the thermocouple.

The ends of the thermocouple connected to each other and immersed in the medium whose temperature is being measured are called the working end of the thermocouple. The ends that are exposed to the environment and which are usually connected by wires to the measuring circuit are called free ends. The temperature of these ends must be kept constant. Under this condition, thermo-EMF Et will depend only on the temperature T1 of the working end.

Uout = Et = C(T1 – T0),

where C is a coefficient depending on the material of the thermocouple conductors.

The EMF created by thermocouples is relatively small: it does not exceed 8 mV for every 100 0C and usually does not exceed 70 mV in absolute value. Thermocouples allow you to measure temperatures in the range from –200 to 2200 0C.

The most widely used materials for the manufacture of thermoelectric converters are platinum, platinumrhodium, chromel, and alumel.

Thermocouples have the following advantages: ease of manufacture and reliability in operation, low cost, lack of power supplies and the ability to measure over a wide temperature range.

Along with this, thermocouples also have some disadvantages - lower measurement accuracy than thermistors, the presence of significant thermal inertia, the need to introduce corrections for the temperature of the free ends and the need to use special connecting wires.

Infrared sensors (pyrometers)- use radiation energy from heated bodies, which makes it possible to measure surface temperature at a distance. Pyrometers are divided into radiation, brightness and color.

Radiation pyrometers are used to measure temperatures from 20 to 2500 0C, and the device measures the integral radiation intensity of a real object.

Brightness (optical) pyrometers used to measure temperatures from 500 to 4000 0C. They are based on a comparison in a narrow part of the spectrum of the brightness of the object under study with the brightness of a reference emitter (photometric lamp).

Color pyrometers are based on measuring the ratio of radiation intensities at two wavelengths, usually selected in the red or blue part of the spectrum; they are used to measure temperatures in the range of 800 0C.

Pyrometers allow you to measure temperature in hard-to-reach places and the temperature of moving objects, high temperatures, where other sensors no longer work.

Quartz thermal converters.

To measure temperatures from – 80 to 250 0C, so-called quartz thermal converters are often used, using the dependence of the natural frequency of the quartz element on temperature. The operation of these sensors is based on the fact that the dependence of the transducer frequency on temperature and the linearity of the conversion function vary depending on the orientation of the cut relative to the axes of the quartz crystal. These sensors are widely used in digital thermometers.

Piezoelectric sensors.

The operation of piezoelectric sensors is based on the use of the piezoelectric effect (piezoelectric effect), which consists in the fact that when some crystals are compressed or stretched, an electric charge appears on their faces, the magnitude of which is proportional to the acting force.

The piezoelectric effect is reversible, i.e., the applied electrical voltage causes deformation of the piezoelectric sample - its compression or stretching according to the sign of the applied voltage. This phenomenon, called the inverse piezoelectric effect, is used to excite and receive acoustic vibrations of sound and ultrasonic frequencies.

Used to measure forces, pressure, vibration, etc.

Optical (photoelectric) sensors.

Distinguish analog and discrete optical sensors. With analog sensors, the output signal varies in proportion to the ambient light. The main area of ​​application is automated lighting control systems.

Discrete type sensors change the output state to the opposite one when a set illumination value is reached.

Photoelectric sensors can be used in almost all industries. Discrete sensors are used as a kind of proximity switches for counting, detection, positioning and other tasks on any production line.

Optical non-contact sensor, registers change luminous flux in a controlled area, associated with a change in the position in space of any moving parts of mechanisms and machines, the absence or presence of objects. Due to their large sensing distances, optical non-contact sensors have found wide application in industry and beyond.

The optical non-contact sensor consists of two functional units, a receiver and an emitter. These units can be made either in one housing or in different housings.

According to the method of object detection, photoelectric sensors are divided into 4 groups:

1) beam crossing - in this method, the transmitter and receiver are separated into different housings, which allows them to be installed opposite each other at a working distance. The operating principle is based on the fact that the transmitter constantly sends out a light beam, which is received by the receiver. If the sensor's light signal stops due to obstruction by a third-party object, the receiver immediately reacts by changing the output state.

2) reflection from a reflector - in this method, the receiver and transmitter of the sensor are located in the same housing. A reflector (reflector) is installed opposite the sensor. Sensors with a reflector are designed in such a way that, thanks to a polarizing filter, they perceive reflection only from the reflector. These are reflectors that work on the principle of double reflection. The choice of a suitable reflector is determined by the required distance and mounting capabilities. The light signal sent by the transmitter is reflected from the reflector and enters the sensor receiver. If the light signal stops, the receiver immediately reacts by changing the output state.

3) reflection from an object - in this method, the receiver and transmitter of the sensor are located in the same housing. During the operating state of the sensor, all objects falling into its work area, become a kind of reflectors. As soon as a light beam reflected from an object hits the sensor receiver, it immediately reacts by changing the output state.

4) fixed reflection from an object - the principle of operation of the sensor is the same as that of “reflection from an object” but is more sensitive to deviations from the setting to the object. For example, it is possible to detect a swollen cap on a bottle of kefir, incomplete filling of a vacuum package with products, etc.

According to their purpose, photo sensors are divided into two main groups: general-purpose sensors and special sensors. Special types include types of sensors designed to solve a narrower range of problems. For example, detecting a colored mark on an object, detecting a contrast border, the presence of a label on a transparent package, etc.

The sensor's task is to detect an object at a distance. This distance varies between 0.3mm-50m, depending on the selected sensor type and detection method.

Microwave sensors.

Push-button-relay consoles are being replaced by microprocessor-based ones. automatic systems management technological process(APCS) of the highest performance and reliability, sensors are equipped with digital communication interfaces, but this does not always lead to an increase in the overall reliability of the system and the reliability of its operation. The reason is that the very principles of operation of most known types of sensors impose severe restrictions on the conditions in which they can be used.

For example, to monitor the speed of movement of industrial mechanisms, non-contact (capacitive and inductive) as well as tachogenerator speed control devices (USS) are widely used. Tachogenerator USSs have a mechanical connection with a moving object, and the sensitivity zone of non-contact devices does not exceed several centimeters.

All this not only creates inconvenience when installing sensors, but also significantly complicates the use of these devices in conditions of dust, which adheres to working surfaces, causing false alarms. The listed types of sensors are not capable of directly monitoring an object (for example, a conveyor belt) - they are tuned to the movement of rollers, impellers, tension drums, etc. The output signals of some devices are so weak that they lie below the level of industrial interference from the operation of powerful electrical machines.

Similar difficulties arise when using traditional level switches - sensors for the presence of bulk product. Such devices are necessary for timely shutdown of the supply of raw materials to production tanks. False alarms are caused not only by adhesion and dust, but also by touching the product flow as it enters the hopper. In unheated rooms, the operation of the sensors is affected by the ambient temperature. False alarms cause frequent stops and starts of the loaded technological equipment- the main cause of its accidents, lead to blockages, breakage of conveyors, and the occurrence of fire and explosion hazards.

Several years ago, these problems led to the development of fundamentally new types of devices - radar speed control sensors, motion and pressure sensors, the operation of which is based on the interaction of the controlled object with a radio signal with a frequency of about 10 to the 10th power of Hz.

The use of microwave methods for monitoring the condition of process equipment allows us to completely get rid of the disadvantages of traditional types of sensors.

Distinctive features of these devices are:

Lack of mechanical and electrical contact with the object (environment), the distance from the sensor to the object can be several meters;

Direct control of the object (conveyor belt, chain) and not their drives, tension drums, etc.;

Low power consumption;

Insensitive to product sticking due to large working distances;

High noise immunity and directionality;

One-time setup for the entire service life;

High reliability, safety, absence of ionizing radiation.

The operating principle of the sensor is based on changing the frequency of a radio signal reflected from a moving object. This phenomenon (the "Doppler effect") is widely used in radar systems for remote velocity measurement. A moving object causes an electrical signal to appear at the output of the microwave transceiver module.

Since the signal level depends on the properties of the reflecting object, motion sensors can be used to signal a broken circuit (belt) or the presence of any objects or materials on the conveyor belt. The tape has a smooth surface and low reflectance. When a product begins to move past the sensor installed above the working branch of the conveyor, increasing the reflection coefficient, the device signals the movement, that is, in fact, that the belt is not empty. Based on the duration of the output pulse, one can judge at a considerable distance the size of objects being moved, make selections, etc.

If it is necessary to fill any container (from a bunker to a shaft), you can accurately determine the moment of completion of filling - a sensor lowered to a certain depth will show the movement of the filler until it is filled.

Specific examples of the use of microwave motion sensors in various industries are determined by its specifics, but in general they are capable of solving a wide variety of problems of trouble-free operation of equipment and increasing information content automated systems management.

If 1-Wire required one data wire, then this bus, based on the name Two-Wire Bus, requires two.
One of the wires - SCL will be clocked, the second - SDA, data will be transmitted in half duplex.
The bus is an open collector, therefore both lines must be connected to power. The sensor will be connected as follows:


Figure 17. Connecting sensors via I2C

The total number of devices that can be connected to the I2C bus is 112 devices with 7-bit addressing. Each device is actually allocated two consecutive addresses; the low-order bit sets the mode - read or write. There is a strict requirement for bus capacitance - no more than 400pF.

Commonly used speeds are 100 kbit/sec and 10 kbit/sec, although the latest standards also allow speed modes of 400 kbit/sec and 3.4 Mbit/sec.

The bus can work both with an irreplaceable master and with flag transmission.
A huge amount of information on the protocol can be found at this link: http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus.html

Connecting digital sensors using the SPI standard
Requires at least three wires, operates in full duplex mode - i.e. organizes simultaneous data transfer in both directions.
Communication lines:
  • CLK - clock signal line.
  • MOSI - master output, slave input
  • MISO - master input, slave output
  • CS - chip selection (optional).
One of the devices is selected by the master. It will be responsible for bus clocking. The connection is made crosswise:


Figure 18. SPI connection and the essence of the transfer

Each device in the circuit contains its own data shift register. Using clock signals, after 8 clock cycles the contents of the registers are swapped, thereby exchanging data.

SPI - The fastest data transfer interface available. Depending on the maximum possible clock frequencies, the data transfer rate can be 20, 40, 75 Mbit/s and higher.

The SPI bus allows devices to be connected in parallel, but there is a problem here - each device requires its own CS line to the processor. This limits the total number of devices on a single interface.
The main difficulty in setting up SPI is setting the polarity of the clock signal. Seriously. Setting up SPI is not easy, but very simple.

Briefly and clearly about SPI with a description of peripheral SPI modules for AVR and MSP430 can be read here http://www.gaw.ru/html.cgi/txt/interface/spi/index.htm

4 Taking readings from sensors


It's time to read at least some information from our sensors.

Depending on the method of connecting the sensor and its type, various ways taking readings. It should be noted that some sensors, such as digital sensors or gas sensors, require a preliminary start of the measurement mode, which may take some time.

Thus, the measurement process consists of two cycles - a data measurement cycle and a data acquisition cycle. When organizing the program, you can choose one of the following options:


Figure 19. Process of reading readings from the sensor

Let's consider each option separately and sketch out the skeletons:
Option 1. started the measurement mode, waited, and counted.
The option is attractive in its simplicity, but behind it lies a problem - while waiting for measurements to be completed, the microcontroller is blatantly idle, not performing tasks. In most automation systems, such a mode is an unaffordable luxury.

In code it would look like this:
Sensor.Start();//start the measurement process delay(MINIMAL_SENSOR_DELAY_TIME);//wait for the process to complete int var = Sensor.Read();//read the data
Option 2. started the measurement mode, returned to other tasks, after a while the interrupt triggered, and counted the data.
One of best options. But the most difficult one:
void Setup())( TimerIsr.Setup(MINIMAL_SENSOR_DELAY_TIME);//set up a timer interrupt with the required frequency int mode = START;//state variable Sensor.Start();//start the measurement process for the first time) TimerIsr.Vector() (//timer interrupt handler if (mode == START( mode = READ; var = Sensor.Read();//if the sensor was in measurement mode, read the data) else ( mode = START; Sensor.Start(); ///if the sensor was in data reading mode, start a new measurement cycle ) )
Looks good. allows you to vary the time between measurement cycles and reading cycles. for example, the gas composition sensor must have time to cool down after previous measurements, or have time to heat up during measurements. These are different periods of time.

Option 3: We counted the data and launched a new round.
If the sensor allows you to start a new measurement cycle after reading the data, then why not - let’s do the opposite.
void Setup())( TimerIsr.Setup(MINIMAL_SENSOR_DELAY_TIME);//set up a timer interrupt with the required frequency Sensor.Start();//start the measurement process for the first time) TimerIsr.Vector())(//timer interrupt handler var = Sensor.Read();//read the data Sensor.Start();///start a new measurement cycle

A great way to save time. and you know what - this method works great without interruptions. Digital sensors store the calculated value until the power is turned off. And taking into account the fact that it is often not necessary to read signals from a humidity sensor due to its inertia of 15 seconds, you can do this:
void Setup())( Sensor.Start();//start the measurement process for the first time while(1)( //a lot of other routine var = Sensor.Read();//read the data Sensor.Start();// /start a new measurement cycle) )
There may also be an option that our sensor independently starts a new measurement cycle and then, using an external interrupt, it reports the completion of measurements. For example, an ADC can be configured to automatically read data at a frequency of N Hz. On the one hand, in the interrupt handler it will be enough to implement only the process of reading new data. On the other hand, you can use the ADC interrupt with Direct Memory Access (DMA) mode. In this case, upon an interrupt signal, the peripheral ADC module at the hardware level will independently copy the data to a specific memory cell in RAM, thereby ensuring maximum speed data processing and minimal impact on work program(no need to go into an interrupt, call a handler, etc.).

But the use of DMA is far beyond the scope of this cycle.

Unfortunately, the first method is widely used in libraries and examples for Arduino; it does not allow this platform to correctly use the resources of the microcontroller. But it is easier to write and debug.

4.1 Working with ADC
When dealing with analog sensors, we are dealing with an ADC. In this case, we consider an ADC built into the microcontroller. Since the ADC is essentially the same sensor - it converts an electrical signal into an information one - everything that is described above in section 2 is true for it. The main characteristics of an ADC for us are its effective bit capacity, sensitivity, reference voltage and speed. In this case, the output value of the ADC conversion will be a certain number in the output register, which must be converted into an absolute value in units of the measured value. In the future, examples of such calculations will be considered for individual sensors.

4.1.1 Reference voltage
The ADC reference voltage is the voltage that will correspond to the maximum output value of the ADC. The reference voltage is supplied from a voltage source, either built into the microcontroller or external. The accuracy of the ADC readings depends on the accuracy of this source. A typical on-chip reference voltage is equal to the supply voltage or half the microcontroller supply voltage. There may be other meanings.

For example, a table of possible values reference voltage for Atmega1280 microcontroller:


Figure 20. Selecting the reference voltage for the ADC of the Atmega1280 microcontroller

4.1.2 ADC capacity and sensitivity
The ADC width determines the maximum and minimum values ​​in the output register at the minimum and maximum input effect of the electrical signal.

It should be noted that the maximum bit capacity of the ADC may not correspond to its effective bit capacity.
Some of the low-order bits can be lost to noise. Let's turn to the datasheet for the ADuCM360 microcontroller, which has a 24-bit ADC with an effective bit width of 14 bits:


Figure 21. ADC data register bit assignments

As can be seen from the figure, in a 32-bit register, part is allocated to the sign, part to zeros and part to noise. And only 14 bits contain data that has the specified accuracy. In any case, this data is always indicated in the documentation.

Its sensitivity depends on the effective bit capacity of the ADC. The more intermediate stages of the output voltage, the higher the sensitivity will be.

Let's say the ADC reference voltage Uop. Then, an N-bit ADC, having 2N possible values, has a sensitivity
(11)

Thus, for a 12-bit ADC and a reference voltage of 3.3V, its sensitivity will be 3.3/4096 = 0.8mV

Since our sensor also has a certain sensitivity and accuracy, it will be nice if the ADC has better performance

4.1.3 ADC performance
The speed of the ADC determines how quickly the readings are read. A SAR ADC requires a certain number of clock cycles to digitize the input voltage level. The larger the bit depth, the more time is required; accordingly, if by the end of the measurement the signal level has time to change, this will affect the accuracy of the measurement.

ADC performance is measured in the number of data samples per second. It is defined as the frequency of the ADC clock signal divided by the number of clocks required for the measurement. For example, having an ADC clock frequency of 1 MHz and 13 clock cycles for taking readings, the ADC speed will be 77 kilosamples per second. For each bit depth option, it is possible to calculate its performance. IN technical documentation Usually the maximum possible clock frequency of the ADC and its maximum performance at a particular bit capacity are indicated.

4.2 Digital sensors
The main advantage of digital sensors over analog ones is that they provide information about the measured value in ready-made form. A digital humidity sensor will return the absolute humidity value in percent, a digital temperature sensor will return the temperature value in degrees.

The sensor is controlled using the register in it in the question-answer form. The questions are:

  • Write the value of B to register A
  • Return the value stored in register C
In response, the sensor, accordingly, either writes the necessary data into the register, setting parameters or starting some mode, or transfers the measured data to the controller in finished form.

I'll end here general material. In the next part we will look at HVAC sensors with examples.
After the sensors, we will consider actuators - there is quite a lot of interesting stuff there from the point of view of the meaning of theory automatic control, and then we’ll get to the synthesis and optimization of the controller of this whole mess.

UPD: I express my gratitude

To achieve high sensitivity of a pressure sensor, a large crystal with a complex structure is usually used. But such a structure means that the sensor is noticeably influenced by gravity and vibration. How can these contradictions be avoided?

AllSensors pressure sensor crystals use proprietary Collinear Beam2 technology, registered as COBEAM²™. This technology has made a breakthrough in the art of creating piezoresistive sensors compared to conventional silicon strain technology. COBEAM²™ technology allows you to get high level sensitivity of a pressure sensor, which previously required a complex structure and a huge crystal topology. By eliminating the complex structure, the effects of gravity and vibration are significantly reduced.

AllSensors produces four types of pressure sensors:

  • with basic output (uncompensated sensor),
  • with mV output (compensated sensor),
  • with amplifier,
  • with digital output.

Basic sensors provide an uncompensated and uncalibrated mV output signal. These sensors have a raw output signal without compensation for errors such as temperature effects. When using basic sensors, OEMs usually add their own compensation circuit. Basic sensors are low-cost solutions that most often meet the requirements of OEM manufacturers.

AllSensors also offers sensors with compensation and calibrated mV output. These sensors are temperature compensated and offset and scale calibrated to provide more accurate data. In addition, the manufacturer produces sensors with an amplified output signal. This type of sensor is suitable for solutions that do not have their own amplifier and which, for some reason, for example, reducing overall dimensions or power consumption, cannot be installed on the board.

And finally, the manufacturer produces sensors with digital output. Temperature compensated sensors are available in three temperature ranges:

  • commercial (5 ⁰C…50 ⁰C),
  • industrial (-25 ⁰C…85 ⁰C),
  • military (-40 ⁰C…125 ⁰C).

About the company: AllSensors specializes in the production of pressure sensors with a focus on sensors low pressure for medical and industrial use. Product pressure measurement range from 0.01 to 150 psi.

To comment on materials from the site and gain full access to our forum, you need register .

  • A very useful new product in terms of the availability of sensor modifications with compensation, initial calibration and digital interfacing. I just don’t agree that the declared technology can be considered a breakthrough. The primary reason for the presence of a “large crystal with a complex structure” in semiconductor strain gauges is the need to compensate at the production stage for the nonlinearity of the temperature characteristics and elastic properties of strain gauges. In addition, in the operating range of deformations and temperatures, these characteristics vary greatly from sample to sample even at the stage p-n formation transitions. Hence the intricate patterns formed in the flat structure of the sensor. I have several domestic C50 case strain gauges with and without a rod (displacement sensors and pressure sensors). As far as I know, they are used at nuclear power plants and other critical automated control systems, possibly in the military. Instead of classic diffusion strain gauges on a semiconductor, the “silicon on sapphire” technology is used (I could be wrong, a different dielectric may be used). Inside is a work of art (who understands)! The characteristic dimensions of the “crystal” of the sensor plate are about 5 * 5 mm with the thickness of such a substrate being 0.05-0.1 mm. “Inside” the translucent wafer is a whole “city” of a micrometer-thick silicon film grown on the surface. This is, in general, a piece of finely crafted jewelry that can be examined for a long time through a magnifying glass. Four pins are soldered to the body with gold wire. Powered by current. Metrological characteristics are very high. In any case, the most interesting for us signal-to-noise ratio per micrometer movement of the rod is 10 times better than the indicators obtained on a stand with ordinary strain gauges and alternative sensors on magnetically sensitive microcircuits. Unfortunately, I don't have a camera at hand high resolution to photograph the single crystal itself. Externally they look like this http://icm-tec.com/index3_14.htm (second row of the table from the bottom). Sapphire sensors similar in filling are widely used in thermal power engineering. But these are developments almost 30 years ago, probably with endless prospects for miniaturization (I don’t know the state of the issue). I am convinced that it is always possible to find OEM components with a high enough accuracy class for a specific application. After all, the question of the “revolutionary nature” of technology as such is always a question of cost. In this sense, it would be useful to compare the solutions of various strain gauge transducer manufacturers within a given accuracy class. But I haven’t seen such “slices” of the market.
News

Sensor– a structurally complete element consisting of a sensitive element and measuring transducers (MT). With the introduction of unified signals, the production of sensors with a unified output signal entered the practice of instrument engineering. In this case, a sensor is called a primary measuring transducer and a normalizing transducer combined in one block. MTs are used to convert the natural signal of the sensitive element (primary transducer) into a form convenient for transmission or processing. Modern sensors contain nodes that perform linearization, correction and other signal processing. An example of a sensor block diagram is shown in Fig. 10.

Fig. 10. Block diagram of the sensor

Main characteristics of the sensor: input parameter, output signal, static characteristic, dynamic characteristic and errors, design characteristics.

3.2.1. Sensor static characteristic

Sensor static characteristic(enter exit ) reflects the functional dependence of the output signal on the input parameter in steady state. The static characteristic is specified: analytically, graphically, tabularly. Rice. eleven.

Fig. 11. Static characteristics of the sensors:

a) linear non-reversible, b) real non-linear, c) reversible, d) hysteretic.

This characteristic is used to determine such sensor parameters as sensitivity (conversion coefficient), sensitivity/resolution threshold, linearity, drift value; operating/dynamic range, hysteresis parameters, etc. For some types of sensors (GSP thermocouples), nominal static characteristics (NSC) are established and accuracy classes are established in accordance with the percentage of deviations from NSCH.

1) Conversion factor or the transmission coefficient is the ratio of the output value of the element Y k to the input value Xk or the ratio of the increment of the output value (=Y 2 -Y1, dy) to the increment of the input value (=X 2 -X1, dx):

Static conversion factor (k, k’).

The value of the dynamic conversion coefficient K d depends on the choice of operating point. (Fig. 10 b) point A).

2) Sensitivity threshold is called the minimum value at the input of the element, which causes a change in the output value. When the input value X changes from 0 to the threshold, the output value Y does not change and is equal to 0. Fig. 10 a), b).

3) Linearity. The static characteristics of the sensor in the working area (in the vicinity of point A) must be linear, the deviation is measured in %.

4) Drifting This is a shift in characteristics when external conditions change relative to standard ones. Rice. 10 a).

5) Range measurements the range of values ​​of the measured signal for which the measured errors are normalized. This area is limited by the measurement limits of the largest and smallest values ​​of the measurement range. D=Xkz..Xn, where Xкз is the final value of the instrument scale, Xn- sensitivity threshold of devices. The measurement range can consist of several subranges. Dynamic range is used if the range is very large.

Dd=20*Log(X 2 /X 1)

6) The characteristics of many sensors have hysteresis: the sensor signal during forward and reverse strokes is different, the main indicator hysteresis loop width. Rice. 10 g).

7) A relay is an automation element in which, when the input value X reaches a certain value, the output value changes abruptly. The dependence Y= f(X) is a variant hysteresis and has the shape of a loop. Fig. 11.

The abrupt change in Y at the moment X = X 2 is called size actuation. The abrupt change in Y at the moment X=X 1 is called size letting go. The ratio of the release value X 21 to the response value X 2 is called coefficient return Usually X 2 > X 1, so K in. = X 1 / X 2< 1.

3.2.2. Dynamic response of the sensor

Dynamic response sensor determines the behavior of the sensor in transient modes. Dynamic characteristics determine the dependence of the sensor output signal on time-varying quantities: parameters of the input signal, external factors, loads. Depending on the completeness of the description of the dynamic properties of SI, a distinction is made between complete and partial dynamic characteristics. Full dynamic characteristics include transient response, impulse transient response, amplitude-phase response, a combination of amplitude-frequency and phase-frequency characteristics, and transfer function. A partial dynamic characteristic does not fully reflect the dynamic properties of the sensor. Examples of such characteristics are sensor response time, damping coefficient, value of the resonant natural angular frequency, value of the amplitude-frequency response at the resonant frequency, delay, rise time, settling time, first maximum time, static error, bandwidth, time constant.

For sensors and measuring transducers, the reaction time is the time to establish the output signal, determined by an abrupt change in the input signal and a given error in establishing the output signal. The dynamic properties of the SI determine the dynamic error.

Rice. 13. Dynamic characteristics of the sensor

The figure shows the characteristics:

delay - t;

rise time - t 2 - t 1 ;

time of the first maximum – T;

time transition process- T 1;

bandwidth – P.

3.2.3. Errors

During operation of the sensor, the output value y deviates from the required value due to internal or external factors (wear, aging, fluctuations in supply voltage, temperature, etc.). The deviation of the characteristic is called error . Errors: divided into basic and additional.

Basic error– the maximum difference between the sensor output signal and its nominal value under normal operating conditions.

Additional errors– caused by changes in external conditions in relation to the norm, normalized by the main factor. Expressed as a percentage of the change in the causing factor. For example: 1% at 5°C.

The main error can be absolute, relative or reduced.

A) Absolute error(error) is the difference between the actual value of the output quantity and its nominal value – Y:

b) Relative error is called the ratio of the absolute error to the nominal (desired) value of the output quantity Y (usually expressed in%):

.

V) Given error The ratio of the absolute error to the standard value is called: for converters this is the largest value of the output quantity, for instruments the maximum scale value. The magnitude of this error determines the accuracy class of the device 0.1; 0.5; 1.0, etc.

.

SI errors can have systematic and random components. Random components lead to ambiguity of states. Therefore, they try to make the random components of the SI error insignificant compared to other components.

Systematic measurement errors are components of the error that remain constant and naturally change with repeated measurements of the same quantity. Constant systematic errors include scale calibration error, temperature error, etc. Variable systematic errors include the error caused by the instability of the power source. Systematic errors are eliminated by calibration or introduction of corrections (bias).

Random measurement errors are components of the measurement error that change randomly during repeated measurements of the same quantity. The meaning and sign of a random error cannot be determined, since random errors owe their origin to reasons whose effects are not the same in every experiment and cannot be taken into account.

Random errors are detected during repeated measurements of the same quantity, therefore, their influence on the measurement result is taken into account by the methods of mathematical statistics and probability theory. Rice. 14.

Rice. 14. Systematic and random components of error

Sensors are electrical devices designed to convert a continuous change in an input (controlled) non-electrical quantity into a change in an output electrical quantity. Input quantities can reflect a wide variety of physical phenomena - linear or angular displacement, speed, acceleration, temperature of solid, liquid and gaseous bodies, force, pressure, etc. The output quantities most often used are active, inductive, capacitive reactance, current, EMF, voltage drop, frequency and phase of alternating current.

The main characteristic of the sensor is sensitivity S = DY/DX, Where DY,DX– increments of output and input quantities. The concept of relative sensitivity is often used, where Y,X- complete changes in output and input quantities.

Sensors can be linear (S = const) and nonlinear (S = var). For the latter, the sensitivity depends on the input value. An important parameter of the sensor is the sensitivity threshold, which is the smallest value of the input quantity that causes a change in the output quantity that can be measured.

The nominal characteristic of the sensor is the dependence of the output value on the input value. This characteristic is given in the sensor's passport and is used as a calculated characteristic during measurements. The experimentally measured input-output relationship differs from the nominal one by an error.

A distinction is made between absolute and relative sensor input errors. Absolute error relative error, where X input no.— the value of the input value of the sensor, determined by the output value and nominal characteristic; X d— actual value of the input quantity.

The output errors of the sensor can be considered similarly.

The error is influenced by external operating conditions: temperature, magnetic and electric fields, environmental humidity, voltage and frequency of the power source, mechanical and radiation influences, etc.

Sensor errors at normal values ​​of external parameters ( normal temperature, normal atmospheric pressure, nominal values ​​of voltage and frequency of supply, etc.) are called basic.

If the parameters of external conditions go beyond the normalized limits, then additional errors arise. To reduce additional errors, either reduce the sensitivity of the sensor to external conditions, or reduce the degree of their influence.

Along with high sensitivity and low error, sensors must have the required range of change in the input value, the ability to match with the measuring circuit and minimal feedback from the sensor on the input value. With rapid changes in the input value, the sensor must be low-inertia.

Existing sensors are very diverse in their operating principle, design and layout.

Sensors can be divided into two large groups - parametric (passive) and regenerative (active).

The first include resistive, inductive, capacitive and contact sensors.

The second includes sensors that use the effect of induced EMF (electromagnetic induction), the piezoelectric effect, the Hall effect, thermal EMF, the appearance of EMF when exposed to radioactive radiation, etc. Below we will consider sensors that, in principle of operation and design, are close to electrical devices.