Hi everybody!
There is a keyboard in which the buttons are connected to one pin, but through different resistors (screen in attachment). To determine the pressing of each of the buttons, it is supposed to use the ADC. Is there a way to to implement this in ESPHome code?
Sure, connect it to an ADC pin, then create three template binary sensors for the expected voltages for each button (use a voltage range to be safe).
You can calculate the expected voltages using this caluclator:
1 Like
Ok, thank you for quick reply. But what is the minimum update_interval is possible for ADC sensor? Button clicks should be monitored in real time…
About 27,000 samples per second max. Or as short as a 37us pulse detection.
I would not recommend running the ADC at that update rate. 5 to 10ms should be plenty for a human interface.
Perfect, thanks!
I have a request if someone will throw in a code so that I do not break down the open door