Embedded Programming Tutorials for Beginners with Step By Step Guide.

Thursday, December 17, 2015

IR (Infrared) Communication Between Two Microcontrollers -Step By Step Tutorial : Part-1

PART 1 : Basic Introduction

PART 2 : Interrupt 

PART 3 : Timer

PART 4 : Calculation

PART 5 : LED Switching Project [END

 

Introduction and Some Basic Descriptions :

IR (Infrared) Communication Between Two Microcontroller -Step By Step Tutorial : Part-1
IR (Infrared) Communication Between Two Microcontroller -Step By Step Tutorial : Part-1

IR means Infrared light . Generally Infrared light is invisible to us .We can find this in our TV remote controlling system. It's very popular and widely used in wireless technology and it's really cheap to buy . You can find more details in Google . In this tutorial I will try my best to make you understand . I will try to skip complexity .

When we press any key of our TV remote , IR light signal comes out . You can't see through your eyes but you can see that if you look through the mobile camera screen. During creating signal the IR-Led turns ON and OFF randomly . 

We will also try this for communication between two pic microcontrollers . When IR-LED remains ON, it transmits 36KHz IR signal continuously. When IR-LED remains OFF there is no signal.



Now take a look on IR-Led (Transmitter) and IR Receiver 

Picture of Transmitter Module:

IR (Infrared) Remote Control Communication Between Two Microcontroller -Step By Step Tutorial : Part-1
Infrared LED (Transmitter Modude)

Picture of TSOP38236(36 KHz) Receiver Module:

IR (Infrared) Remote Control Communication Between Two Microcontroller -Step By Step Tutorial : Part-1
TSOP38236 Receiver Module

 What happens in IR communication ? We transmit a signal in a systematic procedure through Transmitter Unit and Receiver Unit receives that signal .


What happens in IR communication ? We transmit a signal in a systematic procedure through Transmitter Unit and Receiver Unit receives that signal .

Transmitter Unit's Working   

IR (Infrared) Remote Control Communication Between Two Microcontroller -Step By Step Tutorial : Part-1
IR (Infrared) Remote Control Communication Between Two Microcontroller

This picture edited from a picture of https://learn.sparkfun.com



The transmitting signal is a combination of pulses . Consider we would like to send 4 bit data(1011) through transmitter then we might set unique identification for each bit . 

For example,
we can use (562 us ON & 16875 us OFF ) for Logical 1
          and (562 us ON & 562 us OFF ) for Logical 0

By measuring the time duration of each pulse, we can identif each bit in receiver unit.


If we want to get the receiver to receive the signal, then we have to follow the systematic procedure. 
That means , if we want to send 1011, first we need to send a start signal. After sending all data we need to send an ending signal. Actually we need to send start signal to get MCU ready to fetch data accurately.



   [ start_signal + 1101(reverse)+1011(main)+ ending_signal ]  Total Signal                    
 
Now the question is how much time should be selected . We will use NEC Protocol's data type.You can use your own . Generally most of devices are using NEC Protocol. In NEC Protocol data contains 






[ start signal + 8bit Address+ Reverse 8bit Address+ 8 bit Command + Reverse 8bitCommand ]
Start Signal : 9 ms ON and 4.5 ms OFF 
(You can use as your wish but should be grater than bit's pulse)

Logical 1: 562 us ON and 16875 us OFF
Logical 0: 562 us ON and 562 us OFF


In this tutorial, we will use 4 bit data signal and we will use only data type .Our signal will be like this .


  Start + (reverse 4 bit command 4 bit command Combination total 8bit) + End



Receiver Unit's Working

I took this from http://learn.sparkfun.com
When IR-Led turns OFF or no signal comes to IR-Receiver, IR-Receiver provides 5v or high output to microcontroller's external interrupt pin .When IR-Transmitter turns ON, IR-Receiver provides 0v or low.
IR (Infrared) Remote Control Communication Between Two Microcontroller -Step By Step Tutorial : Part-1
IR (Infrared) Remote Control Communication Between Two Microcontroller

Transmitter unit sends Start Signal 9 ms ON and 4.5 ms OFF consequently IR-Receiver provides 9 ms OFF(0v) and 4.5 ms ON(5v)
After finishing this stage when first bit is sent, transmitter sends out pulse  562us ON and 562us OFF and consequently IR-Receiver provides 562us ON(5v) and 562us OFF(0v) . That will make external interrupts on microcontroller and timer0 will start to count duration of time so that each bit can be uniquely identified .In this way all bit's comes to the receiver unit . Finally we need to get our microcontroller understand about ending of signal and we send last signal pulse .

So First we need Interrupt to ditect signal .
Secondly , we need timer to measure time duration of signal so that we can identify each bit from signal (0 or 1). We also need PWM (Pulse width Modulation).

69 comments:

  1. Thank You for the given Information|||Here You can get latest Govt Job Updates
    Govt Jobs 2016

    ReplyDelete

  2. If I change the frequency to 38kHz (changing the receiver and the transmitter to 38kHz as well) how would the new communication

    ReplyDelete
    Replies
    1. Then you just need to create 38kHz freqyuency using PWM on transmitter section. Receiver will respond to 38kHz if it's based on it.That's it.

      Delete
  3. I love the way you write and share your niche! Very interesting and different! Keep it coming! 2 way radio

    ReplyDelete
  4. I got what you mean , a debt of gratitude is in order for posting .Woh I am cheerful to discover this site through google.

    Online Web Hosting Services

    ReplyDelete
  5. i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. création de site internet

    ReplyDelete
  6. Amazing article, thanks for sharing this valuable blog. Visit Ogen Infosystem for responsive website design and SEO Services in Delhi, India at an affordable price.
    SEO Services in Delhi

    ReplyDelete
  7. Thank you very much for this useful article. I like it. WordPress Developer Brisbane

    ReplyDelete
  8. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.
    click here

    ReplyDelete
  9. I was more than happy to uncover this great site. I need to thank you for your time due to this fantastic read!!
    I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
    humidifier dehumidifier combo

    ReplyDelete
  10. I was more than happy to uncover this great site. I need to thank you for your time due to this fantastic read!!
    I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
    WordPress Chat Plugin

    ReplyDelete
  11. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.
    먹튀검증커뮤니티

    ReplyDelete
  12. I like this post,And I guess that they having fun to read this post,they shall take a good site to make a information,thanks for sharing it to me.
    파워볼사이트

    ReplyDelete
  13. Thanks on your marveous posting! Greetings! 먹튀사이트 I'm glad to see such a good comment.

    ReplyDelete
  14. best by introducing verification and verification companies. Plz answer back as I’m looking to construct 먹튀신고

    ReplyDelete
  15. Keep working like that!. back scratcher shoe horn Thanks so much for the post.Thanks Again 보증업체

    ReplyDelete
  16. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.
    best credit card processing companies to work for

    ReplyDelete
  17. thanks for this usefull article, waiting for this article like this again.
    selling merchant services

    ReplyDelete
  18. Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work.
    Flyttstädning Boden

    ReplyDelete
  19. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
    buy pregabalin

    ReplyDelete

  20. This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post!
    North American Bancard Partners

    ReplyDelete
  21. Fascinating to read. I love to read such an excellent article. Thanks! It has made my helps me a lot.Please make time to read, this may help you. 스포츠토토사이트

    ReplyDelete
  22. saved this to my favorite so I can read it again every time sharing all of the awesome info! I am looking forward to checking out more 메이저놀이터

    ReplyDelete
  23. thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss which is good in favor of my know-how 토토사이트검증

    ReplyDelete
  24. Plz answer back as I’m looking to construct 보증업체 I'm surprised there's such a wonderful article

    ReplyDelete
  25. We promise to do our This is a pure nice post. This is the kind of info that should be shared across the net. 먹튀폴리스

    ReplyDelete
  26. 카지노커뮤니티 I can grow up with. Please continue to do well and always do well I live in a different country than you

    ReplyDelete


  27. I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.
    garage construction richmond va

    ReplyDelete
  28. thanks for this usefull article, waiting for this article like this again.
    become a credit card processing agent

    ReplyDelete
  29. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!!
    토토사이트

    ReplyDelete
  30. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!!
    Vende Ethereum Colombia

    ReplyDelete
  31. Hi there! Nice stuff, do keep me posted when you post again something like this! 토토사이트

    ReplyDelete
  32. I am unable to read articles online very often, but I’m glad I did today. This is very well written and your points are well-expressed. Please, don’t ever stop writing. i99pro

    ReplyDelete
  33. i am always looking for some free stuffs over the internet. there are also some companies which gives free samples. 안전놀이터

    ReplyDelete
  34. I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. 안전놀이터

    ReplyDelete
  35. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. 먹튀검증

    ReplyDelete
  36. An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. 안전놀이터

    ReplyDelete
  37. hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. 무료릴게임

    ReplyDelete
  38. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. 메이저사이트

    ReplyDelete
  39. Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers! 먹튀검증업체

    ReplyDelete
  40. Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! pii-email

    ReplyDelete
  41. Merely a smiling visitant here to share the love (:, btw outstanding style. academic transcription services

    ReplyDelete
  42. I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. 먹튀검증

    ReplyDelete
  43. Great post, you have pointed out some fantastic points , I likewise think this s a very wonderful website. สล็อตออนไลน์

    ReplyDelete
  44. I really like your writing style, great information, thankyou for posting. 토토사이트

    ReplyDelete
  45. Merely a smiling visitant here to share the love (:, btw outstanding style. nursing test bank

    ReplyDelete
  46. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work nex777

    ReplyDelete
  47. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. 안전놀이터

    ReplyDelete
  48. I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. 파워볼게임

    ReplyDelete
  49. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. 대전건마

    ReplyDelete
  50. At Inovi, we’re committed to achieving the highest success rates while providing personalized care to our patients. Our Houston location offers expert care and is home to our state-of-the-art embryology lab. Visit Your URL

    ReplyDelete
  51. Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read. https://westasianetwork.com/

    ReplyDelete
  52. In this article understand the most important thing, the item will give you a keyword rich link a great useful website page: https://visualaidscentre.com/service/c3r-surgery/

    ReplyDelete
  53. We place a great deal of attention on the values, principles, knowledge, relationships and abilities that allow for wealth creation. Our values-based model for wealth transition influences human, intellectual, social and structural capital to support and promote growing financial capital. client strategy

    ReplyDelete
  54. wow this saintly however ,I love your enter plus nice pics might be part personss negative love being defrent mind total poeple , http://chezhelenoise.com/does-lasik-surgery-affect-night-vision/

    ReplyDelete
  55. Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... https://www.techsite.io/p/2560737/t/how-woocommerce-newsletter-plugin-will-boost-your-sales

    ReplyDelete
  56. wow this solid in any case ,I love your enter offering little appreciation to astonishing pics might be part personss not all around occupied with sexual relations being defrent mind gutsy poeple , https://zetamatic.com/downloads/woocommerce-mailchimp-newsletter-discount/

    ReplyDelete
  57. This is particularly surprising, at any rate it is head for tap on this interest: https://www.buyyoutubeviewsindia.in/youtube-marketing/

    ReplyDelete
  58. Wow, this is fascinating reading. I am glad I found this and got to read it. Great job on this content. I liked it a lot. Thanks for the great and unique info. 현금바둑이

    ReplyDelete
  59. You possess lifted an essential offspring..Blesss for using..I would want to study better latest transactions from this blog..preserve posting
    슬롯머신

    >wep<

    ReplyDelete
  60. I was reading your article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent. 먹튀검증

    ReplyDelete
  61. This site seems to inspire me a lot. Thank you so much for organizing and providing this quality information in an easy to understand way. I think that a healthy era of big data can be maintained only when such high-quality information is continuously produced. And I, too, are working hard to organize and provide such high-quality information. It would be nice to come in once and get information.

    Also visit my site:먹튀검증


    ReplyDelete
  62. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. industrial tunnel oven

    ReplyDelete
  63. 바카라사이트
    Hello I am so delighted I located your blog, This is my website and it has been very helpful.Teit hienoa työtä. Erittäin luettava ja älykäs. Teit jopa helpon ymmärtää ja lukea. Sinulla on todellinen kirjoitustaito. Kiitos.

    ReplyDelete
  64. Friend, this web site might be fabolous, i just like it. 메이저사이트

    ReplyDelete
  65. swagbucks
    AdsRePay is an online rewards and cashback site. It's completely FREE to register and use, and best of all, you can start earning right away. Complete simple offers from our partners, earn points and then simply redeem your points anytime for instant Paypal and Amazon Gift Cards

    ReplyDelete
  66. This site seems to inspire me a lot. Thank you so much for organizing and providing this quality information in an easy to understand way. I think that a healthy era of big data can be maintained only when such high-quality information is continuously produced. And I, too, are working hard to organize and provide such high-quality information. It would be nice to come in once and get information.

    Also visit my site:스포츠토토

    ReplyDelete

Course by The University of Texas at Austin

(FREE Edx Course) Embedded Systems - Shape The World: Microcontroller Input/Output. Offered by The University of Texas

Become a Robotics Software Engineer- Udacity Course

Ain't getting any visitors!
Please Share and Bookmark posts.

Tags

: (1) 18F2550 (1) 36KHz (3) and (1) arduino (1) Based (1) battery (1) Bipolar (1) Blinking (1) blinks (1) Bluetooth (1) bluetooth device interfacing (1) bluetooth module (1) button (1) circuit (1) clock (1) control (1) crystal oscillator (3) Db9 (1) DC Motor (2) digital (2) Digital Voting Machine (1) digital voting machine using pic (1) display (2) DS1307 (1) electronic (1) embedded c programming tutorial (11) embedded c tutorial (11) experiment kit (4) external interrupt (4) flash (1) flashing (1) Gas Leakage detector (1) HC-06 (1) home (1) how (1) How to (10) i2c tutorial (1) in (1) indicator (1) infrared Connection (3) interface (8) interfacing (3) Interrupt (3) Introduction (1) IR Connection (3) IR Receiver (4) IR Transmitter (4) key pad (1) keyboard (1) keypad (1) lavel (1) Lcd 16x2 (2) lcd 2x16 (2) led (1) lm35 (2) LPG (1) machine (1) make (1) Make bootloader (1) making (1) matrix (1) max232 (1) membrane keyboard (2) meter (2) Micocontroller (1) microchip (4) microchip pic (2) microchips (3) microcontroller (9) microcontroller based (3) microcontroller programming (3) Microcontroller Project (4) Microcontroller Projects (1) microcontroller_project (2) microcontrollers (4) Microprocessor (2) mikroC (5) mikroc code to start and stopstart and stop dc motor (1) mikroc pro for pic (2) Motion detector (1) MQ-9 Gas Sensor (1) musical (1) NEC Protocol (4) pcb (5) PIC (3) pic controller (11) pic microcontroller (11) pic microcontroller tutorial (11) pic programming (1) pic programming in c (12) pic proteus (1) Pic Tutorial (12) pic18 (2) pic18f2550 (11) picmicrocontroller (4) picRFモジュール (1) PIR Motion Sensor (1) printed circuit board (1) proteus (6) pulse width modulation (1) push (1) push button (1) PWM (1) real (1) rf transmitter (3) Rs 232 (1) Rs232 (1) scroll (1) scrolling (1) Serial communication (1) Serial Connection (1) Serial Port (1) serial port rs232 (1) Servo Motembedded c programming tutorial (1) simulation (2) Soil Moisture Meter (1) speed control (1) step by step (7) step bystep (1) Stepper Motor (2) text (2) Thief Detector (1) time (1) timer (4) timer0 (4) tone (1) TSOP38236 Receiver (4) tutorial (2) Unipolar (1) USART Connection (1) USB (1) usb 1.0 (1) USB bootloadere (1) USB HID (1) using (9) voltmeter (1) voting (1) water level indicator (3) with (2) work (1)

Traffic Feed


Live Traffic Feed
Visitor Tracking

Leave Your Message Here

Name

Email *

Message *

Like on Facebook