Adviser : Chao-Huang Wei Student ID : M Student : Shin-An Chen 指導教授 : 魏兆煌 學號 :M 姓名 : 陳信安
2 I. Introduction II. CMOS image sensor, Microcontroller and other devices III. Communication between microcontroller and CMOS image sensor IV. Design circuit and write program V. Results and Conclusions OUTLINE
3 Introduction Solar energy has been used in many traditional technologies for centuries. Solar energy is currently used in a number of applications: heat, electricity generation, desalination of seawater… There are many ways to determine Sun’s angle and one of them uses sensors. Using CMOS image sensor in Sun tracking system is both high productivity and low price
4 Algorithms to determine the Sun’s position In the triangle ΔOAP, we have: (1) Similarly, in the triangle ΔSOP (2) Substituting (2) into (1), we get α H O (x 0, y 0 ) P (x, y) x y z β A B S Incident Sun ray CMOS Image sensor Lens Image of Sun 0 0 ycostanHy cosH yy H OP tan 0 0 costan sintan yHy xHx cos OA OP xtan)yy(x yy xx
5 This research study concentrates on how to use CMOS image sensor and microcontroller in Sun tracking system. PIC18F4520 CMOS Image Sensor SRAM Signal Data Counter Address
6 CMOS technology is used in many fields. Advantages of CMOS imager sensors are low power consumption, low voltage, direct digital output, small size and simple to design. CMOS image sensors are with high performance and reliability. Optics Sensor Digital Imaging Processing Storage Display Interface User Interface
7 CMOS: Complementary Metal- Oxide- Semiconductor KODAK KAC-9647 Array format (number of pixels): Total: 488x 672 (pixels) Active: 488(V) x 648(H) (pixels) Effective Image AreaTotal: 2.93mm x 4.03mm Active: 2.93mm x 3.89mm Resolution: 300,000 pixels Optical format: 1/4‘’ Pixel size: 6.0μm x 6.0μm Video Output: 8 & 10 Bit Digital Frame Rate: 68 frames per second KODAK KAC-9647
8 Microcontroller – PIC 18LF4520 -Package: 40-pin DIP -Program memory: Flash (32k) -Data memory: Sram (1536 bytes), Eeprom (256 bytes) -I/O Ports: Port A, B, C, D, E -4 timers -10-bit A/D module: 13 input channels Other devices SRAM (Static Random Access Memory Counter 74AC161 RS232 MOSFET P channel 74HC14… SRAM CY7C1049CV33
9 Overall chip block diagram CMOS image sensor KAC-9647 Analog pixel values Digital pixel values
10 Inter-Integrated Circuit (I 2 C) I²C is a multi-master serial computer bus and used to attach low-speed peripherals to a motherboard, embedded system, or cell phone. Write operation Read operation A = acknowledge (SDA LOW) Ā = not acknowledge (SDA HIGH) S = START condition P= STOP condition From sensor From master SWPAA Register Address Data Byte Device AddressSWAPAARegister AddressĀDevice AddressSR ‘1’ read ‘0’ write Data Byte Device Address A
11 Digital video port The captured image is placed onto a flexible 10-bit digital port (d [9:0]). d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 KAC-9647Processor Pixel clock Row trigger Frame trigger
12 KAC-9647 has two ways to transfer data into microcontroller: “Master mode” and “Slave mode”. MASTER MODE Sensor sends the signal of row (hsync) and frame (vsync) to microcontroller after it finishes one row or frame.
13 Every pixel in every row is consecutively read out, one pixel at a time. Scan direction can be programmed. CDS/Shift Register Analog Data Out Line Address
14 Microcontroller PIC 18LF4520 CMOS image sensor KAC-9647 RAM CY7C1049 WR RD Master Clock Pixel Clock Row trigger Frame trigger Row valid Frame valid I2C Clock I2C Data Data Computer Counter 74AC161 DATA Address Pixel Clock RS232 CLEAR INPUT, LOAD
15 5V PE TE Q0 Q1 Q2 Q3 CLOCK CARRY OUT PE TE Q0 Q1 Q2 Q3 CLOCK CARRY OUT PE TE Q0 Q1 Q2 Q3 CLOCK CARRY OUT Counter 1Counter 2Counter 3 PE TE Q0 Q1 Q2 Q3 CLOCK CARRY OUT Counter 4 PE TE Q0 Q1 Q2 Q3 CLOCK CARRY OUT Counter 5 Five counters 74AC161 are connected
16 The circuit was drawn by Protel 99SE program. Schematic editor was transferred to the PCB editor. Electronic schematic Printed circuit board
17 Make the circuit Board Master LPKF ProtoMat C40 Circuit CAM
18 Write program MPLAB IDE is a software program to develop applications for Microchip microcontrollers MPLAB debug and compile program code, that write by C language or Assemble. Program Circuit MPLAB Power
19 Flowchart of C program code
20 The following picture is the circuit, which consists of Microcontroller PIC 18LF4520, CMOS image sensor KAC-9647, SRAM HM628512, 82C55, 74HCT245 and others. CMOS Image sensor Counter-74AC161 PIC18LF4520 RS232 ICSP SRAM IRF7422D2 74HC14
21 Graphical user interface (GUI) is written by Visual Basic 6.0 of Microsoft cooperation. It can receive data from microcontroller and store all data into text format file or excel format file. Text file Excel file Interface Visual Basic code
22 GUI can read data of any 24-bitmap image and show it again. It is also transfer to monochrome image. However, GUI can not show clearly the image from KAC sensor. GUI read one image in computer and show it
23 The circuit operates well. Counters and SRAM run synchronously Microcontroller can control the CMOS image sensor SRAM can store all data in to its memory. Computer can receive data and save in text file or excel file. However, the received image is not clear.
24 Using counters and SRAM is a good method to overcome a problem of fast transmitting data of sensor. The circuit was made by CNC machine and welded by hand. Thus, it can put into practice in anywhere and utilize easily. Without the framegrabber card in computer and low cost & high reliability of sensor, the price of the circuit decreases remarkably. It is also able to apply the circuit in devices that price is considered. However, it makes the data process and image display more sophisticated. It concerns about the solutions to keep sensor clean from conditional environment (dust, noise…).
[1]Pham Thi Thu Hien, “Using CMOS image sensor andmicrocontroller in sun tracking system”, 2007