当前位置:网站首页>Electronics: Lesson 014 - Experiment 15: intrusion alarm (Part I)

Electronics: Lesson 014 - Experiment 15: intrusion alarm (Part I)

2022-06-25 08:00:00 acktomas

experiment 15: Intrusion alarm ( The first part )

Designing circuits from scratch often encounters unexpected problems and errors , If you pretend these problems don't exist , Will be misleading . therefore , In the following experimental steps , You will encounter at least one setback and reversal —— Until we finally make it reliable 、 A system that works .

Items needed

  • Breadboard 、 Connecting line 、 Wire nippers 、 Wire stripper 、 A multimeter
  • 9 V Batteries and connectors , or 9 V communication — DC adapter
  • Universal LED 1 individual
  • 2N2222 The transistor 1 individual
  • Double pole double throw 9 V DC relay 1 individual
  • 1N4001 diode 1 individual
  • resistor :470 Ω 1 individual 、1 kΩ 1 individual 、10 kΩ 1 individual

Wish list

This experiment is very complicated , Need a plan . But before making a plan , I need to know what I need first , So I have to write a “ Wish list ”. In the process of making a list , I will also imagine what the components used in the previous experiment should meet .

that , What are the components of the intrusion alarm ?

  1. There should be a trigger system . The equipment needs to detect whether someone has entered the house . Systems that use laser beams or ultrasonic waves are cool , But it's hard to achieve . Because this is the first attempt , So I will use the easy to buy door and window magnetic sensor switch .
  2. To make a sound . The alarm should sound something special 、 A striking oscillating sound wave .
  3. Have anti-interference function . Don't let others cut the wire to stop the alarm . actually , Interference shall trigger an alarm .
  4. To connect the sensors in series . In order to make the system anti-interference , I can make a small and constant current flow through multiple normally closed sensor switches in series . Either switch is off , Or the wire breaks , The current will be disturbed , This triggers the alarm . I think most wired alarms are designed based on this principle .
  5. Open — Switch off . If I use a series sensor , Caused by switch disconnection or circuit interruption “ Turn off ” The event must trigger the alarm . Maybe a double throw relay can do this . The current through the relay coil opens a pair of contacts , As soon as the current disappears , The contacts are closed by default . But the relay will consume huge power if it keeps the contact open , And I hope the alarm system is “ standby ” The current passing through the mode is very small , So it can be powered by batteries . The alarm system must not rely entirely on residential AC power supply .
  6. Is it OK to use transistors ? If I don't use relays , When the circuit is disconnected , Transistors can also trigger alarms . The base of a transistor can always be kept at a low voltage , Until the circuit is disconnected . Then the voltage rises , The transistor turns on .
  7. Be equipped with an alarm . I need a small lamp , When all the doors and windows are closed , The light will come on , Remind me that the alarm is ready . Then I'm going to press a button , Start the one minute countdown , Let me have enough time to leave . A minute later , The alarm will be equipped .
  8. Be self-sustaining . After the alarm is activated , I don't want it to stop easily . If someone opens the window , Even if he closes the window again , The alarm should also continue to sound . Maybe a transistor can trigger a relay , And when the relay is on , Can it stay energized ? Or transistors can do it ?
  9. There must be an initial delay . I don't want to walk into a protected area every time , The alarm immediately starts to alarm . I want it to wait for a minute , Let me have time to go over and turn it off . If I fail to turn off the alarm during that time , It can start alarming .
  10. To turn off the alarm with a password . It would be ideal to turn off the alarm with some kind of password keyboard .

Realize your wish list

The wish list sounds ambitious , Because you have only built one circuit so far , Just three transistors make up a small oscillator . But in fact , Most functions can be implemented in an easy way . I'll leave some of the more difficult features behind , At that time, we have established a broader knowledge base . Final , I will be able to solve every problem on the wish list , All elements will be mounted on a bread board ( Except noise generating circuits , It is optional ).

Magnetic sensor switch

Let's start with the components that trigger the alarm . A typical sensor switch consists of two modules : Magnetic module and switch module . They are side by side in Figure 3-75 Show in .

