Field Testing

I decided to run some field tests using hardware I already had in hand.

Parts list:

  1. FPV Drone
  2. Raspberry Pi Zero W
  3. Raspberry Pi NoIR cam v2
  4. Camera Case
  5. Zip Ties
  6. Anker Power Supply

Note: I tried soldering the Pi Zero W directly to the drone flight controller, but it drew too many amps and the drone kept rebooting (this started happening after my first flight). I also tried to trigger the camera using the drone radio transmitter by connecting a GPIO pin of the Pi Zero W directly to the flight controller. I will write a separate blog post if I can get this to work.

I took my Raspberry Pi Zero W, attached a NoIR camera, put it in a camera case, and zip tied it to the bottom of my 5″ FPV drone. I wrote a python script to make the zero w automatically take pictures every couple seconds.

Code with GPIO trigger

from picamera2 import Picamera2
import RPi.GPIO as GPIO
from time import sleep
from time import strftime

picam2 = Picamera2()
camera_config = picam2.create_still_configuration(main={"size": (3280, 2464)})
picam2.configure(camera_config)
picam2.start(show_preview=False)

GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN)

def debounce():
    sleep(0.06)

#Time stamp each image
def takePicture():
    print("picture captured")
    picam2.start_and_capture_file("Plant_Test_Pics/" + strftime("%d/%m/%y at %I:%M%p:%S:%f") + ".jpg")

while True:
    time.sleep(0.01)
    if GPIO.input(23):
        takePicture()
        debounce()

Time based image trigger

from picamera2 import Picamera2
import RPi.GPIO as GPIO
from time import sleep
from time import strftime

picam2 = Picamera2()
camera_config = picam2.create_still_configuration(main={"size": (3280, 2464)})
picam2.configure(camera_config)
picam2.start(show_preview=False)

def takePicture():
    print("picture captured")
    picam2.start_and_capture_file("Plant_Test_Pics/" + strftime("%d/%m/%y at %I:%M%p:%S:%f") + ".jpg")

while True:
    time.sleep(2)
    takePicture()

All of my code is on my github repository:

https://github.com/Bobcati/BLD_NDVI_Scripts/tree/main

Last minute Anker power supply addition

I also recorded some GoPro footage to go along with the Infrared (IR) images I took. Check out this video:

Here is a slideshow with some of the infrared photos I took with NDVI processing and unfiltered IR images comparisons.