ADC Plugin multiplex and power saving - feature request

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Waldmensch
Normal user
Posts: 11
Joined: 28 Nov 2016, 17:12

ADC Plugin multiplex and power saving - feature request

#1 Post by Waldmensch » 20 Dec 2016, 17:15

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

Waldmensch
Normal user
Posts: 11
Joined: 28 Nov 2016, 17:12

Re: ADC Plugin multiplex and power saving - feature request

#2 Post by Waldmensch » 29 Dec 2016, 22:22

I have done it by myselve. If someone is interested in patching - here is the source

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
multiplex.JPG (61.61 KiB) Viewed 2416 times

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 55 guests