Sound sensor for the robot circuit. Touch and sound sensors. Turn on the light with a double clap

13.10.2023

Used to monitor noise levels or detect loud signals such as popping, knocking or whistling.

Board elements

Microphone and module electronics

The microphone converts sound vibrations into electrical current vibrations. If this signal is directly connected to the analog inputs of a microcontroller such as an Arduino, the result will most likely be unsatisfactory. The signal from the microphone must first be amplified, the negative half-wave removed, and the signal smoothed. All these actions are performed by the module’s electronic wiring.

Why can't we just take any microphone? There are several reasons for this.

Firstly, the signal from the microphone is very weak. So much so that if we connect it to an Arduino analog input, analogRead will always return 0. Before use, the signal from the microphone must be amplified.

Secondly, even an amplified sound signal is always oscillating. Therefore, the microphone readings are very dependent on the moment at which the voltage was measured by the microcontroller. Even with the loudest bang, analogRead can return 0 .

As you can see, even measuring the maximum amplitude values ​​will not provide clear information about the volume level. To obtain this information, you need to take measurements as often as possible and subject this data to mathematical processing. The numerical characteristic of loudness is the area under the graph of the sound wave. This is exactly what the electronic circuitry of the microphone “counts”.

Sensitivity adjustment potentiometer

The potentiometer adjusts the gain of the microphone signal amplifier. It can be useful if you need to change the triggering conditions of your device without changing its firmware. The higher the sensitivity of the module, the higher the proportion of interference in the useful signal of the sensor. We recommend starting work with the module with the potentiometer in the middle position. In this case, the sensitivity of the module will be easy to change in any direction.

Contacts for connecting a three-wire loop

The module is connected to the control electronics by two three-wire loops.

Purpose of three-wire loop contacts:

    Power (V) - red wire. It should be supplied with a voltage of 3 to 5 V.

    Ground (G) - black wire. Must be connected to microcontroller ground.

    Noise sensor signal (E) - yellow wire. Through it, the signal from the noise level sensor is read by the microcontroller.

The second loop from pin S picks up the analog microphone signal.

Video review

Usage example

We will display the readings from the noise sensor and microphone on the computer screen. Let's take Arduino as the control microcontroller.

soundLoudnessSensor.ino #define SOUND_PIN A5 #define NOISE_PIN A4 void setup() ( // open the Serial port monitor Serial.begin(9600); ) void loop() ( // read the microphone readings int soundValue = analogRead(SOUND_PIN) ; // read noise level readings int noiseValue = analogRead(NOISE_PIN) ; Serial.print(soundValue); Serial.print(" \t\t") ; Serial.println(noiseValue) ; )

The cost of electricity is constantly increasing, so there is a need to save it. One way is to automate lighting control. One option is to install acoustic sensors for lighting.

Let's talk about them in more detail, describe the methods of application, the principle of operation. We will also consider several diagrams of these devices for self-assembly.

It is necessary to keep the lighting on only if there are people present in the room or area where it is installed. The only exceptions are emergency lights designed to make it possible to notice unauthorized entry into the territory.

It does not apply at home. In order to detect the appearance of people, and to ensure that the lamps work only in their presence, acoustic sensors are designed for lighting.

Conventionally, sensors can be divided into two types:

  1. triggered by any noise, these are the vast majority of industrially manufactured acoustic relays;
  2. responding to sound commands, there are fewer such relays and more often they are homemade.

Let's look at each type separately.

Noise responsive

Most often, for lighting, an acoustic sensor is mounted on landings and corridors. It is useless to install them in the house, except in combination with a shutdown delay relay in bathrooms and bathrooms (we will also consider this option).

If a person moves, then he definitely makes sounds, even if they are quiet, of course, if there is no task to pass silently. This is the sound of a door opening or closing, the noise of footsteps, conversations (and even a locked lock). The sensor records them.

Collaboration with lighting is based on the following principle. For example, a noise sensor for lighting is mounted on the landing (we’ll talk about where it’s best to install them and where it’s undesirable below), two options are possible.

First option

  1. A man entered the door.
  2. The acoustic sensor heard the noise and gave the order to turn on the lights.
  3. While we are walking (unless we are trying not to hide our steps like a ninja), he hears a noise and leaves the light on.
  4. The last sound is a closed door, the lights are turned off.

Second option

  1. The relay hears a sound (steps, lock, door creaking, conversation), a command is sent to the time delay relay and at the same time the lighting turns on.
  2. After the time set in the delay relay has passed (one should be sufficient to pass through a corridor or landing), the lighting turns off.

The delay function can be built into the acoustic relay itself (most models), or performed using additional components.

It should be noted that in the first version of the relay operation a delay relay can be included, but not turning it off, but turning it on. This is done to protect against false positives. That is, the lighting does not turn on due to short-term noise (for example, a thunderclap on the street or a car horn), but the sound must continue for some time.

A relay that responds to noise has both advantages and disadvantages.

Advantages

  1. The relay is usually simple, which means its price is low.
  2. Unlike motion sensors, it does not respond to the movement of pets and rodents or to electromagnetic interference.

