Shop OBEX P1 Docs P2 Docs Learn Events
Ping = lego? — Parallax Forums

Ping = lego?

roughwireroughwire Posts: 78
edited 2007-01-24 21:51 in BASIC Stamp
Yup it's me again... I got by on some other things but now I need some help wireing up this Lego Ulrasonic sensor to my bs2 (board of Ed), But the wireing's not the same. PING's got 3 wires (RED, WHT, BLK) and this Lego's got·six (WHT, PRP, RED, GRN, YLW, and BLU)... How can I wire this up? Here's a pic... THX.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-01-22 18:02
    You need to find out what the wires do then maybe we could help. Put these types of posts in the sandbox area in the future.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • roughwireroughwire Posts: 78
    edited 2007-01-22 18:09
    gotcha, thx. I'll start testing em asap.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-01-22 20:01
    All the documentation I can find (http://www.wooster.edu/physics/jacobs/220/Appendix_7_Ultrasonic_Sensor_I2C_communication_protocol.pdf)

    seems to indicate the Lego Ultrasonic is I2C communication based. It also looks like it's using 2 wires, not 6, but I haven't found a wiring diagram yet.

    I still say a Ping sensor would be cheaper and easier to interface, if you want to go that way.

    Post Edited (allanlane5) : 1/22/2007 8:05:56 PM GMT
  • ZootZoot Posts: 2,227
    edited 2007-01-24 21:51
    With a BS2p you can use native I2C commands. The two data wires are the I2C SDA and SCL wires. Which is which you would have to try out. I2C is a protocol where you send the address of the device, then [noparse][[/noparse]optional] commands/data, then read in whatever data you've told the device to give you.

    See I2CIN and I2COUT in the Stamp manual for examples. For the Lego Ultrasonics it *appears* that the device address highbyte is always $02 (hex 02) and then the lower byte is the register you want to read/write. You might want to start with just trying to read the version number of the device so you can verify that the device is online and you can communicate with it.

    I do think this device is a bit more complex to use than a Ping))), and doing it on a BS2 would be more involved since I2C is not native on the BS2. But if you were using it with a BS2p (native I2C support) then it looks like the device does some pretty cool things. In particular the "event" capture, where the unit will not take a sonar ranging unless it can not detect *other* ultrasonic noise in the vicinity, and the captures where it will record 8 data bytes of ranges to 8 objects. Some experimentation would certainly be in order, I'm sure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.