Repairs Design Furniture

IK sensor approximation with his own hands. Not exactly the usual "button". IK approximation sensor. Sensor approximation on IR rays

Robots, like death, all people really need sense authorities to navigate in space. Infrared rangefinder Sharp GP2Y0A21YK is very suitable for this role, if you need to avoid collisions with obstacles or know where about this is the most obstacle.

By the way, perhaps you already have one of the robots, where similar sensors are used. This is almost all the sane Chinese vacuum cleaners and, I suppose, many ROOMBA models. And, probably, many others.

And if this sensors have found a place in a more or less serious technique, then we will find them use, right?

In order not to crush the soul, I will say right away: I ordered these sensors not just play. On the contrary, from the very beginning he knew that they would be useful to me to make an interactive lamp, which changes the luminescence intensity depending on the position of the palm over it.

Of course, reality made its adjustments and in the end. In other words, she now has five modes: a night light, a luminaire with brightness adjustment, thermometer, "Northern Light" with manual adjustment and automatic northern lights.

And besides, a pair of service functions: turn on and off the background and top lighting in the room.

That's how it works:

Well, now the time to tell about the sensor, thanks to which everything happened.

As I spoke at the very beginning, Sharp GP2Y0A21YK is an infrared rangefinder. So, it is equipped with an IR emitter and an IR receiver: the first serves as a source of beam, the reflection of which catches the second. At the same time, the IR rays of the sensor for the human eye are invisible (although it is possible to distinguish red flicker, if you look into the sensor) and with such an intensity harmless.

On domestic animals, they do not have any influence.

According to the characteristics, such:

  • Supply voltage: 5V
  • Maximum current consumed: 40 mA (typical - 30 mA)
  • Range of work: 10 cm - 80 cm
As for competitors, compared to ultrasound sensors, for example, superpopular HC-SR04, this sensor has advantages, and disadvantages. The advantages include all that is mentioned above, i.e. Neutrality and harmlessness.

And the disadvantages are a smaller radius of action (in HC-SR04 of about 4 m) and dependence on external interference, including some types of lighting. I, for example, met the mention that sunlight could affect the sensor readings.

The sensor comes in the Spartan package, i.e. Sensor itself and cable with a connector for connecting to the sensor. On the other side - simply lovable wires, which is not very convenient for use with Arduino Uno, but is quite suitable for controllers without sprung connectors. Since I planned to use the sensor with Arduino Pro Mini, it was a completely appropriate option - the wires simply sealed in a batch fee.

Wires differ in color: yellow - signal, black - ground, red - plus power (+ 5V).

The output of the sensor is analog (although in the datashet, for some reason written - digital). That is, the voltage on it is proportional to the distance to the obstacle. At the same time, as in the case of ultrasound, there is a difference between different types of obstacles for the sensor.

In this regard, the Sharp datashet gives data when used as reflectors Kodak reflector cards with a reflection coefficient of 90%. Judging by it, a 20 cm sensor issues 1.3B.

Let's compare with my experimental data:

I remind you that the analog input Arduino operates in the range of 0V - 5V and has 1024 steps, hence the calculation: (5/1024) * (sensor readings). So, if you consider that all your (trembling) hands, the readings are fully fitted in the characteristics of the sensor. And at the same time it can be seen that the black surface makes its own adjustments.

So he shines

At the same time, as noted attentive reader, there are specifics. The bottom line is that when the obstacle is closer to the lower boundary of the range (10 cm), the sensor begins to assume that the obstacle, on the contrary, is removed (when the testimony covered with hand was fixed by 345).

It looks like this:

Hence, the conclusion: Although for many purposes, the dailure is quite adequate, sometimes it makes sense to conduct experiments so that it does not painfully hurt. And this is especially true if the sensor is somewhat mounted (or closed by an IR transparent material), which means it may receive reflections from the walls or other elements of the case.

For example, I faced the fact that the Evlampia, being installed on a regular place after successfully conducted "desktop" tests, began to go crazy. At first, I thought it was to blame for meals for meal and even put a parallel to the sensor power to a pair of capacitors (10 μF and 0.1 μF), pulled the analog Arduino input to zero via a 10-com resistor and even bought a power outlet.

But when it did not help, he returned to the table again, where he twisted the sensor in different directions and saw that in fact even if the distance to the nearest obstacle was more than 80 cm, the sensor readings change significantly. So if your wards are inadequate - check actual readings in real conditions.

Here, for example, an elementary sketch, which, firstly, with an interval in half awend displays the sensor readings, and, secondly, the Arduino LED lights, if the readings fall into the range from 100 to 200:

// Yellow - A0, black - earth, red - + 5V unsigned int l; void setup () (serial.begin (9600); pinmode (a0, input); pinmode (13, output); l \u003d 0;) void loop () (l \u003d analogread (A0); serial.println (L); Delay (1000); if (L\u003e 100 && L< 200) { digitalWrite(13, HIGH); } else { digitalWrite(13, LOW); } }

If you summarize, the sensor, although a bit of capricious, is very easy to use and relatively cheap.

It is possible to use it in robots, as well as to control the intersection of doorways, in some interactive devices managed by gestures and something else will tell fantasy.

I plan to buy +33 Add to favourites I liked the review +38 +67

In this article, consider the connection and work with the IR measurement sensor of the Sharp GP2Y0A02YK0F distance.
Unlike the same, this sensor has a much more modest range of measurements, but still has a number of useful distinctive properties. For example, this sensor allows you to measure the distance even through the transparent surfaces (though, losing accuracy of the testimony, but still).

Sensor connection:

GND. on any of GND Pins --- Arduino

Out. On any of the analog inputs Arduino (in the examples connected to A0)

VCC. on + 5 volts on Arduino

Basic specifications:

Distance measurement range: from 20 to 150 cm

Analog output

Dimensions: 29.5x13x21.6 mm

Current consumption: 33 mA

Power supply: from 4.5 to 5.5 in

It must be unpacked and add to the "Libraries" folder in the Arduino IDE folder. Do not forget to restart the Wednesday if the IDE has been open at the time of adding.

What is the feature of this library and why it is recommended to use it? The answer is simple and lies in the principle of its work. For measuring the distance, a plurality of measurements are used, of which erroneous are discarded, which are very different from the adjacent one. According to authors, 12% of all readings contribute 42% of the errors in the final value of the distance, if not discarding erroneous measurements.

We turn to the program code - the example of working with the sensor (the example is also suitable for the GP2Y0A21Y sensor, in the code it will be necessary to change the MODEL value by 1080):

Sample program code

#Include. #Define IR A0. // PIN to which the sensor is connected. Necessarily analog! #Define Model 20150. // Sensor model. 1080 for gp2y0a21y, 20150 for gp2y0a02y Sharpir Sharpir (IR, MODEL); Void. setup. () { Serial .begin (9600); ) Void loop. () (Delay (2000); unsigned long pepe1 \u003d millis (); // Take up time before the measurement starts int dis \u003d sharpir .distance (); // Get the distance from the sensor Serial .print ("Mean Distance:"); // Display the distance to the port monitor Serial .printLN (DIS); unsigned long pepe2 \u003d Millis () -pepe1; // We consider the time spent on the measurement Serial .print ("Time Taken (MS):"); // and take it Serial .printLN (PEPE2); )

In order to attract customers or buyers, you can make an automated advertising stand or showcase in which the backlight will be turned on when a person approaches it. An attempt to use for this standard motion sensors was not crowned with success, because they react to movement, and not to presence.

Sensor approximation on IR rays

Yes, when the person approaches, the motion sensor will turn on the advertisement, but if a person stops and stand, studying the advertising stand or showcase, the advertisement will turn off, because the movement will not be. We need a sensor that responds not to movement, but that man stands in front of him. For example, the IR reflection sensor, the diagram of which is given here. The sensor consists of an "optical pair" from the TV remote control system, the HL1 infrared LED and the resonant HF1 photodetector configured to 36 kHz.

