Rotating Vegetation Monitoring Camera - VegTrack360 (v3)

by FlorianEllsaesser in Circuits > Cameras

275 Views, 3 Favorites, 0 Comments

Rotating Vegetation Monitoring Camera - VegTrack360 (v3)

20241028_074144.jpg
20241012_113836.jpg
20241017_203854.jpg

Monitoring outdoor spaces presents unique challenges. A single fixed camera, like the PhenoCam, captures only one angle of a complex scene. Achieving a full 360-degree panoramic view requires multiple cameras pointing in all directions. While this is feasible with affordable RGB cameras, replicating the setup with more specialized equipment like thermal cameras or spectrometers can be prohibitively expensive.

That’s where the VegTrack360 comes in. This project introduces a simple rotating camera platform that uses a single camera to create 360-degree panoramic images. By leveraging a rotating mechanism, the VegTrack360 provides a cost-effective solution for capturing comprehensive views, whether you’re monitoring your backyard, a field, or a wildlife habitat.

Welcome to the VegTrack360 Build Tutorial!

In this guide, I’ll walk you through creating a rotating camera platform designed for precise outdoor monitoring. This tutorial is also available on Hackaday.io but in a different style (more concise). You can find the project files and code on github.com and this is also where I update and store the latest version of this project.

This simple setup tutorial uses a single RGB camera to capture 360° panoramas through horizontal and vertical rotation. Once built, you can easily upgrade the system for thermal imaging or multispectral analysis.

This project was made possible with funding from the NWO Open Science Fund. We are deeply grateful for their support in advancing open science and remote sensing innovation.

Ready to get started? Let’s dive in!

Supplies

20241017_170045.jpg
20241017_170755.jpg
20241017_170821.jpg
20241017_170919.jpg
20241017_171028.jpg
20241017_171123.jpg
20241017_171232.jpg
20241017_171251.jpg
20241017_171417.jpg
20241017_171922.jpg
20241017_172955.jpg
20241017_173526.jpg
20241017_173644.jpg
20241017_173753.jpg
20241017_173857.jpg
20241017_174451.jpg

Let’s begin by reviewing the materials you’ll need before getting started. Most of the components I use are affordable and readily available from DIY electronics online stores. Many parts can be substituted with similar alternatives.

If you’re new to DIY electronics, I recommend purchasing the exact parts listed to ensure a smooth build process. However, if you have some experience, feel free to customize the shopping list to suit your preferences.

Essential Components

  1. 3D-Printed Parts: Download the files here. Use PETG or another durable material instead of PLA for better weather resistance.
  2. Teflon Diffuser Disk: 4 cm diameter, 1 mm thick.
  3. Powerbank: At least 10,000 mAh for extended operation.
  4. Jetson Nano Developer Kit (or Raspberry Pi 4 for basic setups).
  5. Cooling Fan: To keep the Jetson Nano running smoothly.
  6. Jetson Nano WiFi Module.
  7. MicroSD Card: 32GB or larger for the Linux image and code.
  8. Raspberry Pi Camera v2 and Ribbon cables (45–60 cm).
  9. Parallax Feedback Servos: For 360° movement (with aluminum disks).
  10. ESP32 Microcontroller, perf board, pin headers.
  11. Neopixel Ring: 8 LEDs (high-quality recommended).
  12. Pushbuttons: 2 required.
  13. Control LED: Color of your choice.
  14. USB stick for image storage (optional)
  15. Additional parts: Screws, spacers, washers, and USB cables.

Prepare Jetson Nano Image

20241017_171251.jpg

Before your Jetson Nano can start operating, we need to set up its operating system.

Here's how to prepare it:

  1. 🧹 Format the SD Card: Use SD Card Formatter to clean and format your SD card. Make sure it has a capacity of at least 32GB to handle AI applications efficiently.
  2. 🌐 Download the OS: Visit NVIDIA's official setup page and download the Jetson Nano SD Card Image.
  3. 🗂 Unzip the Image: Extract the downloaded file using your preferred extraction tool.
  4. 🔥 Flash the Image: Use BalenaEtcher to write the extracted image onto your SD card. The process is straightforward and quick!

