IR Obstacle Detector interface to Atmega32

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I have a NSK OBSTACLE DETECTER ver2.0 - PWM Based , there is not much information, but i had a talk with the guy who designed the module (He has a store near my place) and he told me that this module work by modulating the IR LED at some KHz and when IR detector reads it back to on-board PIC controller it software band pass filter to identify the same modulating frequency, if it finds the same modulated freq it will turn the output HIGH. Simple.

But my problem is when a object is nearing the sensor just near the threshold it starts to flicker my output line (i see that in a scope).

so when I connect it to External interrupt on my ATMega32 it gets triggered multiple times.

How can I avoid those multiple interrupt triggers?

I actually do not want to connect it to external interrupts, if you can suggest how can I program it if I connect it to a GPIO, it would be great.

Thanks a Ton.
K

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rather than use an interrupt, just read the port pin at a regular interval, say, 10 times per second. I wrote a tutorial on multitasking that should address your problem.