Hi, iam newbie to arduino programming and i want to learn arduino programming from roots, so i have started learning programming without libraries. can anyone help me , how to interface IR transmitter and Receiver with arduino without using libraries.
thank you.,
can anyone help me , how to interface IR transmitter and Receiver with arduino without using libraries.
Start by looking at the data sheets for the hardware then maybe the code in the libraries to see how they work
Welcome to your new hobby! ![]()
Transmitting: First you need to generate the carrier frequency, typically 36-40kHz. This cannot be generated by "any PWN-capable pin", but must be generated in conjuction with a timer, typically bound to one pin only (pin 3 on Uno/Nano). I strongly suggest that you "steal" this from an existing library; the best one is of course mine Infrared4Arduino (
), available in the library manager as "Infrared". Then you just need to turn the carrier on and off according to the signal you want to send.
Receiving: Get a sane demodulating receiver (for example TSOP 32438) and find out how it works. It delivers the decoded signal on its output pin; you just need to record the durations when it is on and off. In general, this is done by sampling the pin every 50 micro seconds.
Simple -- at least in principle. Let us know if you need more help.
I'd suggest you start from basics. You need to
1: turn the "transmitter" LED on & off
2: detect the signal from it with the receiver
so first step - https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay
use an LED you can see as you wont see the transmitter working.
next step - Photodiode - The Arduino Workshop explains how to use the arduino to sense light with a photodiode (your "receiver")
Can you post a link to the particular IR transmitter and receiver you are using please?
use an LED you can see as you wont see the transmitter working.
You can usually see an IR LED using a digital camera
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.