Please tell me if it is possible to set the ADC values of the ESP32 as a button by setting the status trigger levels on or off and a kind of trashhold for the response time. This should work fast enough, at the level of the speed of a conventional button, from 50ms.
The fact is that there is an optocoupler output pulled to the ground, and this will help determine the input signal level, and not just on / off.
ADC values of the ESP32 as a button
Moderators: grovkillen, Stuntteam, TD-er
Re: ADC values of the ESP32 as a button
So you want to use an ADC port as a switch input?
A bit like how the Touch plugin is working?
Right now there isn't an option to trigger an event when an ADC value crosses some threshold.
So you could act on it via rules, but I guess that will be quite unusable as you either need to use very frequent loop timers evaluating the ADC value, or it will be quite slow to act on an input change.
I guess it would be a nice feature to have, to set some threshold + hysteresis for ADC pins, but right now we don't have such a plugin or feature in existing plugins.
A bit like how the Touch plugin is working?
Right now there isn't an option to trigger an event when an ADC value crosses some threshold.
So you could act on it via rules, but I guess that will be quite unusable as you either need to use very frequent loop timers evaluating the ADC value, or it will be quite slow to act on an input change.
I guess it would be a nice feature to have, to set some threshold + hysteresis for ADC pins, but right now we don't have such a plugin or feature in existing plugins.
Re: ADC values of the ESP32 as a button
Yes, that's right, like Touch. Too bad it's not available right now.
- Andrew Mamohin
- Normal user
- Posts: 95
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
Re: ADC values of the ESP32 as a button
And if you use a divisor in the formula, wouldn't it make things easier? For example: %value%/10 or %value%/100.
Andy.
Re: ADC values of the ESP32 as a button
Problem is that the ADC input can't be set to give an event when it changes beyond some threshold.
So you need to wait for the minimal interval period (1 sec) of the task to evaluate the task values.
Only way to make something like this without adding code to ESPEasy, is to add some extra hardware.
For example some comparators, so you can trigger a different GPIO pin when the voltage gets above some level.
Maybe you can even use some of those Lithium Ion battery monitoring LEDs to turn on the next GPIO pin at the next analog voltage level.
So you need to wait for the minimal interval period (1 sec) of the task to evaluate the task values.
Only way to make something like this without adding code to ESPEasy, is to add some extra hardware.
For example some comparators, so you can trigger a different GPIO pin when the voltage gets above some level.
Maybe you can even use some of those Lithium Ion battery monitoring LEDs to turn on the next GPIO pin at the next analog voltage level.
Re: ADC values of the ESP32 as a button
I return to the task again. In addition to the proposed options, it is possible to add another tricky option with a comparator and ESP32 DAC. Through the DAC, we set the level of the reference voltage to the comparator and so we adjust the response threshold, right?
However, how will the ESP behave if there are problems with MQTT server connection at the time of active pressing? - for example, the web interface at such moments is very slow.
However, how will the ESP behave if there are problems with MQTT server connection at the time of active pressing? - for example, the web interface at such moments is very slow.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 28 guests