Minuses

  • To avoid turning on the lighting during daylight hours, it must be turned on either manually or using a timer. It is possible to install the light sensor outdoors.

Advice. It is better to install, together with the acoustic relay, not a simple timer that turns it on and off, for example, at six in the evening and eight in the morning, but an astronomical relay. This device takes into account the movement of the sun with the entered geographical coordinates. For example, it allows you to turn on the sound relay half an hour before sunset and turns it off a quarter of an hour after dawn, regardless of the time of year.

  • An acoustic relay cannot be installed in living rooms, since the lighting will turn off, for example, after you settle down with a book on the sofa and do not make any sounds.
  • The relay does not work well, or rather, it constantly turns on, if there is a high level of background noise. For example, you cannot install it in an entrance that faces a noisy street.

Relay responding to commands

In the simplest case, this can be a sound much louder than what can be heard with the normal presence of people in the room. For example, clapping your hands.

The author of this article assembled a similar structure in childhood, visiting the home of the pioneers. Such a relay is actually a regular noise relay, only its response threshold is higher and it distinguishes at least two commands.

For example, they clapped once, the light came on, and went out twice. It is quite possible to install it in residential premises, however, it is still probably more convenient to use a regular switch than to constantly clap.

In a more complex version, you can assemble a device that will distinguish between voice commands. That is, the relay will distinguish speech, just as the browser distinguishes “OK Google”. True, industrial versions of this relay are not yet commercially available.

Industrial relays

Let's look at several models of acoustic relays that can be purchased.

Stair automatic machine ASO-208

One of the inexpensive relays from Belarusian manufacturers - it can be purchased for 300-400 rubles (about 7-8 dollars). The device is quite sufficient for a standard landing. As you can see in the photo, it supports light bulbs up to 150 watts, which is enough to illuminate any landing even with incandescent lamps (although if you are saving money, it is better to use energy-saving LED lamps).

The relay is mounted directly on the wall and has a built-in microphone. Microphone sensitivity is adjustable.

For example, if the device is installed far from the entrance doors, then it can be increased, but if there is background noise, then reduced. Adjustment is carried out with a handle that can be turned with a screwdriver or any other similar tool.

At the maximum level, operation is guaranteed even if the key ring rings.

The relay has a built-in delay of 1 minute after the last sound has been detected. Unfortunately, the delay cannot be changed.

Connection is simple:

  1. We supply power to terminals L and N after a switch or relay, which will prevent the device from operating during daylight hours. It is desirable that there is a phase on contact L and zero on contact N. Although if you mix up the relay it will still work.
  2. We connect the lamps to the remaining two terminals.

Relay EV-01

This is a noise sensor for lighting already Russian production(Relay and Automation LLC), its price is also about 300-400 rubles. It differs from the previous device in lower power of the connected load, only 60 W. However, this is enough for most staircases and landings.

As in the previous case, it is mounted directly on the wall and has a built-in microphone. Its sensitivity, unfortunately, is not adjustable. The manufacturer guarantees that it will respond to any sound within a radius of 5 meters. There is also a shutdown delay, although it is less than only 50 seconds.

The advantage of this relay is the presence of a photocell, which allows operation only in the dark. Its sensitivity is also not adjustable, so you need to choose the location of the device so that there are no false alarms, for example, from illumination through a window from street lights.

The device is connected in exactly the same way as the previous one, although the terminals are hidden under the housing cover.

Relay from Ali Express

A cheaper device can be ordered on the well-known Ali Express site. For example, they offer an acoustic relay Joying Liang (on the website the name is: JOYING LIAN Sound Light Control Delay Switch Surface type Energy Saving Acoustic Light-activated Relay, these are the consequences of automatic translation) for only 266 rubles.

