Hi All,
I've seen in the web where somebody has used the ADC pin with more then one analog sensors. He has used 2 digital pins as power source for the sensor and read the ADC while the pin is set to high. Then he set the second pin to high and take the second measure from ADC.
Is it possible to extend the ADC plugin with managing this multiplexing? Digital pins could be configured in webinterface.
So each delay could be as follow
- D4 -> High
- Value1 = read ADC
- D4 -> Low
- D5 -> High
- Value2 = read ADC
- D5 -> Low
This also would save a lot of energy because the sensor (e.g. Photoresistor) is powered only for a very short time instead permanantly
ADC Plugin multiplex and power saving - feature request
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 11
- Joined: 28 Nov 2016, 17:12
-
- Normal user
- Posts: 11
- Joined: 28 Nov 2016, 17:12
Re: ADC Plugin multiplex and power saving - feature request
I have done it by myselve. If someone is interested in patching - here is the source
https://github.com/Tommy-LSA/ESPEasy/co ... af703f6f4b
https://github.com/Tommy-LSA/ESPEasy/co ... af703f6f4b
If none of the 2 GPIO pins is set it works as usual and the value get
written in "Analog1". If one or both GPIO pins are set the pin is set to
HIGH while reading A0. This way 2 analog sensors are possible. The
positive source for the sensor is 1st GPIO for Analog1 and 2nd GPIO for
Analog2. It's also possible to set only one of the both GPIO. In this
case it works like a powersave because the sensor only get voltage for
the short moment of measure.
- Attachments
-
- multiplex.JPG (61.61 KiB) Viewed 2681 times
Who is online
Users browsing this forum: No registered users and 13 guests