I would like to build circuit that can detect current flow and provide suitable digital high signal to GPIO pin for 3.3V ESP-01 logic.
I started looking at the designs available on internet. Option that drawn my attention is based on current transformer / Hall's effect combined with OP amp (or comparator). Current from the main line is represented with the proportional voltage drop which is used as input for an OP amp. As I understand OP amp (with negative feedback) suppose to give amplified signal representation prepared for further processing or in case of comparator (positive feedback) digital representation could be provided. But neither of those options can serve exactly my needs. When OP amp is used as amplifier (negative feedback) I get amplified voltage representation for current flow. Second option, using converter (positive feedback) gives saturated voltages, and thus it can give digital representation, but in that case, depending on the way comparator is configured you can get digital high during first half of sinusoidal signal and 0 during second half or vice versa. In booth cases it is not what I need.
In short, I don't know how to use circuitry to process signal after OP amp/comparator and get suitable 3.3V logic HIGH state on GPIO when current flow is present.