SlideShare a Scribd company logo
1 of 24
INTRODUCTION
In this project our aim is to interface OV7670 camera module with ATmega based
Arduino Microcontroller board. Camera modules are widely used in the world of
electronics. Our aim is to show how to connect, configure and get a test image
using a small program on java, it will be an excellent starting point for further
experiments. Currently ov7670 camera is the affordable image acquisition module
for embedded applications.
Our goal is to interface the camera with Arduino which are much
efficient, low cost easily available and easy to configure. These are the major
reasons for which here an Arduino is used. In spite of the following advantages
there are some disadvantages too, that are:
o Very limited I/O pins
o Limited memory capacity
o Slow Processing speed
The above disadvantages are the challenges in interfacing the camera
with an Arduino and these are to be overcome by applying some Data handling
and manipulation techniques. The OV7670 Camera module talks over a modified
I2C protocol that is known as SCCB (Serial Camera Control Bus). This protocol is
intended to be used with OmniVision’s camera modules.
This project is intended to provide a low cost and easily configurable image
capturing solution, that can be used in real-time Time-lapse photography, image
acquisition systems or as security cameras.
The camera module is accessed by SCCB (I2C) protocol by the Arduino.
The Data sent by the camera is parallel over data channel D0-D7, Data received by
the Arduino is sent to the computer over serial communication and this follows the
rule of sending pixel data of one row at a time. This help to overcome the problem
of slow processing and slow data transmission rate of the Arduino boards
1
Figure 1: Block diagram for Camera-Arduino interface
2
OV7670
camera
module
Arduino UNOI2C
COMPUTER Seri
al
HARDWARE
2.1 CAMERA MODULE (OV7670)
The camera module has an onboard CMOS sensor designed for mobile application
where low power consumption and small size are of utmost importance.
Proprietary sensor technology utilizes advanced algorithms to cancel Fixed Pattern
Noise (FPN), eliminate smearing, and drastically reduce blooming. All required
camera functions are programmable through the Serial Camera Control Bus
(SCCB) interface.
The device can be programmed to provide image output in various fully
processed and encoded formats.
Resolution
VGA (640 x 480); - QVGA (320 x 240); - CIF (352 x 240); -
QCIF (176 × 144)
Transfer rate up to 30 fps
Image encoding RGB 565/555, YUV / YCbCr 4: 2: 2
Interface I2C interface interaction / SCCB
Table 1: Camera module Specification
2.2 Two Wire SCCB Interface
The modified 2-wire implementation allows for a SCCB master device to interface
with only one Slave device. This 2-wire application is implemented in the camera
chip reduced pin package products where the SCCB_E signal is not available
externally.
Figure 2: Two Wire SCCB Interface
3
2.3 Pin Functions
Signal Name Signal Type Description
SCCB_Ea Output Master drives SCCB_E at logical 1
When the bus is idle. Drives at logical 0 when
the master asserts Transmissions or the
system is in Suspend mode.
SIO_C Output Master drives SIO_C at logical 1 when The
bus is idle. Drives at logical 0 and 1 when
SCCB_E is driven At 0. Drives at logical 0
when the system is Suspend mode.
SIO_D I/O Serial I/O Signal 0 Input and Output -
remains floating when the bus is idle and
drives to logical 0 when the system is in
Suspend Mode.
Table-2: Master Device Pin Descriptions
Signal Name Signal Type Description
SCCB_Ea Input Input pad can be shut down when the System
is in Suspend mode.
SIO_C Input Input pad can be shut down when the System
is in Suspend mode.
SIO_D I/O Serial I/O Signal 0 Input and Output - input
pad can be shut down When the system is in
Suspend mode.
Table-3: Slave Device Pin Descriptions
2.4 Application
Some of the applications of camera module are: PC Camera, and Cellular phones,
Video conference equipment, Machine vision, Security camera, Biometrics,
Digital Still Cameras
4
2.5 ARDUINO
Arduino is an open-source platform used for building electronics projects. Arduino
consists of both a physical programmable circuit board (often referred to as
a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code
to the physical board.
Microcontroller ATmega 328-p
Operating Volts 5V
Input Voltage 7-20v
Digital I/O Pins 14
Analog Input 6
PWM pins 6
Flash Memory 32 Kb
SRAM 2 Kb
EEPROM 1 Kb
Clock Speed 16 MHz
Current 50 mA
DC Current at Digital I/O 20 mA
Table 4: Arduino UNO Specification
5
CAMERA-ARDUINO INTERFACING CIRCUIT
For interfacing the camera module with the Arduino we need a circuit that will
provide the mount points as well as the voltage Pull-up and Pull-down facilities.
below is a Typical Block representation of the hardware connection between
OV7670 and Arduino UNO. Oscillator used here is optional, we will be Arduino’s
onboard crystal oscillator is being used to generate the XCLK.
3.1 Block diagram for Arduino-Camera interfacing
Arduino
Figure 3: Block representation of Connection
6
Camera
Module
SCL, SDA
HREF, VSYNC
DATA
PCLK
PWDN
+3.3V, GND
Oscillator
XCLK
3.2 Pin Configuration
Pin configuration is one of the most important data that must be kept in mind
while designing the interfacing circuit and must be followed to ensure proper
communication Arduino and Camera Module.
Pin Type Description
VDD Supply Power supply
GND Supply Ground level
SDIOC Input SCCB clock
SDIOD Input/output SCCB data
VSYNC Output Vertical synchronization
HREF Output Horizontal synchronization
PCLK Output Pixel clock
XCLK Input System clock
D0-D7 Output Video parallel output
RESET Input Reset (Active low)
PWDN Input Power down (Active high)
Table 5: Arduino Pin Configuration
7
3.3 Circuit Diagram
The Arduino is rated for 5V and the camera module is of 3.3V. Hence, the voltage
divider for the XCLK will be used (two resistors of 4.7KΩ) to pull down the
voltage to ~3V. Furthermore, OV7670 does not provide output voltages higher
than 3.3V which is a quite low for Arduino to reads the input as high (5V), so we
will connect pull-up resistors.
Here external signal is provided to D12 to capture image and to D8 for
image to PDF conversion, both are active high with 0.3 sec high pulse.
Figure 4: Circuit Diagram for OV7670-Arduino Interfacing [Source: privateblog.info]
PROGRAM FLOW FOR INTERFACING
8
OV7670 camera module captures image during LOW at VSYNC and sends out
row data during the HIGH at HREF. The Arduino receives the parallel data input
from camera module image sensor and converts it to the serial data and also
provides initialization to the registers of the OV7670 Module.
Figure 5: Typical Data flow diagram
Basic steps in the code are:
1. Generation of PWM
2. Start I2C Communication
3. Write default register values
4. Receive data from camera
9
Arduino
Figure 6: Flow diagram for initialization of camera module
4.1 Configure Arduino that will give 8 MHz at Pin D11
DDRB | = (1 << 3); // pin 11,
The ASSR & = ~ (_BV (EXCLK) | _BV (the AS2));
TCCR2A = (1 << COM2A0) | (1 << WGM21) | (1 WGM20 <<);
TCCR2B = (1 << WGM22) | (CS20 1 <<);
OCR2A = 0; // (F_CPU) / (2 * (X + 1))of d0 of low-
DDRC & = ~ 15; // d3 camera
DDRD & = ~ 252; // d7-d4 and interrupt pins
10
4.2 Configure I2C interface
TWSR & = ~ 3; // preset for the disable the TWI
TWBR = 72; // set to 100 kHz
Figure 7: Flow Diagram of I2C communication
4.3 Initialization of Camera Module
Figure 8: Write default Register values
11
ARDUINO
Write Default register
Values with I2C Camera Module
WrReg (0x12, 0x80);
_delay_ms (100);
wrSensorRegs8_8 (ov7670_default_regs);
WrReg (REG_COM10, 32); // PCLK does not HBLANK Locality toggle on.
4.4 Receiving Image bytes
The camera module sends parallel image data bytes where it is buffered till receiving full
row data then this data is sent over serial communication to the pc as shown in figure 9.
Figure 9: Receiving Image Bytes
12
OV7670
camera
Module
Arduino UNO
ComputerParallel Data Serial Data
MUX
Buff
er
RAM
OV7670 MODULE DATA TRANSFER
The SIO_C signal is a single-directional, active-high, control signal that must be
driven by the master device. It indicates each transmitted bit. The master must
drive SIO_C at logical 1 when the bus is idle. A data transmission starts when
SIO_C is driven at logical 0 after the start of transmission as shown in figure 10 &
11. A logical 1 of SIO_C during a data transmission indicates a single transmitted
bit. Thus, SIO_D can occur only when SIO_C is driven at 0.
5.1 Timing Diagram
Figure 10: SCCB Timing Diagram
Figure 11: Horizontal Timing Diagram
13
Camera module sends row data between every HSYNC LOW and during each
HSYNC HIGH, the HREF follows the HIGH and both of this occurs between the
two HIGH of the VSYNC signal as shown in figure 12, that means all the row data
is sent over the VSYNC at LOW.
Figure 12: VGA Frame Timing
14
PIXEL DATA BYTE TO IMAGE CONVERSION
For this purpose a java program is being used, that will grab the serial input data
(bits) stream from Arduino at specific COM port that will generate a valid BMP
image from it , the code works as illustrated below in figure 13.
6.1 Program Work Flow
Figure 13: Algorithm of data to image generation
15
6.2 COM Port selection (JAVA)
if(!enumeration.hasMoreElements())
break;
portId = (CommPortIdentifier)enumeration.nextElement();
if(portId.getPortType() == 1)
{
System.out.println((new StringBuilder()).append("Port name:
").append(portId.getName()).toString());
SimpleRead simpleread;
if(portId.getName().equals("COM5"))
simpleread = new SimpleRead();
6.3 Port parameters (JAVA)
serialPort = (SerialPort)portId.open("SimpleReadApp", 1000);
inputStream = serialPort.getInputStream();
serialPort.setSerialPortParams(0xf4240, 8, 1, 0);
int i = 0;
6.4 Waiting for an (data stream) input from Arduino (JAVA)
do // infinite loop starts here
{
System.out.println("started the if else ");
16
while(!isImageStart(inputStream, 0))
// image Generation code goes here
} while(true);
}
catch(Exception exception)
6.5 Image generation from received data stream (JAVA)
17
Figure 14: Algorithm for image generation from received data steam
while(!isImageStart(inputStream, 0))
{
System.out.println("Looking for image");
System.out.println((new StringBuilder()).append("Found image:
").append(i).toString());
for(int j = 0; j < 240; j++)
{
for(int l = 0; l < 320; l++)
{
int j1 = read(inputStream);
ai[j][l] = (j1 & 0xff) << 16 | (j1 & 0xff) << 8 | j1 &0xff;
}
}
for(int k = 0; k < 240; k++)
{
for(int i1 = 0; i1 < 320; i1++)
ai1[i1][k] = ai[k][i1];
}
BMP bmp = new BMP();
bmp.saveBMP((newStringBuilder()).append("c:/out/").append(i+
+).append(".bmp").toString(), ai1); System.out.println((new
StringBuilder()).append("Saved image: ").append(i).toString());
18
}
HANDLING MULTIPLE SCANS (CMD)
It is sometime needed to perform multiple scans. That means the scanning
mechanism is provided input for scan again and again, then this program as shown
in figure 15 proves to be useful it takes the user inputs to perform a certain number
of scans and then control the Arduino or any other microcontroller to perform the
scanning and PDF conversion till it reaches the provided number of scans.
Figure 15: Algorithm to handle multiple Scans
19
IMAGE TO PDF CONVERSION (CMD)
Now after generating the images we need to convert those images to a PDF file for
which we will use the software ConvertITP.EXE. following is the algorithm for
Image to PDF conversion.
Figure 16: Algorithm Image to PDF generation
8.1 Code for the Image to PDF conversion
@echo off
echo by somnath
echo .
20
set CITP="%ProgramFiles%Softinterface, IncConvert Image To
PDFConvertITP.EXE"
set InputFolder=C:out
set OutputFolder=C:out
REM Convert from JPG to PDF
%CITP% /S%InputFolder%*.bmp /T%OutputFolder%all_img.PDF /F0 /+
ren %InputFolder%all_img.PDF all_img-%date:~10,4%%date:~7,2%
%date:~4,2%_%time:~0,2%%time:~3,2%.pdf
mkdir %InputFolder%original_images_%date:~10,4%%date:~7,2%
%date:~4,2%_%time:~0,2%%time:~3,2%
move /Y %InputFolder%*.bmp %InputFolder%original_images_%date:~10,4%
%date:~7,2%%date:~4,2%_%time:~0,2%%time:~3,2%
echo `
echo DONE!
echo .
exit
21
SOFTWARE SETUP GUIDE
-Extract the Extra.zip file. Then copy:
"win32com.dll" to "..jdk1.8.0_74jrebin” Directory.
the "comm.jar" in "...jdk1.8.0_74jrelibext"
"javax.comm.properties" in "...jdk1.8.0_74jrelib"
Copy “out” folder to C: Drive
Install the software “Installme.exe”
Double click on SCAN.bat from c:out folder
It will start the program
22
CONCLUSION
Interfaced the OV7670 Camera module with Arduino at 8 MHz XCLK pulse
which is generated by the Arduino board itself. Arduino talk to the camera module
using I2C to write/read camera registers. Frames are read one by one in a brute-
force manner. Currently the camera module is configured to work with QCIF
(176x144) format in order to eliminate timing issues. Pixels of a given frame are
stored in the java program and on completion of whole row data the JAVA
program generates the valid BMP image.
The most challenging task for interfacing Arduino &Camera is the low
memory capacity of Arduino microcontroller due to which we are unable to store a
full image at once, to overcome this the JAVA program is implemented that
receive the Data Bits of one row at a time.
It has also to be noted that there are microcontrollers out there that
actually have dedicated peripherals/devices for interfacing with camera modules
such as the OV7670, but the interface of OV7670 Camera Module with Arduino
Microcontroller provides us a easy to use, maintain, low cost and a configurable
system that can be used in various fields of image acquisition.
23
References
[1] N. Sriskanthan and Tan Karand. “Bluetooth Based Home Automation System”.
Journal of Microprocessors and Microsystems, Vol. 26, pp.281-289, 2002.
[2] Al-Ali, Member, IEEE & M. AL-Rousan,“Java-Based Home Automation System R.”
IEEE Transactions on Consumer Electronics, Vol. 50, No. 2, MAY 2004
[3] The Java Tutorials: All About Sockets [Online]. Available:
http://docs.oracle.com/javase/tutorial/networking/sockets, March
2013
[4] L. Lo Presti, M. La Cascia, “Real-Time Object Detection in Embedded Video
Surveillance Systems,” Ninth International Workshop on Image Analysis for Multimedia
Interactive Services, 7-9 May 2008, pp. 151-154.
[5] http://arduino.cc/en/Main/ArduinoBoardADK
[6] https://forum.arduino.cc/index.php?topic=211741.0
[7] http://www.dejazzer.com/coen4720/labs/lab11_camera.pdf
24

More Related Content

What's hot

Project smart notice board ppt
Project smart notice board pptProject smart notice board ppt
Project smart notice board pptRahul Shaw
 
R-2R Ladder DAC
R-2R Ladder DACR-2R Ladder DAC
R-2R Ladder DACChandul4y
 
Consumer electronics lab manual
Consumer electronics lab manualConsumer electronics lab manual
Consumer electronics lab manualSushil Mishra
 
Smart Notice Board with android app via Bluetooth
Smart Notice Board with android app via BluetoothSmart Notice Board with android app via Bluetooth
Smart Notice Board with android app via BluetoothS.M. Fazla Rabbi
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introductionMichal Sedlak
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoOmer Kilic
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWINDvaibhav jindal
 
Bluetooth Home Automation
Bluetooth Home AutomationBluetooth Home Automation
Bluetooth Home AutomationApoorv Gupta
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt maineddy royappa
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCUroadster43
 
Random Running Lights, Seminar project
Random Running Lights, Seminar projectRandom Running Lights, Seminar project
Random Running Lights, Seminar projectSmruti Patro
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 

What's hot (20)

Arduino uno
Arduino unoArduino uno
Arduino uno
 
Project smart notice board ppt
Project smart notice board pptProject smart notice board ppt
Project smart notice board ppt
 
Led display
Led displayLed display
Led display
 
R-2R Ladder DAC
R-2R Ladder DACR-2R Ladder DAC
R-2R Ladder DAC
 
Consumer electronics lab manual
Consumer electronics lab manualConsumer electronics lab manual
Consumer electronics lab manual
 
Smart Notice Board with android app via Bluetooth
Smart Notice Board with android app via BluetoothSmart Notice Board with android app via Bluetooth
Smart Notice Board with android app via Bluetooth
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWIND
 
Arduino Projects
Arduino ProjectsArduino Projects
Arduino Projects
 
R2 r dac
R2 r dacR2 r dac
R2 r dac
 
Bluetooth Home Automation
Bluetooth Home AutomationBluetooth Home Automation
Bluetooth Home Automation
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCU
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
Arduino
ArduinoArduino
Arduino
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Random Running Lights, Seminar project
Random Running Lights, Seminar projectRandom Running Lights, Seminar project
Random Running Lights, Seminar project
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 

Viewers also liked

Arduino & Internet of Things - First Step
Arduino & Internet of Things - First StepArduino & Internet of Things - First Step
Arduino & Internet of Things - First StepAlessio Reggiani
 
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICE
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICESMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICE
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICEASHOKKUMAR RAMAR
 
Cours0 presentation carte arduino
Cours0   presentation carte arduinoCours0   presentation carte arduino
Cours0 presentation carte arduinolabsud
 
Presentation arduino
Presentation arduinoPresentation arduino
Presentation arduinoSinGuy
 
Présentation Arduino par Christian, F5HOD
Présentation Arduino par Christian, F5HODPrésentation Arduino par Christian, F5HOD
Présentation Arduino par Christian, F5HODwebmasterref68
 
Projet de fin d'etude :Control d’acces par empreintes digitale
Projet de fin d'etude :Control d’acces par empreintes digitaleProjet de fin d'etude :Control d’acces par empreintes digitale
Projet de fin d'etude :Control d’acces par empreintes digitaleAbdo07
 
Cours4 allumer une led sur la carte arduino
Cours4   allumer une led sur la carte arduinoCours4   allumer une led sur la carte arduino
Cours4 allumer une led sur la carte arduinolabsud
 
KPI measurement
KPI measurementKPI measurement
KPI measurementkpphelu
 
War Field Spying Robot with Fire Fighting Alarm.
War Field Spying Robot with Fire Fighting Alarm.War Field Spying Robot with Fire Fighting Alarm.
War Field Spying Robot with Fire Fighting Alarm.vansh_raheja
 
Cours16 ressources pour arduino
Cours16   ressources pour arduinoCours16   ressources pour arduino
Cours16 ressources pour arduinolabsud
 
Call Setup Success Rate Definition and Troubleshooting
Call Setup Success Rate Definition and Troubleshooting Call Setup Success Rate Definition and Troubleshooting
Call Setup Success Rate Definition and Troubleshooting Assim Mubder
 
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTHAUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTHAbhinav Maggu
 
Présentation de projet de fin d’études
Présentation de projet de fin d’étudesPrésentation de projet de fin d’études
Présentation de projet de fin d’étudesAimen Hajri
 
Metal Detector : A Working Model
Metal Detector : A Working ModelMetal Detector : A Working Model
Metal Detector : A Working ModelAtit Gaonkar
 
presentation projet domotique
presentation projet domotiquepresentation projet domotique
presentation projet domotiquets4riadhoc
 
Rapport projet Domotique
Rapport projet DomotiqueRapport projet Domotique
Rapport projet Domotiquets4riadhoc
 

Viewers also liked (20)

final_report
final_reportfinal_report
final_report
 
Arduino & Internet of Things - First Step
Arduino & Internet of Things - First StepArduino & Internet of Things - First Step
Arduino & Internet of Things - First Step
 
Home automation
Home    automationHome    automation
Home automation
 
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICE
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICESMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICE
SMS(GSM)BASED HOME AUTOMATION SYSTEM PROJECTS-ECE/EEE/E&I/ICE
 
Cours0 presentation carte arduino
Cours0   presentation carte arduinoCours0   presentation carte arduino
Cours0 presentation carte arduino
 
Presentation arduino
Presentation arduinoPresentation arduino
Presentation arduino
 
Présentation Arduino par Christian, F5HOD
Présentation Arduino par Christian, F5HODPrésentation Arduino par Christian, F5HOD
Présentation Arduino par Christian, F5HOD
 
Projet de fin d'etude :Control d’acces par empreintes digitale
Projet de fin d'etude :Control d’acces par empreintes digitaleProjet de fin d'etude :Control d’acces par empreintes digitale
Projet de fin d'etude :Control d’acces par empreintes digitale
 
CV Jenhani 2015
CV Jenhani 2015CV Jenhani 2015
CV Jenhani 2015
 
Cours4 allumer une led sur la carte arduino
Cours4   allumer une led sur la carte arduinoCours4   allumer une led sur la carte arduino
Cours4 allumer une led sur la carte arduino
 
KPI measurement
KPI measurementKPI measurement
KPI measurement
 
War Field Spying Robot with Fire Fighting Alarm.
War Field Spying Robot with Fire Fighting Alarm.War Field Spying Robot with Fire Fighting Alarm.
War Field Spying Robot with Fire Fighting Alarm.
 
Cours16 ressources pour arduino
Cours16   ressources pour arduinoCours16   ressources pour arduino
Cours16 ressources pour arduino
 
Call Setup Success Rate Definition and Troubleshooting
Call Setup Success Rate Definition and Troubleshooting Call Setup Success Rate Definition and Troubleshooting
Call Setup Success Rate Definition and Troubleshooting
 
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTHAUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
 
Présentation de projet de fin d’études
Présentation de projet de fin d’étudesPrésentation de projet de fin d’études
Présentation de projet de fin d’études
 
Metal Detector : A Working Model
Metal Detector : A Working ModelMetal Detector : A Working Model
Metal Detector : A Working Model
 
presentation projet domotique
presentation projet domotiquepresentation projet domotique
presentation projet domotique
 
Rapport projet Domotique
Rapport projet DomotiqueRapport projet Domotique
Rapport projet Domotique
 
63077585 idle-mode-parameter-optimization
63077585 idle-mode-parameter-optimization63077585 idle-mode-parameter-optimization
63077585 idle-mode-parameter-optimization
 

Similar to Interface OV7670 Camera Module with Arduino

Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2srknec
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGVKUNJBIHARISINGH5
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
 
Mobile robotic platform to gathering real time sensory data in wireless perso...
Mobile robotic platform to gathering real time sensory data in wireless perso...Mobile robotic platform to gathering real time sensory data in wireless perso...
Mobile robotic platform to gathering real time sensory data in wireless perso...Alexander Decker
 
Cameratrainingsergiopublic 120904235733-phpapp02(2)
Cameratrainingsergiopublic 120904235733-phpapp02(2)Cameratrainingsergiopublic 120904235733-phpapp02(2)
Cameratrainingsergiopublic 120904235733-phpapp02(2)KASIM DUDEKULA
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using ArduinoBalajiK109
 
Automatic Enable and Disable Speed Breaker
Automatic Enable and Disable Speed BreakerAutomatic Enable and Disable Speed Breaker
Automatic Enable and Disable Speed BreakerSai Kumar Vegireddy
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller IJECEIAES
 
Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller systemnugnugmacmac
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...IOSR Journals
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...IOSR Journals
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...IOSR Journals
 

Similar to Interface OV7670 Camera Module with Arduino (20)

Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Mini project
Mini projectMini project
Mini project
 
mini project
mini projectmini project
mini project
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
 
Mobile robotic platform to gathering real time sensory data in wireless perso...
Mobile robotic platform to gathering real time sensory data in wireless perso...Mobile robotic platform to gathering real time sensory data in wireless perso...
Mobile robotic platform to gathering real time sensory data in wireless perso...
 
Cameratrainingsergiopublic 120904235733-phpapp02(2)
Cameratrainingsergiopublic 120904235733-phpapp02(2)Cameratrainingsergiopublic 120904235733-phpapp02(2)
Cameratrainingsergiopublic 120904235733-phpapp02(2)
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using Arduino
 
Automatic Enable and Disable Speed Breaker
Automatic Enable and Disable Speed BreakerAutomatic Enable and Disable Speed Breaker
Automatic Enable and Disable Speed Breaker
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
 
Am044253258
Am044253258Am044253258
Am044253258
 
Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller system
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
 
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...Implementation of an Improved Microcontroller Based Moving Message Display Sy...
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
 
E010132736
E010132736E010132736
E010132736
 

Recently uploaded

Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRdollysharma2066
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)861c7ca49a02
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls DubaiDubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubaikojalkojal131
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...Amil Baba Dawood bangali
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...Amil baba
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一C SSS
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证gwhohjj
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil Baba Dawood bangali
 
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...Amil baba
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightKomal Khan
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...amilabibi1
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一C SSS
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作f3774p8b
 

Recently uploaded (20)

Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
 
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Serviceyoung call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls DubaiDubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
Dubai Call Girls O525547819 Spring Break Fast Call Girls Dubai
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun Tonight
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
young call girls in  Khanpur,🔝 9953056974 🔝 escort Serviceyoung call girls in  Khanpur,🔝 9953056974 🔝 escort Service
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作
 

Interface OV7670 Camera Module with Arduino

  • 1. INTRODUCTION In this project our aim is to interface OV7670 camera module with ATmega based Arduino Microcontroller board. Camera modules are widely used in the world of electronics. Our aim is to show how to connect, configure and get a test image using a small program on java, it will be an excellent starting point for further experiments. Currently ov7670 camera is the affordable image acquisition module for embedded applications. Our goal is to interface the camera with Arduino which are much efficient, low cost easily available and easy to configure. These are the major reasons for which here an Arduino is used. In spite of the following advantages there are some disadvantages too, that are: o Very limited I/O pins o Limited memory capacity o Slow Processing speed The above disadvantages are the challenges in interfacing the camera with an Arduino and these are to be overcome by applying some Data handling and manipulation techniques. The OV7670 Camera module talks over a modified I2C protocol that is known as SCCB (Serial Camera Control Bus). This protocol is intended to be used with OmniVision’s camera modules. This project is intended to provide a low cost and easily configurable image capturing solution, that can be used in real-time Time-lapse photography, image acquisition systems or as security cameras. The camera module is accessed by SCCB (I2C) protocol by the Arduino. The Data sent by the camera is parallel over data channel D0-D7, Data received by the Arduino is sent to the computer over serial communication and this follows the rule of sending pixel data of one row at a time. This help to overcome the problem of slow processing and slow data transmission rate of the Arduino boards 1
  • 2. Figure 1: Block diagram for Camera-Arduino interface 2 OV7670 camera module Arduino UNOI2C COMPUTER Seri al
  • 3. HARDWARE 2.1 CAMERA MODULE (OV7670) The camera module has an onboard CMOS sensor designed for mobile application where low power consumption and small size are of utmost importance. Proprietary sensor technology utilizes advanced algorithms to cancel Fixed Pattern Noise (FPN), eliminate smearing, and drastically reduce blooming. All required camera functions are programmable through the Serial Camera Control Bus (SCCB) interface. The device can be programmed to provide image output in various fully processed and encoded formats. Resolution VGA (640 x 480); - QVGA (320 x 240); - CIF (352 x 240); - QCIF (176 × 144) Transfer rate up to 30 fps Image encoding RGB 565/555, YUV / YCbCr 4: 2: 2 Interface I2C interface interaction / SCCB Table 1: Camera module Specification 2.2 Two Wire SCCB Interface The modified 2-wire implementation allows for a SCCB master device to interface with only one Slave device. This 2-wire application is implemented in the camera chip reduced pin package products where the SCCB_E signal is not available externally. Figure 2: Two Wire SCCB Interface 3
  • 4. 2.3 Pin Functions Signal Name Signal Type Description SCCB_Ea Output Master drives SCCB_E at logical 1 When the bus is idle. Drives at logical 0 when the master asserts Transmissions or the system is in Suspend mode. SIO_C Output Master drives SIO_C at logical 1 when The bus is idle. Drives at logical 0 and 1 when SCCB_E is driven At 0. Drives at logical 0 when the system is Suspend mode. SIO_D I/O Serial I/O Signal 0 Input and Output - remains floating when the bus is idle and drives to logical 0 when the system is in Suspend Mode. Table-2: Master Device Pin Descriptions Signal Name Signal Type Description SCCB_Ea Input Input pad can be shut down when the System is in Suspend mode. SIO_C Input Input pad can be shut down when the System is in Suspend mode. SIO_D I/O Serial I/O Signal 0 Input and Output - input pad can be shut down When the system is in Suspend mode. Table-3: Slave Device Pin Descriptions 2.4 Application Some of the applications of camera module are: PC Camera, and Cellular phones, Video conference equipment, Machine vision, Security camera, Biometrics, Digital Still Cameras 4
  • 5. 2.5 ARDUINO Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. Microcontroller ATmega 328-p Operating Volts 5V Input Voltage 7-20v Digital I/O Pins 14 Analog Input 6 PWM pins 6 Flash Memory 32 Kb SRAM 2 Kb EEPROM 1 Kb Clock Speed 16 MHz Current 50 mA DC Current at Digital I/O 20 mA Table 4: Arduino UNO Specification 5
  • 6. CAMERA-ARDUINO INTERFACING CIRCUIT For interfacing the camera module with the Arduino we need a circuit that will provide the mount points as well as the voltage Pull-up and Pull-down facilities. below is a Typical Block representation of the hardware connection between OV7670 and Arduino UNO. Oscillator used here is optional, we will be Arduino’s onboard crystal oscillator is being used to generate the XCLK. 3.1 Block diagram for Arduino-Camera interfacing Arduino Figure 3: Block representation of Connection 6 Camera Module SCL, SDA HREF, VSYNC DATA PCLK PWDN +3.3V, GND Oscillator XCLK
  • 7. 3.2 Pin Configuration Pin configuration is one of the most important data that must be kept in mind while designing the interfacing circuit and must be followed to ensure proper communication Arduino and Camera Module. Pin Type Description VDD Supply Power supply GND Supply Ground level SDIOC Input SCCB clock SDIOD Input/output SCCB data VSYNC Output Vertical synchronization HREF Output Horizontal synchronization PCLK Output Pixel clock XCLK Input System clock D0-D7 Output Video parallel output RESET Input Reset (Active low) PWDN Input Power down (Active high) Table 5: Arduino Pin Configuration 7
  • 8. 3.3 Circuit Diagram The Arduino is rated for 5V and the camera module is of 3.3V. Hence, the voltage divider for the XCLK will be used (two resistors of 4.7KΩ) to pull down the voltage to ~3V. Furthermore, OV7670 does not provide output voltages higher than 3.3V which is a quite low for Arduino to reads the input as high (5V), so we will connect pull-up resistors. Here external signal is provided to D12 to capture image and to D8 for image to PDF conversion, both are active high with 0.3 sec high pulse. Figure 4: Circuit Diagram for OV7670-Arduino Interfacing [Source: privateblog.info] PROGRAM FLOW FOR INTERFACING 8
  • 9. OV7670 camera module captures image during LOW at VSYNC and sends out row data during the HIGH at HREF. The Arduino receives the parallel data input from camera module image sensor and converts it to the serial data and also provides initialization to the registers of the OV7670 Module. Figure 5: Typical Data flow diagram Basic steps in the code are: 1. Generation of PWM 2. Start I2C Communication 3. Write default register values 4. Receive data from camera 9 Arduino
  • 10. Figure 6: Flow diagram for initialization of camera module 4.1 Configure Arduino that will give 8 MHz at Pin D11 DDRB | = (1 << 3); // pin 11, The ASSR & = ~ (_BV (EXCLK) | _BV (the AS2)); TCCR2A = (1 << COM2A0) | (1 << WGM21) | (1 WGM20 <<); TCCR2B = (1 << WGM22) | (CS20 1 <<); OCR2A = 0; // (F_CPU) / (2 * (X + 1))of d0 of low- DDRC & = ~ 15; // d3 camera DDRD & = ~ 252; // d7-d4 and interrupt pins 10
  • 11. 4.2 Configure I2C interface TWSR & = ~ 3; // preset for the disable the TWI TWBR = 72; // set to 100 kHz Figure 7: Flow Diagram of I2C communication 4.3 Initialization of Camera Module Figure 8: Write default Register values 11 ARDUINO Write Default register Values with I2C Camera Module
  • 12. WrReg (0x12, 0x80); _delay_ms (100); wrSensorRegs8_8 (ov7670_default_regs); WrReg (REG_COM10, 32); // PCLK does not HBLANK Locality toggle on. 4.4 Receiving Image bytes The camera module sends parallel image data bytes where it is buffered till receiving full row data then this data is sent over serial communication to the pc as shown in figure 9. Figure 9: Receiving Image Bytes 12 OV7670 camera Module Arduino UNO ComputerParallel Data Serial Data MUX Buff er RAM
  • 13. OV7670 MODULE DATA TRANSFER The SIO_C signal is a single-directional, active-high, control signal that must be driven by the master device. It indicates each transmitted bit. The master must drive SIO_C at logical 1 when the bus is idle. A data transmission starts when SIO_C is driven at logical 0 after the start of transmission as shown in figure 10 & 11. A logical 1 of SIO_C during a data transmission indicates a single transmitted bit. Thus, SIO_D can occur only when SIO_C is driven at 0. 5.1 Timing Diagram Figure 10: SCCB Timing Diagram Figure 11: Horizontal Timing Diagram 13
  • 14. Camera module sends row data between every HSYNC LOW and during each HSYNC HIGH, the HREF follows the HIGH and both of this occurs between the two HIGH of the VSYNC signal as shown in figure 12, that means all the row data is sent over the VSYNC at LOW. Figure 12: VGA Frame Timing 14
  • 15. PIXEL DATA BYTE TO IMAGE CONVERSION For this purpose a java program is being used, that will grab the serial input data (bits) stream from Arduino at specific COM port that will generate a valid BMP image from it , the code works as illustrated below in figure 13. 6.1 Program Work Flow Figure 13: Algorithm of data to image generation 15
  • 16. 6.2 COM Port selection (JAVA) if(!enumeration.hasMoreElements()) break; portId = (CommPortIdentifier)enumeration.nextElement(); if(portId.getPortType() == 1) { System.out.println((new StringBuilder()).append("Port name: ").append(portId.getName()).toString()); SimpleRead simpleread; if(portId.getName().equals("COM5")) simpleread = new SimpleRead(); 6.3 Port parameters (JAVA) serialPort = (SerialPort)portId.open("SimpleReadApp", 1000); inputStream = serialPort.getInputStream(); serialPort.setSerialPortParams(0xf4240, 8, 1, 0); int i = 0; 6.4 Waiting for an (data stream) input from Arduino (JAVA) do // infinite loop starts here { System.out.println("started the if else "); 16
  • 17. while(!isImageStart(inputStream, 0)) // image Generation code goes here } while(true); } catch(Exception exception) 6.5 Image generation from received data stream (JAVA) 17
  • 18. Figure 14: Algorithm for image generation from received data steam while(!isImageStart(inputStream, 0)) { System.out.println("Looking for image"); System.out.println((new StringBuilder()).append("Found image: ").append(i).toString()); for(int j = 0; j < 240; j++) { for(int l = 0; l < 320; l++) { int j1 = read(inputStream); ai[j][l] = (j1 & 0xff) << 16 | (j1 & 0xff) << 8 | j1 &0xff; } } for(int k = 0; k < 240; k++) { for(int i1 = 0; i1 < 320; i1++) ai1[i1][k] = ai[k][i1]; } BMP bmp = new BMP(); bmp.saveBMP((newStringBuilder()).append("c:/out/").append(i+ +).append(".bmp").toString(), ai1); System.out.println((new StringBuilder()).append("Saved image: ").append(i).toString()); 18
  • 19. } HANDLING MULTIPLE SCANS (CMD) It is sometime needed to perform multiple scans. That means the scanning mechanism is provided input for scan again and again, then this program as shown in figure 15 proves to be useful it takes the user inputs to perform a certain number of scans and then control the Arduino or any other microcontroller to perform the scanning and PDF conversion till it reaches the provided number of scans. Figure 15: Algorithm to handle multiple Scans 19
  • 20. IMAGE TO PDF CONVERSION (CMD) Now after generating the images we need to convert those images to a PDF file for which we will use the software ConvertITP.EXE. following is the algorithm for Image to PDF conversion. Figure 16: Algorithm Image to PDF generation 8.1 Code for the Image to PDF conversion @echo off echo by somnath echo . 20
  • 21. set CITP="%ProgramFiles%Softinterface, IncConvert Image To PDFConvertITP.EXE" set InputFolder=C:out set OutputFolder=C:out REM Convert from JPG to PDF %CITP% /S%InputFolder%*.bmp /T%OutputFolder%all_img.PDF /F0 /+ ren %InputFolder%all_img.PDF all_img-%date:~10,4%%date:~7,2% %date:~4,2%_%time:~0,2%%time:~3,2%.pdf mkdir %InputFolder%original_images_%date:~10,4%%date:~7,2% %date:~4,2%_%time:~0,2%%time:~3,2% move /Y %InputFolder%*.bmp %InputFolder%original_images_%date:~10,4% %date:~7,2%%date:~4,2%_%time:~0,2%%time:~3,2% echo ` echo DONE! echo . exit 21
  • 22. SOFTWARE SETUP GUIDE -Extract the Extra.zip file. Then copy: "win32com.dll" to "..jdk1.8.0_74jrebin” Directory. the "comm.jar" in "...jdk1.8.0_74jrelibext" "javax.comm.properties" in "...jdk1.8.0_74jrelib" Copy “out” folder to C: Drive Install the software “Installme.exe” Double click on SCAN.bat from c:out folder It will start the program 22
  • 23. CONCLUSION Interfaced the OV7670 Camera module with Arduino at 8 MHz XCLK pulse which is generated by the Arduino board itself. Arduino talk to the camera module using I2C to write/read camera registers. Frames are read one by one in a brute- force manner. Currently the camera module is configured to work with QCIF (176x144) format in order to eliminate timing issues. Pixels of a given frame are stored in the java program and on completion of whole row data the JAVA program generates the valid BMP image. The most challenging task for interfacing Arduino &Camera is the low memory capacity of Arduino microcontroller due to which we are unable to store a full image at once, to overcome this the JAVA program is implemented that receive the Data Bits of one row at a time. It has also to be noted that there are microcontrollers out there that actually have dedicated peripherals/devices for interfacing with camera modules such as the OV7670, but the interface of OV7670 Camera Module with Arduino Microcontroller provides us a easy to use, maintain, low cost and a configurable system that can be used in various fields of image acquisition. 23
  • 24. References [1] N. Sriskanthan and Tan Karand. “Bluetooth Based Home Automation System”. Journal of Microprocessors and Microsystems, Vol. 26, pp.281-289, 2002. [2] Al-Ali, Member, IEEE & M. AL-Rousan,“Java-Based Home Automation System R.” IEEE Transactions on Consumer Electronics, Vol. 50, No. 2, MAY 2004 [3] The Java Tutorials: All About Sockets [Online]. Available: http://docs.oracle.com/javase/tutorial/networking/sockets, March 2013 [4] L. Lo Presti, M. La Cascia, “Real-Time Object Detection in Embedded Video Surveillance Systems,” Ninth International Workshop on Image Analysis for Multimedia Interactive Services, 7-9 May 2008, pp. 151-154. [5] http://arduino.cc/en/Main/ArduinoBoardADK [6] https://forum.arduino.cc/index.php?topic=211741.0 [7] http://www.dejazzer.com/coen4720/labs/lab11_camera.pdf 24