I have a sensor that outputs a signal between 0-5V and i set a simple window comparator with open drain output (TLV3402) connected to a micro-controller so i can detect when sensor is below a threshold. The system is powered from 2 li-ion batteries (7,4V) and i use a step-down to feed 5V to the circuit. This setup is working fine, and i chose components to have the lowest consumption.

Due to some restrictions i had to remove one battery so i just have 3,7V to power the system. I had to replace my step-down for a low power step-up (MAX1724), and now my circuit is triggering more than expected. It seems the culprit is noise introduced by step-up, and since i'm going to make a new PCB, i'm seeking some advice on how to reduce noise from the step-up. I already have decoupling caps 0,1uF + 1uF and i'm using the design from the step-up datasheet.

  1. i read something about a LC filter on the step-up output, or ferrite beads, but don't know how to calculate values. Output current will be less than 1mA and the signal will vary slowly

  2. add hysteresis to my comparator, adding a resistor RH between IN- and out, but i read something about being 100 times bigger that R1. I choose R1=1M to reduce consumption when comparator is ON, so if i set R1=10K could i use RH=1M?

  3. other ideas will be appreciated.

Bellow is my circuit and the zoomed output of the comparator were is visible the effect of noise in the LOW-HIGH transition

comparator circuit

noisy Output

  • \$\begingroup\$ Use the sensor at 3V to 4V if poss. What is it? Show link. \$\endgroup\$ Jun 9, 2021 at 15:25
  • \$\begingroup\$ Unfortunately is not that simple, single li-ion vary between 2,5V (discharged) and 4,2V (fully charged) \$\endgroup\$
    – Geologic
    Jun 9, 2021 at 22:39
  • \$\begingroup\$ 2.5Vwill reduce life much faster than 3V. Many sensors work over this range. Add an RC filter for Vcc and a snubber for signal with twisted pairs. Then add hysteresis. \$\endgroup\$ Jun 9, 2021 at 23:15

1 Answer 1


The correct solution for this isn't to filter out the noise, because you'll never be able to filter the noise enough.

The correct solution is to use a Schmitt trigger instead of a plain comparator. A Schmitt trigger has hysteresis, that is, the voltage required to turn it on is not the same as the voltage required to turn it off. With a Schmitt trigger in the circuit, the noise would have to be higher than Von-Voff in magnitude in order to cause spurious triggering like this, and if you set Von and Voff so that they're sufficiently far apart, you don't have to worry about it at all.

An easy way to implement a Schmitt trigger is to add positive feedback to a comparator. Here, that would be a resistor from the output to the noninverting input, along with an additional resistor between the noninverting input and the comparator's input signal. Since you appear to be using a comparator with open-drain output, that output pullup resistor needs to be smaller for this method, as you note. The feedback resistor must be to the noninverting (+) input, however, not the inverting (-) input as you talk about in your question--negative feedback like that creates an amplifier, not a comparator.

Alternatively, dedicated Schmitt trigger ICs are readily available, with most logic families having a Schmitt trigger (often inverting) as part of their lineup. These logic ones are generally not meant for use as comparators, and just have a fixed voltage at which they switch output state. Otherwise, I would recommend using a bipolar-output comparator to avoid the need for that pullup resistor.

You can also use the ever-popular NE555 as a Schmitt trigger with no additional components required, with Von at 2/3 Vcc and Voff at 1/3 Vcc, but since you mention being concerned about supply current, that's not a great idea; the 555 is very power-hungry.

Another thought that just came to me: the waveform out of your comparator looks quite similar to switch bounce, so if you filter the comparator's output with a standard switch debouncing circuit, that should also work. I don't have the time to go into any detail on this option right now, though.

  • \$\begingroup\$ I found TLV7042 with 7mV built in hysteresis. In datasheet it shows how to add more, the example it is not for open drain, but i think i can adapt it to my needs. Thanks @Heart, you point me in the right direction. \$\endgroup\$
    – Geologic
    Jun 9, 2021 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.