For complete details go to: 6. Zero Municipal Water Toilet   https://sites.google.com/site/nodemcu12e/#zero

Complete Code is here: https://sites.google.com/site/zerowatercode/