<< return to Pixycam.com

Numbers of Blocks Displayed on Serial Monitor Differs from PixyMon

I am using a Pixy2 to detect red, blue and green golf balls. The golf balls are evenly spaced apart on a plate with holes to make sure the camera never sees two adjacent balls of the same color as one block.

Using the default hello world arduino example, I am getting at most 18 blocks detected through the serial monitor even though 30 individual blocks are being displayed on the pixymon software. I made sure the max blocks setting in pixymon was not the issue.

Is there something I’m missing? I just need to be able to detect 30 blocks with 3 different signatures.

When all 24 golf balls on the table, the number of blocks consistently detected is 18. When I empty the table and add the golf balls one at a time, it accurately counts up to 18 but never detects more than 18 blocks at a time. Please see the attached photos for reference of the Pixymon screen and the serial monitor from the Arduino IDE. What could be wrong?

19%20PM59%20PM

Hi Anthony,
Your picture looks great! What’s happening is that only 18 blocks can fit in a 255 byte serial packet. We need to implement multi-packet responses in the next release. You are the first person to want to detect more than 18 objects with Pixy2. :slight_smile:

I don’t have a timeframe for the next release, but I’ll try to get an estimate.

Edward

Do you know of any workaround for now? Can I process one signature at a time? In my case, I will not be tracking movement. My ESP32 based delta robot, seen here, will take a snapshot of the table and then proceed to sorting the golf balls.

The NXP LPC4330 is capable of 16 bits per SPI transfer. While the arduino uno is only capable of 8 bit SPI transfers, I’m using an ESP32 which is capable of 16 bit SPI transfers and I’ve used it before for communicating with a different NXP chip. Hopefully, it’s as simple as creating a separate example sketch for those of us using microcontrollers with 16 bit SPI transfers. That should allow 32 blocks per SPI transfer.

Thanks Edward!

Edward, I have a workaround for my case. I just poll Red, Green and Blue blocks separately. Here’s a screen shot of detecting 30 golf balls at once.

41%20PM

The idea had just occurred to me and I was going to suggest, but you had already figured it out!

Excellent work! :slight_smile: