官术网_书友最值得收藏!

Testing the alarm system

We are now ready to test our simple alarm system. Just grab the code for this project (either from the preceding code or the GitHub repository of the book) and put it into your Arduino IDE.

In the IDE, choose the right board type (for example, Arduino Uno) and also the correct serial port.

You can now upload the code to the board. Once it is done, simply pass your hand in front of the PIR motion sensor; the alarm should go off immediately. Then, simply press the push button to stop it.

To illustrate the behavior of the alarm, I simply used a battery pack to make it work when it is not connected to my computer. The following is the result when the alarm goes off:

If this works as expected, congratulations, you just built your first secret agent project: a simple alarm system based on Arduino!

If it doesn't work well at this point, there are several things you can check. First, go through the hardware configuration part again to make sure that your project is correctly configured.

Also, you can verify that when you pass your hand in front of the PIR sensor, it goes red. If this is not the case, most probably your PIR motion sensor has a problem and must be replaced.

主站蜘蛛池模板: 文登市| 乌恰县| 南溪县| 黔东| 交城县| 大港区| 黔西| 远安县| 南投县| 中方县| 莱西市| 葫芦岛市| 麟游县| 赤水市| 阿克| 济源市| 滦平县| 安多县| 河源市| 桂平市| 黔南| 正安县| 澄迈县| 丽水市| 皮山县| 凌云县| 措美县| 化州市| 商城县| 页游| 中超| 阿荣旗| 辽宁省| 惠东县| 荔浦县| 偏关县| 抚远县| 彭泽县| 新乡县| 民权县| 遂川县|