First, you need to use a standard artificial diet consisting mainly of wheatgerm, casein, vitamins and mineral salts in an agar gel to rear the larvae of these species of lepidoptera. Other larva can be reared on specific leaf diet depending on wich species. 5 grams of fresh faecal pellets, and midgut contents dissolved in 50 ml of distilled water can be used to measure the pH with a standard pH probe electrod. For more information please see this paper: