For the past two weeks, I have been working on building an autonomous drone to run mapping missions. I connected two Raspberry Pis to the drone to take pictures using the Raspberry Pi Cam v2. I ran into several issues with my receiver not connecting and GPIO pins not triggering, but I managed to come up with workarounds for each problem. I used the Ardupilot Mission Planner software to operate the drone: https://ardupilot.org/planner/.

Parts list

Total Cost: $887

Setup

Here is a quick breakdown of the build setup.

Completed Build
NoIR cam and RGB Camera
Inside look at raspberry pi wiring

The Pololu 5v 5.5 A voltage regulator provides power to the servo rail on the flight controller and both Raspberry Pis (4b and Zero W). This voltage regulator has an XT30 plug and is powered off of a LiPo battery that is separate from the one that powers the drone. The flight controller connects to the Pi 4B’s GPIO and has a camera trigger. The Pi 4B (with LTE HAT attached on top right) provides power to the Zero W. I also connected one of the 4B’s GPIO pins to the Zero W to act as a secondary camera shutter relay. The Pi 4B is attached to the NoIR camera and the Zero W is attached to the RGB camera.

Stay tuned for another blog post with a more in-depth technical breakdown of the drone build.

Testing Highlights

Watch this video:

Map Construction

The test flights were a success and the cameras were a partial success. My RGB camera was slightly out of focus for the tree pictures. I also set the angle incorrectly on Mission Planner so the images did not have enough overlap. I still gave it a go using the auto image merge in photoshop (aka the Brenizer Method): https://digital-photography-school.com/5-steps-to-rock-the-brenizer-method/

The results are promising. The top left image is from the first test flight of a field, which looks pretty good. After that first flight, I ran another test flight above the trees. The tree images in the second flight got fractured into separate parts, which means I need to take more images during each flight.

Future Plans – Short Term

Now that I trust the drone to fly over trees on its own, I am going to set up another, longer mapping mission where I look at some diseased beech trees.

I am also going to set up the raspberry pi’s to automatically start run the python programs at boot using systemd.

Then I’ll geotag the images and put it into photogrammetry software (webODM) to construct a map from the images. I’m also going to lower the resolution of the RGB photos because the Zero W is a slower at taking pictures so it often misses picture triggers and is out of sync with the 4B.

Future Plans – Long Term

I want to get the 4G telemetry working on the raspberry pi. The raspberry pi can send telemetry data from the drone directly to my laptop so that I do not need to use the telemetry radios. However, I have to set up port forwarding and I have not had access to a router to do so. I have an idea to use a sim card router and set up dynamic DNS…stay tuned.

Tutorials I am using:

Raspberry Pi Pixhawk drone: https://www.youtube.com/watch?v=kB9YyG2V-nA

Setting up Telemetry over 4G: https://www.youtube.com/watch?v=IokyotAGbJI

Using port forwarding on a https://www.youtube.com/watch?v=2d5HfU39tyM