Swallowable electronic capsules can provide gas profiles of the gut and distinguish changes in a person’s diet.