Prepare Jetson Nano

20241017_174556.jpg
20241017_174656.jpg

Carefully remove the heat sink with a screw driver, ensuring no screws are lost.

Add Wifi Module

20241017_174732.jpg
20241017_174755.jpg
20241017_174826.jpg
20241017_174902.jpg

To add the WiFi Module:

  1. Remove the black screw beneath the heat sink
  2. Carefully slide the WiFi module into place. No force is required. Be careful not to damage it!
  3. Secure the module with the black screw without over-tightening.
  4. Attach the antenna cables
  5. Reattach the heat sink.

Add Cooling Fan

20241017_174947.jpg
20241017_175015.jpg
20241017_175035.jpg
20241017_175133.jpg
20241017_175210.jpg
20241017_175258.jpg
20241017_175325.jpg

Now let's add the cooling fan:

  1. Connect it to the Jetson Nano fan socket (review the pictures above).
  2. Mount the fan onto the heat sink.
  3. Secure the fan with screws; most fans (even the original one) come with horrible wood screws. Ideally replace them with machine screws and counter nuts.
  4. Tape or route the cables neatly to avoid interference.

Let's Start the Jetson Nano for a First Time

Now we can start the Jetson nano for a first time:

  1. 💾 Insert the SD Card in the slot under the heat sink.
  2. 🖥 Connect Peripherals: Hook up a screen via HDMI, a mouse, and a keyboard via USB.
  3. Power Up: Add a jumper for 5V and connect power via the barrel jack.
  4. 🚀 Boot Time: Your Jetson Nano should come alive!

Initial Setup for Jetson Nano

Welcome to the Nano interface! Set up the system:

  1. Accept the license.
  2. Choose your language, keyboard layout, and time zone.
  3. Enter your name (I use "vt360"), set a password (I use e.g. 1234, which is not very safe as you can imagine), and enable auto-login.
  4. Keep the app partition size as default.
  5. Select the MAXN option for maximum power (this is not very energy efficient but helps to generate on board mosaics, if you generate the mosaics/panoramas on another computer you can also select the other option).
  6. Reboot and watch the desktop load.

Remote Control Your Jetson Nano

You might have noticed that the mouse, keyboard, and monitor cables are cumbersome and will obstruct the camera’s rotation. To keep things tidy and functional, let’s set up remote access. You’ll need an Ethernet cable for the initial setup, and later, you can switch to WiFi.

Here’s how to get started:

On the Jetson Nano:

  1. 🖥 Ethernet First: Plug in an Ethernet cable (weirdly, this activates WiFi connectivity later).
  2. 🔄 Restart: Restart the Nano and connect to WiFi.
  3. 🌐 Open Chromium: Navigate to this VNC setup guide.
  4. 🛠 Configure VNC: Open a terminal and run these commands (I use the password '123456' here which is of course absolutely not safe):
cd /usr/lib/systemd/user/graphical-session.target.wants
sudo ln -s ../vino-server.service ./.
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password $(echo -n '123456' | base64)
sudo reboot
  1. 🔍 Find Your IP: After reboot, type ifconfig in the terminal to get the Nano’s IP address (e.g., 192.168.1.198).

On Your Computer:

  1. 🖥 Install VNC Viewer: You can download it here. Open it and type in the Nano’s IP address.
  2. 🔑 Enter Password: Use the password 123456 (I hope you found a better one).
  3. 🎉 Connect: You’re in!

Install Spyder IDE (optional)

The Nano is great for coding, so let’s install Spyder (this is optional but I recommend it if you want to further develop this):

  1. 💻 Install via Software Manager: Search for "Spyder" and install it.
  2. 🧪 Install Python Packages: Open a terminal and run:
pip3 install pyserial flask serial
  1. 🔄 Switch Python Kernel: In Spyder, go to Tools -> Preferences -> Python Interpreter.
  2. Select "Use the following Python interpreter".
  3. Apply and OK.

Prepare Control LED

