Beginner problems...

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

I'm trying to make an ir beam barrier using ir receiver module. The thing is that I cannot get the code working so that it lights up a led if there is atleast one pulse in 20 ms and a another led if not.

I'm using timer 1 for the 38 kHz pulse generation for the IR-led and the timer is on for 5 ms and off for 15 ms, as the datasheet of the receiver module specifies the acceptable burst (atleast 15 ms gap every 90 ms). No problems there, it works even 5 meters away with a red led connected to the receiver.

But when the receiver module is connected to INT0 and int0 isr just counts up, nothing happens.

I tried just setting a wire from pc.5 to int0 and pulsing the pc.5 5 ms on and 15 off and got nothing.

For the coding I'm using Codevision AVR. What am I doing wrong ? And how do I fix it ?

Simply, I want to light up a led if there is enough pulses in specified time and another led on if there isn't.

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

Hi,

Can you post your code?

Regards,
Steve

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

Is the output from the detector open collector?
And if so have you included a pullup in your build.

Keep it simple it will not bite as hard

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

IR reciver

Attachment(s): 

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

IR barier

Attachment(s): 

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

Thanks for the help. Got it working.. too simple error :oops:. I wrote the same led zero both ways :D