This perhaps is a dumb question and I assume I can but just to be sure. Can I attach a crystal oscillator to my arduino pin and then to the infrared led instead of using registers? Yes or No?

  • 3
    To achieve what, exactly? – ocrdu Nov 3 '20 at 19:02
  • 2
    it is not a dumb question ... it is a very unclear question .... please draw a schematic diagram of what you are asking ... what do you mean frequency of infrared ... do you mean the frequency (wavelength) of the light itself? ... do you mean the frequency of the data that is being transmitted? – jsotola Nov 3 '20 at 19:06
  • 1
    @PeterPaulKiefer The only reason I thought it might work is because basic rf modules uses crystals for their frequency of 433mhz and 315mhz when I looked at the crystals. So I thought perhaps I can use a crystal to just set the infrared transmission frequency to 38khz. – Macaroni Nov 3 '20 at 19:11
  • 1
    @PeterPaulKiefer so if I built a rf module of my own it wouldn't work with a different oscillator?. Theres nothing looking special about the module so Idk what you mean pls explain. im noob – Macaroni Nov 3 '20 at 19:21
  • 1
    If that beat oscilator is setup to 38 kHz you can use a standard IR Receiver module for that frequency. Or if you have access to one with another frequency, you should use that. I don't advice you to use higher Frequencies as the IR LEDs are lazy and can not handle at that speed ;-). Then they are dimmed. And Receiver Diodes or Transistors are even more lazy. – Peter Paul Kiefer Nov 3 '20 at 19:34

Still not clear on exactly what you are trying to do. If you drive the IR LED directly with a crystal oscillator (38 kHz or anything else) there's no data there, just a steady carrier. So maybe you are trying to modulate that carrier with the Arduino? It sounds like your plan is to use an output pin to power the crystal oscillator, and modulate by essentially turning the power off and on. This is probably not such a good idea. Even if the Arduino pin could handle the current (doubtful), the crystal oscillator might not take kindly to this approach... it's meant to go on and stay on.

So you need some sort of switching circuit. Depending on what you have on hand, you could connect the Arduino (modulator) output through a resistor to the base of an NPN transistor. The emitter of the transistor goes to the high side of the LED and the collector goes through the LED's dropping resistor to the +5 rail. If this is a low-power LED then you may be able to use the +5 from the Arduino itself, and a small-signal transistor. If you have a powerful LED, you'll not only need a separate supply, but a power transistor as well... and maybe wired with a small signal driver in a Darlington configuration if the power transistor needs more base current than the Arduino can give. Lots of other switching options, but we need to know more details! Boggyman

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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