DIY Plant Inspection Gardening Drone (Folding Tricopter on a Budget)

by Imetomi in Circuits > Remote Control

16660 Views, 215 Favorites, 0 Comments

DIY Plant Inspection Gardening Drone (Folding Tricopter on a Budget)

title.jpg
IMG_20190831_161155.jpg
IMG_20190831_161330.jpg
IMG_20190831_161341.jpg
2019-08-31T10_59_28.065Z.jpg
IMG_20190817_135305.jpg
IMG_20190817_140334.jpg
IMG_20190831_161356.jpg

At our weekend house we've a nice little garden with a lot of fruits and vegetables but sometimes it's just hard to keep up with how the plants change. They need constant supervision and they're very vulnerable to weather, infections, bugs, etc...

I had a lot of multicopter spare parts from old projects laying around in my toolbox so I decided to design and build a drone which can do plant analysis using a Rasperry Pi Zero W and its NoIR PiCamera. I also wanted to make a video on this project but that's pretty hard next to the university so I'll just upload the raw footage.

The Theory behind Near Infrared Imaging

I recommend to read this Wikipedia article. Long story short, when plants function normally they reflect infrared light coming from the Sun. A lot of animals can see IR light, like snakes and reptiles but your camera can see it too (try it with a TV remote controller). If you remove the IR filter from your camera you will get a purplish, washed out image. If you don't want to break your camera then you should try it with the NoIR PiCamera, which is basically the same as the standard PiCamera but does not have a built in IR filter. If you place the infrablue filter under your camera's lens you'll get only IR light on your Red channel, blue light on Blue channel, green and red are filtered out. Using the normalized difference vegetation index formula for every pixel you can get a very good indicator on your plant's health and photosynthetic activity. With this project I was able to scan our backyard and identify an unhealthy plant under our pear tree.

Why a Tricopter?

I like tricopters a little bit more than quads for example because of their efficiency. They have longer flight times, they're cheaper and you can fold them which probably the single best feature when it comes to DIY drones. I also enjoy flying with this tricopter, they have a somewhat "airplane-ish" control which you'll experience if you build this drone along with me. When it comes to tris David Windestal's name is probably the first in a Google search, I recommend to check out his site, I'm using his folding frame design too.

Downloads

Flight Footage

Plant Inspection Tricopter Test Flight

This was my second test flight where the copter was already tuned and ready to do plant analysis. I have some onboard recordings from my action camera, you can check out our beautiful surroundings from a bird's eye. If you want to see the NDVI recordings go to the last step of this instructable. Unfortunately I had not time to make a full how to guide video on this tricopter, but I've uploaded this short flight test video.

Required Tools and Parts

IMG_20190806_191152.jpg
IMG_20190806_190854.jpg
IMG_20190830_153459.jpg
IMG_20190806_182333.jpg
IMG_20190806_190838.jpg
IMG_20190806_191210.jpg
IMG_20190806_191259.jpg
IMG_20190806_194251.jpg
IMG_20190808_150921.jpg

With the exception of the wooden booms and the paint spray I had every part laying around in my toolbox, so the total cost of this project was around $5 for me but I will try to find eBay or Banggood links to every part I used. I highly recommend to look around for the parts, maybe you can get a better price than I did.

Tools

  • Soldering Iron
  • Dremel Tool
  • 3D printer (I don't have one, my friend helped me out)
  • Cutting Tools
  • Wire Cutter
  • Super Glue
  • Zip Ties (a lot of them, in 2 sizes)
  • Paint Spray (with a color of you liking - I used black)

Parts

  1. ArduCopter Flight Controller (I used an old APM 2.8, but you should go for a PixHawk or PIX Mini)
  2. GPS Antenna with Magnetometer
  3. MAVLink Telelemetry Module (for ground station communication)
  4. 6CH Receiver + Transmitter
  5. Video Transmitter
  6. Servo Motor (at least 1.5kg torque)
  7. 10" Propellers (2 CCW, 1 CW + extra for replacement)
  8. 3 30A SimonK ESCs (Electronic Speed Controller) + 3 920kv Motors
  9. 3S Battery 5.2Ah
  10. Raspberry Pi Zero W + NoIR PiCamera (comes with infrablue filter)
  11. 2 Battery Straps
  12. Vibration Damping Mounts
  13. 1.2cm Square Shaped Wooden Booms (I bought a 1.2 meter rod)
  14. 2-3mm Thick Wooden Lamina Plate
  15. Action Camera (I used a 4k capable GoPro clone - SJCAM 5000x)

These are the parts I used for my drone, feel free to modify it to your liking. If you're not sure about what to use leave a comment and I'll try to help you out. Note: I used the discontinued APM board as a flight controller, because I had one spare. Flies well, but this board is no longer supported so you should probably get another flight controller that is ArduCopter compatible for great GPS features.

Cutting the Frame

IMG_20190806_182409.jpg
IMG_20190806_182229.jpg
IMG_20190806_183751.jpg
IMG_20190806_184200.jpg
IMG_20190807_111325.jpg
IMG_20190807_111303.jpg

Download the frame file, print it, and cut it out. Check if the printed size is correct then use a pen to mark the shape and the holes on the wooden plate. Use a saw to cut the frame and a drill the holes with a 3mm bit. You'll need only two of these, I just made 4 as spare parts.

Assemble the Frame

IMG_20190807_122224.jpg
IMG_20190807_122238.jpg
IMG_20190807_205021.jpg
IMG_20190807_205005.jpg

I used 3mm screws and nuts to assemble the frame. I cut each boom 35cm long and left a 3cm long one to the front of the frame. Don't overtighten the joints, but make sure that there is enough friction so the arms wont fold. This is a really smart design, I crashed two times and nothing only the arms folded back.

Drilling Holes for the Motors

IMG_20190807_151557.jpg
IMG_20190807_151551.jpg
IMG_20190807_151545.jpg
IMG_20190807_153106.jpg
IMG_20190807_153113.jpg

Check the size of your motor screws and the distance between them then drill two holes into the left and right wooden arms. I had to drill a 5mm deep and 8mm wide hole in the arms so that the shafts have enough room to spin. Use a sandpaper to remove those little splinters and blow out the dust. You don't want any dust in your motors because that may cause unnecessary friction and heat.

Folding GPS Mount

IMG_20190807_164902.jpg
IMG_20190813_140206.jpg
IMG_20190807_204952.jpg
IMG_20190807_204957.jpg

I had to drill to extra holes for my GPS antenna for a good fit. You should place you compass up high so it does not interfere with the magnetic field of the motors and wires. This is a simple folding antenna that helps me to keep my setup as compact as possible.

Painting the Frame

IMG_20190808_150914.jpg
IMG_20190808_151117.jpg
IMG_20190813_125358.jpg

Now you have to unscrew everything and do the paint job. I ended up choosing this matte deep black color spray. I hooked up the parts on a thread and simply painted them. For a really good result use 2 or more layers of paint. The first layer is probably going to look a little bit washed out because the wood is going to drink up the moisture. Well, that happened in my case.

Mounting the Vibration Damping Platform

IMG_20190813_130534.jpg
IMG_20190813_130836.jpg
IMG_20190813_131548.jpg
IMG_20190813_131540.jpg
IMG_20190813_132946.jpg

I had this gimbal holder platform which in my build doubles as a battery holder too. You have to mount this under your frame with zip ties and/or screws. The weight of the battery is helping to absorb a lot of vibration so you'll get a really nice camera footage. You can also mount some landing gears on the plastic rods, I felt like it's unnecessary. This black color worked out well, at this point you should have a nice looking frame and it's time to set up your flight controller.

Setting Up ArduCopter

circuit_jpg.jpg
IMG_20190813_140246.jpg
2019-08-23.png

To setup the flight controller you'll need an additional free software. Download Mission Planner on Windows or APM Planner on Mac OS. When you plug in your flight controller and open the software a wizard helper is going to install the latest firmware on your board. It is going to help you calibrate your compass, accelerometer, radio controller and flight modes as well.

Flight Modes

I recommend to use Stabilize, Altitude Hold, Loiter, Circle, Return to Home and Land as your six flight mode. Circle is really useful when it comes to plant inspection. It is going to orbit around a given coordinate so it helps to analyze your plants from every angle in a very precise way. I can do orbit with the sticks, but it's hard to maintain a perfect circle. Loiter is like parking your drone in the sky, so you can take high resolution NDVI pictures and RTH is useful if you loose signal or loose the orientation of your drone.

Pay attention on your wiring. Use the schematic to plug in your ESCs in the correct pins and check in Mission Planner the wiring of your input channels. Never ever test these with props on!

Installing the GPS, the Camera, and the Flight Controller

IMG_20190813_140100.jpg
IMG_20190813_140052.jpg

Once your flight controller is calibrated you can use some foam tape and install it on the middle of your frame. Make sure it's facing forward and have enough room for the cables. Mount the GPS with 3mm screws and use zip ties to keep your camera in place. These GoPro clones come with all the mounting utilities so it was quite simple to install this one.

ESCs and Power Cable

IMG_20190808_132429.jpg
IMG_20190808_125647.jpg
IMG_20190808_135007.jpg
IMG_20190808_135408.jpg
IMG_20190808_134300.jpg
IMG_20190814_124631.jpg

My batteries have an XT60 connector so I soldered 3 positive and 3 negative wires to each pin of a female connector. Use some heat shrink tube to protect the connections against shorting them (you can use electrical tape as well). When you solder these thick wires rub them together and fix them a copper wire then add a lot of molten solder. You don't want no cold solder joints especially at powering up the ESCs.

Receiver and Antennas

IMG_20190813_145928_1.jpg
IMG_20190813_151342.jpg
IMG_20190813_151348.jpg
IMG_20190814_124622.jpg

To have a good signal reception you have to mount your antennas in 90 degrees. I used zip ties and heat shrinking tubes to mount my receiver antennas on the front of my drone. Most of the receivers come with cables so and the channels are labeled so it should be easy to set it up.

The Tail Mechanism

IMG_20190815_114511.jpg
IMG_20190901_113919.jpg
IMG_20190901_113930.jpg

The tail mechanism is the soul of a tricopter. I have found this design online so I gave it a try. I felt like the original design was a little bit weak but if you reverse the mechanism it works perfectly. I cut the excess part with a dremel tool. On the picture it may seem like my servo motor is suffering a little but it works flawlessly. Use a little drop of superglue when tightening screws so they won't fall off because of the vibrations; or you can zip tie the motors like I did.

Doing a Hovering Test and PID Tuning

IMG_20190817_120839.jpg
IMG_20190817_135315.jpg
IMG_20190817_140330.jpg

Double check all your connections and make sure you won't fry anything when plugging in your battery. Install your propellers and try to hover with your drone. Mine was pretty smooth out of the box, I just had to do a little yaw tuning because it was correcting way too much. I can't teach PID tuning in this Instructable, I learned almost everything from Joshua Bardwell's video tutorial. He explain this so much better than I could.

Choose a Raspberry and Install Raspbian (Jessie)

IMG_20190830_153222.jpg
IMG_20190830_153526.jpg
IMG_20190830_153835.jpg
IMG_20190830_162845.jpg
2019-08-30 (1).png
2019-08-30.png

I wanted to keep this as light weight as possible so I went with the RPi Zero W. I am using Raspbian Jessie because the newer versions had some problems with OpenCV which we use to calculate the vegetation index from the raw footage. If you want a higher FPS rate you should choose the Raspberry Pi v4. You can download the software here.

Installing Dependencies

We're going to use PiCamera, OpenCV and Numpy in this project. As an image sensor I chose the smaller 5MP camera which is only compatible with the Zero boards.

  1. Flash your image using your favorite tool (I like Balena Etcher).
  2. Boot up your Raspberry with a monitor connected.
  3. Enable Camera and SSH interfaces.
  4. Check your IP address with ifconfig in terminal.
  5. SSH into your RPi with the ssh pi@YOUR_IP command.
  6. Copy and paste the instructions to install the required softwares:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libatlas-base-dev gfortran
sudo pip install numpy python-opencv
python (to test it)
import cv2
cv2.__version__

You should see a response with the version number of your OpenCV library.

Testing the NoIR Camera and NDVI Imaging

IMG_20190831_103054.jpg
test3.jpg
test_ndvi.png

Turn off your RPi board, insert the camera and then we can try to do some NDVI imaging with it. You can see on the flower (the one with a red background), that the greener parts inside show some photosynthetic activity. This was my first test, which was made with Infragram. I learned all the formulas and color mapping on their site to write a fully functional code. To make things more automatized I made a Python script that captures frames, calculates the NDVI images and saves them in 1080p on the copter.

These images are going to have a weird colormap and they will look like it's from another planet. Make a few tests, change some variables, fine tune your sensor before the first mission.

Downloads

Installing the RPi Zero W on the Drone

IMG_20190831_141421.jpg
IMG_20190831_141048.jpg
IMG_20190831_103005.jpg
IMG_20190831_141645.jpg
IMG_20190831_141932.jpg
IMG_20190831_141640.jpg
F4TMWXHJYSZCQQU.jpg

I installed the Pi Zero on the front of the tricopter. You can face your camera forward as I did or down as well. The reason mine is facing forward is to show the difference between plants and other non photosynthetic objects. Note: It may happen that some surfaces reflect IR light or they're warmer than the surroundings which causes them to have a bright yellow color.

Adding a Video Transmitter (Optional)

IMG_20190831_142423.jpg
IMG_20190831_142617.jpg
IMG_20190831_142604.jpg
IMG_20190831_142827.jpg
IMG_20190831_142932.jpg

I had this VTx laying around as well so installed on the back arm of my copter. This has a range of 2000 meters but I haven't used it while making tests. Only did an FPV flight for fun with it. When I don't use it the cables are removed, otherwise they're hidden under the frame to keep my build nice and clean.

Doing Plant Analysis

test3.jpg
IMG_20190823_111635.jpg
2019-08-31T10_56_06.825Z.jpg
2019-08-31T10_59_28.065Z.jpg
2019-09-01T12_43_28.225Z.jpg
2019-09-01T12_44_46.367Z.jpg

I did two 25 minute flights for a proper analysis. Most of our vegetables seemed to be okay, potatoes needed some extra care and watering. Going to check it that helped in a few days. They look pretty green on the picture compared to the orange and pink trees.

I like to do circle flights so that I can examine the plants from every angle. You can clearly see that under the fruit trees some vegetables don't get enough sunlight which makes them turn blue or black in the NDVI images. It's not a problem if one part of the tree is not getting enough sunlight at a time of the day, but it's bad if the whole plant turns into black and white.

Fly Safe ;)

IMG_20190831_161201.jpg
IMG_20190831_142749.jpg
IMG_20190831_161319.jpg
IMG_20190817_135317.jpg
IMG_20190817_140505.jpg

Thank you for reading this Instructable, I hope some of you will try to do experiments with NDVI imaging or with building drones. I had a lot of fun making this project from zero out of wooden parts, if you liked as well you may consider helping me out with your kind vote. Oh, fly safe, never above people and enjoy the hobby!