Did you know that birds aren't real? They are actually mobile devices that have cameras and microphones to maintain surveillance by the government. You may be asking yourself why they do not just use the cell phones in everyone's pocket; hey, I don't know; I don't make the rules.
Now that I have completely destroyed my credibility on LinkedIn, let's get into the real article.
When I was at GrrCon, B-Sides Orlando and Defcon, I brought along a friend, a 3D-printed surveillance bird. This guide will show you how to create this Not-NSA bird.
Here is the list of parts that are needed:
ESP32 (https://www.amazon.com/HiLetgo-ESP-WROOM-32-Development-Microcontroller-Integrated/dp/B0718T232Z)
Microservo (https://www.amazon.com/Micro-Servos-Helicopter-Airplane-Controls/dp/B07MLR1498)
Powercell (Buy any, but this is similar to the one I used) https://www.amazon.com/EnergyQC-Portable-Ultra-Compact-Compatible-More-Black/dp/B09Z6T7FQ8)
USB Cable (Micro USB to USB A to plug ESP32 into Powercell)
2 Magnets (these fit the 3D print specifically)
https://www.amazon.com/REALTH-Neodymium-Permanent-Magnetic-MC20212/dp/B08GLGFYW7/
Dupont Cable (Better things exist, but I like them because they are easy)
https://www.amazon.com/EDGELEC-Breadboard-Optional-Assorted-Multicolored/dp/B07GD2BWPY?th=1
Sharpie (Multicolor prints take too long)
Soldering Iron
Hot Glue Gun
Shrink Wrap
The first thing I needed was a bird. I went online and found this design on sketchfab fit by tomkranis.
Next, I needed a surveillance camera. I found this design on Thingiverse by vogon_poetry and remixed it to allow a micro servo to attach.
DESIGNING THE "BIRD"
Now that we have everything, I took the camera STL and put a hole in the top for the LED. I also added a hole at the bottom to connect the micro servo. This can all be printed in one color; I just colored in the "Not NSA" and front screen with a sharpie.
Next, we took the pigeon file and removed the head (sorry), added a space for the servo, and put a hole that runs down to the bottom of the "bird" for the wiring. The end result looks like this poor guy.
That was the first version. The problem is that the legs are very delicate and hard to attach to a backpack. I finally found this to be the best solution. I attached a disc on the side of him to slide in a magnet. This way, he can attach to most surfaces with little problem, not so top heavy. Also, adding a circle to the bottom of the feet helps them from breaking off (sorry again).
The last 3D print is the magnet holder. This will go inside of your backpack or whatever you're using to secure the "bird". This isn't super important to print, but the bare metal of the magnet can scratch things, so if that is important to you, give this a quick print. Otherwise just throw the magnet in your backpack
WRITING THE CODE
The coding part is next, which is also the easiest part. We need a light that blinks occasionally and the servo to move at what seems like random times. To do this, we use Tinkercad again. The link below shows the code. But I will explain it line by line.
Let's break down this simple program.
The first thing we want to do is grab the library for the servo. This allows us to interact with and move the servo. The next line defines a Servo object named servo_9. We called it servo_9 because it will use the GPIO pin 9.
#include <Servo.h>
Servo servo_9;
The setup function runs once on boot. We first set the pinMode of GPIO pin 8. This will be the pin of the LED on top of the "head." Because we are sending data with this pin and not receiving anything, we set it to OUTPUT. Next, we attach the servo and assign it to pin 9. The 500 and 2500 are the minimum and maximum pulses in microseconds for the servo, aka how much it can turn. Finally, we set a delay of 7 seconds to give us some time to plug in the bird and attach it before it starts moving, less chaos.
void setup()
{
pinMode(8, OUTPUT);
servo_9.attach(9, 500, 2500);
delay(7000); // Wait for 7000 millisecond(s)
}
The last function is the loop. This will continually run as long as the device has power. We set the GPIO pin 8 to High, which turns on the LED, then we wait 1 second and set it to low to turn it off. Next, we turn the servo 90 degrees, wait 5 seconds, turn it 15 degrees, wait 2 seconds, 45 degrees, and 4 seconds, 0 degrees, and 6 seconds. This gives anyone the sense that it's random. After that, it returns to the beginning and turns on the LED at the start of the loop and repeats the whole thing.
void loop()
{
digitalWrite(8, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(8, LOW);
servo_9.write(90);
delay(5000); // Wait for 5000 millisecond(s)
servo_9.write(15);
delay(2000); // Wait for 2000 millisecond(s)
servo_9.write(45);
delay(4000); // Wait for 4000 millisecond(s)
servo_9.write(0);
delay(6000); // Wait for 6000 millisecond(s)
}
As you can see, this isn't a very advanced program, but it provides the effect; don't overengineer something that doesn't need it.
All together, here is the script.
#include <Servo.h>
Servo servo_9;
void setup()
{
pinMode(8, OUTPUT);
servo_9.attach(9, 500, 2500);
delay(7000); // Wait for 7000 millisecond(s)
}
void loop()
{
digitalWrite(8, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(8, LOW);
servo_9.write(90);
delay(5000); // Wait for 5000 millisecond(s)
servo_9.write(15);
delay(2000); // Wait for 2000 millisecond(s)
servo_9.write(45);
delay(4000); // Wait for 4000 millisecond(s)
servo_9.write(0);
delay(6000); // Wait for 6000 millisecond(s)
}
WIRING IT UP
First, you want to solder the 2 wires to the LED. This can be messy, as the LED will be encased in hot glue. Then, feed the LED to the top of the camera and inject hot glue around it. It should look something like this.
Next, strip the wires of the servo and either attach Dupont connectors to the end of the solder the 2 ends together and shrink wrap it as I did here.
Feed put the servo in, and attach the head to the servo. The fit should be tight enough on the servo. You don't need any adhesive. This makes it much easier to travel with. Feed the wires through the body of the bird to the bottom.
Now, to connect the board. Here is the sketch of how you wire up the board. I know this isn't the best solution, but it works and doesn't make this a permanent project. I just put some hot glue on them to prevent the wires from coming undone.
LED (+) - Pin 8
LED (-) - Ground
Servo - Ground
Servo - 5V
Servo - Pin 9
Connect the battery and watch him come to life. (Video coming soon)
I hope you enjoyed this project. If you have any recommendations or changes, feel free to contribute. If you make this project, please tag me or let me know.
Comments