1 / 15

Implementing a JPEG Camera Module on the Rover

Implementing a JPEG Camera Module on the Rover. Subrata Debnath Team: T3 Fall 2011. Objective (on progress). Configuring the camera module to work with the Arduino Uno ( ATmega 328p). Mounting the camera module on the Rover and take pictures ( on progress).

nodin
Download Presentation

Implementing a JPEG Camera Module on the Rover

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Implementing a JPEG Camera Module on the Rover SubrataDebnath Team: T3 Fall 2011

  2. Objective (on progress) • Configuring the camera module to work with the Arduino Uno (ATmega 328p). • Mounting the camera module on the Rover and take pictures (on progress). • Using the camera module during the mission to take pictures of the targets/plaques (on progress).

  3. Parts List • Arduino Uno. • Linksprite serial JPEG Camera (TTL interface). • microSDHC 16gb Card with FAT32 filesystem (SD card of equal or under 2gb and FAT16 file system preferred). • Adapter for microSD cards (optional if SD card is used). • SD card breakout board (included level shifter for 3.3v to 5v translation preferred). • Wires.

  4. Wiring Diagram (Fritzing)

  5. How does it Work? • The camera module captures JPEG images of low to mid ranged resolution (160 X 120 – 640 X 480). • It’s able to transmit raw image data (HEX) over serial port. • Using Arduino’s USART subsystem, the camera can transmit the data and store it in the memory card. • Default baud rate for transmission of data is 38400 Hz and default baud rate for storing data in memory card is 9600 Hz.

  6. Sample Program (Block Diagram)

  7. Future Research/Development • Reading the camera’s TVOUT signal and transmitting a live video wirelessly for augmented reality projects. • Replacing the IR sensor with the camera and processing the incoming video to measure the distance of the targets/plaques for the mission (if at all possible by the processing power of ATmega 328p)

  8. Sample Program (Codes) #include <NewSoftSerial.h> #include <byteordering.h> #include <fat.h> #include <FAT16.h> #include <fat_config.h> #include <partition.h> #include <partition_config.h> #include <sd-reader_config.h> #include <sd_raw.h> #include <sd_raw_config.h> byte incomingbyte; NewSoftSerialmySerial(4,5); long int a=0x0000,j=0,k=0,count=0,i=0; uint8_t MH,ML; booleanEndFlag=0; FAT TestFile;

  9. Continued void SendResetCmd(); void SetBaudRateCmd(); void SetImageSizeCmd(); void SendTakePhotoCmd(); void SendReadDataCmd(); void StopTakePhotoCmd(); void setup() { Serial.begin(38400); mySerial.begin(38400); if(!sd_raw_init()) { while(1); } TestFile.initialize(); TestFile.create_file(“plaque1"); }

  10. Continued void loop() { byte a[32]; SendResetCmd(); delay(4000); SendTakePhotoCmd(); while(mySerial.available()>0) { incomingbyte=mySerial.read(); } TestFile.open(); while(!EndFlag) { j=0; k=0; count=0; SendReadDataCmd(); delay(20);

  11. Continued while(mySerial.available()>0) { incomingbyte=mySerial.read(); k++; if((k>5)&&(j<32)&&(!EndFlag)) { a[j]=incomingbyte; if((a[j-1]==0xFF)&&(a[j]==0xD9)) EndFlag=1; j++; count++; } } for(j=0;j<count;j++) { if(a[j]<0x10) Serial.print("0"); Serial.print(a[j],HEX); Serial.print(" "); }

  12. Continued TestFile.write((char*)a); Serial.println(); i++; } TestFile.close(); Serial.print(“Done Storing"); while(1); } void SendResetCmd() { mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x26, BYTE); mySerial.print(0x00, BYTE); }

  13. Continued void SetImageSizeCmd() { mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x31, BYTE); mySerial.print(0x05, BYTE); mySerial.print(0x04, BYTE); mySerial.print(0x01, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x19, BYTE); mySerial.print(0x11, BYTE); } void SetBaudRateCmd() { mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x24, BYTE); mySerial.print(0x03, BYTE); mySerial.print(0x01, BYTE); mySerial.print(0xAE, BYTE); mySerial.print(0xC8, BYTE); }

  14. Continued void SendTakePhotoCmd() { mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x36, BYTE); mySerial.print(0x01, BYTE); mySerial.print(0x00, BYTE); } void StopTakePhotoCmd() { mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x36, BYTE); mySerial.print(0x01, BYTE); mySerial.print(0x03, BYTE); }

  15. Continued void SendReadDataCmd() { MH=a/0x100; ML=a%0x100; mySerial.print(0x56, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x32, BYTE); mySerial.print(0x0c, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x0a, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x00, BYTE); mySerial.print(MH, BYTE); mySerial.print(ML, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x20, BYTE); mySerial.print(0x00, BYTE); mySerial.print(0x0a, BYTE); a+=0x20; }

More Related