Introduction: How to Use PIR Sensor and a Buzzer Module - Visuino Tutorial
In this tutorial we will learn how to use a PIR sensor and a buzzer module to make a sound every time a PIR sensor detects a movement.
Watch a demonstration video.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
- Arduino UNO (or any other Arduino)
- PIR Sensor
- Buzzer module
- Jumper wires
- Visuino program: Download Visuino
Step 2: The Circuit
- Connect PIR sensor pin [GND] to Arduino pin [GND]
- Connect PIR sensor pin [VCC] to Arduino pin [5V]
- Connect PIR sensor pin [Signal] to Arduino digital pin 
- Connect Buzzer pin [+] to Arduino pin [5V]
- Connect Buzzer pin [-] to Arduino pin [GND]
- Connect Buzzer pin [S] to Arduino digital pin 
Step 3: Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2
Step 4: In Visuino Add and Connect Components
- Add "Digital (Boolean) Change Only" component
- Add "Play Frequency Tone" component and in the properties window set "Initial Frequency (Hz)" to 20
-select "Enabled" field and click on the pin icon and select "Boolean SinkPin"
- Connect Arduino digital pin  to "ChangeOnly1" pin[In]
- Connect "ChangeOnly1" pin[Out] to "PlayFrequency1" pin [Enabled]
- Connect "PlayFrequency1" pin [Out] to Arduino digital pin 
Step 5: Generate, Compile, and Upload the Arduino Code
In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Step 6: Play
If you power the Arduino UNO module, and make a move the PIR sensor should detect it and a buzzer module will make a sound.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu