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

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.

主站蜘蛛池模板: 玉树县| 平远县| 上蔡县| 仙桃市| 股票| 阿瓦提县| 巴彦淖尔市| 区。| 和平县| 尼勒克县| 即墨市| 石泉县| 黑龙江省| 临朐县| 嵩明县| 唐海县| 鞍山市| 临城县| 吐鲁番市| 桐梓县| 洱源县| 青铜峡市| 隆尧县| 绥阳县| 屯昌县| 平和县| 东安县| 新乡市| 虹口区| 偃师市| 平罗县| 滦平县| 安化县| 休宁县| 怀柔区| 镇远县| 孟村| 灌云县| 扶绥县| 中超| 呼和浩特市|