This is the fourth post in a series:
- Autonomous Moth Trap Project
- Autonomous Moth Trap Hardware Revisions
- Hardware and Software updates to Autonomous Moth Trap
- Alternatives for Autonomous Moth Trap
- Software components for Autonomous Moth Trap
- Time Lapse module for Autonomous Moth Trap
Raspberry Pi 4 + Logitech BRIO + motion detection
The components used in my first autonomous moth trap (mostly following the Danish design, except for the LED tube) are:
- Raspberry Pi 4 Model B 4GB with fan
- Logitech BRIO 4K Ultra HD webcam
- USB 3.0 hub (theoretically not needed but directly connecting the camera to the Pi 4 seems to cause timing issues and the camera does not initialise properly)
- USB 3.0 to USB C cable (short)
- 12V 5A power adapter
- Neewer 10-inch LED light ring
- Huion A3 LED light table
- IP67 waterproof enclosure
- 9 high-power LEDs (6 UV, 1 white, 1 green, 1 blue)
- A009 BuckBlock DC LED Driver – 2100ma
- 50 cm clear acrylic tube (32 mm internal diameter)
- 50 cm aluminium extrusion (20 mm internal channel)
- 2 small power transformers
- Contact switch for safe shutdown of Raspberry Pi
- Toggle switch to test lights outside control of Raspberry Pi
- DHT22 temperature/humidity sensor
- Assorted electrical components (resistors, diodes, transistor, relay)
- Assorted grommets, screws, wire, plugs, connectors, solder etc.
- 3D-printed parts (PETG)
- Nylon mesh as screen inside enclosure vent
- 64GB SD card
The circuit design is available here.
The Logitech camera depends on a USB 3.0 connection, which requires a Raspberry Pi 4, which then necessitates a solution to vent the enclosure and use a fan. The power of this unit makes it possible to use motion detection to capture images. This has demonstrable benefit in producing time series imaging for active insects, but (on warm nights) results in images being captured almost every 2 seconds.
A sample from this model has been uploaded as a video.
Raspberry Pi Zero + Raspberry Pi HQ camera + time lapse
I wanted to test a more lightweight (and significantly cheaper) alternative that could more easily be deployed on battery power in the field.
The A3 LED light table in the original model seems to add little to the effectiveness of the system. Power is better devoted to running the moth light and the illumination from the light ring.
The Raspberry Pi Zero has significantly lower power consumption than the Raspberry Pi 4 and does not require a fan or venting. It is also compatible with the Raspberry Pi HQ camera and 6mm wide-angle lens. This camera has a larger image size than the Logitech Brio for less than half the cost and without the need for a USB 3.0 connection.
I have therefore constructed a second model using these components:
- Raspberry Pi Zero W
- Raspberry Pi High Quality Camera
- Tracer 12v 8Ah lithium battery – relatively old
- 12V 5A power adapter – alternative power source wired to use the same connector as the battery
- Neewer 10-inch LED light ring
- Sealed polycarbonate enclosure for Raspberry Pi, camera and electronics
- Sealed ABS enclosure for mains power adaptor
- 6 high-power LEDs (4 UV, 1 green, 1 blue – but the device is modular and I can connect the original 9 LED tube or a 3 UV LED tube)
- A009 BuckBlock DC LED Driver – 2100ma
- 40 cm clear acrylic tube (32 mm internal diameter)
- 40 cm aluminium extrusion (20 mm internal channel – in future I will use simple aluminium bars)
- 2 small power transformers
- Contact switch for safe shutdown of Raspberry Pi
- Toggle switch to test lights outside control of Raspberry Pi
- DHT22 temperature/humidity sensor
- DS3231 real time clock
- Assorted electrical components (resistors, diodes, transistor, relay)
- Assorted grommets, screws, wire, plugs, connectors, solder etc.
- 3D-printed parts (PETG)
- 64GB SD card
I have written a Python script (triggered as a cron job) to capture images on time lapse. The code (AMT_TimeLapse.py) is in Github along with other software and files for the project. A JSON configuration file controls various settings and the images are saved to a folder including a timestamped copy of this configuration.
I used the instructions here to add the real-time clock to the Pi: Adding a DS3231 Real Time Clock To The Raspberry Pi. The circuit diagram for this unit is available here. The number of UV lights is adjustable (3, 6 or 9).
An early result from this trap has been uploaded as a video.