3-75 A typical alarm sensor consists of a magnet wrapped in a plastic case ( The lower left ) And magnetic excitation reed switch of similar package ( The upper right ) form 3-76 This cross-section shows the two components that make up the sensor in the alarm system : Reed switch ( Bottom ) And the magnet that activates the switch ( Top )

The magnetic module contains only one permanent magnet , The switch module contains a reed switch , It forms or breaks a connection under the action of a magnet ( Similar to the contacts inside the relay ).
Connect the magnetic module to the movable part of the door and window , Connect the switch module to the window frame or door frame . When doors and windows are closed , The magnetic module almost touches the switch module , The magnet keeps the switch closed , Until the doors and windows are opened , The switch will open . chart 3-76 Shows the magnet — Sectional view of the switch assembly .

The switch is composed of two elastic magnetized metal sheets , The terminal forms an electrical contact . Each piece of metal is connected with an external screw , Screws can be used to connect wires .

When the magnet approaches the switch , It magnetizes the elastic sheet metal , Make the pieces of metal attract each other , Until the contacts close .

From my description, you can find , The reed switch is usually off (Normally Open,NO), But kept closed by the magnetic field . If you decide to buy an alarm sensor , Should know , Some sensors contain reed switches that work in different ways .

They are usually closed (Normally Closed,NC), But it is disconnected under the influence of magnetic field . They are not suitable for this experiment .

“ Open circuit ” Transistor circuit

Now? , How do we turn on the noise generating circuit of the alarm ? remember , We will set up several normally closed switches in series , When any of them is disconnected , All alarms must be triggered .

recall NPN The working principle of A-type transistor . When the base voltage is low , Transistor blocks current between collector and emitter . When the base voltage is high , Transistor turns on current .

Take a look at the picture 3-77 Circuit diagram in , It is used by our old friends ——2N2222 NPN Type transistor . For testing purposes , I use a normally closed button switch to represent the alarm sensor . I know you don't have a normally closed push button switch in your spare parts , But now please use your imagination , Until we are ready to connect the breadboard circuit .

As long as the push button switch remains closed , It will go through 1 kΩ The resistor , Connect the base of the transistor to the negative pole of the power supply .

3-77 Basic circuit , When the normally closed push button switch is disconnected ,LED Lighten up

meanwhile , The base of the transistor also passes through 10 kΩ The resistor is connected to the positive pole of the power supply . Due to the difference in resistance , The transistor base voltage is closer to 0 V Instead of 9 V, Make the transistor unable to reach the on threshold . therefore , A transistor can only pass a very small current ,LED There is not enough voltage to illuminate .

After the button switch is turned off , What's going to happen ? The transistor base is disconnected from the negative pole of the power supply , Only connect to the positive pole of the power supply , Its voltage rises significantly , Reduce the internal resistance of the transistor , Through more current . Now? ,LED Lighten up . therefore , When the button switch is off ,LED It will light up .

This system seems to be feasible . We need multiple sensors , On every door and window , But no problem —— We can connect as many as we want , Pictured 3-78 Shown , Each button switch can be replaced by an alarm sensor . Circuit wiring can surround the whole house , Because the total resistance of the wire is the same as 10 kΩ The resistor is relatively small .

3-78 In serial sensor networks , Any one of the sensors will destroy continuity , Trigger transistor
When all sensors remain closed , Transistors carry very little current —— about 1 mA. If used for development and demonstration , You can use it. 9 V Battery powered . If used in practical application , You need to use an automatic charging system 12 V Battery powered alarm .

This is beyond the scope of this book , But remember , If you need an alarm battery and charger , They are easy to buy .

