Hi !
i have two sensors. A moisture and a photoresistor. I'd like to use both together with a wemos d1 mini, which only has one analog input.
I already wired the vcc to several gpio's and defined a switch to power on/off the sensors. Both Analog output goes to A0 on the wemos.
Now i can switch between the senors, so that only one sensor has power.
Unfortunately the measurements for both senors are not correct. When i connect only one sensor to A0, everything works fine and the measurements are correct.
What do i wrong! Is there any trick?
Thanks a lot!
Regards.
C
reading multiple analog sensors
Moderators: grovkillen, Stuntteam, TD-er
Re: reading multiple analog sensors
Hello,
as both sensors are permanently connected to the analog input they influence each other. Sorry, that won't work.
There are several ways out.
First you could replace the photo resistor with a luminosity sensor like TSL2561 or BH1750.
Second you could use a relay to switch the analog input itself instead of powering the sensors via GPIO.
Third you may use an external analog-to-digital converter (ADC) like the ADS1115.
Regards
Shardan
as both sensors are permanently connected to the analog input they influence each other. Sorry, that won't work.
There are several ways out.
First you could replace the photo resistor with a luminosity sensor like TSL2561 or BH1750.
Second you could use a relay to switch the analog input itself instead of powering the sensors via GPIO.
Third you may use an external analog-to-digital converter (ADC) like the ADS1115.
Regards
Shardan
Regards
Shardan
Shardan
Re: reading multiple analog sensors
3rd solution is the easiest and safer IMHO!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Who is online
Users browsing this forum: No registered users and 20 guests