<< return to Pixycam.com

Pixy2.1 with Arduino Mega 2560 and Dragino LoRa Shield

Has anyone tried using the Pixy2.1, Arduino Mega 2560, and the Dragino LoRa shield together?

Am facing an interesting roadblock to my use of the Pixy2.1 camera. The project is a proof-of-concept for using Arduino, Dragino, and Pixy2.1 to send a picture from the camera, through LoRa, to a basestation.

Using Arduino Uno and USB to begin, the project goes well. The image from Pixy2.1 is sent to the basestation and the basestation displays the image. Adding the Dragino LoRa shield to the Uno and then plugging the camera into the Dragino does not interfere with Pixy2.1’s operation. Everything works as expected.

Arduino Uno proved to have not enough memory to support the required software so switched to the Arduino Mega 2560. If the camera is plugged directly into the Mega, the software uploads and operates as expected. However, adding the Dragino shield and plugging the camera into the shield keeps the camera from operating as expected. Shown below is test software and the results. These occur when the Dragino is plugged into the Mega as delivered or if the Dragino is plugged in with the slight modification shown in this video: https://www.youtube.com/watch?v=0t-FHww_4uY. Interesting to note is that, under these circumstances, PixyMon says no devices are detected.

Thank you very much for your insights.

=============== Arduino Test Software =====================
#include <Pixy2.h>
#include <stdio.h>

// This is the main Pixy object
Pixy2 pixy;

void setup()
{
// Initialize Arduino
Serial.begin(9600);
Serial.print("\n============== Starting…\n");

// We must initialize the pixy object.
// may generate “error: no response” one time.
// This is fine but has to be accounted for in receiver software.
Serial1.end();
Serial1.begin(9600);
while(!Serial1); // make sure Serial1 is ready
pixy.init();
delay(1000);
Serial.print("\nPixy is initialized.\n");

// Getting the RGB pixel values requires the ‘video’ program
pixy.changeProg(“video”);
delay(1000);
Serial.print(“Pixy program changed to ‘video’.\n”);

// Ready to go
Serial.print(“Pixy is ready.\n”);
}

void loop()
{
uint8_t r, g, b;

// Show picture dimensions
uint16_t rows, columns;
Serial.println("\nPicture Dimensions");
Serial.print(“Rows: “); Serial.print(pixy.frameHeight);
Serial.print(” Columns: “); Serial.print(pixy.frameWidth);
Serial.print(”\n\n”);

// get RGB value at last pixel of frame
if (pixy.video.getRGB(pixy.frameWidth - 1, pixy.frameHeight - 1, &r, &g, &b)==0)
{
Serial.println(“Color of Last Pixel”);
Serial.print(“red:”);
Serial.print®;
Serial.print(" green:");
Serial.print(g);
Serial.print(" blue:");
Serial.println(b);
delay(2000);
exit(0);
}
}

=============== Results =================

============== Starting…
error: no response
error: no response

… numerous times …

Pixy is initialized.
error: no response
Pixy program changed to ‘video’.
Pixy is ready.

Picture Dimensions
Rows: 0 Columns: 0
error: no response

… last three lines repeat continuously …

Hello,
How are you powering everything? Please check out this page:
https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:powering_pixy

It’s possible to “brown out” the Arduino power supply with Pixy, which tends to consume around 150mA, which in some cases, the Arduino may not be able to supply. Adding a shield only increases the power needed.

Edward

Excellent insight Edward. Did not realize this was a possibility. Thank you for bringing that up.

From what I can tell though, there are pin incompatibilities between Mega 2560, Dragino LoRa, and Pixy2.1. Without physical and firmware modifications, I do not think this configuration can be made to work.