so connect the pi 3.3V to the power of the op-amp and the INPUT1 V-
INPUT1 V+ connected to the balance connector of the battery
OUTPUT connected to buzzer + LED and ground
Where do the resistors go?
Ok, if you just want to power an LED, that can by driven directly from the op-amp (with resistor).
What voltage is your LiPo pack? Is it 2S or 3S configuration?
At what voltage do you want your alarm to go off?
The way the "op-amp as a comparator" works in this case is as follows.
You power the op-amp form a single 5V supply, so that your high rail voltage is 5V and your low rail voltage is 0V (ground).
Connect the 3v3 reference to the non-inverting input (+) of one of the four op-amps on LM324N (through a 10k resistor).
Then you will need to create a voltage divider by using two resistors. Input voltage to the voltage divider is your battery pack voltage, output voltage of the divider will be connected to the inverting (-) input of the op-amp. Resistor values will need to be set up such that when your pack reaches the alarm voltage level, output of the voltage divider will be 3v3.
Then to avoid false alarms due to momentary load changes, you can create a delay, by feeding the output of the comparator to another op-amp of the LM324N through a resistor and capacitor connected to ground. Output of this RC network will go to the non-inverting input and the inverting input will be connected in to the 3v3 supply. Output of this second comparator will be connected to the LED (through a resistor). That's it.
When your battery pack voltage is above the alarm voltage, voltage divider will scale it back but it will be still higher than 3v3, so the inverting input voltage will be higher than non-inverting input voltage and the output of the op-amp will be at low rail voltage.
When your battery pack reaches alarm voltage, voltage divider will scale it back such that it will be 3v3, then since the inverting input will be less than non-inverting input, output of the op-amp swings to the high rail voltage.
That will start to charge capacitor, similar process as described above is happening on the second comparator. Until voltag eof the capacitor reaches above the 3v3 reference, the LED is off, as soon as voltage of the capacitor (and of the non-inverting input of the second comparator) exceeds 3v3, the LED will be on.
If there is a short voltage dip due to a sudden load change, but the duration of the dip is less than the time delay given by the RC network nothing will happen.