Shop OBEX P1 Docs P2 Docs Learn Events
Project on basic stamp II — Parallax Forums

Project on basic stamp II

NtelosNtelos Posts: 21
edited 2009-05-24 05:55 in BASIC Stamp
Hello there,

I am new in basic stamp use and programming.

I bought basic stamp II for a homework for my University.

I also bought an IR sensor, working at 40KHz. It has transmitter and receiver in it.The code of the sensor is tsop1740.
How could i connect this sensor on basic stamp II and could you give me some tips for programming it?
(I would like to use the tsop1740 as a motion sensor. )

Thank you in advance

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-05-03 17:57
    You could look at the data for the Parallax IR receiver for some ideas but it won't be exactly the same so you will need to make adjustments to the code. I don't think you will get "motion sensing" since that is not what this device is designed to do. Take a look at the PIR sensor for motion sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-03 18:44
    The TSOP1740 does not have a transmitter in it. It is only a receiver. From looking at the TSOP1740 datasheet, it appears to be similar to the IR detector sold by Parallax. It's not identical, but the sample programs for Parallax's sensor might work with the TSOP1740. Read the datasheet carefully and compare it to the device sold by Parallax.
  • NtelosNtelos Posts: 21
    edited 2009-05-03 19:52
    I found this:
    http://www.rentron.com/Micro-Bot/IR_Nav.htm
    Do you think it could work?

    Thanks anyway
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-03 20:39
    It probably would work with some small changes. I suspect the definitions for the servo pulse width and the pin numbers will have to be changed. There's no check_left or check_right routine. Best thing is to start with the examples in the Robotics with the BoeBot tutorial which shows how to do IR object detection and distance measurement with a Stamp and an IR emitter / detector.

    See here: www.parallax.com/tabid/535/Default.aspx
  • NtelosNtelos Posts: 21
    edited 2009-05-19 07:00
    I tried the circuit i found in http://www.rentron.com/Micro-Bot/IR_Nav.htm and it worked. I just had to place the transmitter and the receiver looking at the same direction. So if any obstacle appears, the beam reflects and the receiver detects a signal ( I have tried to place them at opposite sides - the receiver looking towards the transmitter - and it didn't work.

    Thanks for your advice!
  • DataJDataJ Posts: 23
    edited 2009-05-24 05:55
    Dear Ntelos - -

    I just finished an HO Model Train Switching Display, in which I used·5 Vishay TSOP 4838, Infra-red receivers.

    This component is similar to your TSOP 1740, but operates at a lower frequency, i.e., 38 mhz vs 40.··Both components closely approximate each other.

    The emitters, (or IR Transmitters), I used were the Fairchild QEC-113.

    I tried a reflective configuration, similar to what you have described.· In this configuration you should find the output signal from the IR receiver, (TSOP 1740), will be high,·about 5 volts.··When something is detected··(a reflection occurs)·the·receiver will drop the output down to·2 volts.· (At least that was my experience).

    However, in·my project,·the locomotives were a flat-black finish,·and detection was unreliable and
    inconsistent.

    Consequently the configuration was changed to a "Break-beam" system in which the emitter is on one side of the track with the receiver on the other.· i.e., the emitter sends a beam directly into the lens of the IR Receiver.· In this configuration, the voltage remains low, (about 2 volts) until the beam is broken.· When the beam is broken, the output voltage from the receiver goes high·to 5 volts.

    After many hours of trial-and-error programming, the "break-beam" detection method has never failed
    to operate each time a locomotive passed through the beam.

    Hope this helps you.

    Regards,
    Jim



    ·
Sign In or Register to comment.