Optical flow sensor for accurate lateral (x & y) velocity measurement
Designed by Pesky Products in United States of America
Buy with confidence.
Our Tindie Guarantee protects your purchase from fraud. Learn More
What is it? This is a small (0.7 x 0.4 inch) breakout board for PixArt's PMW3901MB optical flow sensor. This is the same optical flow sensor used in Bitcraze's Flow Deck but here in a much smaller fo…
Read More…This is a small (0.7 x 0.4 inch) breakout board for PixArt's PMW3901MB optical flow sensor. This is the same optical flow sensor used in Bitcraze's Flow Deck but here in a much smaller form factor for easier integration into your robot or UAV project.
The PMW3901 optical flow sensor is just like the tracking sensor in a typical mouse but here designed for ranges from 80 mm minimum to infinity. The sensor requires a lens (provided with the breakout) that enables the far-field tracking capability. Practically, we have tested the sensor with good results at table-to-ceiling (6 feet) distances, but outdoors the range could be quite a bit longer. The field of view is a rather wide 42 degrees.
The board is designed to mount directly onto the non-USB end of a Teensy 3.2 or a Butterfly or Dragonfly development board for easy prototyping and testing. It can also be used on a breadboard. The board exposes 3V3 and GND, the SPI port for serial communication with the host as well as the sensor 1.8 V enable (active HIGH, pulled up by a 10 K resistor), and a motion detection pin (active LOW) which is some kind of an interrupt but the datasheet has no information about how this is supposed to be used (see here for an example of interrupt-based data collection). The reset (active LOW, pulled up by a 10 K resistor) is also exposed on the board.
The sensor requires 1.8 V VDD power input and this is provided by a low-noise NCP161AMX180 LDO on the board. The input power to the board is 3V3 and the SPI (VDDIO) port is 3V3 so the sensor will work with any 3V3 microcontroller. Use a logic level translator if using a 5 V MCU like an Arduino UNO. Even though the RC filter circuit is optional I have included it here on this board for best performance. The low-noise LDO and the RC filter circuit make possible the superb accuracy we have seen with this optical flow sensor.
The data sheet leaves a lot to be desired and is quite sparse, so it is not clear what the spectral response of the sensor is or even the pixel count. But in some sense, it doesn't matter. This is more or less a black box lateral velocity detector that uses optical flow, comparing successive frames, to determine (relative) lateral motion. Usually, optical flow requires a lot of number crunching on the host mcu to grab and compare frames, detect pixel changes, compute derivatives and produce a resultant delta x and delta y. Here, the sensor embeds an ASIC that does all of this for you so that delta x and delta y are simply read by the host from sensor registers at up to 100 Hz sample rate using the fast SPI interface. The measured delta x and delta y are changes in pixels per unit time; with an appropriate distance scale factor, the optical flow sensor provides direct measurement of lateral velocity. By integrating the measured delta x and delta y the distance traveled can be determined between any two points in time, if you know the distance to the surface being tracked.
The sensor can operate in navigate mode producing delta X and Y values which are proportional to lateral velocity. The limiting speed is determined by the maximum 7.2 rads/sec flow rate and by the distance to the measurement surface; 80 mm is the minimum measurement distance. So at 80 mm the maximum speed is 0.58 m/s (1.3 mph), at 2 meter distance (~drone height) the maximum speed is 14.4 m/s (32 mph), etc.
The x and y values output from the sensor are raw flow rate in signed int16_t format. So the proper scale is to multiply these values by 7.2 / 32768 to get flow rate in units of rads/sec at the minimum 80 mm distance. Multiply by height/80 mm for larger distances.
You can also just calibrate by integrating the raw flow rate to get travel over a known distance to be sure.
If mounted on a rolling robot make sure the distance to the ground is at least 80 mm for best results.
Our initial testing shows that moving the optical flow sensor along a straight line (along x) over a known 30-inch path using the ceiling ~60 inches away as the tracking surface and integrating the measured delta x over the tracking time gives a distance of 30 +/- 0.5 inches. In other words, the sensor is incredibly accurate.
New production design is a slightly redesigned board with the LED power pin (acive LOW) exposed on the board edge. The LED power pin is synced with the frame rate to allow control of a MOSFET gate so that one or more IR led(s) can illuminate the scene for nighttime or obscured daytime velocity estimation. This requires a separate IR led circuit as described in the full data sheet, available with a signed NDA from PixArt. Please contact PixArt for more details.
For flying robots (AKA quadcopters) an outstanding problem is lateral drift when hovering at a fixed point. Vertical stability can be achieved using the barometer for altitude hold or even the VL53L0 time-of flight distance sensor (from 0 - 2 meters) as bitcraze uses in their flow deck. But lateral position hold is quite difficult without using optical methods. So far, cameras and the computations to do optical flow have been prohibitive for small (~35 g) UAVs meant for precision flying indoors. Cameras are expensive and heavy, and the optical flow computations require a lot of MCU horsepower. The PMW3901 solves a lot of these problems. The sensor + lens components aren't very expensive, the entire sensor + pcb is very small and light ( ~1 g), and all of the optical flow calculations are done on the sensor itself. It's a great solution for any kind of robot--flying or rolling--that can benefit from lateral velocity measurements and lateral distance estimation.
There is a simple Arduino API that makes the sensor very easy to use with almost any MCU that has an SPI port. Here is a more or less complete sketch designed to run on the Dragonfly or Butterfly development boards.
This is a small, breadboard friendly breakout board that can also be integrated directly into your project. It provides a simple and convenient way to accurately measure lateral velocity and estimate lateral distance traveled. If the data is folded into a flight control loop, it can be used for position hold in a flying robot.
Order some pcbs from OSH Park and assemble your own or buy the fully assembled and tested board from me and see how easy it is to measure lateral velocity and displacement in your application using optical flow!
No country selected, please select your country to see shipping options.
No rates are available for shipping to .
Enter your email address if you'd like to be notified when PMW3901 Optical Flow Sensor can be shipped to you:
Thanks! We'll let you know when the seller adds shipping rates for your country.
Shipping Rate | Tracked | Ships From | First Item | Additional Items |
---|---|---|---|---|
:
|
Buy with confidence.
Our Tindie Guarantee protects your purchase from fraud. Learn More
Danville, CA, United States of America
Ships from United States of America.
179 Reviews | 5,404 Orders
$49.95
Free Shipping!
$11.95
Free Shipping!
$35.95
Free Shipping!
$35.95
Free Shipping!
$49.95
Free Shipping!
$19.95
Free Shipping!
$12.95
Free Shipping!
$19.95
Free Shipping!
$35.95
Free Shipping!
$35.95
Free Shipping!
$39.95
Free Shipping!
$35.95
Free Shipping!
By clicking Register, you confirm that you accept our Terms & Conditions
We recognize our top users by making them a Tindarian. Tindarians have access to secret & unreleased features.
We look for the most active & best members of the Tindie community, and invite them to join. There isn't a selection process or form to fill out. The only way to become a Tindarian is by being a nice & active member of the Tindie community!