Okay lemme explain the entire scenario, as I mentioned earlier I need to automate a water pumping mechanism using esp8266.the board along with ultrasonic sensor is kept on top of the overhead tank.The board is powered using a 3.7v cell.Coming to the relay part...I need to connect 3 wires .. gnd,vcc and trigger from esp8266 to the relay which is near the pump 30m away from esp8266.vcc,gnd are connected to corresponding pins of the relay module.The trigger is fed to the base of 2N222 and gnd to the emitter.The input pin of the relay is connected to the collector terminal.
This is my setup, except for that 30m cable for connection... everything works perfectly for my cause.Only concerned about the cable and its cost.sorry for the inadequate informations provided earlier.