The LED and the photodetector are directed in one direction to the place in front of the advertising bench or the showcase. They should be located so that light from neither directly falls on the HF1, but only when reflected from the obstacles located in front of the sensor. That is, there must be an opaque partition between them.

The multivibrator on the elements D1.3 and D1.4 generates pulses with a frequency of 36 kHz (accurately this frequency is set by the selection of resistance R7). These impulses come to the key base on the VT3 transistor. In its collector circuit, an infrared LED is turned on. Light-emitting diode
Eusings outbreaks of IR light, repeating with a frequency of 36 kHz, and the power of these flashes depends on the current through the LED, the value of which is set by the selection of resistor resistance R5.

If a person is standing before the sensor, the light flashes emitted by the LED is reflected from it and fall on the HF1 photodetector. In this case, the output key of the photodetector opens and at its output (output 3) will be logical zero. The VT1 transistor opens and charges C2 capacitor. The voltage on it is a logical unit. At the output D1.2 is also a logical unit.

The VT2 transistor also opens and the relay K1 with its contacts (not shown in the diagram) includes the lighting of the stand or showcase. When a person moves to the side of the light turns off immediately, but after 23 seconds (time for the discharge C2 through R3). It is necessary that the light does not blink when the man moves near the advertising stand or showcase. The sensitivity of the sensor (range to humans) depends on the resistance R5.

The sensor is designed to control electrical equipment or to work with the security system. He reacts to an approach in a person or any item. Depending on the sensitivity set by the trimming resistivity, the trigger range can be from several meters to several centimeters.

The diagram is based on the LM567 chip, which is a tone decoder. Since the setting on the decoding frequency depends on the frequency of the built-in generator, and in virtually it is equal to it, it is possible to use this frequency as a source of pulses for modulating infrared radiation.

The frequency of the built-in generator of the microcircuit depends on the RC-circuit R7-C2. In this case, the impulses can be removed from the output of 5 chips. What is done here and done. The pulses from the output 5 A1 through the R4-C3 circuit arrive at the amplifier input on the transistors VT1 and VT2, at the output of which (in the collector chain VT1), the infrared HL1 LED is enabled.

Thus, the Emitter of the IR signal serves HL1, and the receiver is the phototransistor VT3.

HL1 and VT3 are mutually located so that, there is no direct optical connection between them. They are directed in one direction, - in the other side, and between them there is an opaque partition, in which there may be a tabletop of the table (for example, HL1 on the table, and VT3 under the table).

If a person or some object, an IR-beam, radiated by the HL1 LED reflects from its surface, appears before the sensor consisting of HL1 and VT3. The HL1 LED is reflected from its surface, and enters the phototransistor VT3. Since the beam was modulated by pulses from the A1 microcircuit generator, then the emiter VT3 forms a photocurrent pulses of the same frequency. They via a rapid resistor R6, regulating sensitivity, and capacitor C1, come to the input of the decoder of the microcircuit of A1. Since, in terms of frequency, they coincide with the frequency of the generator on R7 and C2, and otherwise there can be no key at the output of the A1 chip, it exits the collector to its output 8. It creates a current on the basis of the VT4 transistor. It opens and the voltage at its collector rises to the supply voltage.

The nominal supply voltage for the LM567CN chip is 5V, and the entire scheme here is powered by a 12V voltage. Therefore, the supply voltage of the chip is lowered and stabilized at the level of the 5th parametric stabilizer VD2-R11.

The IR LED of the domestic production of al123a can be replaced by almost any IR LED designed for remote control systems.

R7 and C2 rates can differ significantly from the scheme. It practically does not affect the operation of the sensor, because the same R7-C2 circuit operates both in the reference frequency generator for the phase detector of the microcircuit decoder A1 and in the generator for the modulation of the IR emission of the LED. That is, the frequency of transmission and reception in any case coincide, because they are generated by the same generator.

All applied capacitors must be calculated for the maximum voltage not lower than the supply voltage.

