I want to have automatic control for my pump, wirelessly.

A transmitter unit fitted in the water tank would sense the water level and transmit the data to a receiver unit attached to the pump starter to turn it off/on.

Also an override unit would allow me to turn the pump on/off according to my will and will also display the water level.

How do I write the code for the wireless transmission part ?

put on hold as too broad by gre_gor, VE7JRO, sempaiscuba, per1234, Juraj 2 days ago

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    this question has been asked almost exactly same way before .... is this a school assignment? – jsotola Nov 29 at 8:05
  • which of the transmitters are you asking about? – jsotola Nov 29 at 8:08
  • Since it was closed I decided to post a new one with more specific on point questions as directed. – PratyayRakshit Nov 29 at 9:09
  • I want to know about how to code the wireless transmission-receiving part of the system. For the sensor an ultrasonic sensor can be used to output the water levels. so, the code goes like this : if(waterlevel <= minimum ) turn pump on; if(waterlevel = maximum) turn pump off; I now want to know how to send the instruction from the transmitter module (that will be attached with the tank) to the receiver module (that will be attached to the pump switch) wirelessly over my home network. – PratyayRakshit Nov 29 at 9:12

First of all I would recommend to play around with Web Server example to understand how the server hosting works. Also, the ip adders is assigned randomly to the ESP so you definitely need to write a rule in your WiFi router in order to assign a static ip to the ESP. But you can try to use mDNS to assign a name to your esp. For example http://pump.local/path. You can find some instructions here. If you are looking for simplicity you can use Blynk. It is a fully automated and free service that allows you to control you ESP from anywhere where there is a internet connection. And it also can display different variables such as the water level in your case.

Not the answer you're looking for? Browse other questions tagged or ask your own question.