Laser Weeding Tool

My team at Liberty University has been working on a Capstone Project for a Laser Weeding Tool that uses object detection to identify a weed and then turn a laser on at the weed location to remove it. As part of that effort, our team has created three YouTube videos focusing on the Weed Detection processes.

For background, an object detection program has a few necessary steps, the first is a dataset of images used to train an image. This dataset requires many photos or images that need to be annotated or labeled, often in the magnitude of thousands. These can either be manually made or downloaded from other open-source projects that have already gone through the tedious process of annotating the images. A dataset is composed of the image itself, a text file that provides the class index and coordinates, and a class file. For example, if there is a picture of a carrot and lettuce, I can define class 1 as a carrot and class 2 as lettuce. The text file will then state the class index and location for every object.

Once a valid dataset has been acquired, it can then be used to train an object detection model. The specific one used in our project is YOLOv3 Darknet, more information can be found in the YouTube video below. Many prerequisites are required, such as OpenCV, CUDA, and CUDNN. Once a training process has been started, the dataset will be run through the process which can take many hours. Our team used a 3080Ti and around 150 images and a valid weight file was produced after nearly 3-4 hours. Training a model is a very hardware-intensive process and is often sent out to High-Performance Computing labs where it can be done much more efficiently with powerful computing units running in parallel.

Once a weight file has been produced by the training process, it can be used flexibly across different programs. In our project, we use the weight file (alongside the training configuration settings) in a Python program that can detect an object and draw a box around it. As for the overall integration with FarmBot itself, there is a potential path through the already-established Weed Detection [Weed Detection | FarmBot Software Documentation] where, instead of identifying by color, a weed can be directly identified and both the center coordinates and radius of the weed can be passed through. A script or procedure can be made to utilize the Laser Weeding Tool, which will hopefully be showcased in a future post.

How to Install LabelImg: youtube.com/watch?v=BsEP7KndZfQ&list=PLJESLGqXwXdWCxusTTihjrxiT7_09RlhO

This video details the installation and usage of a free program called LabelImg. This is a tool used to manually annotate images.

How to Install and Train Darknet: youtube.com/watch?v=n8reLlFNcuk&list=PLJESLGqXwXdWCxusTTihjrxiT7_09RlhO&index=2

This video goes through the installation process of Darknet and how it is used to train a model using a dataset. This was simply the process that worked with our team and may not be exactly the solution for others. Other online resources go through similar yet slightly different tutorials for installing Darknet.

How to Run a Detection Program: youtube.com/watch?v=MMXwSG4lyQs&list=PLJESLGqXwXdWCxusTTihjrxiT7_09RlhO&index=3

This video goes through the usage of the generated weight file in a Python program to view an image, detect plants/weeds, and draw a box around it. The final output can be modified to only pass out center coordinates and radii of objects.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Hello all,

Our last post contained information primarily focused on the software aspect, so this update will showcase the actual hardware and mounting used for our Laser Weeding Tool.

STLs Description, Usage, and Purpose:

The following STL files can be used to physically print and utilize the laser tool to its fullest.

Final Mount.STL (73.8 KB)
Starting with the mount that holds the laser, this piece is a lightweight but strong component that holds the laser. The design has two countersunk holes on the back that that are used to mount to the Z-Axis track with M5x10 bolts and T-nuts. The mount also has three small holes around the bottom that are used when interfacing with the shroud.

Final Shroud.STL (300.1 KB)
Moving on to the shroud, this is a more unique part of the physical assembly as it is used to contain the area being burnt. The shroud has three holes at the top that are used to connect the shroud to the bottom of the mount. With a M2x12 bolt in each of those holes, you can secure the shroud to the mount. The next big design feature is the integrated water nozzle. This will be used to cool any hot matter after burning a weed. This could also be used to water the whole garden if an algorithm is developed for that purpose. Lastly, there is a short track piece that can be used to attach the camera in its current mount halves except you must use M5x12 bolts to secure the camera mount into the slot on the shroud. The instruction manual goes over the assembly in more detail.

The laser that the mount was modeled around is the Creality 3D Printer Laser Engraver Module Ender 3 Laser Engraving Attachment.

The laser itself uses 12 V to operate but the product comes with a soldered stepdown circuit from 24 V to 12 V. However, the chip has been known to fail and ours did as well. As such, we purchased a voltage reducer (Amazon.com: DC 24V to DC 12V 10A 120W Step Down Buck Converter Voltage Regulator Reducer Power Converter Mini Module Transformer : Electronics). By wiring the laser to the voltage reducer and into the peripheral port on the Farmduino board, we were able to easily control the powering on and off the laser. Additionally, a pressure regulator was connected between the hose and solenoid to allow us to control the flow of pressure going into the spray nozzle.

After connecting all of these components, it was simple to control each of them using the web app. While they are not directly interfaced with the Weed Detection Software, we hope that this successfully showcases both sides needed for a fully operational Laser Weeding Tool.

The videos discussed in the last forum post are posted below:

How to Install LabelImg: https://www.youtube.com/watch?v=BsEP7KndZfQ&t

How to Install and Train Darknet: https://www.youtube.com/watch?v=n8reLlFNcuk&t

How to Run a Detection Program: https://www.youtube.com/watch?v=MMXwSG4lyQs

4 Likes

:zap:Remarkable work! Great design and functional! :zap:

Great work @LU_Capstone_2324! Really fun to see the prototype in action :boom: I hope laser weeding can one day make its way into production FarmBots!

FarmBot community, please check out the full project video from the Liberty University team on the FarmBot YouTube channel:

1 Like

super interested in this. is there anyway i can buy the pieces or is it planned to be added to the default set of tools from Farm Bot?

@Solarpunk

The laser weeding tool is just a prototype to show what is possible with the FarmBot Open Source Platform. Although the video implies that it will be commercially available, there are no firm plans to incorporate laser technology into a FarmBot kit.

Having said that, if you want to replicate it using a 3D printer, all the plans and STL files are available in the post above from April 13, 2024. You can purchase the Creality 3D Printer Laser Engraver Module Ender 3 Laser Engraving Attachment directly from Amazon.

We would caution you that lasers in your garden can start fires. Also there are other safety risks that you must consider. Lasers can cause permanent loss of sight if fired directly into a person’s eye or if reflected by glass.

Safety Risks when working with Lasers

Working with wood burning lasers involves several safety risks that you should be aware of:

  1. Fire Hazard: The laser can ignite flammable materials, including wood, causing fires. Always use laser-safe materials and never leave the machine unattended. Do not operate the laser remotely and always have someone attending the FarmBot.
  2. Toxic Fumes: Burning wood releases harmful gases and particulates, which can be hazardous if inhaled.
  3. Eye Damage: Direct or reflected laser beams can damage your eyes, potentially causing vision impairment. Always wear appropriate safety glasses and avoid looking directly at the laser.
  4. Skin Burns: The high-energy laser light can cause severe burns if it comes into contact with your skin. Wear protective gloves and clothing to minimize this risk.
  5. Cuts and Wounds: Handling the materials and equipment can lead to cuts and other injuries. Be cautious and use proper tools and techniques.