Sensor sensitivity (reaction range) can be adjusted in two ways. In the first case, this is a r6 trimming resistor, which adjusts the sensitivity of the decoder. In the second case, this is the selection of resistor resistor R5, which limits the current through the infrared LED. You should not choose this resistor less than 3-4 ohms.

Literature:

  1. "Two lighting controls". g. Radio, 2008, №3, p. 37.

Gorchuk N.V.

There will be no bigger application yet, since it came to me later than planned (the reason is not in the delivery speed, but in some other reasons) and I had to apply a much more expensive solution.

There are different switches and switches.
There are usual who stand at home. To enable them or switch, you need to click.
There is a touch sensor, you do not need to press, but it is enough to touch.
And there are contactless, but not in terms of the lack of contacts (although one does not interfere with another), but in the absence of the need to even touch the switch, just to bring the hand to it.
Here is the last type of such devices and goes on.

Perhaps, perhaps, as always with the description and the photo that I received, and already in the process I will tell you what it is why and what are the exemplary analogues of this device.
She came in a neat box, the switch itself (or rather the switch) was in a transparent sachet, but before the photo I took it off.

Inside the package was.
Actually switch.
A set of fasteners, two plastic plugs and two screws.
Instructions in English, although it is not particularly necessary for this device, since it does not have any adjustment organs, and the outputs are signed from behind the device itself.
Impaired paper paper.

Instructions, and suddenly someone will come in handy :)

The button itself is very high-quality, the metal is strong, although thin, very similar to the stainless steel, plastic parts are fitted well.
Yes, and looking pretty pretty, annoying only an inscription EXIT, I will write further.

Rear present 5 wires.
Red and black, respectively, plus and minus power, everything corresponds to the generally accepted marking (there are exceptions).
Yellow - Total Relay Contact
Green - Normally Front Contact
White - Normally closed contact.
Wires are not very long, about 15 cm.

So we gradually got to the internships.
The board in the device is two-way, the prescription of the wires is also signed, which is very nice, since the paper passed from behind may well tear away, be spoiled, etc.
The back cover is not sealed, but it is quite normal, but the hole for the exit of the wires is made with a margin, because the security class is only valued for the front panel.

By logic, there must be a photo of the internships. She will be, but at first I will do a little lyrical retreat.
To begin with, what are the contactless switches.
1. Capacitive, require touch, or bringing hands to a very close distance. Probably the simplest and cheap solution. I had with such a sensor.
2. Radio frequency working on the principle of Doppler. The most expensive sensors.
3. Sensors based on reflection of IR radiation. Simple and inexpensive, but compromise.

And now the advantages and disadvantages.
Cucitiverelatively inexpensive, but desirable touching to the surface, I can incorrectly work in case of electromagnetic interference.
Radio frequency, work at a very high frequency, about 24GHz. Complex and, accordingly, expensive, but less fear of interference, are not afraid of surface pollution, can work through opaque plastic.
Infrared, simple design, the distance commensurate with radio frequency, but may decrease if the surface has strong contaminants and do not work through the materials are non-transparent in the IR range.

And now I will try to explain why I use such switches.
In addition to writing reviews, soldering boards, I do install automatic sliding doors. And these doors do not always have a motion sensor.
And since I install such doors and enterprises, then there are sanitary standards, according to which it is desirable (and sometimes it is necessary, for example, in operating and toilets), the use of doors opened activators with contactless control (there are even special devices where it is necessary to insert the leg that BBA worked contact).

Until recently, I used the sensors of the Belgian company BEA. for example

