Water level controler
Moderators: grovkillen, Stuntteam, TD-er
Water level controler
I have a kind of tube and the floating part of it is connected to a kind of resistor. The resistor level is from 0-190 ohm. I tried to connect it to the AQ on my esp8266 (like an LDR) but no result. Also tried the lever regulator device but also nothing in the log. I use the latest firmware. I want to read the change in resistance to use it in a script.
Re: Water level controler
How is this connected to the ESP?
Typically you need an extra resistor so you can create a voltage divider.
Something like this:
3V3 --- Resistor --- AnalogPin --- VariableResistor --- GND
The "Resistor" is there to pull the AnalogPin up and the VariableResistor will try to pull the pin down to GND.
The "Resistor" is also needed to limit the current to some safe level.
Worst-case, when the variable resistor is 0 Ohm, this fixed resistor will determine the current through the variable resistor.
I would opt for an 1k resistor. This way the max. current will be 3.3 mA.
As input, you can use the ADC plugin.: https://espeasy.readthedocs.io/en/lates ... #p002-page
Typically you need an extra resistor so you can create a voltage divider.
Something like this:
3V3 --- Resistor --- AnalogPin --- VariableResistor --- GND
The "Resistor" is there to pull the AnalogPin up and the VariableResistor will try to pull the pin down to GND.
The "Resistor" is also needed to limit the current to some safe level.
Worst-case, when the variable resistor is 0 Ohm, this fixed resistor will determine the current through the variable resistor.
I would opt for an 1k resistor. This way the max. current will be 3.3 mA.
As input, you can use the ADC plugin.: https://espeasy.readthedocs.io/en/lates ... #p002-page
Re: Water level controler
I used the esp8266 for this test and connected one of the wires of the resistance vlotter to 3.3, the other wire of the vlotter to AO and from there a 10k resistor to gnd. Also selected the Anolog input internal device from the dropdown. But nothing in the log. Is a 10k a good option or another one ?
Re: Water level controler
10k is too much.
Also I would connect the variable resistor between the analog input and GND as not all ESP boards can measure upto 3V3.
What you want is to use as much from the range of 0 ... 3V3 as possible with your 0...190 Ohm variable resistor.
If you only use a small part of this range, it is hard to measure small changes in resistance.
Also you need some current limiting resistor.
I would start with 470 Ohm or 1k.
3V3 --- 470 Ohm --- A0 --- VariableResistor --- GND
This way you will have an analog voltage of 0 ... 0.95V on the analog input
Also I would connect the variable resistor between the analog input and GND as not all ESP boards can measure upto 3V3.
What you want is to use as much from the range of 0 ... 3V3 as possible with your 0...190 Ohm variable resistor.
If you only use a small part of this range, it is hard to measure small changes in resistance.
Also you need some current limiting resistor.
I would start with 470 Ohm or 1k.
3V3 --- 470 Ohm --- A0 --- VariableResistor --- GND
This way you will have an analog voltage of 0 ... 0.95V on the analog input
Re: Water level controler
This solution "3V3 --- 470 Ohm --- A0 --- VariableResistor --- GND "worked perfectly. 470 ohm was the correct one. Did not have to test other values 

Who is online
Users browsing this forum: No registered users and 14 guests