<< return to Pixycam.com

pixy and motor driver

I have been trying to use Pixycam. It is really good in detecting multiple colour signatures and tracking them. I tried to do simple navigation using the colour signatures(red ball) like move left or right depending on position of the ball . But the robot acts strangely with pixycam. It either moves back or right always even though the code is to move to other directions . Without the cam it works accordingly but with cam it starts acting weird. I doubt if it is an interference between the cam and motor driver.i have attached my program.

Hi Rohit,

What robot are you using? And how does the signature data from Pixy end up controlling the motors? Have you verified in Pixymon that Pixy is detecting the objects correctly?

Thanks.

Scott

Hi Scott,

I am using 4WD Arduino Compatible Mobile Platform with single arduino with motor shield.Yes the camera is detecting the correct object , ie, RED ball. But the problem i found is that when i create an object for pixy, it starts acting strangely. I tried a simple program of moving just forward if it sees a red ball. Instead it moves toward right. When i comment all the commands associated with pixy, it moves forward correctly. I found that as soon as an object is created , there is a malfunction.Could you tel what possibly might be going wrong?? Do i require two arduinos - one for the pixy and another for controlling the motion and all other things??

Thanks
Rohit

Hi scott,

I am using TB6612FNG motor driver. There seems to be conflict in pin numbers. The pin3 is used by pixy for SPI Sck and pin 10 for ground. Also same pins are used by the driver to give PWM (PIN 3)and STBY for disconnecting the motor from power(PIN 10).Is there any other way through this?? Should i use another driver or another arduino( one for pixy and other for motor driver??)

Thanks
Rohit

Hi Rohit,

The Pixy Arduino library uses the Arduino SPI library, which in turn uses whatever pins support SPI on the given board. Looking at Arduino’s documentation, this doesn’t seem to be configurable. You could try using another communication type, or using another Arduino board isn’t a bad idea. This might be the easiest solution.

Hope this helps.

Scott

Hi Scott,

Yeah it was helpful but as i can see the motor driver requires pin 3,5,8,9,10,11,12 for its functioning and in Pixy for its communication with arduino in SPI requires pin 1,3,4 ; in I2C requires pin 5,9 and for UART requires pin 1,4 and pins 6,8,10 are ground and pin 2 is for power. So i guess none of the communication type will work properly because of the pin conflicts.Is there any way for multiplexing the pins of arduino??

Thank You

Rohit

Hi Scott

Is Arduino mega compatible with pixy??

Thank You
Rohit

Hi Rohit,

Sorry I missed your response from earlier. It seems as though the shield will not work when being used with Pixy.

I do not have a Mega to verify compatibility, so if anyone else has one I’d like to hear about your experience. If I had to speculate (again, I have NOT verified this), I’d say it should work. The only Arduino we’ve had problems with is the Due, and this is because it is an ARM processor and not the typical ATmega.

Scott

Hi Scott,

I tried with Arduino Mega and it works fine.Now I am trying to integrate simple mapping of obstacles (for obstacle avoidance )using IR mounted on a servo and pixy cam to detect a coloured target in a room. Hoping to finish it soon.

Thank You
Rohit

Good luck, Rohit! We’d love to see any projects you create with Pixy.

Scott