Skip to content

Simple SG90 servo controlled hatch open/close mechanism for moth traps

Notifications You must be signed in to change notification settings

ScionResearch/moth-trap-hatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moth Trap Hatch Controller

Moth Trap Assembly

A compact, automated hatch controller for a moth trap, designed for the Seeed Studio XIAO (SAMD21 Cortex-M0+). This project combines simple electronics, robust firmware, and 3D-printed parts to automate the opening and closing of a hatch for insect trapping or similar applications.


Features

  • Automated Servo Control: Opens/closes hatch based on trigger input.
  • PlatformIO/Arduino: Easy to build and upload.
  • 3D Printable Hardware: STL files and Fusion 360 assembly included.

Hardware

  • Microcontroller: Seeed Studio XIAO (SAMD21 Cortex-M0+)
  • Servo Motor: Standard SG90 hobby servo
  • Trigger: Digital input (e.g., button or sensor)
  • 3D Printed Parts:
    • Bracket.stl
    • Hatch.stl
    • PCB cap.stl
    • PCB insert.stl
  • CAD Source: hardware/Moth trap assembly.f3z

Getting Started

Prerequisites

  • PlatformIO
  • Seeed Studio XIAO (SAMD21)
  • Standard SG90 hobby servo
  • Trigger button/sensor

Setup

  1. Clone this repository:
    git clone https://github.com/ScionResearch/moth-trap-hatch.git
    cd moth-trap-hatch
  2. Open in PlatformIO (VSCode recommended).
  3. Connect your Seeed XIAO board.
  4. Build and upload:
    pio run --target upload

Usage

  • The servo is attached to PIN_SERVO (default: pin 10).
  • The trigger input is on PIN_TRIGGER (default: pin 9).
  • When the trigger is pulled LOW, the servo moves to the DOWN position; otherwise, it stays UP.
  • Debounce is handled crudely with a 1s delay.

3D Printing

  • STL files for all mechanical parts are in hardware/3MF files/.
  • The full assembly is in hardware/Moth trap assembly.f3z (Fusion 360 format).

Contributing

Pull requests and suggestions are welcome! Please open an issue first to discuss major changes.


License

This project is licensed under the MIT License. See LICENSE for details.


Acknowledgments

  • PlatformIO community
  • Seeed Studio for XIAO platform
  • Arduino ecosystem
  • All contributors and testers

For questions or support, please open an issue on GitHub.

About

Simple SG90 servo controlled hatch open/close mechanism for moth traps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published