Sharp Distance Sensors with I2C

IMG_9718.JPG?width=400

For my own rover, Data Bus, I've been working on a board that converts Sharp range sensors to I2C.

I ran out of analog ports and had to prototype an I2C solution for my obstacle detection. I have this problem on all my robots. Pokey has too few analog ports. And I want to run a few of these on my RPi tele-rover.

They'll work with any Sharp ranger. For that matter, with any analog sensor (ideally at 3.3V or 5V). I plan to test a Maxbotix Sonar module soon.

Up to 27 of these on an I2C bus without re-programming the base address.

The firmware's oversampling, decimation and low pass filtering increases resolution and lowers noise floor. The analog anti-alias filter helps too. Performance is really good. Here's a pseudo-theremin demo:

They're running ATtiny44As. 6-pin AVRISP header doubles as I2C interface -- SPI and Serial on the newer revision is possible; I break out an ~SS pin. I also break out 2 GPIOs for the heck of it. I'm testing out SOIC and QFN versions.

If there's anyone who's building a project using analog rangers (Sonar, Sharp, other) and wants to try these let me know.

I have example code for Arduino, mbed, Raspberry Pi, and Propeller so far.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Hm, this is an old thread :)  I decided to put these on the back burner for awhile. Some of the example client code is here: https://code.google.com/p/a2d/  I don't seem to have checked in the hardware design or firmware. :(

  • Just to follow up with some of the possibilities I mentioned -- I was on an iPhone so hard to type all this...

    The current version uses card edge type pads and so it should plug into a 5x2 card edge connector (ribbon or board) so you could easily daisy chain these with ribbon cable for easy connection.

    Or create a backplane with card edge connectors and add loads of these, with all the exposed pins broken out, for a highly parallel robot controller, or whatever else.

    Or use pin headers soldered onto the pads and wire up with female .1" sockets (what I'm doing). 

    Since you can have 27 per bus, you could have a butler robot with lots of IR sensors for very robust obstacle avoidance. I'm probably going to add a feature where the base address is configurable so you could have 127 per I2C bus.

    I'm contemplating putting several on a rotating assembly as a sort of radar. Their update rate is slow so you need a bunch to support a reasonable update rate of your radar display.

    On diyrovers email list we've talked about small embedded MCU boards for dedicated tasks on our scratch built robots, like controlling ESC and Steering servo over I2C.

    Or reading wheel encoder counts.

    Doable as long as the anti-alias filter doesn't get in the way ;)

    I am sure there are lots of other possible uses.

    Also, I keep talking about using lots of these. I'm trying to keep costs as low as possible, definitely well under $10 and almost certainly under $8 at least with the current design. I'm hoping for even less if possible.

  • Yup they did. The SolarBotics product was my inspiration.

    Were you able to find versions for the 150cm and 550cm models? Or for any other analog sensors? I never did.

    What if you want SPI or Serial?

    Is it open source? Programmable? Hackable? Adaptable?

    How does it perform? I tried using discrete I2C ADCs in my early versions and was very unsatisfied.

    The MCU approach with some signal processing has worked so much better. I wished i had done that early on.

    And it opens the door for many different applications. You just have to see the possibilities.
  • Solarbotics did the same thing, but the PCB is inside the sharp sensor!
    https://solarbotics.com/product/35080/

    35080-back-dscn1505.jpg?width=400

    I2C-It Sharp IR Distance Sensor (10 to 80cm range) :: Solarbotics
    We've turned this excellent standard-range Sharp IR sensor into something faster, and I<sup>2</sup>C compatible!
  • @Tom -- what sort of tuning/signal processing are you doing? I can probably implement it on the board if the existing processing doesn't cover it.

  • As far as I know, they work outdoors.

    I was using one of the 150cm ones as a curb detector a couple years ago and it seemed to work fine.

    I believe Tom is using two rangers on his champion rover.

    @Gary -- if you want to help me further the development, go to bot-thoughts.com and click "contact me" and send me your address.

    @Randy -- thanks!

  • Nice work.  Could really help with the sonar sensors too.

    Do the Sharp IR sensors work outdoors?

  • Seems like a great part for all of us and if you can do the linearization for the Sharp sensors, even better.

    The APM is already a bit low on the fast resources needed to do that.

    I'd be very interested in this set up linearized for the GP2Y0A02 which is the 8" to 60" sensor.

    Will you be making these available for sale and wil they be able to be user programmed?

  • Developer

    it is a very pretty board too.  nicely done

  • Ok, great. Send me your address in an email (bot-thoughts.com has a 'contact me' link).

    I'll send two after I get done with some testing and after I implement the distance conversion which I'll start working on next.

    The boards are intended to be dedicated to an individual sensor, so no problem if each has a unique calibration.

This reply was deleted.