The cost of one such sensor is (if I don't confuse anything) about $ 130.
And often you need two sensors per door.
It should be noted that these sensors are not anti-vandal, overlapped performed more firmly, but the anti-vandal is also not considered.

So I got smoothly before showing as an IR sensor arranged inside.
At first I will show the place itself where the fee is set, it is clearly visible by the openings for the transfer and reception of IR radiation, they are made so that the IR receiver saw only the reflected radiation.
The fee itself will not work in itself.
By the way, a sealing gum would prevent the sealing gum around the perimeter of the metal, but there is also no way in an expensive radio frequency.

And now the device's printed circuit board itself.
It can be seen -
IR LED.
IR photodetector, such usually apply in different radio equipment having remote control, the frequency of 38 kHz (measured).
Relay, its parameters correspond to the parameters specified in the instructions.
Connector for connecting wires.
Power supply has protection in the form of a self-adjustable fuse and diode that protects against the power supply of incorrect polarity. Further there is a power stabilizer for 5 volts, electrolytic capacitors are missing, which only increases reliability.
Four two-color LEDs. Shoot red in normal mode and blue when triggered.
Control microcircuit, small, 6 legs, in the SOT23 housing.

To control the microcircuit is applied on which 02EN is written, I found on the Internet, but I'm not sure that it is, since the page is Chinese and looks like a page of some kind of incomprehensible trading platform or forum.
It does not simply constantly generate pulses to control the LED, but forms some sequences of pulse packs, a photodetector is counted on it.
As a result, the recognition of the obstacle is quite correct, it does not respond to the IR console, as well as on a strong incandescent lamp (but this is the merit of the photodetector).

Naturally, I measured consumption currents in standby mode and working.
In standby mode consumes 27mA. 12 volt food.

In active mode, a little more, 38mA, since the relay is included.

In standby mode, the backlight has a red, a little uneven, but maybe so conceived.

In active mode, the illumination is blue, but as a matte light scatter is applied, it does not bother.

A triggered range of about 8cm from hand and about 15 cm from white paper sheet.
It works very clearly even on the relatively fast movement of the hand, after the triggering is about two seconds in the active mode, after that it goes into standby mode.
On relatively subtle items do not work.

The design is quite subtle, most of the drowned, as it is designed for the insertion into the wall \\ panel.

Just in case, I measured the main dimensions, suddenly someone would come in handy.

As I wrote above, the power is 12 volts, which hints that the device is intended for use in security systems, and the inscription Exit also speaks about it.
Systems for industrial automation have standard 24 volts nutrition, and can work from direct current and from alternating.
I think that with a simple refinement, you can completely apply the button and with industrial automation systems.
The button could be very convenient in various applications, but strains the inscription, in my opinion it would be possible to offer either different options for inscriptions, or give a sticker with various inscriptions.
Scope of application -
Access control devices.
Managing the doorway in the rooms where it is necessary to give a team to open without touch, food companies, operating, clean rooms, toilets, etc.
Just places where such control can be convenient, for example in the kitchen (with appropriate decorative refinement) to turn on the lighting.

In general, when I wrote this review, I had a feeling of lung deja vu, I described similar impressions from the device in the review. In particular, I really liked the quality of manufacture and quite thoughtful and reliable in the form of a circuitry.

On the Internet, I met at least two options for the homemade implementation of such a device, one on the LM567CN chip, as well as on. I have collected the last option and it is successful for me is used, if I'm interested, I can somehow make a review.

Summary.
Pros.
Price.
Good appearance.
High-quality manufacture and fairly thought-out design.

Minuses.
We would like a sealing gum around the perimeter, for sealing.
Since the device can be applied not only as an output button, then I would like to have options for changing the inscription.

My opinion. A decent and simple replacement for radio frequency contactless switches, and not creating radiofrequency radiation.

This product was provided free of charge, for review and testing, Eachbuyer shop.

I think the overview of this device can be useful. Waiting for issues and comments.
If something forgot to mention, write, add.

P.S. By adding a kerching chip (and possibly one resistor and capacitor), you can redo the device in bistable, i.e. They brought the hand, turned on, brought once again, turned off. The cost of the alteration of about 20 cents, the HeF4013BP chip.
Now the device works as an analogue of a non-fixed button (as an output button in intercoms, although this sensor is made for such an application).
Perhaps there will be a review with a similar refinement :).

I plan to buy +91 Add to favourites I liked the review +112 +198