This device is similar in its characteristics to a relay from a Russian manufacturer.

  • Delay time - 40-50 seconds.
  • It is not possible to adjust the sensitivity of the microphone and light sensor.
  • The relay is connected using terminals with wires coming out of the housing (they can be clamped into an external terminal block).

    Homemade acoustic relays

    Now let's move on to the diagrams for DIY assembly. Here are several options of varying complexity.

    The simplest circuit using one transistor

    Let's start with the simplest scheme of two blocks of the actual acoustic relay and a trigger for controlling the load.

    Acoustic relay

    The relay is assembled on just one transistor, here is its diagram.

    An old germanium transistor MP 39 is used, it is easy to find in old equipment from the 60-90s, and other elements are also easy to find there, including D 2 B diodes.

    Advice. It is advisable not to take electrolytic capacitors from old equipment (those with polarity indicated, they are usually of high capacity from 0.1 microfarad or more). If all other parts do not lose their properties over time, the capacitors dry out.

    A carbon microphone from an old TA 68 telephone (analogues of TAI 43, TAN 40) was used as a sensor. These microphones are used in simple rotary dial phones that do not have built-in amplifiers.

    The advantage of a carbon microphone is its enormous sensitivity, the disadvantage is its narrow frequency transmission range. But in our case, the minus is a plus, since the possibility of triggering from extraneous noise is reduced, that is, the selectivity of the device.

    1. When noise appears, the resistance of the carbon microphone decreases, and alternating current flows through capacitor C1 to the base of the transistor.
    2. The transistor, with the help of the current flowing through resistor R2, is in a slightly open state, so it immediately begins to amplify this signal.
    3. Through capacitor C2 from the collector of the transistor, this voltage is supplied to a doubler assembled on two diodes and capacitor C3.
    4. Double the voltage is supplied again to the base of the transistor through resistor R 3.
    5. The transistor begins to work as an amplifier direct current and opens completely.
    6. The current through the emitter (collector) of the transistor flows to the winding of relay P1.
    7. Relay contacts KP1 close.
    8. When the sound disappears, the alternating current at the base of the transistor disappears and it returns to the half-open state. There is no current through the relay coil and its contacts are open.

    If the sensitivity of the relay is excessive, adjustment can be made by installing a variable or trim resistor with a resistance of about 100 Ohms in series with capacitor C1.

    In principle, you can connect in series with the KP1 contacts an ordinary powerful relay, rated for 220 V, which will control the lighting, but this approach is not very convenient. When the noise disappears, the light will go out. Therefore, you need to use a relay with a turn-off delay.

    The circuit can be assembled either on a canopy or on a breadboard or printed circuit board. The author's version is shown in the photo below.

    For power supply, you can use any power supply with a voltage of 9-12 volts. If all safety measures are followed, even transformerless.

    Trigger for lighting control

    The author of the circuit offers a slightly different approach to control lighting - he mounted a trigger on a polarized relay RP 4. In this case, after each sound (clapping hands), two lamps are switched. If you leave only one, it will simply turn on and off.

    Lighting control in this case will look like this:

    1. We entered the room, slammed, the lights came on.
    2. On their way out, they slammed again and the lights went out.

    In this circuit, you can use any powerful diodes designed for the current passing through the lighting lamps and a voltage of 220 V, for example D245.

    Note. Capacitor C1 must also be designed for a voltage of 220 V.

    The trigger works as follows:

    1. When noise occurs, contact KR1 of the acoustic relay closes.
    2. The voltage through lamp L1 and diode D1, contacts of the second winding of relays 7 and 8, current-limiting resistor R1 and contacts KR1 charge capacitor C1.
    3. The charging current of the capacitor switches the armature to the left position and lamp L1 lights up.
    4. Diode D1 is blocked by relay contacts.
    5. Diode D2 remains in a ready-to-use state.
    6. When the sound reappears and the contacts of the KR are closed, the current already flows through the diode D2 and the contacts of the second winding 6 and 5.
    7. The relay armature closes the right contact, and the system returns to its original state.

    If we need the trigger to control only one lamp, then instead of the second we include a series capacitor of 0.25 μF x 300V and a 10-5 kOhm resistor with a power of at least 2 W.

    Circuit with three transistors

    This is a more complex circuit with three transistors, but it already works as a trigger, turning on the lighting at the first sound and turning it off at the second.

    The circuit also uses transistors KT315 and KT818, which are also common in radio engineering - they can be soldered or purchased at any specialized store. Even if you buy the entire set of radio components, it will cost a maximum of 70 rubles, which is significantly cheaper than a ready-made acoustic relay.

    With a supply voltage of 9 volts, the sensitivity of the device is about 2 meters. By increasing the voltage (the relay can operate in the range of 3.5-15 V), you can raise it, and by decreasing it, you can lower it. If you use KT368 transistors or their analogues, it is possible to achieve sound recognition at a distance of more than 5 meters.

    Instead of domestic transistors, you can use their foreign-made analogues (in many cases, imported equipment is more accessible for disassembly). For example, replace KT315 with 2N2712 or 2SC633, KT818 with 2N6247 or 2SB558. In general, the circuit is not critical to the parts used.

    The microphone used is electrodynamic; it can also be taken from a broken tape recorder or any other similar device - the type is also not critical.

    The electromagnetic relay must be designed for a voltage of 220 volts and the corresponding current. If a significant current flows through its winding, then it is advisable to mount the KT818 transistor on a radiator to prevent its overheating and failure.

    The scheme works as follows:

    1. A generator with positive voltage is assembled using KT315 transistors feedback. The values ​​of the passive elements are selected so that it is in a state at the threshold of excitation.
    2. The noise received by the microphone excites a signal in its winding.
    3. The signal goes through the decoupling capacitor to the base of the first transistor and starts the generator.
    4. In the generation mode, a voltage appears on the collector of the second KT315 transistor, which opens the switch on the powerful KT818 transistor.
    5. Through the collector and emitter of the third transistor, voltage is supplied to the relay winding Rel1. The relay contacts close and the load (lighting) turns on.
    6. The generator operates until the generation is interrupted as a result of the repeated receipt of a signal from the microphone caused by noise near it (repeated clap).
    7. When generation fails, the voltage at the KT818 base is removed and the key is closed.
    8. The relay winding is without current, therefore, the contacts open and the lighting turns off.
    9. A diode connected in parallel with the relay winding serves to dampen the reverse current surge.
    10. The LED parallel to the usual one serves to indicate the moment the relay operates. You can refuse it.

    To power the acoustic relay, a small ready-made power supply can also be used (for example, Charger cell phone) or self-assembled. As we have already said, the device is operational in the range of 3.5-15 V. The main thing is that the voltage corresponds to the maximum permissible for the relay winding and is enough to reliably close the contacts.

    You can assemble an acoustic relay on a breadboard, or you can make a printed circuit board. The author's version of this scheme is shown in the picture below.

    You can watch a video of how the assembled relay works:

    Why does generation start from one signal, but stop from another?

    After reading the description of the device's operation, many may have a question - why does one amplifier signal start the generator, and the other stop it? After all, they can be completely identical, and the second one, it seems, should support the operation of the generator. Let us explain using a physical analogue of a generator - a pendulum.

    1. Make a pendulum, hang a weight on any string. This is an analogue of a generator at the excitation threshold.
    2. Push the pendulum, it will begin to swing. Your impact is a signal that starts the generator, and the vibrations of the load simulate current fluctuations during the generation process.
    3. Try pushing the swinging weight again. If you do not fall in time with its oscillations, then you will inevitably stop the pendulum.

    The same processes occur in our relay. Of course, it is possible that the second signal will be synchronous with the oscillations of the generator, but the likelihood of this is low. In addition, it is not difficult to clap a second time if the relay did not respond to the first sound.

    Relay option using microcircuits

    Let's consider another version of the relay, which uses a microcircuit. It is also interesting in that it does not require a separate power supply; it is included in the design of the device itself.

    The circuit also differs in that a thyristor is used instead of an electromagnetic relay. This approach allows you to increase reliability; the relay has a certain resource (number of operations), but the thyristor does not have such a limitation. In addition, controlling the load using a semiconductor element allows you to reduce the size of the relay without reducing the power of the controlled load.

    The device is designed to work with incandescent lamps with a power of 60-70 W and has a sensitivity of up to 6 meters. The design is easy to assemble and is well protected from interference. Schematic diagram presented below.

    The relay is also not critical to parts; replacement with analogues is possible:

    1. An electret microphone can be removed from an old tape recorder.
    2. instead of the KT940 transistor, you can install a KT630 ​​or even a KT315 (although there is a possibility that it will get very hot).
    3. The K561TM2 chip can be replaced with KR561TM2.
    4. Diodes KD226 are replaced with D112 - D116 or KD258, please note that they must be rated at 300 V.
    5. The D814 zener diode is replaced with a D808 or KS175 stabilization voltage should be in the range of 9-12 V.
    6. Thyristors can be KU 201 or KU 202. If there is a choice, then we select an instance with a minimum control electrode current. You can also install a triac (we’ll talk about this circuit upgrade below).

    Now let's look at the operation of the device. In order not to be distracted later, we will immediately describe the principle of operation of the microcircuit. It consists of two triggers (translated from English as latches), this can be seen by the letter “T” on the symbol of the element. In the diagram they are designated DD1.1 and DD1.2.

    A trigger is a digital device. Its inputs accept only two types of signal.

    1. Logical zero- there is no voltage, or rather its potential is close to the power supply minus potential.
    2. Logical unit- there is voltage (for 561 series microcircuits it is close to the power supply plus potential).

    The same signals are also generated at the power outputs. The trigger works like this:

    1. Immediately after it is turned on, the output is logical zero.
    2. At the second output, which is called inverse and is indicated by a small circle on the contour symbol— there will be a zero at the beginning of the line designating it. This is an output, as if in reverse (the word inversion is the Latin inversio - turning over, rearranging), its state always differs from the direct one, when the direct one is zero, then the inverse one is one.
    3. If you apply a logical one to the S input, then a one will appear at the output, and the trigger will remain in this state, even if the signal from the input is removed.
    4. To reset the output to zero, you need to apply a one to the R input.
    5. The trigger has two more inputs. D (information) - the output state changes with each new signal (pulse) on it. Moreover, this happens only in the case when a logical unit is applied to input C (synchronization). Otherwise, the signal at the R input will not be perceived.

    Now let's take a closer look at how the scheme works:

    1. The signal from the electret microphone is fed to an amplifier assembled on two transistors VT1 and VT2. One of them is familiar to us from the previous scheme KT315, the second is KT361. This is a twin of the first one, but only with a different type of conductivity. The use of such a pair of transistors makes it possible to reduce their mutual influence on each other and improve the sensitivity of the device.

    Capacitors C1 and C2 serve to decouple the microphone from the amplifier and both transistors from each other. Capacitor C3 protects the amplifier from interference from the power supply.

    1. The signal from the amplifier goes to input C of the first trigger. Since a logical one is constantly present at its input D (it is connected to positive), the trigger switches, and voltage appears at its direct output.
    2. At the output there is also a chain of resistor R6 and capacitor C4. The capacitor begins to charge; when fully charged, a voltage (logical one) will appear at the R input. The trigger is reset (zero output). Input S is connected to ground, and it is constantly zero - it does not affect the operation of the device.
    3. Capacitor C4 is discharged through diode VD 1 to the trigger output (zero on it, i.e. minus power). In this state, the logical element DD1.1 will remain until its input C receives voltage from the amplifier again (the relay will again respond to sound.

    Thus, a single-vibrator is assembled on DD1.1 - a device that, for each input pulse, regardless of its shape and duration, produces an output square pulse, with an amplitude equal to the voltage of a logical unit. Its duration is determined by the values ​​of capacitor C4 and resistor R6 in direct dependence (the oscillogram of the signals in the relay is shown below). With these values ​​of capacitance and resistance, the pulse duration is 0.5 seconds.

    If the system does not operate clearly, then you can extend the pulse period by increasing the resistance R6 (by the way, it is marked in the diagram with an asterisk - “*”, which means selectable)

    1. The pulse from the one-vibrator is supplied to input C of the second trigger (DD1.2). At this moment, at its input D there is a logical one, supplied from the inverse output (the inputs R and S are connected to ground and are constantly zero, they do not affect the operation of the microcircuit). A logical one will appear at the output of the trigger.
    2. Through resistor R7, the voltage from the output of the second trigger is supplied to the base of transistor VT3, it opens.
    3. At the connection point of the emitter VT3 of resistor R8, voltage appears - it goes to the control electrode of the thyristor, and it opens.
    4. A lighting lamp connected to the network via a diode bridge VD2 -VD5 and our thyristor VS1 lights up. A diode bridge is needed since the thyristor does not work with alternating voltage.
    5. After the second clap sounds, the single-vibrator generates another pulse that switches the DD1.2 trigger to its original state. Its output is zero.
    6. Transistor VT3 closes, and, therefore, the voltage on the control electrode of the thyristor is removed - it also closes.
    7. The lamp goes out and the relay returns to its original state until the next signal.

    To make the processes occurring in the relay more clear, you can study the oscillogram of the signals generated in its nodes.

    To power the relay, the circuit provides a transformerless power supply; it consists of the following elements.

    • Diode bridge VD2-VD5 - converts the alternating voltage in the network into a constant, pulsating one. At the same time, the lighting lamp-thyristor circuit is powered from it.
    • To dampen excess voltage, resistor R9 is used. Together with the supply resistance of the device elements, it forms a voltage divider.

    Note. If all other resistors can have a small power of 0.125 W, then the power of this one is at least 2 W, otherwise it will inevitably burn out. Also, with possible upgrades of the circuit, its rating will have to be selected again so that the supply voltage does not exceed 12 V.

    • To convert the pulsating voltage to direct voltage, capacitor C5 is used. In the diagram its capacity is 1000 µF, but the more the better.
    • Eliminates voltage surges with zener diode VD1. The voltage between its cathode and anode is always constant.

    You can assemble the circuit on a breadboard, but it’s still better to make a printed one so it’s more reliable. When assembling, pay attention to the pin numbering of the K561TM2 microcircuit; its pinout is shown below.

    The device can be placed in any convenient case - either self-assembled or from other devices.

    Attention. All elements of the device are under voltage of 220 V, be extremely careful when testing and setting up the device. The housing must also provide protection against electric shock. It is advisable that the relay be connected to an electrical wiring line with an RCD (residual current device) installed.

    Now we present several options for modernizing this scheme.

    Increasing load power

    The relay is designed for a load of 60 - 70 W, this is quite enough for staircase lighting. However, if necessary, it can be increased. To do this, the diodes of the bridge VD2 - VD5 and the thyristor VS1 need to be installed on radiators, which will reduce their heating.

    True, you will have to use diodes D112 - D116; they have a thread for a nut for mounting on the radiator.

    The larger the radiator area, the better. When installing elements on the radiator, consider the following nuances.

    • The contact points between radio components and radiators must be carefully polished to ensure reliable contact.
    • For better heat transfer, use heat-conducting paste, the same as for installing the processor in computer system units.
    • Radiators must be electrically isolated both from each other and from the device body.

    Operation in noise relay mode

    In the original version, the relay responds to commands given using claps. However, it can be redesigned so that it responds to noise, like the industrial relays presented in our article.

    That is, when a sound occurs, the relay turns on the lighting, and when it disappears, it turns off after a certain period of time. To do this, you don’t even have to complicate the device; on the contrary, it simplifies it. We make changes to the diagram - the instructions are as follows.

    1. To the base of transistor VT3 we connect not the output of the second trigger DD1.2 to the output of the first (we connect pin 13 of the microcircuit to resistor R7). It turns out that we don’t need the second part of the microcircuit. Thus, the lighting will be turned on from the one-shot signal launched by the sound amplifier.
    2. However, as we saw in the oscillogram of the signals, in the relay the duration of the pulse generated by the monostable is only 0.5 seconds. That is, after noise has appeared, the lighting will only come on for this time. So it needs to be extended. As you remember, the pulse duration directly depends on the capacitance of capacitor C4 and resistor R6. This means that we increase the capacitance of the capacitor and the resistance of the resistor - we select them so that the delay suits us.

    Advice. You can, of course, select capacitance and resistance by trial and error, but it’s easier to calculate. The formula is T=CxR.

    Example, we select a capacitor capacitance of 300 µF, and the turn-off delay time is 60 seconds. Let's transform the formula to calculate the resistance of the resistor: R=T/C, in our case 60/300×10-6=200000 Ohm, that is, 200 kOhm. You can also use online calculator, for example at the link: http://hostciti.net/calc/physics/condenser.html.

    You can also install a variable or construction resistor instead of the usual resistor R6, then during operation the relay will easily change the delay time.

    That's it, you don't need to make any other changes to the schema.

    The load operates not from rectified current, but from alternating current

    The load in our circuit is supplied with a constant pulsating current, since a diode bridge is installed in front of the thyristor switch. This is not quite the right solution for a device designed to save energy. The thing is that only incandescent lamps can be powered by 220 V DC. Energy-saving lamps designed for alternating current.

    • Fluorescent lamps, including long-familiar lamps " daylight» use alternating current for the starting device.
    • IN LED lamps a voltage-reducing circuit is installed (for LEDs you need 3 - 5 V), it is also operational only when powered from an alternating current network.

    So naturally it is better to switch to AC supply for the load. There are three ways to do this.

    • Install a relay instead of a thyristor, and all the benefits that control with a semiconductor device brings are lost.
    • Install a triac instead of a thyristor; this element works similarly, but passes current in both directions. This is the best option.

    • Alternatively, instead of a triac, you can install two parallel-back-to-back (the cathode of one is connected to the anode of the other) connected thyristors. The control electrodes are connected together. This option can be used if problems arise with purchasing a triac. The second thyristor is the same.

    A triac is installed with a load of up to diode bridge. In this case, the latter will only be used for power supply electronic components devices, so you can use less powerful diodes, for example D102, or even use a ready-made bridge, for example KTs405. You can choose a triac, for example KU208G or TS112.

    That's all we wanted to tell you about the sound sensor for lighting. We hope our article helped you understand the principles of operation of this device and told you about the possibilities of its use. It’s great if you were able to independently implement one of the proposed schemes or at least purchased an industrial relay to control lighting. Let your home be comfortable and economical.

    With the development of civilization, electricity has become an integral part of our Everyday life. Today it is possible to use a wide variety of innovations and technical innovations right in your home.

    Lighting in a home has always been one of the most important aspects of comfortable living in it. But how many times have you encountered a situation when you need to turn on the light, but you can’t immediately find the switch in the dark? Modern technologies, which today penetrate our homes everywhere, are designed to eliminate such awkward moments. Now you can use it to turn on the light in the room sensor responsive to sound.

    Sound sensor

    A device such as a sound sensor has recently begun to enjoy noticeable popularity, since to a certain extent it allows us to make our lives more comfortable and practical.

    Let's talk about the sensor

    Sensor for turning on the light in the room using sound signal appeared on sale relatively recently. It is a special device consisting of a special structure into which a light bulb is inserted. Sometimes it has the form of a cartridge, but most often it is found in the form of a plastic box.

    It responds to sound signals, thanks to which the light turns on. A clap of your hands can act as a sound signal.

    Note! This method of switching on is very convenient, but only in a situation where your hands are free. Therefore, some sensors can be programmed for a specific sound signal, which will turn on the light.

    Installing such equipment allows you to reduce energy costs, since many of us, being too lazy to reach for the switch, simply do not turn off the light when it is not particularly needed. In addition, moving around the house in the evening will become more comfortable and safe, since when entering a room the light can be turned on using sound, avoiding blind actions. It is the light that is not turned on in time that very often leads to injuries.

    Types of devices

    Today, sensors for turning on light in a room via an audio signal can be of the following types:

    • standard sound;
    • a sound device that also reacts to movement;

    Motion Sensor

    • sensor with photocells. It monitors the level of general illumination present in the room and, if necessary, independently monitors whether the lights are turned on or off.

    Note! The installation of this device is very popular in places where emergency power outages often occur, as well as where periodic breaks in electrical wires are possible.

    Sensor with photocells

    As you can see, there are several types of devices that can be used to turn on the light in a room without using a standard switch. In this case, the signal to turn on for each product will be different: sound, movement or light level.

    Each of these devices has its own specifications, Advantages and disadvantages. Before choosing a device, make sure that this is the type of device you need. Remember that this pleasure does not come cheap. Therefore, your choice must be balanced.

    Purpose of the device

    Typically, sensors that are designed to turn on lights are used in different rooms:

    • in rooms that are rarely visited;
    • they are in demand in warehouses or other premises where it is not always possible to turn on the light with your hands;
    • in private homes;
    • often installed in rooms intended for transition. For example, today such technical innovations can be found in the corridors of office buildings and government institutions;
    • It is rational to install them in garages, in summer cottages, as well as in those rooms where it is not possible to install a standard switch. Usually these are sterile rooms or rooms with increased hygiene requirements.

    Installed sensor

    In addition, depending on the type of device, it can be used in a variety of situations where its functions are in demand. For example, thanks to the installation of some types of products, after turning off the electricity, the light will remain on for some time, which is very convenient and allows a person to leave the room without any problems.

    The use of such products in the home allows you to use energy more rationally, saving and not wasting it. Connecting a sensor will allow you to significantly increase the operating resources of the light sources you use.

    Of course, there is not always a need to install a sound recorder for turning lights on/off in a private or apartment building. But if you want to make your home more technologically advanced or just surprise your friends, then the best way what to buy sensor For Sveta, No.

    Principle of operation

    The sound sensor required to turn on the light belongs to the group of acoustic mechanisms. The principle of its operation is based on the detection of an acoustic wave by the device. Such a wave propagates throughout the device, penetrating inside. At the same time, it registers any deviations from standard parameters that arise as a result of the propagation of a sound wave. The wave speed and its amplitude are used as reference points. The wave speed, in turn, is recorded through the frequency and phase indicator.

    Any device designed to turn on lighting in a room using an audible signal must be installed in a break in the power line of the lighting device.

    Sensor installation diagram

    The operation of the device itself follows the following algorithm:

    • The device is in the " acoustic control" IN this mode the sensor is capable of reducing the sound signal;
    • in the presence of a loud acoustic signal, the device picks it up due to a sharp change in the sound background;

    Note! The sensor can interpret a door slam, a person’s steps, a door opening, a voice, etc. as a sound signal.

    • When a sound wave is detected, the device turns on the light for 50 seconds. During this time, it does not respond to changes in the sound background in the room.

    According to this algorithm, the device operates until the next change in the sound background in the room. If it has not registered the acoustic waves, the light will be automatically turned off.

    If noise is detected, the operation of the device will be extended for another 50 seconds. This algorithm will be repeated throughout the operation of the device.

    It should also be noted that the sound sensor uses piezoelectric materials in its operation. In physics, piezoelectricity is understood as a certain type of electric charge that is formed due to the presence of mechanical stress. Piezoelectric materials, when applied to an electric field of a certain charge, cause mechanical stress. Thus, piezoelectric sound sensors promote the development of mechanical waves using an electric field. Based on these phenomena, the operation of acoustic sensors occurs.

    Acoustic sensor

    The microphone serves as the receiver of the sound signal. It serves as a converter of acoustic vibrations into the existing alternating electrical voltage.

    These microphones come in the following types:

    • low-resistance - is an inductor equipped with moving magnets. They act as variable resistors;
    • high-resistance - is the equivalent of a variable capacitor.

    In addition, microphones can be:

    • electret two-terminal;
    • three-terminal electret.

    But such microphones have somewhat poor signal transmission. To improve their performance, a special amplifier is needed that will pre-amplify the acoustic wave.

    Despite the fact that electret microphones are similar to piezo transducers, they differ from them in linear transmission, as well as a significantly wider frequency. This allows the device to process the received signal without distorting it.

    As practice shows, this operating principle is very reliable, which guarantees long-term operation of the device. Therefore, you will enjoy this technological device for quite a long time.

    With a sensor focused on receiving the audio signal, you optimize the switching process Sveta in your home or in a separate room. Installing the device will allow you to save more, and you will no longer look at your electricity receipts with the same fear.

    How to select and install volume sensors for automatic light control
    Homemade adjustable transistor power supplies: assembly, practical application

    Using the described design, you can determine whether a mechanism located in another room or building is working or not. Information about the operation is the vibration of the mechanism itself. The design is quite simple and contains a minimum of parts.

    In automation systems, it is often necessary to determine the state of a device or mechanism simply at the level of “on - off”, or “working - not working”. A fairly real and clear example is a pump in a mini-boiler room.

    The boiler itself with the control device (controller) can be located in one room, and the pump that creates pressure in the heating system in another. And not just in different rooms, but generally in neighboring buildings.

    How can you tell the controller that the pump is on and running? Of course, simpler systems may use not a controller, but a simple and cheap alarm to attract the operator's attention.

    There are several ways to do this. For example, using an additional contact of a starter that turns on a pump: the contact is closed, therefore the pump is running. Although, for some reason, it may not work. In addition, the starter does not always have an unused contact. This is another disadvantage of this scheme.

    In addition to this method, you can receive a signal about the operation of the pump by using a current sensor. Such a signal will more objectively reflect the operation of the device as a whole than the above-mentioned contact. The disadvantage of this method is that it interferes with the electric drive circuit.

    How can you control the operation of the installation without interfering with its circuitry? It turns out to be quite simple if you remember that the mentioned pump creates noise and vibration during operation. Many other devices have the same properties: electromagnets, powerful transformers, simply mechanical parts of an electric drive. The operation of the mechanism operation sensor described below is based on these “harmful” properties. Similar sensors can also monitor the status of a device equipped with a motor. internal combustion or diesel.

    The sensor uses vibration to a greater extent than noise, so when installing it, you should find a place in the mechanism where the vibration is sufficient to trigger the sensor. At the same time, elevated temperature is not desirable at the location where the sensor is installed. The schematic diagram of the sensor is shown in Figure 1.

    Figure 1. Diagram of the mechanism operation sensor (to enlarge the diagram, click on the picture).

    The circuit is quite simple and contains only 3 transistors. The principle of its operation is very similar to the operation of the hitchhiking circuit in tape recorders: while pulses are coming from the magnetic tape motion sensor, a signal to stop the mechanism is not generated. The tape jammed or ran out - the mechanism stopped.

    In our case, the vibration sensor is electret microphone M1, the signal from which is fed through capacitor C2 to an amplifier made on transistor VT1. Through capacitor C3, the alternating component of the amplified signal is supplied to a rectifier made according to a voltage doubler circuit. The rectified voltage charges capacitor C4, so transistor VT2 will be open (low voltage level at the collector). This low level keeps transistor VT3 closed, so relay P1 is turned off and the alarm signal is not sent to the controller or alarm. A diode VD4 is installed in the emitter of transistor VT3. This is a so-called level clamp, which ensures more reliable closing of the transistor.

    If the mechanism stops, the vibrations stop, and there is simply nothing for the microphone to pick up. Therefore, the pulses on the collector of transistor VT1 stop, and capacitor C4 is discharged. Therefore, transistor VT2 closes, and VT3 opens and turns on relay P1, the contacts of which inform the controller about an emergency situation.

    Setting up the device

    Setting up the device is easy. First of all, using resistor R2 on the collector of transistor VT1, you should set the voltage to approximately half the supply voltage. In this case, transistor VT1 will operate in linear mode, i.e. as a signal amplifier.

    The second stage of setup is to set the sensitivity level of the entire sensor as a whole using variable resistor R4. To do this, move its engine to the lowest position according to the diagram. This is the minimum sensitivity of the sensor; in this case, the relay will be turned on. Then, placing the microphone in the place where it will be installed, rotate the trimming resistor R4 to turn off the relay. When the mechanism is turned off, the relay should turn on again.

    Details and design

    If you intend to manufacture several copies of the sensor, then it is best to assemble the circuit on a printed circuit board. The easiest way to make it is using laser ironing technology. If only one copy is required, then it is quite acceptable to assemble it by hanging installation. The assembled board should be placed in a plastic case with fastening elements.

    Transistors VT1, VT2 can be replaced with KT3102 with any letter index, KT503 with KT815 or KT972. All diodes can be replaced with any high-frequency low-power diodes, for example KD521, KD503.

    All resistors are MLT-0.25 type or imported. Electrolytic capacitors It’s also easier to buy imported ones with an operating voltage of at least 25V.

    As relay P1, it is permissible to use any small-sized relay, possibly also imported, with an operating voltage of 12V. The device can be powered from a low-power source, for example from a Chinese network adapter.

    When making your own power supply, you will need a transformer with a power of no more than 5 W, with a secondary winding voltage of about 15 V. The easiest way to assemble such a source is based on the 7812 integrated stabilizer. A similar circuit is quite easy to find, so its description is not given here.

    CMA-4544PF-W or similar;

  • 3 LEDs (green, yellow and red, from this set, for example);
  • 3 resistors of 220 Ohms (here is an excellent set of resistors of the most common values);
  • connecting wires (I recommend this set);
  • breadboard;
  • personal computer with Arduino IDE development environment.
  • 1 Electret capsule microphone CMA-4544PF-W

    We will use a ready-made module that contains a microphone, as well as the minimum necessary wiring. You can purchase such a module.

    2 Connection diagram microphone to Arduino

    The module contains an electret microphone that requires power from 3 to 10 volts. Polarity when connecting is important. Let's connect the module according to a simple diagram:

    • output "V" of the module - to +5 volt power supply,
    • pin "G" - to GND,
    • pin "S" - to analog port "A0" of Arduino.

    3 Sketch for reading readings electret microphone

    Let's write a program for Arduino that will read readings from the microphone and output them to the serial port in millivolts.

    Const int micPin = A0; // set the pin where the microphone is connected void setup() ( Serial.begin(9600); // initialization of the sequence port } void loop() ( int mv = analogRead(micPin) * 5.0 / 1024.0 * 1000.0; // values ​​in millivolts Serial.println(mv); // output to port }

    Why might you need to connect a microphone to Arduino? For example, to measure noise levels; to control the robot: follow the clap or stop. Some even manage to “train” the Arduino to detect different sounds and thus create more intelligent control: the robot will understand the “Stop” and “Go” commands (as, for example, in the article “Voice recognition using Arduino”).

    4 "Equalizer" on Arduino

    Let's assemble a kind of simple equalizer according to the attached diagram.


    5 Sketch"equalizer"

    Let's modify the sketch a little. Let's add LEDs and thresholds for their operation.

    Const int micPin = A0; const int gPin = 12; const int yPin = 11; const int rPin = 10; void setup() ( Serial.begin(9600); pinMode(gPin, OUTPUT); pinMode(yPin, OUTPUT); pinMode(rPin, OUTPUT); } void loop() ( int mv = analogRead(micPin) * 5.0 / 1024.0 * 1000.0; // values ​​in millivolts Serial.println(mv); // output to the port /* LED response thresholds are adjusted by you experimentally: */ if (mv )

    The equalizer is ready! Try talking into the microphone and see the LEDs light up when you change the speaking volume.

    The threshold values ​​after which the corresponding LEDs light up depend on the sensitivity of the microphone. On some modules, the sensitivity is set by a trimming resistor, but on my module it is not. The thresholds turned out to be 2100, 2125 and 2150 mV. You will have to determine them yourself for your microphone.

    © ru-opel.ru, 2024
    Car portal