1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Record Signal (IR from pin)

Discussion in 'Microcontrollers' started by AtomSoft, Apr 30, 2009.

  1. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Ok i have some pulses i want to record. Lets say i have

    00110010 0001 0010

    How can i collect data for at least 500mS like that?

    I want to collect info like is the pin high or low. Then for how long is it high or low. Somewhat like a logic. Any thoughts? I tried to use the logic analyzer with pickit but it doesnt seem to give me stable results.

    I want to read the data from a remote controll. Its a Magnavox TV but no universal remote seems to work for it. So im trying to create my own by copying the data out from the pin used to controll the Infared LED. This way i can get straight data instead of trying to capture via infared i capture using output pin from remotes IC and input from pic.

    Please some thoughts on how to set this up would rock.

    I havent been working with pics lately due to some personal issues. But i have some time now.

    I have plenty of pics around such as some:
    18F4620
    18F2550
    18F2525
    18F2455
    18F1320
    18F4525
    18F448
    18F452
    dsPIC30F4013

    almost any of those should be enough i assume. The 4620 should have enough space to store large data amounts. If not i can setup a external mem card (SD) and do a raw right easily.

    Please any help would be appreciated ... thanks a ton!
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,213
    Likes:
    640
    Location:
    Derbyshire, UK
    If you try and record it from the LED in the remote, you're recording the 38KHz carrier - use an IR reciever IC and record the data directly from the output of that, the PICKit2 analyser should be perfect for doing so.
     
  3. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    I've used the Junebug LA tool to easily collect IR data and display it. As long as the Magnavox's IR is around 38kHz it should work.
    A small program to relay the IR pin to RB6 or 7 should do it. If you want the super simple way jumper your Junebugs IR output pin to PGC, PGD or Aux.

    LOL Nigel beat me by one minute!
     
    Last edited: Apr 30, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US

    the issue is i thinks its irDA. My remote can also controll my xbox 360. So not sure what it is lol i tried the LA tool for the pickit with no luck meaning i get different results for the same button
     
  6. House0Fwax

    House0Fwax Member

    Joined:
    Nov 15, 2006
    Messages:
    583
    Likes:
    17
    Location:
    Hampshire U.K.
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    I think its a RC6 or NEC. Here is a PNG of data i got.
     

    Attached Files:

  8. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    House0Fwax:

    awesome i have all the parts! ill plan to make it with a max232 or max232 and run off of 5v plug tho. ill build in a little but later and take photos and results later thanks!


    EDIT:

    Do you think i can just use a 7805 and power from RTS on serial?

    I based the about edit on:
    http://www.tkk.fi/Misc/Electronics/circuits/rspower.html
     
    Last edited: Apr 30, 2009
  10. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    I've seen IR on a serial port with parasite power. Usually a Zener is used as it's smaller. Look up Girder home control.
     
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    give me like 3 minutes to draw a schematic of what im planning to do itll be fun lol

    EDIT:

    Bill you are correct but as i dont have any Zener diodes available i cannot use it. i have to make a work around :D
     
    Last edited: Apr 30, 2009
  12. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The 7805 should work. Here's one.
    [​IMG]
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    nice! but i have to include the 12F629 now :D here is my rough draft.

    [​IMG]
     

    Attached Files:

    • ir.jpg
      ir.jpg
      File size:
      19.3 KB
      Views:
      514
  14. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Hey i gota step out for a while. Friend is back from hospital ill finish this later on . But here is a sample.

    Test of power. There is a diode there but its behind the 7805 so you might not see it:
    [​IMG]
     

    Attached Files:

    Last edited: Apr 30, 2009
  15. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    ARG! i tried the schematic attached but no luck. The application says no data recieved.

    [​IMG]
     

    Attached Files:

    • ir3.jpg
      ir3.jpg
      File size:
      27.2 KB
      Views:
      385
  16. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    I would add another cap, from the input of the 7805 to ground, about 47uF.
     
  17. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    i just did but a 10uf since no 47uf is avail. i might get one today from local source. but still no luck.
     
  18. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    The only thing i can thing of is ... How can this pic drive RS232 levels using 5v+ only? I thought it would have needed 12v+ and 12v- to work?

    should i add a max232 to the equation? i have a nice board ready for it.
     
    Last edited: May 1, 2009
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,213
    Likes:
    640
    Location:
    Derbyshire, UK
    RS232 works quite happily from 0-5V, all you need for an RS232 interface to a PIC is a single resistor, and that's only for the receive side. You can't use the hardware UART though, only a software one - as a MAX232 inverts the signal.
     
  20. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    oh cool. But for some reason this still doesnt seem to be working. So i will try my best to create a program to capture about 200mS - 500ms of data and sent to PC.

    Anythoughts on which is best for this ASM or C?

    Also where should i start with this? Should i look into that capture feature of many pics? or should i do it manuall by testing if a pin is high then using a timer to calc how long it was high for. Then having 2 variable arrays which can store data.

    I get lost fast lol. I have a old project somewhere around i gota look for it lol
     
  21. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    You might be having bit rate matching problems. Look up Nigel's tutorials I think he has software UART code there. There should be plenty of software UART code out there for C as well, all you need is a calibrated delay loop.
     

Share This Page