Editing Experimenting with IR Remotes using a PIC running BoostC Project

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 15: Line 15:
 
This code may be used as part of a user interface into a larger project.  One pin supports all the buttons on a remote, and a universal remote is only about $10. and works remotely.
 
This code may be used as part of a user interface into a larger project.  One pin supports all the buttons on a remote, and a universal remote is only about $10. and works remotely.
  
== Hardware ==
+
khaled ma'aitah Just
 
 
Taking apart old VCR's and similar devices you can often find small IR remote receivers.  These are outwardly simple devices, an IR sensor looks something like a LED but perhaps hidden behind a grill or filter and 3 wires.  The wires are for power ( two wires, +5 volts and ground ) and one for the signal which goes to a PIC input port.  Shine the light from an IR remote control ( from a broken, or not TV, the dump or buy a universal remote ) and the output pin jumps up and down for a while.  Learn what the jumping means and figure out what button was pressed on the remote.  Add a whole new interface to your PIC projects using only one pin.
 
 
 
An IR receiver whose spec sheet is easy to Google is the GP1U58X, this will help you with the pin out.  Other information on the receiver and hardware can be found by Googling for the many other projects out on the web.
 
 
 
For the PIC part of the project I use my favorite 16F877A set up as in [[PIC based Stepper Motor Dancing Analog Clock]].  Use input RB.0 as it has an interrupt available.  Use the UART and a PC for other control of and communications with the PIC as with the Clock.
 
 
 
=== Schematic ===
 
 
 
I think you can figure this out, if not take a look at another project like [[PIC based Stepper Motor Dancing Analog Clock]]
 
 
 
Parts
 
 
 
{| class="wikitable"
 
|-valign="top"
 
|Part
 
|Details
 
 
 
|-valign="top"
 
|Power supply
 
|Not shown, 5 volts, you can use a higher voltage with a voltage regulator.  There is a suitable power supply in the [[PIC based Stepper Motor Dancing Analog Clock]]
 
<!-------------------------------->
 
|-valign="top"
 
|PIC16F877A
 
|My favorate 16 series part, relatively lots of memory and pins.  Bigger than you need, but only about 8 bucks.  Try with an 18 series part, should not be hard and will leave you more up to date.  Let me know.  Other parts of the PIC circuit not discussed here.
 
<!--------------------------------
 
|-valign="top"
 
|IR three terminal receiver.
 
|I used a salvage one I had lying around.
 
<!--------------------------------
 
|-valign="top"
 
|
 
|
 
<!--------------------------------
 
|-valign="top"
 
|Power supply splitting resistors, form a pseodo ground at about 2.5 volts.
 
|100 more or less
 
<!--------------------------------
 
|-valign="top"
 
|RIN
 
|about 5 to 10 K 
 
<!--------------------------------
 
|-valign="top"
 
|RFB
 
|feedback resistor should be about 4 times higher than the input resistor
 
<!--------------------------------
 
|-valign="top"
 
|xx
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Q = crystal
 
|4 meg Hz is what I used.  May be quite a bit faster than needed, I have not looked into this.  The 4 meg crystal seems to work ok on a proto board.  Note that some of the code is dependent on this frequency, but could be fairly easily changed.
 
<!--------------------------------
 
|-valign="top"
 
|RA4, RA5 = Pull up resistors
 
|10K more or less
 
<!--------------------------------
 
|-valign="top"
 
|RB1 ... RB6 = Pull up resistors
 
|10K more or less
 
<!--------------------------------
 
|-valign="top"
 
|RRA2, RRA3  = Pull up resistors
 
|10K more or less
 
<!-------------------------------->
 
|-valign="top"
 
|C_BP  = By Pass Cap.
 
|Good idea to add one. A .01 to .1 mfd mica or other by pass cap, good at high frequency seems good.
 
<!--------------------------------
 
|-valign="top"
 
|RRA1 = Pull Up resistor
 
|10K more or less
 
<!--------------------------------
 
|-valign="top"
 
|RMC  = Pull up resistor for master clear ( pull down with push button switch to reset ).
 
|10k more or less
 
<!--------------------------------
 
|-valign="top"
 
|PUSH_BUTTON_SWITCH  = Reset
 
|Push to reset the processor.  Mine was from salvage.
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|
 
|
 
<!--------------------------------
 
|-valign="top"
 
|SW_UP, SW_DOWN =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!--------------------------------
 
|-valign="top"
 
|  =
 
|
 
<!-------------------------------->
 
 
 
|}
 
  
 
== Command Interface ==
 
== Command Interface ==

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)