IR for robot on 16F877A


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Samuel's Avatar
    Samuel Guest

    Default IR for robot on 16F877A

    My robot is travelling along a narrow coridoor. At the point where it has to turn into a room, i want to have an IR transmission @38KHz. I got the IS1U60 IR reciever (by Sharp?) that detects IR only @ this frequency. I'm planning to mount the reciever on the side of my robot.

    My detector output will remain High and when it detects the IR @ 38KHz, it will go Low. So basically my robot will be going forward, and as soon as the detector goes low, the robot has to make the turn.

    I have two methods in mind and not sure which would be work best.

    1. Connect the detector output to portb (pins 4-7) and Use an interrupt (portb<4:7> change). So the 'forward routine' of the robot is interrupted and made to go into a 'turn routine'.

    (Also note portb0,1,2,3 are connected to my hbridge for my motors and i'm also using a bumper switch (interrupt) on portb.5. This setup works perfectly so far.)


    -OR-

    2. During my 'forward routine, just use an IF loop to keep checking if my detector is high or low?

    In the second case do i HAVE to use ADCON? and if i DO use ADCON, will I HAVE to connect my detector to port RA or RE? Or can i still use port RB? (VCC for my detector and PIC is 5V)


    Thanks,
    Samuel
    Last edited by Samuel; - 31st March 2005 at 21:42.

  2. #2
    AllanL5's Avatar
    AllanL5 Guest


    Did you find this post helpful? Yes | No

    Default

    Personally, I'd use the 'IF' loop.

  3. #3
    Join Date
    Feb 2005
    Location
    Revelstoke BC Canada
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    I agree with Allan, Use the if/then statement.
    You can connect the output of your IR receiver to the RB pin, just be sure to set which ever pin you use as an input.
    Are you going to put the IR emitter inside the room you want the robot to turn into?

    Dave

  4. #4
    thelightbrain's Avatar
    thelightbrain Guest


    Did you find this post helpful? Yes | No

    Default

    Be aware that those IR receivers are designed for modulated data (usually Manchester or some other type of async encoding) and they will reject continuous carrier signals. If you just send a continuous 38Khz IR signal, it will briefly go low, then it will go high again. Check the data sheet for acceptable burst lengths and data rates. Usually each burst of 38KHz will have to be followed by a corresponding "space" to allow the AGC circuit to recover.

  5. #5
    Samuel's Avatar
    Samuel Guest


    Did you find this post helpful? Yes | No

    Default Is1u60

    oh no ... i was just planing on a simple 38KHz modulation .. im really running out of time. Can someone else pls give me some insight on that? my retector is the sharp IS1U60 and im planning on bulding an IR transmietter at 38KHz using a 555 timer.

  6. #6
    Join Date
    Jan 2005
    Location
    Greece
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    You could use a 556 and use the second timer to modulate the first
    LSB

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 08:44
  3. PIC10F200 Automated IR Light Switch
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 3rd May 2007, 11:40
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. how to get pic to pic communication
    By kinsiro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th August 2005, 17:12

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts