I have had great success with Tasmota firmware on a dozen Sonoff basic devices and a couple of TH16s.
I'm looking to go deeper and if possible create code for a chlorine level capacitive level detector.
Using a concept I have used in the past, with a 32 bit 8 core microcontroller, of applying a voltage momentarily to a capacitor to an output Pin, while simultaneously starting a counter, switching that pin from output to input, then when the voltage on that same pin falls to 1/2 VCC the counter stops and that count value is compared. The 1/2 VCC threshold was simply when the state of the now input pin transitioned from on to off.
I'd like to do a similar thing using the ESP 8266 with a couple of large plates on the outside of a plastic chlorine tank and determine the approximate level based on how long it takes to charge this crude capacitor which should vary via tank level.
I'm not looking for super high accuracy like +/- .1" but something +/- .5" would be sufficient.
While I am quite adept at programming in Assembly, my C skills are standard & basic in python.
I'd like to make this part of my Node Red Home Automation system running on a Raspberry Pi so as to monitor the tank's chlorine level via my cell phone.
Anyone use the ESP8266 for this or similar purpose? Ideally I'd like to use a Sonoff Basic as it has the power supply and is self contained. I'd obviously have to add some external leads to the tank's capacitor plates.