How to Make an OwlBot: the Bird Intimidator – Part 1: Motion Sensing
by Motbots in Circuits > Arduino
90 Views, 1 Favorites, 0 Comments
How to Make an OwlBot: the Bird Intimidator – Part 1: Motion Sensing
In this project we’re going to be performing the initial steps of what will eventually be the OwlBot. The OwlBot will be a device that can be used as a bird intimidation tool to scare away pesky birds in the yard, around the house or barn, at restaurants, or in trees, bushes, and gardens. Hence, the phrase, “The Bird Intimidator”.
The OwlBot (a.k.a. “The Bird Intimidator”) we’ll be making will be done in several parts. The OwlBot is an ambitious project. When complete, the OwlBot will sense motion. When motion is detected, the OwlBot should make owl sounds, perform varying movements, and flash its red eyes to intimidate and scare away pests. To put together all these tasks in one page would be too long and cumbersome, so we’ve decided to split each process we want the OwlBot to do into easy to accomplish chunks or parts as we continue on our goal to complete the OwlBot.
This is part one. This initial part of the OwlBot project will involve setting up its ability to sense motion via a passive infrared sensor (PIR). Our goal at the end of this part of the project will be to have the PIR sensor and an Arduino Uno communicating to each other when motion is detected and to print out whether or not motion is detected.
Goal of Part 1 of the OwlBot Project
A motionless, plastic great horned owl deterrent with a staring gaze might not do much over time. For the OwlBot to be effective enough to deter birds from nesting in an area throughout the year requires lifelike actions, like sound and movement. Our goal for part one of the OwlBot project is to first get it to detect motion, and then we’ll move on to the other stuff later, in the proceeding parts of this build series.
- Motion Sensing: When the OwlBot is complete, we want it to be able to sense motion of a bird or other creatures, and when it does to start making owl hooting sounds, and to perform various movements. We also want it to flash its red eyes as an added effect to help deter pesky animals in the surrounding area. We’ll end up having all these actions done in sync when motion is detected, and we’ll use an HC-SR501 PIR sensor to get the OwlBot to detect such motion.
Before we get started, let’s first briefly discuss about the HC-SR051 PIR sensor we’ll be using for this part of the project, to allow ourselves to know more about it and to get an understanding of how it works.
The HC-SR501 PIR Sensor
We’ll be using the HC-SR501 PIR sensor to get our OwlBot to detect motion. PIR stands for Passive Infrared Sensor. Since the sensor detects infrared, it’ll be able to detect motion from humans, animals, and hopefully smaller animals, like birds for our project’s purpose. The HC-SR501 has three pins; a VCC or power pin, an output signal pin, and a ground pin, as shown in the image provided.
The + power pin (VCC) has a wide range of input voltages, anywhere between DC 4V and 12V, although +5V is recommended. The Arduino Uno that we’ll be using can provide the 5V we need to power the PIR sensor.
The output pin is 3.3V TTL logic, so it can be used with any microcontroller platform, such as the Arduino, Raspberry, PIC, ARM, and 8051, to name a few. We’ll be using the Arduino Uno for this project for its robustness, ease of use, low cost, and availability. The output pin will send signals to the Arduino, letting it know when motion is detected.
The ground pin allows for connecting to the ground of the circuit. This is a must.
The jumper wire of the HC-SR501 PIR sensor has two positions that it can be placed in. Position L or Position H:
- Position L: When the jumper wire is in Position L, it locks the high signal to approximately 2 minutes. This is the position we’ll set for the OwlBot. This means that when motion is detected, it’s set in single-trigger mode, meaning that when something crosses its path and triggers it, it’ll lock itself into the on or high output position for approximately 2 minutes. Any motion does not reset the time.
- Position H: When the jumper wire is in Position H, this puts the sensor into repeat trigger mode, meaning that when something crosses its path and triggers it, the 2 minute countdown begins. If something crosses its path again within that 2 minute countdown, the timer will restart the countdown over again for 2 minutes. Any motion resets the 2 minute timer.
Looking at the image below, we can see the HC-SR501 PIR sensor at another angle. In this image, we see that there are two potentiometers labeled for the time-delay and sensitivity.
The time-delay knob controls the delay time. The delay time is for when motion is detected how long the sensor stays in the high output (3.3V) or motion detected position. When no motion is detected the sensor stays in the low output (0V), idle or no motion detected position. Turning the knob all the way counter-clockwise decreases the delay to approximately 3 seconds. Turning the knob completely clockwise increases the delay to approximately 5 minutes.
The sensitivity knob controls the sensitivity of the PIR sensor or how easily it can detect infrared based on how far something is away from it. Turning the knob all the way counter-clockwise increases the sensitivity to allow the PIR sensor to detect motion up to approximately 7 meters (approx. 23 feet) away. Turning the knob completely clockwise decreases the sensitivity of the PIR sensor to detect motion up to approximately 3 meters (approx. 10 feet) away.
It’ll be up to you to choose how you set your time-delay and sensitivity knobs. This will be things you’ll have to play around with to get everything to do how you want it to. Next, we’ll briefly go over the Arduino Uno.
The Arduino Uno (ATmega328P)
The Arduino Uno is a development board developed to make prototyping your electronic ideas into reality more easily. It’s simplicity allows for people new to the world of making with electronics create things without needing tons of formal training. This development board is based on the ATmega328P microcontroller, and programming it is easy to do in the Arduino IDE, once you get the hang of the coding rules. You can download the newest release of the Arduino IDE here.
We won’t be doing an in depth setup of the Arduino IDE here, or go over the programming language syntax during this project. If you need to know how to setup your computer for the Arduino IDE, then you can visit the Arduino web-page on how to Download and install the Arduino IDE here. Below, I’ve provided some recommended video content to help you get started using the Arduino:
- GreatScott!: Arduino Basics 101: Hardware Overview, Fundamental Code Commands
- Programming Electronics Academy: Arduino MASTERCLASS | Full Programming Workshop in 90 Minutes!
- Paul McWhorter (recommended): New Arduino Tutorials (playlist)
For part one of the OwlBot project, we’ll be using the Arduino Uno to help control the PIR sensor. In later parts of the OwlBot project, we’ll use the help of the Arduino Uno to control things like an MP3 player to play owl sounds, solenoids for wing movement, flashing red LEDs for eyes, and a DC motor to rotate a propeller.
The Arduino Uno has 14 digital I/O pins, 6 of which can be used as PWM outputs, 6 are analog outputs, a USB connector, a power jack, and other features. Later in part one of this project, there will be an image labeling which pins and features we’ll be using for the OwlBot.
Supplies
Breadboard Prototyping Parts List
- 1x Solderless Breadboard
- Male-to-Male Jumper Wires
- Male-to-Female Jumper Wires
- 1x HC-SR501 PIR Sensor
- 1x Arduino Uno
- 1x Male Barrel Jack Adapter with Screw Terminals (5.5mm x 2.1mm)
Tools Used in Project (Optional)
Although we’re only starting with a few components for part one of the OwlBot project, for each of the proceeding parts for this build we’ll eventually be adding more and more components and jumper wires during the prototyping process.
I’ll be using The Ultimate DIY 3220-Point Breadboard that I made on a previous project, so that I have plenty of space and portability for this OwlBot project, as well as having the built-in 9V battery power supply to make things much easier during the build process. You can use whatever breadboard you have available to you if you’d like, or if you’re interested in making your own Ultimate DIY 3220-Point Breadboard, you can visit our page here.
DON’T WORRY! Even though I’ll be discussing how to make connections on The Ultimate DIY 3220-Point Breadboard throughout the following prototyping steps, I’ll provide images of how to hook up items on a generic breadboard, so you can still follow along!
From now-on, I’ll refer to The Ultimate DIY 3220-Point Breadboard as “TUDIY” to save me from having to say “The Ultimate DIY 3220-Point Breadboard” every time.
Connecting 9V Power to the Breadboard
I’ll be using The Ultimate DIY 3220-Point Breadboard or TUDIY for prototyping this project. TUDIY has a built-in 9V battery power supply that we’ll use for our power source during the OwlBot’s prototyping process.
If you did not make your own 3220-point breadboard, you can use any type of breadboard you like and still follow along. If you’re unfamiliar with using a solderless breadboard, then you can check out our page on breadboards here. Let’s take two male-to-male jumper wires, a red one and a black one.
- Take the red jumper wire and connect a male end of it to the red binding post for the 9V battery power supply of TUDIY.
- Take the black jumper wire and connect a male end of it to the black binding post for the 9V battery power supply of TUDIY.
- Next, connect the other male end of the red jumper wire to a positive (+) rail of TUDIY’s main power rail supply at the top section of TUDIY.
- Now, connect the other male end of the black wire to the negative (-) rail of TUDIY’s main power rail supply at the top section of TUDIY, next to the positive rail you chose for the red jumper wire earlier.
If you’re using a breadboard other than TUDIY, then you won’t be connecting a 9V battery supply to the breadboard. All you’ll need to do is connect a 9V battery snap connector to a 9V battery, for now, as shown in the image provided.
Setting Up the Arduino for Power
For the Arduino to get power for our prototype build, we’re going to use a male barrel jack adapter with screw terminals to make connections from the power rail of TUDIY to the Arduino. Let’s grab another pair of male-to-male jumper wires, a red one and a black one, to make connections from the screw terminals of the barrel jack to TUDIY’s 9V power rail we just set up in step 1:
- Take a male end of the red jumper wire and place it into the + screw terminal of the barrel jack adapter. Now, tighten the screw terminal.
- Take a male end of the black jumper wire and place it into the – screw terminal of the barrel jack adapter. Now, tighten the screw terminal.
- Now, take the other male end of the red jumper wire and place it into a point on the positive (+) power rail of our 9V battery power supply we set up in step 1.
- Next, take the other male end of the black jumper wire and place it into a point on the negative (-) power rail of our 9V battery power supply we set up in step 1.
If you’re using a breadboard other than TUDIY, then all you’ll need to do is connect the wires of the 9V battery snap connector from step 1, to a DC barrel jack adapter with screw terminals, as shown in the image provided.
Setting Up 5V Power From the Arduino
Now, let’s take our Arduino Uno and a couple more male-to-male jumper wires, a red one and a black one, to make connections from the Arduino’s 5V power supply and ground to another pair of power rails on the breadboard to get set up for 5V DC power for the modules we’ll be using.
- Connect the male end of the red jumper wire to the 5V pin of the Arduino Uno. Next, connect the other male end of the same red jumper wire to a point on a positive (+) power rail of a breadboard on TUDIY. In this case, I’ve chosen the far left breadboard on the 3220-point breadboard.
- Now, connect the male end of the black jumper wire to the GND pin of the Arduino Uno. Next, connect the other male end of the same black jumper wire to a point on the negative (-) power rail on TUDIY, next to the positive power rail we previously chose for the red jumper wire.
If you’re using a breadboard other than TUDIY, then you’ll make your connections from the Arduino’s 5V power and ground to a power distribution rail on your breadboard, as shown in the image provided.
Connecting the PIR Sensor
Next, let’s grab our HC-SR501 PIR sensor and some jumper wires to make connections from the sensor to the breadboard and Arduino. Starting with the HC-SR501, lets grab a few male-to-female jumper wires; a red one, a black one, and a yellow one. Before we connect our jumper wires to the PIR sensor, let’s first remove the Fresnel lens cover from it so we can see the labeling of the pins on the board.
- Remove the HC-SR501’s Fresnel lens cover, so that we can see the pin labels on the board.
- Connect the female end of the red jumper wire to the VCC pin of the HC-SR501.
- Connect the female end of the yellow jumper wire to the OUT pin of the HC-SR501.
- Connect the female end of the black jumper wire to the GND pin of the HC-SR501.
Now that we have the red, yellow, and black jumper wires connected to the HC-SR501 PIR sensor, we can now connect the male ends of the jumper wires to the 5V power and ground we set up in step 2, and to one of the header sockets of the Arduino Uno.
- Connect the male end of the red jumper wire to a point on the Arduino’s 5V positive (+) power rail we set up on the breadboard in step 3.
- Connect the male end of the black jumper wire to a point on the Arduino’s negative (-) power rail we set up on the breadboard in step 3.
- Connect the male end of the yellow jumper wire to pin 12 of the Arduino.
If you’re using a breadboard other than TUDIY, then you’ll connect the PIR sensor’s VCC or + power pin to the positive (+) rail of the breadboard (this is the 5V supply rail from the Arduino we set up in step 3). You’ll then connect the GND pin of the PIR sensor to the negative (-) rail of the breadboard (this is the ground supply rail from the Arduino we set up in step 3). Then, you’ll connect the OUT pin of the PIR sensor to pin 12 of the Arduino, as shown in the image provided.
Programming the Arduino and More!
Now that you've assembled the first part of the OwlBot prototype, it's time to create the initial code we'll use to test what we've done so far in this project!
If you're interested in continuing this fun project and are ready to get the code for your Arduino, then head over to our page and go to the section titled Programming the Arduino to Sense Motion here.
At our page titled "How to Make an OwlBot: The Bird Intimidator – Part 1: Motion Sensing", you'll find a more detailed version for the steps of this prototype build, more close up images, and documents, as well as a more thorough parts list. You'll also find the steps and accompanying videos to instruct you to complete this project in its entirety.
Thanks for trying out this neat project. Hope you had fun! Stay tuned for Part 2, where we'll add an MP3 player to this project to make our OwlBot make hoot owl sounds. Remember to keep at it and stay motivated!