Connecting 10 nos of Pixy 2 camera's to one monitor

Hi All -

Thank you in advance for your time to read this post, I'm planning to use 10 nos of Pixy 2 camera's in tandem, can I, get advise on how to connect 10nos of Pixy 2 camera's to one monitor (like PIP - picture in picture mode of operation), where I, can see all the pixty 2 camera visuals on one monitor.

Best,

Ramesha

That would be a question for the PIXY forum. The Arduino is rarely used for image display or processing.

jremington:
That would be a question for the PIXY forum. The Arduino is rarely used for image display or processing.

I, see use of Arduino with Pixy

http://cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Microcontroller_(like_an_Arduino)

Yes, the Pixy can communicate blob colors, positions and sizes to the Arduino via a serial connection.

The Pixy2 library looks to use SPI and the way the SPI library for Arduino is written, looks like only supports one SS (slave select) pin.

One way you might do this is to add an addition piece of decode hardware to your circuit. For example, you could use a 74HC154:

https://www.digikey.ca/product-detail/en/texas-instruments/CD74HC154M/296-9182-5-ND/376807

as a 4-16 decoder.

  • set up 4 free digital IO on the Arduino as digital outputs and run them to the A0-A3 inputs of the decoder.
  • run the SS pin from the Arduino to the nE1 input of the decoder
  • connect the nE2 pin of the decoder to GND.
  • connect the nYx outputs to your Pixy camera SS pins; nY0 to camera 1, nY1 to camera 2 … and nY9 to camera 10
  • connect the SCK, MOSI and MISO pins of the Arduino to each camera

When you want to talk to a camera, set the A3…0 pins prior to the SPI transaction. When SS goes low, the nYx pin associated with that channel will go low and SPI will talk to that camera. When the transaction is finished, the SS pin going high will de-select that camera.

So from the ccc_hello_world example, they have this:

.
.
.

void loop()
{ 
  int i; 
  // grab blocks!
  pixy.ccc.getBlocks();
.
.
.

With the external decoder, your code might look like this:

.
.
.

void loop()
{ 
  int i; 
  // grab blocks!
  for( i=0; i<9; i++ ) {
SelectCamera(i);

pixy.ccc.getBlocks();

.
.
.

};

void SelectCamera( int ch )
{
  if( ch > 9 )
    ch = 0;
  digitalWrite( CH_A0, (ch & 0x1) ? HIGH:LOW );
  digitalWrite( CH_A1, (ch & 0x2) ? HIGH:LOW );
  digitalWrite( CH_A2, (ch & 0x4) ? HIGH:LOW );
  digitalWrite( CH_A3, (ch & 0x8) ? HIGH:LOW );
  
}//SelectCamera

This should work for your top-level code.

Where it might fall down is if there are camera-specific initializations, if any, occur when pixie.init() is called (as opposed to just setting up the SPI port.) If it does, you might need to modify the library to support the multiple external channel decoder.

Just for image and display management a PC or at least a RasPi is required.

Blackfin:
The Pixy2 library looks to use SPI and the way the SPI library for Arduino is written, looks like only supports one SS (slave select) pin.

One way you might do this is to add an addition piece of decode hardware to your circuit. For example, you could use a 74HC154:

https://www.digikey.ca/product-detail/en/texas-instruments/CD74HC154M/296-9182-5-ND/376807

as a 4-16 decoder.

  • set up 4 free digital IO on the Arduino as digital outputs and run them to the A0-A3 inputs of the decoder.
  • run the SS pin from the Arduino to the nE1 input of the decoder
  • connect the nE2 pin of the decoder to GND.
  • connect the nYx outputs to your Pixy camera SS pins; nY0 to camera 1, nY1 to camera 2 … and nY9 to camera 10
  • connect the SCK, MOSI and MISO pins of the Arduino to each camera

When you want to talk to a camera, set the A3…0 pins prior to the SPI transaction. When SS goes low, the nYx pin associated with that channel will go low and SPI will talk to that camera. When the transaction is finished, the SS pin going high will de-select that camera.

So from the ccc_hello_world example, they have this:

.

.
.

void loop()
{
  int i;
  // grab blocks!
  pixy.ccc.getBlocks();
.
.
.




With the external decoder, your code might look like this:



.
.
.

void loop()
{
  int i;
  // grab blocks!
  for( i=0; i<9; i++ ) {
SelectCamera(i);

pixy.ccc.getBlocks();

.
.
.

};

void SelectCamera( int ch )
{
  if( ch > 9 )
    ch = 0;
  digitalWrite( CH_A0, (ch & 0x1) ? HIGH:LOW );
  digitalWrite( CH_A1, (ch & 0x2) ? HIGH:LOW );
  digitalWrite( CH_A2, (ch & 0x4) ? HIGH:LOW );
  digitalWrite( CH_A3, (ch & 0x8) ? HIGH:LOW );
 
}//SelectCamera




This should work for your top-level code. 

Where it might fall down is if there are camera-specific initializations, if any, occur when pixie.init() is called (as opposed to just setting up the SPI port.) If it does, you might need to modify the library to support the multiple external channel decoder.

Thanks! appreciated.

DrDiettrich:
Just for image and display management a PC or at least a RasPi is required.

Thanks