Now? , Suppose we take LED, Replaced with a relay , Pictured 3-79 Shown .( I used a bipolar relay , Although we don't use the second pole yet .) As long as all button switches remain closed , The base voltage of the transistor is low , Therefore, the transistor does not supply power to the relay coil , The relay contacts remain in the position shown in the figure .

3-79 In this circuit , Opening any switch in the sensor network will energize the relay 3-80 One of the sensors in the circuit is disconnected , The relay is activated by a transistor

When either sensor is disconnected , The high voltage at the base of the transistor will make the transistor turn on the current entering the relay coil , This activates the alarm , Pictured 3-80 Shown .( It is possible to use relays in this mode , Because the relay will not “ Always disconnect ”.

It will remain normally closed , Energy is consumed only when the alarm is triggered .) Be careful , I removed from the circuit 470 Ω The resistor , Because the relay does not need to protect the power supply .

You can use experiments 7 The same relay in builds this circuit by itself ( Please refer to the experiment 7: Study the relay section ). But maybe you should wait for me to explain in more detail .

You may need to consider the following things .

  • Whether the relay will overload the transistor ? You can refer to the data sheets of these two components , Find out .
  • remember , Even when the transistor is on , There will also be a small pressure drop at both ends . The voltage is enough to activate one 9 V The relay ? The data sheet of the relay will tell you , What is the minimum operating voltage of the coil , You can prove it by testing .

Self locking relay

The current circuit can activate the alarm when any sensor switch is disconnected . That's good , But if the sensor switch returns to the closed state , What will happen ? The voltage at the base of the transistor goes down again , It turns off the alarm . That's not good .

According to number... On my wish list 8 strip , The alarm shall be self-sustaining . Even if someone opens the door and closes it quickly , It must also continue to make noise . therefore , The relay must be self-locking in some way .

One implementation method is to use self-locking relay , It keeps a state ( Not disconnected , It's closing ), It can be switched to another state simply by providing electrical energy . But the self-locking relay has two coils , When you want to turn off the alarm , Another circuit is required to unlock the memory .

actually , It is easier to use non self locking relays , I can also figure out how to make the relay after receiving a small amount of electricity , A method of maintaining continuity indefinitely .

chart 3-81 Revealed the secret . In this view , The rightmost button switch is closed again after it is disconnected , So the transistor is blocked , But the relay is still on , Because now there is a wire connecting the contact of the relay with its coil . When the relay activates the alarm , It will also activate itself .

3-81 The sensor switch is closed again . The transistor is no longer conducting , But the alarm is locked 3-82 chart 3-81 Close up of , Shows how the relay remains on

chart 3-82 This concept is illustrated by showing the possible path of current . As long as the contacts of the relay are closed , Its coil will be energized through its own contacts . In this way , The relay can keep on .

Block the bad voltage

This design looks promising , But there are problems . chart 3-81 The circuit diagram in is not completely accurate . Take a look at the picture 3-83, The top half of the diagram is another close-up of the relevant parts of the circuit . When the alarm is locked on , When the transistor is blocked , The current will flow from the relay coil back to the transistor emitter . I should have painted this wire red , Because its voltage is relatively high .

It is wrong to apply a reverse voltage across a transistor , The transistor may be damaged . How should we deal with this problem ? Maybe I can use some device to block the reverse current :

A rectifier diode . chart 3-83 The diode is drawn in the lower half of the .

3-83 You can add a diode , When the alarm is locked 、 When the transistor is blocked , Diodes prevent current from flowing back into the transistor
chart 3-84 Shows the updated complete circuit diagram , The diode is included .

3-84 Complete circuit , Including diodes
But what is a diode ? It and led (LED) Are they exactly alike? ? They are both the same , It's different .

Basic knowledge of : diode

Diode is an early semiconductor component . It allows current to flow in one direction , But it blocks the current in the opposite direction . Diode and its later cousins LED be similar , Because of voltage reversal 、 Damage due to excessive power , But most diodes are generally better than LED. actually , Diodes are used to block the reverse voltage , The limit of reverse voltage that can be withstood shall be specified by the manufacturer .

One pole of the diode that blocks the forward voltage is usually marked , It is usually represented by a circular ribbon , As shown on the left . The marked pole is called the cathode , At the other end is the anode , Unmarked . Diodes are sometimes used in logic circuits , It can also convert AC to DC .

 Insert picture description here 3-85 Three circuit diagram symbols for diodes , They all have the same function

If the diode cannot withstand the current you want it to block , Then replace it with a larger diode . Diodes come in many sizes . It is recommended to use diodes with rated power greater than the actual power of the circuit . Like any semiconductor component , If the diode is not used correctly , Overheating can also occur 、 Burnout .

The symbol of the diode looks like LED The central part of , Removed circles and arrows . chart 3-85 Three representations are shown .

The chain of problems arises

previously , I need to keep the relay on . Through an additional conductor , I solved the problem , But the wires have created new problems : The current will flow in the reverse direction into the transistor . I added a diode to solve this problem , But new problems still arise .

We have to pay a certain amount for the service provided by the diode , Just as we have to pay for the service of transistors . actually , Because both components are semiconductors , So the compensation is very similar , Are reflected in the reduction of voltage .

After the relay is disconnected , Current must pass through transistors and diodes to make the relay turn on . After the relay is turned on , Its state is locked , It's not a problem . But both ends of the transistor should have about 0.7 V Pressure drop of , And both ends of the diode should have about 0.7 V Pressure drop of , altogether 1.4 V. Their pressure drop is fixed , No matter what the power supply voltage is .

I think the rated voltage is 9 V The relay of can be in 7.6 V Under the voltage of . my Omron The data sheet States , I recommend G5V—2 The series relays only need to be of rated voltage 75%( namely 6.75 V) It works . This margin of error seems reasonable .

But what if you replace it with a different relay ? Some relays have more stringent performance requirements . If the circuit is powered by batteries , Its voltage drops to 9 V What should I do next ? Designers should anticipate unexpected situations , And in general , Components should be brought as close as possible to their rated values .

In the book No 1 After the circuit of this experiment is published in the edition , Several readers wrote to ask about the pressure drop .( I do pay attention to readers' anti -
Feed .) at that time , I prescribe the use of 12 V DC power supply , Feel the... Of transistors and diodes 1.4 V The pressure drop is acceptable . But in the 2 Version of the , I decided to use... For all the experiments 9 V DC power supply , So if you prefer batteries , No need to buy AC adapter , use
The battery can . Unfortunately , from 9 V deduction 1.4 V It's hard to accept .

You see now , Decision making leads to consequences . Because I use 9 V DC power supply , So I want to think of a better way to make the relay self-locking .

solve the problem

The first step in solving the problem is to find out what the problem is .

The control task of the alarm consists of two components : Transistors and relays . Transistor on alarm , Then the current is blocked , There is nothing to do , The task of the relay is to keep itself locked . The weakness of the system is , When a task is undertaken by two components , They interfere with each other . A better plan would be to have one component control all other components . I should keep the transistor in control , It should keep itself open , And as long as it's on , The relay will also remain on .

ah , Now I know how to modify the circuit . All I need is a relay ( That is experiment 7 The relay you used in ) The second pole of . I can make the contact of the second pole ( Normally closed ) Ground the series sensor , Pictured 3-86 Shown .

3-86 The series sensor is now grounded through the contacts on the right side of the relay , This pair of contacts is usually closed

Here is how the circuit works .

The base of the transistor now passes through all the sensors 、1 kΩ The resistor and the contacts on the right side of the relay ( Usually closed ) Connect to the negative pole of the power supply . As long as this series of connections is uninterrupted , The base voltage of the transistor is low enough , It can prevent electric current from passing through .

Now someone has disconnected a sensor switch , So the transistor base is no longer grounded , The transistor thus activates the relay . The relay closes the contacts on the left side , Start the alarm , But the relay also opens the right contact .

Now it doesn't matter if someone closes the sensor switch again , Because the contact on the right side of the relay is open , And cut off the connection with the negative pole of the power supply . The transistor continues to conduct current , While the relay remains active , Pictured 3-87 Shown .

3-87 Since a sensor switch has been disconnected , The transistor will remain on , Even if the sensor switch is then closed
So the problem is solved .

Protection diode

In the figure 3-87 in , I deleted the diode in the circuit . But if you look at the picture 3-88( I guarantee it's the last version , At least for now ), You will find that the diode is back , But its role now is quite different . It is now connected in parallel with the relay coil . What on earth is it doing ?

3-88 The diode is back , Its function now is to protect the circuit

Later in this book , I will introduce the knowledge of coil . Now I can tell you , After the power is turned on , The coil stores electrical energy , And after cutting off the power , The coil releases electrical energy . The release of electrical energy will produce surge current , Some components may be damaged , Especially semiconductors .

therefore , The standard process is to connect a protective diode in parallel at both ends of the relay coil . The diode adopts the connection direction shown in the figure , To block the normal flow of current , Force it into the relay coil , And that's what we want . But when the current disappears , When the coil attempts to release electrical energy , The diode is in the middle , Say to the relay :“ My resistance in that direction is very small , Why not divert the current to me , Let it disturb other components ?”

That's what happened .

If you use only a small relay , Its coil is very small , It will not generate too much current , You can also not connect the protective diodes in parallel . however , It is a good habit to use protective diodes , You should try to form this habit .

Connect the bread board

I must explain how circuits are designed from scratch . Now? , At the end of the day , You're going to build the circuit —— Otherwise, how can you know if the circuit can work properly ?

chart 3-89 Shows a breadboard layout . I don't use the noise generator of the alarm , It's about using LED Instead of , For explanation . I will soon discuss the choice of noise generator .

chart 3-90 It shows the perspective view of bread board circuit .

3-89 Bread board alarm circuit , Final version 3-90 Perspective view of bread board alarm circuit

In order to imitate the alarm sensor on the bread board , I should have used a normally closed push-button switch , But I want to reduce the component cost as much as possible , And if you really want to use this alarm circuit , You will use magnetic sensor switches , Not a button switch . therefore , As a substitute , I used two normally closed conductors . They are sufficient for testing , I'll call them “ Sensor lead ”. You will see that they cross each other under the relay .

Make sure that the wires touch each other when the power is turned on . At first , Nothing will happen .

Now disconnect the sensor wire .LED Lighten up , If you have completed the second version of this circuit , The noise generator will sound , Indicates that the alarm has been triggered .

Now reconnect the sensor wires , Imitate such a situation : The intruder opened a window , Hear the alarm , He quickly closed the window again . If your circuit is connected correctly ,LED It will be on forever .

So far so good , We get a functional circuit , The alarm can be self-locking .

But in this case , How can you stop the circuit ?

That's all right. , Just disconnect the power supply . The relay will return to the default position , The next time you turn on the power , It's in standby mode again . In the final version of the circuit , You will need to enter the password on the keyboard to turn off the alarm . In the experiment 21 in , I will introduce a method to build password protection circuit , At that time, you will use the logic chip , But it has not been involved yet .

Add sound

The alarm sound can be tested 11 The oscillator circuit and the loudspeaker in the , But there are better ways . A kind of name. 555 The small integrated circuit chip of timer is more suitable for this task , And it happens to be my next experiment —— experiment 16 Components described in .

555 The timer can also meet the No. on my wish list 7 Article and paragraph 9 strip , They require a certain delay before the alarm is activated . therefore , I will put the alarm project on hold , We'll be experimenting 18 Complete it .

Reference resources :

Although the alarm project is not over yet , But it raises several important questions . I will summarize here , For future reference .

  • You can use transistors to provide a high output response for low inputs , vice versa .
  • You can wire the relay , Make it form a self-locking conduction mode , Just feed the current back to the coil of the relay .
  • Diodes can block current , Prevent current from flowing to places you don't want .
  • When the forward current passes through the diode , The voltage drops by about 0.7 V.
  • Transistors also form about 0.7 V Pressure drop of .
  • No matter what the power supply voltage is , The voltage drop caused by semiconductor components remains constant . therefore , When the power supply voltage is low , The effect of pressure drop is more remarkable .
  • When the power supply is cut off , The relay coil will form a back EMF ( A reverse current ).
  • The protective diode in parallel with the relay coil can suppress the back EMF . The diode should be connected in such a way that it blocks the normal flow of current , It turns on the reverse current generated by the coil .
原网站

版权声明
本文为[acktomas]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250628316654.html