Hi All,
Brief description of our set-up: we are using the Pixy2 in color-components mode in which it has been trained to recognize a green line. The Pixy2 communicates to the Rbp4 via USB. The Pixy2 lives about 20cm above a hallway chamber, with metallic rods that span the entire hallway horizontally and the green line at the middle of the hallway (which the pixy recognizes nicely). These rods are in turn connected to a shock generator which delivers a 0.3mA ‘shock’ through the rods in particular experimental conditions (active avoidance with rodents). The shocks get delivered when there is a ‘break’ in the detection of the given signature by the pixy2.
The issue: when the shock happens, the pixy2 gets disconnected and i get the ‘error: no response’ communication issue. I am forced to power off the pixy2/rbp4 and restart it to restore communication. I need to have detection intact during this period.
What I’ve tried: shielding tape all around the pixy2 cable + ferrite beads all over the place. If there is no shock, no interruption happens, everything works perfectly. I am guessing the shock causes so much electromagnetic interference that it disrupts data transfer over USB. I’ve tried longer shielded cables and playing around with cable location but the same issue happens.
I was wondering if anyone had any advice. We have a similar set-up that is with arduino and the pixy communicates via the provided SPI cable and that works fine. Do you think trying to swap from USB to SPI using jumper wires to the rbp4 SPI is worth an effort? I also read on the wiki about the pixy2’s analog/digital output which i think could potentially work (custom wires from the pixy2 to the rbp4 GPIO). I really do not know much about these things, but perhaps one means of communication would be less vulnerable to EMI than USB?
Apologies for the wall of text, any advice would be much appreciated.
Thank you in advance!