I have 2 op-amps in series, one is configured as an inverting AC amplifier and one as a voltage comparator.
The purpose of this circuit is to detect a 4mV AC signal and trigger a transistor at the other end to switch a logic level on/off at an mcu pin. 4mV is the trigger threshold (in theory).
The amplifier is run from a single 5V supply, and this side of the circuit works fine and I am seeing a DC bias of 2.5V with a 4mV*(200/10 + 1) AC component at point B.
The second op-amp is being used as a comparator, and this is where I'm having trouble. I'm not 100% on using a single supply design for this. I've set my reference voltage on the positive input of U1A using a pot. divider, to give the DC reference voltage 2.672 V. The comparator is then being triggered by the AC signal seen at B, but is only switching between 3.4V and 1.6V (at point C) rather than the rails, which ideally will then be used in turn to switch a transistor.
I think this is where I'm tripping up, but I'm not sure why. Any help greatly appreciated!
RAIL net = 5V SPLIT net = 2.5V