Author
Topic: Converting Sharp Ranger to I2C (Read 723 times)

I developed a board that converts Sharp (or any) analog to I2C with oversampling and filtering to reduce noise and stabilize the signal based on an AVR application note. I was really surprised at how well that approach works (no more averaging for me).

I originally built the board for my autonomous 20mph rover, Data Bus as well as for Pokey, my Trinity-style Firefighting robot that needs rangers but doesn't have enough analog ports. Then I realized, duh, I could stick a ranger or two on my RPi tele-rover to aid while driving over the web. So they are useful to me, at least I'm probably going to sell them on Tindie. We'll see how it goes.

I have been writing up code examples for Propeller, Arduino, mbed, and RPi thus far.

Good job! I find that an Attiny running I2C is a very convenient way to hook up other parts of a 'bot. Personally, I use it for battery monitoring and power control (turn motors, fans, servos, etc on/off)

Also, technically, averaging multiple samples *is* a kind of oversampling with filtering! Now you're offloading it to the sensor-specific controller, and using slightly fancier math than a plain rectangular window, which probably makes life a lot easier on the main controller.

Thanks. It is good to hear you're also taking this approach of offloading focused tasks to Tinys.

We've been talking about this on diyrovers gmail list -- encoder counting, NMEA parsing, stuff like that. There are advantages. My own rover had a fast enough MCU to do everything but the distributed/modular approach is intriguing.

Last night, in fact, I was also contemplating building a backplane board that would accept a bunch of these Tiny boards to control various aspects of a robot. I may have to explore that further.