IR for robot on 16F877A


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Hi!

    You can use something like BC546 or similar, here in Europe they are easy to find, if you live across the Atlantic just go to one of those companys who sell trough the net (Farnell, RS, etc) and try to find on their list something alike

    Best wishes to your project
    nomada

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


    Did you find this post helpful? Yes | No

    Default

    You could use pretty much any NPN transistor 2N3904 or 2N2222 should work fine.

    Dave

  3. #3
    Samuel's Avatar
    Samuel Guest


    Did you find this post helpful? Yes | No

    Default multiple IR's

    thanks a lot DWV! I thought a 2N2222 would work but wasnt sure. I tried and now and it works! Also, I was concerned that the detector, when it sees the IR would stay low only momentarily and go back high but its not the case. It stays low as long as it sees the 38KHz IR!!!

    Now i'm trying to add more than one IR to the same circuit. I think at the output of the timer, if i use two 2N2222 with two IR on each it should work according to the schematic i posted above. The other thing is dunt know if the 555 timer on the schematic above is regular or CMOS. So far i only tried the CMOS 7555 with one 2N222 and one IR.

    I'm still contemplating if i should use "for loop" or "interrupts" to make the robot go to a turn or pause subroutine as soon as the detecto goes low etc.

    I think two ppl have posted to use IF loops. Anymore suggestions/experience?

    Thanks so much everyone,
    Samuel

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


    Did you find this post helpful? Yes | No

    Default

    Your welcome Samuel, the timer is probably a standard NE555, but if the one your using works, go for it!
    The 2n2222 is rated for up to 500ma, so you should have no problem running 4 or 5 LEDs on each one. In theory, even if you run your LEDs at thier maximum rating of 50ma, you should be able to connect 10 of them to each transistor, allthough I imagine the transistor would run pretty hot!
    Generally each LED would only be drawing around 20ma and the 2n2222 will have no problem handling 100ma.
    I would still use the If/Then loop to poll the detectors every once in a while, and save the interrupts for more important things.

    Dave

  5. #5
    Samuel's Avatar
    Samuel Guest


    Did you find this post helpful? Yes | No

    Default Using IR to make the robot turn.

    Thanks again Dave. I have implmented the transmitters and detectors. I have two detectors one on portd.0 and other on portd.1. (Basically for left and right turns). I have two visible leds on porte.0 and porte.1. I'm trying to get away with using just one detector to make both turns. Lets see how it works ...

    I had to use straws wrapped with black tape on the detector to narrow the detection zone from around 30 degrees to 10 degrees. When IR is detected the detector output goes low and the respective visible leds on portE light up!

    So basically polling my IR detector using "if loops" work well and I'm using my portb interrupts for bumper switches etc.

    I also have added 4 IR LEDS to my 2N2222. All of them work perfectly. I now have to place them appropriately.

    I used my sony digital still camera to see my IR's light and took some pics!! Looks cool! Its a pink color!

    I have one more day to get everything going. I also have to add an LCD and a 5x7 dot matric led!!! Its all in my head .. got all the ports and schematics figured out .. but u know the errors that are gonna popup as i actually put them together. Seems like i'm using around 30 of my 34 ports on my 16F877A!!

    Thanks again
    Samuel

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