Shop OBEX P1 Docs P2 Docs Learn Events
How would I change this circuit for the propeller? — Parallax Forums

How would I change this circuit for the propeller?

P!-RoP!-Ro Posts: 1,189
edited 2010-02-15 17:23 in Accessories
This is the OOPic circuit for the sonar module I'm trying to use, and I need to use it with the 3.3v Propeller.
polaroid-2s.jpg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-14 17:00
    Your schematic doesn't show this, but I assume INIT is an input to the module and ECHO is an output from the module. There is a long "sticky" thread at the top of the Propeller forum thread list called "Propeller: Getting Started and Key Thread Index". There's a link in this thread to another thread on the whole issue of interfacing the Propeller to +5V logic. The simplest thing to try is to put a 2.2K resistor in series between the sonar module's INIT and ECHO pins and the Propeller's I/O pins. If that doesn't work, you may need to use one of the voltage translator circuits discussed in the thread.
  • P!-RoP!-Ro Posts: 1,189
    edited 2010-02-14 18:47
    I currently have 1k resistors between them, and I can't get it to work which is why I looked up this schematic. I don't have a resistor between the 5V supply and the echo, but since I don't seem to be setting off the transducer I'm not sure it matters.

    I'm using the Polaroid version of this, with the only difference being 8 pins instead of 9: www.acroname.com/robotics/parts/R11-6500.html

    I may also have a software problem, but I'll start with this for now to make sure I don't have circuit problem. I'll check that thread you talked about now, maybe the signal voltage is the only thing I need to fix?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-14 19:02
    The TL851 that this module uses is TTL-compatible. That means that a direct connection to the INIT input from the Prop should work fine. The ECHO output is open-collector, but it's pulled up on the module. All you have to do is remove the pull-up resistor from the module and replace it with one at the Prop end of the cable that's pulled up to 3.3V instead.

    -Phil
  • P!-RoP!-Ro Posts: 1,189
    edited 2010-02-14 19:22
    That makes sense. I'll try it out and see if I have success.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2010-02-14 23:12
    Alright I got the initiation to work well, however I'm still not getting a reading back of distance. I have a 10k resistor pulling up the echo pin to 3.3v and 1k to the prop pin. I was thinking the resistor values were too high--but I really don't know and I don't wish to destroy a pin. What do you think?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2010-02-15 17:23
    I did some more testing and it seems the pin isn't going high, even though I have it pulled up to 5v with a 10k resistor. When I comment out this line: waitpne(0, |< Pin2, 0) the code repeats like I want, even though there are no distance measurements. What could be wrong?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
Sign In or Register to comment.