20241017_180125.jpg
20241017_180218.jpg
20241017_180607.jpg
20241017_180640.jpg
20241017_180931.jpg
20241017_181053.jpg
20241017_181530.jpg
20241017_181725.jpg
20241017_181819.jpg

Let's prepare the control LED. This LED displays the status of the Jetson Nano (on/off/busy):

  1. Cut two 20 cm cables (black for ground, a colored one for the signal. Obviously, the color of the cables doesn't matter, but it helps if you have reconnect things in the field later).
  2. Remove the cable cover on both ends.
  3. Solder or clamp the cables to connectors and use heat shrink for insulation.

Prepare Control Buttons

20241017_182137.jpg
20241017_182200.jpg

Let's now prepare the control buttons. With these buttons we can switch the Jetson Nano on and off and we can reboot the system. This is a bit more elegant and healthier to your SD card then just pulling the plug:

  1. Cut four cables (two black for ground and two in a different color for signals), each 20cm.
  2. Add connectors and heat shrink as done with the LED.
  3. You can use any type of pushbutton here. I really don't like the haptics of the cheap ones though. That is why I use these really nice ones from the 80ies.

Add Controls to Jetson Nano

20241017_182400.jpg
Jetson_Nano_OnOff_Reset_Switch.jpg

Let's now add our control buttons and status LED to the Jetson Nano. The pictures above show my setup and an alternative setup with a LED-button combination:

  1. Follow the images to attach the cables correctly.
  2. Ensure that ground is always connected to the correct pin for consistency. (this doesn't matter for the pushbuttons though).

Build Motor Controller

02_Feedback_servos_NeoPixels_wiring_bb.png
20241017_185928.jpg
20241017_182508.jpg
20241017_182605.jpg
20241017_182900.jpg
20241017_182936.jpg
20241017_183256.jpg
20241017_184313.jpg
20241017_184928.jpg
20241017_190107.jpg

Now let's build the motor and status lights controller. You can also use an Arduino for this, or whatever micro-controller you have at hand. I use the ESP32 because I like it better than Arduino and it has some nicer feedback Servo libraries.

Please refer to the wiring diagram above to check how the servos and the Neopixel ring is connected.

In the wiring diagram the PWM cable is yellow (in my pictures it is white) and the sensor cable is blue (in my pictures it is yellow).

You have two options here: connect the cables directly to the pins of the micro-controller or use a perf board like I did. I might make a PCB board for this some day, check the github projects for updates.

As an additional advice: I use a cheap NanoPixel board here (it did cost less than 2EUR). After a few days, some of the NeoPixels stopped working properly. I recommend you invest a bit more to buy a more decent board if you want a nice looking result.

Upload Code to ESP32

Now let's upload the code to the ESP32 board:

  1. Download the code from the github project.
  2. Download and install the Arduino IDE.
  3. If you have never used the Arduino IDE with ESP32 devices, have a look at this tutorial first.
  4. Open the downloaded code in the Arduino IDE
  5. You will need to install two libraries: Adafruit_NeoPixel.h and ESP32Servo360.h
  6. Select the COM port of your ESP32 device
  7. Upload the code to your ESP32
  8. Once powered, the status NeoPixel ring should light up immediately and the servos will move to 15 degrees (the default position).

Horizontal Feedback Servo

20241017_190152.jpg
20241017_190254 - Copy.jpg
20241017_191000 - Copy.jpg

Let's now install the Horizontal Feedback Servo:

  1. Mount the horizontal feedback servo on the main base plate.
  2. Ensure the servo axis is centered. Use screws and washers to secure it.
  3. Route the servo cable neatly through the 3D print.

Add Base Disk

20241017_191032 - Copy.jpg
20241017_191435 - Copy.jpg
20241017_191456 - Copy.jpg
20241017_192212 - Copy.jpg

Let's now add the base disk. You might have to remove it later again to mount it on a post or a camera tripod. However, attaching it now helps during the building process:

  1. Attach the fancy aluminum servo disk to the base disk using four screws.
  2. Secure the base disk to the servo and test for smooth 360° movement. The disk should move easily without touching the main body of the camera platform.

Add Vertical Feedback Servo

20241017_192239.jpg
20241017_192535 - Copy.jpg
20241017_192708 - Copy.jpg
20241017_192743 - Copy.jpg
20241017_193445 - Copy.jpg

Now we can add the Vertical Feedback Servo:

  1. Position the vertical feedback servo on the vertical camera wheel’s axis.
  2. If your 3D printer is imprecise, add washers or spacers to create clearance between the servo and main body. As you can see I use super glue to keep the washers in place before attaching the screws.
  3. Secure the servo, ensuring cables are not squeezed or tangled.

Install Indicator NeoPixel Ring

20241017_193445.jpg
20241017_193620 - Copy.jpg
20241017_193715 - Copy.jpg
20241017_193955 - Copy.jpg
  1. Screw the Neopixel ring into the 3D-printed tower or secure it with hot glue.
  2. Route cables carefully to avoid interference.

Install Servo Controller and Connect

20241017_194153 - Copy.jpg
20241017_194210 - Copy.jpg
20241017_194422 - Copy.jpg
20241017_194431 - Copy.jpg
  1. Attach the servo controller board to the main assembly using screws or hot glue.
  2. Manage cables using zip ties to ensure they don’t interfere with the rotating parts.

Install WiFi Antenna Sockets

20241017_195208 - Copy.jpg
20241017_195303 - Copy.jpg

Insert the WiFi antenna sockets into the upper holes and secure with a washer and nut.

Add Switches and LED

20241017_195524.jpg
20241017_195634 - Copy.jpg
20241017_195845 - Copy.jpg
20241017_200116 - Copy.jpg
  1. Position the switches and LED in the designated holes.
  2. Secure them with hot glue or appropriate mounts.
  3. Use images as a reference.

Prepare Camera Wheel

20241017_200315.jpg
20241017_200346 - Copy.jpg
20241017_200700 - Copy.jpg
20241017_200715 - Copy.jpg
20241017_201524 - Copy.jpg
20241017_201636 - Copy.jpg
20241017_202001 - Copy.jpg
  1. Attach the ribbon cable to the camera module carefully. The sockets for these ribbon cables break very easily (trust me on that!) be very careful.
  2. Secure the camera to the aluminum disk.
  3. Mount it onto the 3D-printed camera wheel.

Install Camera Wheel

20241017_202001.jpg
20241017_202040 - Copy.jpg
20241017_202046 - Copy.jpg
20241017_202046.jpg
20241017_202108 - Copy.jpg
20241017_202130 - Copy.jpg
20241017_202159 - Copy.jpg
20241017_202208 - Copy.jpg
  1. Connect the ribbon cable to the Jetson Nano board. Again, be careful with the ribbon cables.
  2. Have a look of how I organize the ribbon calble in the camera wheel.
  3. Use a screw to attach the camera wheel to the servo. This time it is good to connect the ESP32 shortly so that the servo goes to a default position of 15 degrees. This way you can already place the camera in a 90 degre angle looking forward.
  4. Test the camera wheel’s rotation manually and carefully, ensuring the ribbon cable does not entangle or stretch.
  5. Aim for at least three full rotations. Make sure this works well.

Connect to ESP32

Time to interface with external hardware. Connect the USB port of the ESP32 to the USB port of the Jetson Nano for a test. Start up the Jetson Nano and connect remotely:

  1. 🔍 Detect the ESP32:
dmesg | grep tty

2. Enable User Access:

sudo usermod -a -G tty vt360

3.🔧 Set Permissions:

sudo chmod a+rw /dev/ttyUSB0

Organize Cables and Install Jetson Nano

20241017_202525 - Copy.jpg
20241017_202419 - Copy.jpg
20241017_202625 - Copy.jpg
20241017_202931 - Copy.jpg
  1. Neatly organize all cables to avoid tangles.
  2. Mount the Jetson Nano using spacers, ensuring it fits snugly. If necessary, adjust cable placements underneath the board.

Keep Organizing Cables

20241017_202948 - Copy.jpg

Add Powerbank and Connect Power Supply

20241017_203018 - Copy.jpg
20241017_203136.jpg
20241017_203221.jpg
  1. Place the power bank in its compartment and secure it with rubber bands.
  2. Connect the power supply to the Jetson Nano.

Add USB Stick for Image Storage

20241017_203249.jpg

This is optional. Name the USB stick "VT360". The code on the Jetson Nano will later look for a pen drive or USB stick that is attached to the USB ports named "VT360". If none with this name is there, it will just safe the images on the SD card.

Prepare and Install Dome

20241017_203405.jpg
20241017_203428 - Copy.jpg
20241017_203525 - Copy.jpg
20241017_203600 - Copy.jpg
20241017_203609 - Copy.jpg
  1. Glue the Teflon diffuser disk onto the dome.
  2. Slide the dome onto the main assembly. This should work perfectly if you have a proper cable management.

Add WiFi Antennas

20241017_203708.jpg
20241017_203841 - Copy.jpg
  1. Screw the WiFi antennas onto the installed sockets.

You Are Almost There!

20241017_203841.jpg
20241017_203854 - Copy.jpg
20241017_203905 - Copy.jpg
20241017_203912.jpg
  1. Test all components for smooth operation.
  2. Move the camera wheel and servos manually to confirm there are no obstructions.

Add Scripts

Now that your hardware setup is complete, let's add the software to the Jetson Nano Linux system. For this power the camera and connect to a Computer via VNC.

Download the vt360_startup.sh script and the FLASK_APP folder from the github project.

In the FLASK_APP folder navigate to the app.py script and add your own WiFi credentials to the script:

#WIFI_SSID = 'My_WiFi_Name'

#WIFI_PASSWORD = 'My_WiFi_Password'

My recommendation is to create a WiFi hotspot on your phone and use these credentials, this will allow you to use the vt360 also outside the range of your home WiFi.

Copy both the vt360_startup.sh script and the FLASK_APP folder to your Desktop folder on the vt360 system.

Run Scripts on Startup

To automate tasks, we can use CRONTAB in Linux:

  1. 📋 Add to Crontab. Open a terminal and type:
crontab -e
  1. This opens the crontab. It is very annoying to navigate in crontab if you were born (like me) after 1985 and think user firendly GUIs are a human right.

If you eventually manage, add this line:

@reboot sh ~/Desktop/vt360_startup.sh


3. Save and exit typing: :wq

Test the Camera

Screenshot_20241016_152632_DuckDuckGo.jpg
  1. Power on the camera.
  2. It should connect to your WiFi network automatically. Remember, it is best using a WiFi hotspot on your phone, but any WiFi will work.
  3. Use a browser to find the camera’s IP address. If you can't find it use an app like Fing to find its IP address on your network. A typical IP address could look like this: http://192.168.39.98:5000/
  4. A control panel should load that looks like the picture above.
  5. Press the green "Start Taking Pictures" button to capture your first set of images.
  6. Of course you can adjust the covered images per rotation and the start and point of the movements.

Build Stationary Base Plate

20241017_204516 - Copy.jpg
20241017_204559 - Copy.jpg
20241017_204606.jpg
20241017_204628 - Copy.jpg

Create a sturdy base plate for stationary applications. Avoid leaving the camera outdoors permanently unless weatherproofed. Optionally you can use the tripod mount in the next step below.

Build Base Plate for Camera Tripod

20241017_204414 - Copy.jpg
20241017_204428 - Copy.jpg
20241017_204903 - Copy.jpg

A tripod-compatible base plate is ideal for portable setups.

Thermal and Multispectral Camera Wheels

20241026_213425.jpg
20241017_170118 - Copy.jpg

Experiment with other sensors! Add wheels for bandpass-filtered cameras or FLIR Lepton thermal sensors for advanced imaging.

Troubleshooting Tips

If you face port issues:

  1. Update and install tools:
sudo apt update
sudo apt install lsof
  1. Check and kill processes on a port:
sudo lsof -i :5000
sudo kill -9 <PID>