What is the operating current of a float switch?

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
Hello, I'm a complete beginner to electronics projects and have a question about using a float level sensor / float switch to a nodemcu. I have attched the circuit.

I am unable to find the current that is drawn by the float level sensor?
I can find terms such as "switching current" but that is not the current drawn right?

This is the sensor I wish to use:
https://nl.aliexpress.com/item/32949744036.html?spm=a2g0z.search0104.3.12.75c872ddnHu5wG&ws_ab_test=searchweb0_0,searchweb201602_4_10065_10068_5729915_319_317_10696_10924_10084_453_454_10083_10618_10920_10921_10304_10307_10922_10820_10301_10821_5730815_537_536_10843_10059_10884_10887_100031_321_322_10103,searchweb201603_51,ppcSwitch_0&algo_pvid=92c20693-4ce7-41d2-b8af-36942b6a0685&algo_expid=92c20693-4ce7-41d2-b8af-36942b6a0685-1
 

Attachments

Last edited:

sghioto

Joined Dec 31, 2017
2,363
The sensor will handle up to .5 amp maximum.
The sensor doesn't draw any current. The current through it depends on what you are using it for.
So what are you connecting this sensor to?
EDIT: Should be fine with that setup above.
 

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
I am connecting this sensor to an esp8266 which should run a 5V water pump via a 5V relay to water a plant.

The bigger picture: I am creating a plant auto-watering system. The soil moisture sensor senses soil moisture levels in a plant. If it is below a threshold, the pump should water the plant.
 

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
Ah okay, thank you! Can you comment on if my circuit diagram is wired correctly specially using the float switch being powered at 3.3V?
 

djsfantasi

Joined Apr 11, 2010
7,693
The moisture sensor has its terminal labels covered by the wires you’ve drawn. Try redrawing the wires or labeling the sensor connections.

One end of the water sensor should connect to either Vcc or Gnd. The other should connect to a analog digital pin on the ESP8266. You may need a PULL-UP or PULL DOWN resistor as well.

The motor should have one side connected to 5V Gnd. Observe pump polarity. The other side should connect to the relay NO connection* and the relay common should be connected to +5V.

* you could use the NC connection and code for that case. But that probably waste power and overheat the relay.

EDIT: should have specified analog input pin[/S]
 
Last edited:

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
I don't think the pump is wired to the relay correctly.

The NO or NC contacts should be used to switch a power source...which I don't see.
You have a 5 volt relay but only a 3.3 volt supply. You will need a separate 5 volt supply for the pump and relay as I see it.
The pump is not wired correctly. See attachment.
View attachment 229677
The moisture sensor has its terminal labels covered by the wires you’ve drawn. Try redrawing the wires or labeling the sensor connections.

One end of the water sensor should connect to either Vcc or Gnd. The other should connect to a digital pin on the ESP8266. You may need a PULL-UP or PULL DOWN resistor as well.

The motor should have one side connected to 5V Gnd. Observe pump polarity. The other side should connect to the relay NO connection* and the relay common should be connected to +5V.

* you could use the NC connection and code for that case. But that probably waste power and overheat the relay.
I believe the output of the soil sensor should connect to an analog input as the voltage output depends on the moisture level of the soil.
Firstly, thank you all so much for your help and feedback, appreciate it :)
I have re-wired this. Does this seem correct?
 

Attachments

Reloadron

Joined Jan 15, 2015
5,934
Looking at your drawing when the switch you label float switch is open you have a floating digital input to your MCU. Unless the MCU allows or has an internal pullup it won't work. When your float switch is closed the digital in pin will be low but again as I see it when that float switch is open the digital in pin is just floating. If the MCU allows or has internal pullup your code should reflect it. I have not looked beyond that.

Ron
 

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
Hi, just another question on the schematic you've drawn. I am powering the ESP8266 directly via the 3.3V pin using a LiFePo4 battery. I am using the 5V battery to power the relay and pump only. Does this schematic still hold true for this case?
 

Thread Starter

ArushiMadan

Joined Feb 6, 2021
9
Hello all,

I am trying to add a push button to the nodeMCU which allows the user to stop the water pump from pumping water.
Bigger picture: the NodeMCU Esp8266 is powered using a LiFePo4 battery using the 3.3 pin directly. There is a 5V battery for the 5V relay module and pump.

When connecting the button, how do I engage the button the relay module hence the pump?

Thank you for your help in advance!
 

Attachments

sghioto

Joined Dec 31, 2017
2,363
I would connect the switch to one of the unused digital inputs and ground and program it when pushed to make the control line going to the relay LOW regardless of what the other inputs are doing until the switch is pushed a second time. Basically putting the system in standby. I would also have a LED come on to indicate the system is in standby.
 
Top