Difference between revisions of "S18: Team Nemesis(SJSU Cam)"
Proj user8 (talk | contribs) (→Hardware Design) |
Proj user8 (talk | contribs) (→Hardware Design) |
||
Line 121: | Line 121: | ||
The two main hardware components used in the project are discussed in detail below. | The two main hardware components used in the project are discussed in detail below. | ||
− | LCD Screen: | + | '''LCD Screen:''' |
[[File:CMPE244_nemesis_LCD.jpg]] | [[File:CMPE244_nemesis_LCD.jpg]] | ||
− | Figure : 5 inch LCD screen | + | ''Figure : 5 inch LCD screen'' |
This is a 5.0" TFT screen with 800x480 pixels. These screens are commonly seen in consumer electronics, such as miniature TV's, GPS's, handheld games car displays, etc. A 40-pin connector has 8 red, 8 green, and 8 blue parallel pins, for 24-bit color capability. The display is supposed to be constantly refreshed, at 60Hz, with a pixel clock. The backlight requires a constant-current mode boost converter that can go as high as 24V. Hence along with the display we use an RA8875 driver board. | This is a 5.0" TFT screen with 800x480 pixels. These screens are commonly seen in consumer electronics, such as miniature TV's, GPS's, handheld games car displays, etc. A 40-pin connector has 8 red, 8 green, and 8 blue parallel pins, for 24-bit color capability. The display is supposed to be constantly refreshed, at 60Hz, with a pixel clock. The backlight requires a constant-current mode boost converter that can go as high as 24V. Hence along with the display we use an RA8875 driver board. | ||
− | LCD Driver : | + | '''LCD Driver :''' |
[[File:CMPE244_nemesis_LCDDriver.jpg]] | [[File:CMPE244_nemesis_LCDDriver.jpg]] | ||
− | Figure : RA8875 Driver Board | + | ''Figure : RA8875 Driver Board'' |
The RA8875 is a powerful TFT driver chip, it has 768KB of RAM, so it can buffer the display (and depending on the screen size also have double overlaying).The RA8875 can also handle standard 4-wire over the SPI interface. | The RA8875 is a powerful TFT driver chip, it has 768KB of RAM, so it can buffer the display (and depending on the screen size also have double overlaying).The RA8875 can also handle standard 4-wire over the SPI interface. | ||
− | Camera: | + | '''Camera:''' |
[[File:CMPE244_nemesis_cam.jpg]] | [[File:CMPE244_nemesis_cam.jpg]] | ||
− | Figure : | + | ''Figure : OV2640 camera'' |
− | The | + | The OV2640 Camera Module is a small image sensor, works at low operating voltages.It provides all functions of a single chip of VGA camera and image processor. Through Serial Camera bus control, the sensor can output the whole frame, sampling at various resolution 8 bits of data. The product VGA image can reach up to a maximum of 30 frames per second. We can control the image quality, data format and transmission mode. All the process of image processing functions can through the SCCB programming interface, including gamma curve, white balance, saturation, and chroma . |
Camera Module Block Diagram : | Camera Module Block Diagram : | ||
Line 147: | Line 147: | ||
− | System block diagram: | + | '''System block diagram:''' |
− | [[File:CMPE244_nemesis_sbd.png]] | + | [[File:CMPE244_nemesis_sbd.png]] |
=== Hardware Interface === | === Hardware Interface === |
Revision as of 22:28, 23 May 2018
Contents
Grading Criteria
- How well is Software & Hardware Design described?
- How well can this report be used to reproduce this project?
- Code Quality
- Overall Report Quality:
- Software Block Diagrams
- Hardware Block Diagrams
- Schematic Quality
- Quality of technical challenges and solutions adopted.
SJSU Cam
Abstract
Our project is a digital camera implemented using the SJONE board. An image is captured using a camera and is then displayed on an LCD screen. An SD card is also used to store the output of the camera as the captured image. For navigating through various options on the LCD screen, a menu is created.
The camera is mounted on a 3D printed box which contains an LCD screen behind to display the image being captured by the camera.
Objectives & Introduction
The objective for this project was to learn how timing and buffer play an important role in capturing the pixels from the camera and displaying them on the LCD screen. The following objectives were set for the project:
1. Write a driver for camera (mention what kind of camera ), which has a better rate of capturing the image with the SJONE board and integrate it.
2. Store the output of the camera to SD card.
2. Write the driver for LCD (mention the name) and integrate it by choosing the right resolution.
3. Have a menu implemented for the options available on the digital camera.
Team Members & Responsibilities
- Chhavi Mehta
- Camera Module Driver
- Deeksha Prakash Kankalale
- PCB Design, Camera driver interfacing.
- Parth Gujar
- LCD Module Driver, 3D design.
- Sagar Kalathia
- LCD Module interfacing, implementing graphics library
- Saurabh Badenkal
- LCD Driver, Integration of camera and LCD on the PCB and data pipelining.
Schedule
Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.
Week# | Date | Task | Actual |
---|---|---|---|
1 | 4/17 | 1. Placing order for the components required in the project. 2. Division of module development. |
Completed! Problems Encountered: Finding the right components after going through various datasheets. |
2 | 4/24 | 1. Making interface with LCD. 2. Drawing simple shapes. 3. Work on the overall design of the menu for LCD. |
Completed! Problems Encountered: Setting appropriate initial frequency for the LCD to light up. |
3 | 5/1 | 1. Interfacing the camera 2. Implementing menu class with sub-menus and items. 3. Designing hardware prototype for 3D printing. |
Completed! Problems Encountered: Not enough RAM for displaying more than 1 picture of size 100x100, Using interrupts for UART receive instead of normal function call. |
4 | 5/8 | 1. Design PCB and place order. 2. Integrating file explorer of the SD card onto LCD with GUI. 3. Capturing image from the camera, saving it on the SD card. |
Partially Completed! Problems Encountered: |
5 | 5/15 | 1. Displaying the image on the LCD. 2. Integrating the modules together with the 3D case having the LCD on one side and SJONE and camera on the other with buttons. |
Completed? Problems Encountered: |
6 | 5/22 | 1. Final testing and debugging of the system as a whole. | Completed? Problems Encountered: |
Parts List & Cost
Components | Model Number | Cost | Notes |
---|---|---|---|
SJONE board | LPC 1758 | 80$ | notes_1 |
LCD | 5 TFT Adafruit | 32$ | notes_2 |
LCD driver | RA8875 | - | notes_3 |
Camera | OV 2640 | 20$ | notes_4 |
PCB | - | 50$ | notes_5 |
Design & Implementation
This design section outlines the hardware and software design of the project.
Hardware Design
The two main hardware components used in the project are discussed in detail below.
LCD Screen:
Figure : 5 inch LCD screen This is a 5.0" TFT screen with 800x480 pixels. These screens are commonly seen in consumer electronics, such as miniature TV's, GPS's, handheld games car displays, etc. A 40-pin connector has 8 red, 8 green, and 8 blue parallel pins, for 24-bit color capability. The display is supposed to be constantly refreshed, at 60Hz, with a pixel clock. The backlight requires a constant-current mode boost converter that can go as high as 24V. Hence along with the display we use an RA8875 driver board.
LCD Driver :
Figure : RA8875 Driver Board
The RA8875 is a powerful TFT driver chip, it has 768KB of RAM, so it can buffer the display (and depending on the screen size also have double overlaying).The RA8875 can also handle standard 4-wire over the SPI interface.
Camera:
Figure : OV2640 camera
The OV2640 Camera Module is a small image sensor, works at low operating voltages.It provides all functions of a single chip of VGA camera and image processor. Through Serial Camera bus control, the sensor can output the whole frame, sampling at various resolution 8 bits of data. The product VGA image can reach up to a maximum of 30 frames per second. We can control the image quality, data format and transmission mode. All the process of image processing functions can through the SCCB programming interface, including gamma curve, white balance, saturation, and chroma .
Camera Module Block Diagram :
System block diagram:
Hardware Interface
The SPI interface is done to both the camera and the driver board of the LCD display. The PCB design was done on Dip Trace, which is a CAD software for creating schematic diagrams and printed circuit boards.
Schematic:
PCB Design:
Software Design
Software Design mainly consist of two part
1) Design for LCD : LCD would continuously display menu on its right with different option. Menu driver is programmed dynamically using pointers & Function Pointer.
Various API & functions as follows:
- Add_Menu API, whenever gets called would add one more node to linked list.
- Add_Submenu API would create Node inside its parent Node.
- "Navigate" API enables user to navigate through Menus. This API navigates pointer to different nodes and calling respective functions such as capture image or going inside sub_menu.
With this dynamic functionality we can create menus as required inside which we can call respective function to be performed according to submenu.
2) Design for SJOne & CAM : Controller has to Configure camera, receive data from camera and send this to LCD as soon as it gets the data.
Function includes :
- To Configure Camera Includes
- To receive Data from Camera at 8 MHz through SPI. After receiving One Frame, it is sent to LCD via SPI. In both the case, Controller is Master and other device is slave.
- To Store Image in SD card, whole frame is sent to SD card through SPI, and new text file with unique name is created and pixel values in that text file would be ascii values in matrix.
Software Flow of Project:
The general flow of our project can be explained by the flowchart shown below:
Implementation
The camera is interfaced to the board where Image Sensor Configuration is done through I2C Protocol and Sending pixel data through SPI communication protocol. The raw pixels are read from the camera to the SJONE board. There are five buttons on the camera. One of them used to capture an image and store it on the SD card. The LCD screen is interfaced through SPI communication protocol. The raw pixels received from the camera are displayed on to the LCD screen.
MENU for the LCD
A menu was designed for the LCD screen using an LCD_MENU class. This class included functions like adding sub-menu, displaying them or loading previous ones. It helped in dynamically adding options for the innumerous camera settings like changing image resolution and format.The private members of this class are as shown:
private: type myType; //to know if current object is itemType or menuType str myName; //name of this object LCD_MENU *ParentMenu; //parent menu of current menu object LCD_MENU *CurrentMenu; //reference to global CurrentMenuG VECTOR<Element> all_elements; //to store all elements by Element .name .id and .type VECTOR<str> all_elements_name; //to store all elements by name to use by Find function int highlighted; //to track currently highlighted sub-element
Similar to the this class, a file_explorer class was implemented for navigating through the SD card files.
Testing & Technical Challenges
Problem 1: Making any camera work on SJOne can be little tricky. We found SJOne to be not so compatible with camera modules and have timing issue which leads to displaced images or sometimes no image at all.
Solution: After trying a number of cameras like OV7670 without fifo and VC0706 serial camera, we were able to solve the problem by using OV2640 camera with fifo which made capturing the image easier because the buffer saved the values rendering the timing issues.
Conclusion
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
Project Video
Upload a video of your project and post the link here.
Project Source Code
References
Acknowledgement
We would like to thank our professor, Preetpal Kang for designing such a course where learning was his guidance and consistent feedback. We would also like to thank the ISA team for their valuable inputs as per their own experience of the course when taken and their support and motivation at every phase of this project. There were some unsung, selfless classmates who helped us whenever necessary, whenever any immediate hardware was required or any other guidance needed in spite of being from the rival teams. We would like to thank each one of them who forgot their differences or considered the course and project as a competition to selflessly help us when in need.
References Used
[1] Preetpal Kang's lecture notes of CMPE 244, Computer Engineering, San Jose State University, Jan-May 2018.
Appendix
You can list the references you used.