Replicator Team - Mothbox Pro

Hey! My names Cam and I’m an ecologist from Melbourne, Australia. Over the past month I have been building a Mothbox Pro and I wanted to share my progress here. I am fortunate to have a job managing remnant bushland in Melbourne and got interested in all things insects last year when I hosted a insect night at the bushland. From there I have tried all kinds of things to attract insects, mercury vapor bulbs, de-zappified bug zappers and recently a high powered diy “lepiled”.

Of course, a couple days after making my own lepiled I discovered the Mothbox project. Firstly, congratulations to all involved, it really is a special thing to see open source hardware/software like this so well documented and funded. It’s been a lot of fun making the Mothbox Pro and I’m excited to see where it all goes.

I’d like to share my experience from ordering the pcb’s to deploying it in the bushland not too long ago, as well as some developments I have made with the camera.

PCB

I went for the 5.0.5 PCB as there was the warning on the build guide that 5.0.6 was still being worked on. I skipped the KiCAD steps as I didn’t need to adjust anything. I had no troubles following the steps of flipping components to match etc. The only issues I ran into were with the Mothbeams. I firstly had to find a replacement for the 395nm LED’s which was fine however I got an email from JLCPCB explaining that the 4 pin connector would either need a new part or have the solder changed.

I decided to trust this decision as I wasn’t sure I would be able to solder them myself if I ordered the part separately. Side Note: I haven’t noticed any issues with the soldering and I have run the LED’s on full power to test how hot they get and everything has been fine.

After those fixes the PCB’s arrived quickly and well packed. I ordered the minimum of 5 and total cost inc. shipping was $535.07 AUD.

Battery

Just how others have mentioned, at first I was having trouble figuring out how to get the batteries shipped to Aus, so I ordered a single battery for the time being to ensure I could test out the pcb while I sorted out the TalentCells. I went with the NEEWER PS099F which has a 12v output. I procced to have a head scratching afternoon trying to boot the pi and get the Mothbox working before I realised the NEEWER has an internal 12v regulator and was going into a sort of safe mode when connected to the regulator in the configuration shown in the build doc. Quick solution for those using batteries with internal regulators, solder a barrel jack with 4 leads and wire it up like so:

Once I got that working, I had to completely redo the ISO on the SD as I think it became corrupted when using the NEEWER battery with the regulator.

The way I managed to get TalentCells to Aus was making direct contact with Yabopower in Shenzen. I had a discussion with Amanda on Whatsapp, got a quote, and paid through Alibaba’s Trade Assurance platform as I was having issues with Paypal. All up with shipping they were $363.90 AUD. They are very well priced, $35.90 USD a unit but I had to pay a premium for shipping at ~$100. I am yet to test them out but they arrived well packaged and came with a delightfully worded user manual.

Other Components

I tried hard to find a second hand Pi as the prices are ridiculous but unfortunately had to cop the the AI tax. Most of the other electronics I got from CoreElectronics. I had to find an alternative for the regulator as amazon was being difficult and kept saying they had stock in Australia but when I would checkout it would say I was ordering from America. I managed to find a supplier here in Aus, Spacetek, and the units come with a barrel jack attached which was handy. (I haven’t officially tested them with the tallentcells yet but I used a bench top power supply at varying voltages to check and no problems.)

Case and Panel

I am lucky to know someone with a 3D printer (shoutout to my twin) and used the latest model design. Took about 2 days to print and used up a roll of bambu labs normal PETG filament. I haven’t been brave enough to leave it in the rain but the print came out amazing, super lightweight and seamless.

For the Panel and arms I decided for the first box to cut it by hand. I rushed with this as all the parts arrived sooner than I expected and I had a weekend free so I went to a local pool shop which had acrylic sheets but advertised them as “UV Resistant”. Bought it and what do ya know, it barely stops any UV light. Cutting the case front by hand was no trouble but I had to modify the design of the legs as scoring and cutting overhangs etc was quite difficult. At the moment my set up is ~25cm from the front panel and the target panel I eye balled the right size by using my phone camera where the arducam is and then measuring by hand the frame as both cameras have similar specs with FOV. I am using an old polyester polo as the material.

First Photos

This was the thing I was most curious about with the Mothbox, how did the camera resolve insects. Here in Melbourne we have plenty of diversity of insects but a majority of them are quite small. Though I have spotted Endoxyla cinereus in Melbourne, which has the wikipedia claim of “one of the worlds heaviest moths”.

Overall the camera is amazing for the price, size and functionality. Having so many LED’s on the PCB helps with the white balance and I was able to zoom in for some great detail.

However I seemed to be getting a lot of rolling shutter, and for my first night deploying in the backyard, missed a lot of insects.

Luckily for me, one of my other hobbies is macro photography and have come across a similar issue when focus stacking at night. The key for freezing motion when you have a relatively slow readout speed is to use a flash but time it during a window when all line buffers are reading out at the same time. I came across this when trying to take macro photos of orchids at night with a process called ultra violet induced visible florescence with older dslr cameras.

I’m not particularly familiar with raspberry pi coding so I did employ some locally run AI to help. (I can share the code for fixing rolling shutter if anyone is keen but I can’t promise its efficient as I am only just learning it). Currently the Mothbox takes a photo by turning the white leds on and then turning the sensor on very quickly to take a photo. Thanks to whoever designed the led circuit with the mosfets as now the LED’s can flash briefly during the sensor readout.

Rather than having the LED’s for the whole time the sensor is exposing, even if it is very fast at about 377ms, any moving objects will effected by rolling shutter. With this fix, the readout time is the same as we can’t push that any faster, but rather the Mothbeams are turned off, camera exposes and halfway through the readout a flash is fired at about ~0.8ms flash to freeze motion. It’s kind of like pseudo global shutter.

With that change you end up not only capturing flying insects but images seem to be sharper. Also I have made it so the Mothbeams turn off during the exposure which seems to fix the purple/blue cast.

E-ink

I am also working on a display change as I was having trouble reading the eink. This is just using the other font Scientifica with the addition of a moon icon with rise and set times as I seem to always go mothing when its a full moon…

Mothbot

I have gotten the segmentation and identification to work flawlessly as well but haven’t had the time to sit down and start properly identifying! The ML side of things is very intriguing, at a glance it was very accurate to family level and only made a few errors to genus.

Again, thankyou to everyone so far that has helped with the project. I definitely wouldn’t have gotten this far by myself without the documentation and years of work behind this. I’m keen to build upon this project as I would love to see this kind of sampling become standard for terrestrial insects. Here in Australia we have a comprehensive scoring system for macroinvertebrates surveying called SIGNAL, that gives an indication for aquatic system health and the Mothbox seems to me a way to work towards that in the terrestrial space.

I will post here with any new updates.

Thanks!

2 Likes