Electronic – Adding Low Pass Filter to Open Collector Hall Sensor

filterhall-effectlow passopen-collectorpassive-filter

I'm using a gear tooth sensor to create pulses when a metal object passes the sensor. There's a lot of noise on the signal so I decided a simple low pass filter would suffice(f-cutoff = appx.400hz).

The sensor is an open collector type, so the mcu pin is using the internal pull-up to keep it at 3.3v. And falling edges are triggering my mcu timer.

The sensor is connected to the resistor and the other side of the resistor is connected to the mcu pin and the cap. The cap then goes to ground. Like this:

schematic

simulate this circuit – Schematic created using CircuitLab

low pass filter

Here is a screenshot from my scope while it's making false counts:
False Counts

Updated circuit at bottom:
When the LP filter is connected to the input of the Shmitt Trigger Opto-islator(H11L1M) The output does not seem to work. Without the LP filter, it output side works. I've tested these with LEDs. When the hall sensor is triggered, both LEDs should go off. The output LED never comes on to begin with. Is the LP filter affecting the current through the IC?

Best Answer

You have a bundle of problems with your third circuit.

  • There is a +5 V supply permanently powering the opto-isolator. No matter what happens the Hall sensor the opto will never turn off.
  • You have quite a high resistance in the circuit to the opto-isolator LED. It may not be turning on.
  • You have the MCU input connected between the LED and it's current limiting resistor instead of to the Schmitt-trigger output directly. If everything else was working the MCU input could only switch between 1.8 V and 3.3 V.

Let's start again with the bare minimum.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Modified circuit.

  • Wire up the opto, R7 and LED1 to the Hall sensor as shown.
  • Test it. Make sure that the LED blinks as the screw-heads pass the sensor. (You don't explain where the magnetic field is coming from in your setup. The Hall sensor needs to detect a change in magnetic field strength. It won't "just detect metal". This may be another problem.)
  • Next connect up the output as shown. You should see LED2 blink as you test.
  • If all is well hook up to the MCU.
Related Topic