Automatic trap for moth detection in integrated pest management