Connect with us

Pulsing an ir led using arduino

Discussion in 'Microcontrollers, Programming and IoT' started by cyberteen, Sep 21, 2012.

  1. cyberteen

    cyberteen

    48
    1
    Dec 4, 2011
    Hi guys,
    I have an ordinary ir emitter and an receiver(just the LEDs with two pins). I managed it to send its signal to a pin on the arduino and am now able to control things like a led glowing when path obstructed. But I have no idea at what freq. the ir is transmitting. But I want a method to control the ir led to produce at an certain kHz. How do I do it using arduino?

    Thanks for the help, in advance
     
  2. MrEE

    MrEE

    84
    0
    Apr 13, 2012
    you can set up a PWM. See the datasheets on how to do that.
     
  3. cyberteen

    cyberteen

    48
    1
    Dec 4, 2011
    I basically don't have any data sheets, part nos and other details because i got it from an local electronic spares who just gave the parts alone. I read in several places in Internet, that they Pwm the transmitter at say 38 kHz. They don't clearly specify how to Pwm it at that freq.
     
  4. CocaCola

    CocaCola

    3,635
    4
    Apr 7, 2012
    Google Arduino IRremote library
     
  5. MrEE

    MrEE

    84
    0
    Apr 13, 2012
    You need to be familiar with the AVR microcontrollers and have some basic programming skills at least in AVR assembly. I haven't used the Arduino myself because I design my own boards. I use the latest AVR studio and a common AVR programmer. Also you need to have some basic knowledge of electronics even though you are using a ready board such as the Arduino.
    A datasheet for the device you are using is a must if you need to accomplish anything useful. There is a lot of homework you can and should do to start programming AVRs or other controllers. Start by visiting the ATMEL's and the AVRFREAK's websites. Also follow the links given earlier in this thread.
     
  6. CocaCola

    CocaCola

    3,635
    4
    Apr 7, 2012
    There is zero need for assembly to do this... I suggested Googling the Arduino libraries that make this dead simple, not that it's all that hard anyway with most high level compilers to start with...

    In this case since he/she has already got the IR LED and IR receiver working there is little need for the datasheet, more so just an understanding of how IR remotes themselves work and how to put out the IR signal and read in the received signal based on that protocol...

    I'm guessing the IR LED is well just an LED, run it at generic safe levels and you will be fine, the IR receiver just takes the pulses of light and passes them out as digital signal, and since he/she has this working they know what pin is sending out the signal... Almost all these IR sets work identical, a quick Google search will almost certainly reveal plenty of 'generic' information the will work fine...

    I'm not downplaying datasheets, it's always best to have them handy, but they are not necessarily needed in many cases... With a basic understanding of the components and some tinkering you can get by just fine for simple applications like this...
     
    Last edited: Sep 21, 2012
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-