Request New Floor Tracking Sensor based on PMW3901 breakout

Here’s a quick mechanical drawing for the breakout:

The height of the lens and sensor module can be found on the datasheet: https://www.pixart.com/_getfs.php?tb=product&id=74&fs=ck2_fs_tw

Awesome thank you!!

Is there any sample code for how to generate a x,y plot of the sensor data? I’ve been trying to do so and the data I’m getting doesn’t seem right.

I’m moving the sensor in a straight line in the x direction and I’m seeing both the x and y values changed a lot, same goes for moving the sensor in a straight line in the y direction

Lastly how would I deal with rotations?

Good to hear you have the sensor producing data! I am still waiting to receive mine, UPS seems to have made a mess of the delivery. Hopefully next week sometime.

Plotting: You should be able to just print out the x and y values to a text file, read it up in excel and plot it there. Should do the job for simple debugging.

Rotation: a flat-ground dwelling robot will typically have 3 degrees of freedom: X, Y and rotation. 1 sensor will only provide 2 of these. To get the third, you will need a heading sensor like a compass, or a second flow sensor a fixed distance away from the first, preferably diametrically opposite from the center of rotation. Then you can calculate the rotation.

Is (or will there be) any library for the Arduino/ESP32?

Are these dimensions the same for the PMW3901 sensor?

How would you go about hooking up 2 sensors to a single rpi? Is there any example code for this as well?

Hi!

Phil would know more about the code questions, but for wiring two PAA5100’s to a single Pi you’d share the SPI pins between the two breakouts and use separate CS pins to select which sensor is communicated to. This is how they’re wired when using a Breakout Garden SPI HAT:


The PMW3901 uses a different lens which doesn’t protrude from the sensor like on the PAA5100, but apart from that the dimensions are the same.

this may be a bit out there, especially since you just released this board, any thoughts on creating a board with 2 of these sensors on it to allow for rotation? either the PAA5100JE or the PMW3901 preferably both :-P, I’m evaluating both for the specific flooring type I’m dealing with (very shiny concrete)

Also are there any volume discounts?

See this: GitHub - bitcraze/Bitcraze_PMW3901: Arduino driver for PMW3901 optical flow sensor
For this new chip, you will need to adjust the register settings in initRegisters(), should be straightforward based on the python library from pimoroni.

To get the best sensitivity to rotation, one should maximize the distance between the sensors. The ideal arrangement will have the axis of rotation bisecting the two sensors. So, a singe small PCB with 2 sensors will not be a robust measurement platform unless your vehicle/platform is very small.

You can also try a compass for rotation instead. Can be a superior solution in many cases.

Hello, I am having fun with these new sensors! Question - do we know a way to switch off the LEDs, including putting the chip to sleep? My application is power consumption sensitive, would be good to be able to power manage a bit.

Hi!

You can put the PAA5100 into shutdown by writing 0xB6 to register 0x3B, and wake up by writing 0x5A to register 0x3A. This resets the chip so after wakeup wait 1 ms and initialise the chip again. The datasheet isn’t very clear, but i’d hope that the shutdown mode turns the leds off too.

Thanks, will attempt!

I suppose Pixart dont disclose details around disabling just the LEDs. Then you could cut the majority of the power consumption, and not have to re-initialize everytime.

The datasheet doesn’t mention LED control specifically, but you could try if the PMW3901 code from here works: How do I turn on the LEDs? · Issue #4 · pimoroni/pmw3901-python · GitHub

Thanks again! PMW3901 LED commands seem to work. No side-effects that I can see yet.