Hermetia illucens, the black soldier fly, is a common and widespread fly of the family Stratiomyidae.
The larvae and adults are considered neither pests nor vectors. Instead, black soldier fly larvae play a similar role to that of redworms as essential decomposers in breaking down organic substrates and returning nutrients to the soil.
Black soldier fly larvae (BSFL) are an excellent source of sustainable protein for aquaculture, animal feed, and pet and human nutrition. The larvae have voracious appetites and can be used for composting household food scraps and agricultural waste products.
This species is native to the Neotropical ecozone, but in recent decades has spread across all continents becoming virtually cosmopolitan. It is present in most of Europe (in the Iberian peninsula, in southern France, in Italy, in Croatia]], in Malta, in the Canary Islands and in Switzerland. Is can also be found in the Afrotropical ecozone, in the Australasian ecozone, in the East Palaearctic ecozone, in the Nearctic ecozone, in North Africa and in the Oriental ecozone.
The adults of Hermetia illucens measures about 16 mm (5/8 inch). These medium-sized flies have a body predominantly black, with metallic reflections ranging from blue to green on the chest and sometimes with a reddish end of the abdomen. The second abdominal tergite has translucent areas, from which the specific Latin epithet derives. The head is wide, with very developed eyes. The antennas are about twice the length of the head. The legs are black with whitish tarsi. The wings are membranous, in the resting time they are folded horizontally on the abdomen and overlapped.
Hermetia illucens is a mimic fly, very close in size, color, and appearance to the organ pipe mud dauber wasp and its relatives. The mimicry of this particular kind of wasp is especially enhanced in that the fly's antennae are elongated and wasp-like, the fly's hind tarsi are pale, as are the wasp's, and the fly has two small transparent "windows" in the basal abdominal segments that make the fly appear to have a narrow "wasp waist".
The adult Black Soldier Fly has a life span of 5 to 8 days. The adult soldier fly has no functioning mouthparts (although it can ingest water); it spends its time searching for mates and reproducing.
An adult female lays between 600-800 eggs at a time. These eggs are typically deposited in crevices or on surfaces above or adjacent to decaying matter such as manure or compost and hatch into larvae in approximately four days.
Black Soldier Fly larvae can be differentiated from blowfly or housefly larvae by a thin gray-black stripe on the posterior end. These larvae eat and grow for 10–14 days until they enter the pre-pupal stage, when they begin to turn a brownish color. After about a week they enter the pupal stage, when they are at their nutritional peak.
Black soldier fly larvae (BSFL) are used to compost waste or convert the waste into animal feed. The harvested pupae and prepupae are eaten by poultry, fish, pigs, lizards, turtles; even dogs. The wastes include fresh manure, food wastes of both animal and vegetable origin.
Fly larvae are among the most efficient animals at converting feed into biomass. Aside from the protein production, fly larvae also produce another valuable resource called frass. Fly larvae frass is a granulated and odorless residue that can be used as organic fertilizer 
When the larvae have completed their larval development through six instars, they enter a stage called the "prepupa" wherein they cease to eat, they empty their guts, their mouth parts change to an appendage that aids climbing, and they seek a humid sheltered area to pupate. This prepupal migration instinct is used by grub composting bins to self-harvest the mature larvae. These containers have ramps or holes on the sides to allow the prepupae to climb out of the composter and drop into a collection area.
Larvae are beneficial in the following ways:
The main difficulty is obtaining black soldier fly larvae or eggs to start or replenish the colony. This is usually done by enticing the soldier flies to lay eggs in small holes over the grub bin. Adult flies lay clusters of eggs in the edges of corrugated cardboard or corrugated plastic. In some regions, it is possible to start or maintain adequate larvae colonies from native soldier flies; however, pest species such as houseflies and blowflies are also drawn to many of the foods used to attract soldier flies (such as fermented chicken feed).
In tropical or subtropical climates, they might breed year-round, but in other climates, a greenhouse may be needed to obtain eggs in the cooler periods. The grubs are quite hardy and can handle more acidic conditions and higher temperatures than redworms. Larvae can survive cold winters, particularly with large numbers of grubs, insulation, or compost heat (generated by the microorganisms in the grub bin or compost pile). Heat stimulates the grubs to crawl off, pupate, and hatch, and a great deal of light and heat seem to be required for breeding. Many small-scale grub farmers build their larval colonies from eggs deposited by wild soldier flies.
Captive breeding can also keep pest flies away if done carefully.
Newly emerged soldier flies mate in flight.
Adults typically mated and oviposited at temperatures of 24 °C (75 °F) up to 40 °C (104 °F) or more. 99.6% of oviposition in the field occurred at 27.5–37.5 °C (81.5–99.5 °F).
Quartz-iodine lamps have been successfully used to stimulate mating of adult BSF. In tropical conditions, morning direct sunlight is optimal for emergence, mating and egg laying, with indirect sunlight often preferred pre and post mating.
70% RH for all stages of the life cycle is considered optimal.
Substrate was found to be unnecessary for pupation. however it was postulated that substrate acts as a regulator for humidity which prevents desiccation. a 93% emergence rate was observed when humidity was held at 70%.
Black soldier fly larvae are edible to humans. The larvae are highly efficient in converting proteins, containing up to 42% of protein, much calcium and many amino acids. In 432 hours, 1 gram of black soldier fly eggs turns into 2.4 kilograms of protein.Which means there are more than 45000 eggs in 1g of eggs. They thus can be a source of protein for human consumption.
In 2013, Austrian designer Katharina Unger invented a table-top insect breeding farm called "Farm 432" in which people can produce edible fly larvae at home. It is a multichambered plastic machine that looks like a kitchen appliance. According to Unger: “Farm 432 enables people to turn against the dysfunctional system of current meat production by growing their own protein source." About 500 g of larvae or two meals can be produced in a week by the machine.
The taste of the larvae is said to be very distinctive. Unger: "When you cook them, they smell a bit like cooked potatoes. The consistency is a bit harder on the outside and like soft meat on the inside. The taste is nutty and a bit meaty."
Worm farmers often get larvae in their worm bins. Larvae are best at quickly converting "high-nutrient" waste into animal feed. Redworms are better at converting high-cellulose materials (paper, cardboard, leaves, plant materials except wood) into an excellent soil amendment.
Redworms thrive on the residue produced by the fly larvae, but larvae leachate ("tea") contains enzymes and tends to be too acidic for worms. The activity of larvae can keep temperatures around 37 °C (100 °F), while redworms require cooler temperatures. Most attempts to raise large numbers of larvae with redworms in the same container, at the same time, are unsuccessful. Worms have been able to survive in/under grub bins when the bottom is the ground. Redworms can live in grub bins when a large number of larvae are not present. Worms can be added if the larval population gets low (in the cold season) and worms can be raised in grub bins while awaiting eggs from wild black soldier flies.
Possible natural enemies
In West Africa, Dirhinus giffardii has been found to be a parasitoid of H. illucens pupae and have a negative impact on egg production. It has been found to reduce stocks by up to 72%. The parasite is carried by the wasps and precautions should be taken to protect the larvae from exposure to these wasps.
A generic term for grubs of Hermetia illucens is black soldier fly larvae, abbreviated as "BSFL". BSFL were developed as a feeder insect for exotic pets by D. Craig Sheppard. Dr. Sheppard named the larvae Phoenix Worms and began marketing them as pet food. In 2006, Phoenix Worms became the first feeder insect to be granted a U.S. registered trademark. Other companies also market BSFL under such brand names as "NutriGrubs", "Soldier Grubs", "Reptiworms", "Calciworms", and "BIOgrubs." In Australia BSFL are marketed as live feeder insects under the brand name "Beardie Grubs".
Under the quartz-iodine lamp... mating pairs were observed...approximately 39% less than observed when observing the effects of sunlight