Phoebe’s sensitive under belly*

Phoebe's delicate underside

Phoebe’s delicate underside

Phoebe has got the PiCamera and the SRF02 Ultrasonic Range Finder installed on her underside; legs are back in place to achieve both camera focus and URF minimum range on the ground.

Camera’s working fine though the software is proving tricky for using the camera to do laser dot following or motion tracking MP4 encoding.

URF isn’t working; i2cdetect -y 1 sees the sensor, but a write to send an ultrasonic ping just blocks. ┬áThere’s a couple of possible causes: the URF is running on 3.3V not the 5V as defined by the spec, and the I2C bus is running at 400kbps instead of the URF’s supported 100kbps.

I can’t drop the I2C baudrate – I have 1000 batches of 12 byte samples to read each second from the IMU FIFO and even ignoring the I2C overhead that requires 96kbps – not a cat in hell’s chance of running the IMU and the URF together at that baudrate.

The voltage is fixable with some 2-way level adjustors like these, but these are going to need a PCB rework.

Stuck again for the moment.

*much like a hedgehog

5 thoughts on “Phoebe’s sensitive under belly*

  1. Had the same issues with the SRF02, 2 of them so far. Randomly they stopped responding or worse, responding with random distances.
    In the end I gave up and got a MaxSonar that works perfectly. Huge range and very stable.
    I recommend you get one of them – they have both i2c and UART versions. I use the UART one, I don’t remember why but I regret not getting the i2c one now… i2c is no much easier to work with.

    • I’d seen the MaxSonar range before but wrote them off as too expensive for the weather resistant versions or too bulky for the raw PCB versions, but I’ve just read through the spec and they all support 400kbps and 3.3V – should have spent more first time round and got the right ones!

      • Just spotted 400kbps i2c baudrate is only supported if the i2c master (i.e. Raspberry Pi) supports clock stretching otherwise the frequency is 50kbps; sadly the RPi I2C device does not support clock stretching.

        • Ah I see, probably this is why I didn’t get the i2c one.
          In any case, the serial one works very nice. Just beware that the signal is not TTL but Serial 232 – so it’s inverted. You’ll need either an inverter or cheaper – use it with bitbanging and pigpio with the bb_serial_read_open and bb_serial_invert functions. Works perfectly, no inverter needed and you don’t use the rpi UART port so later on you can add a GPS there.
          Takes almost no CPU as it’s dma driven.

          • I’ll have a look – the pigpio library also bit-bangs i2c and does support clock stretching – only down side is that I’ll have to swap from using the I2C pins on the RPi to a pair of spare GPIO pins, which means new PCBs (as would RS232 serial).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.