Professional Documents
Culture Documents
Cmos Camera Interface Arduino Manual
Cmos Camera Interface Arduino Manual
Manual for
( Sr. No:............................)
AIM: To study the CMOS Camera interface to ARDUINO UNO and display the image in TFT
LCD Display.
ARDUINO:
Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header and a reset
button. It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.. You
can tinker with your Uno without worrying too much about doing something wrong, worst case
scenario you can replace the chip for a few dollars and start over again.
The Arduino UNO is the best board to get started with electronics and coding. If this is your first
experience tinkering with the platform, the UNO is the most robust board you can start playing
with. The UNO is the most used and documented board of the whole Arduino family.
Getting started
The Getting Started with Arduino Uno page contains all the information you need to configure
your board, use the Arduino Software (IDE), and start tinkering with coding and electronics.
From the Tutorials section you can find examples from libraries and built-in sketches as well
other useful information to expand your knowledge of the Arduino hardware and software.
Tech specs
Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz
LED_BUILTIN 13
Length 68.6 mm
Width 53.4 mm
Getting Started with Arduino UNO
This document explains how to connect your Uno board to the computer and upload your first
sketch. The Arduino Uno is programmed using the Arduino Software (IDE), our Integrated
Development Environment common to all our boards and running both online and offline. For
more information on how to get started with the Arduino Software visit the Getting Started page.
Use your Arduino Uno on the Arduino Web IDE
All Arduino boards, including this one, work out-of-the-box on the Arduino Web Editor, you only
need to install Arduino Create Agent to get started.
The Arduino Web Editor is hosted online, therefore it will always be up-to-date with the latest
features and support for all boards. Follow this simple guide to start coding on the browser and
upload your sketches onto your board.
Use your Arduino Uno on the Arduino Desktop IDE
If you want to program your Arduino Uno while offline you need to install the Arduino Desktop
IDE The Uno is programmed using the Arduino Software (IDE), our Integrated Development
Environment common to all our boards. Before you can move on, you must have installed the
Arduino Software (IDE) on your PC, as explained in the home page of our Getting Started.
Connect your Uno board with an A B USB cable; sometimes this cable is called a USB printer
cable
The USB connection with the PC is necessary to program the board and not just to power it up.
The Uno automatically draw power from either the USB or an external power supply. Connect
the board to your computer using the USB cable. The green power LED (labelled PWR) should
go on.
Install the board drivers
If you used the Installer, Windows - from XP up to 10 - will install drivers automatically as soon
as you connect your board.
If you downloaded and expanded the Zip package or, for some reason, the board wasn't properly
recognized, please follow the procedure below.
While in the Control Panel, navigate to System and Security. Next, click on System. Once the
System window is up, open the Device Manager.
Look under Ports (COM & LPT). You should see an open port named "Arduino UNO
(COMxx)". If there is no COM & LPT section, look under "Other Devices" for "Unknown
Device".
Right click on the "Arduino UNO (COmxx)" port and choose the "Update Driver Software"
option.
Finally, navigate to and select the driver file named "arduino.inf", located in the "Drivers"
folder of the Arduino Software download (not the "FTDI USB Drivers" sub-directory). If you are
using an old version of the IDE (1.0.3 or older), choose the Uno driver file named "Arduino
UNO.inf"
See also: step-by-step screenshots for installing the Uno under Windows XP.
Open your first sketch
Open the LED blink example sketch: File > Examples >01.Basics > Blink.
Open the LED blink example sketch: File > Examples >01.Basics > Blink.
You'll need to select the entry in the Tools > Board menu that corresponds to your Arduino board.
UNO BoardType
Select the serial device of the board from the Tools | Serial Port menu. This is likely to be COM3
or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can
disconnect your board and re-open the menu; the entry that disappears should be the Arduino
board. Reconnect the board and select that serial port.
Upload the program
Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see
the RX and TX leds on the board flashing. If the upload is successful, the message "Done up-
loading." will appear in the status bar.
UNO Upload
A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to
blink (in orange). If it does, congratulations! You've gotten Arduino up-and-running. If you have
problems, please see the troubleshooting suggestions.
Learn more on the Desktop IDE
See this tutorial for a generic guide on the Arduino IDE with a few more infos on the Prefer-
ences, the Board Manager, and the Library Manager.
This module allows you to capture images in VGA format (640x480). It can perform some initial
processing and transfer the images to microcontrollers, such as the Arduino, via the SCCB
interface.
The camera unit allows you to form images in other formats like CIF (352x240) and others.
Manual adjustments up to 40x30 are also possible. The maximum image transfer rate (VGA) can
reach 30 frames per second. The camera also performs pre-processing of images, such as expo-
sure control, amplification, white balance, and more.
Also supported are various image encoding options (YUV, various types of RGB). Data transfer
is carried out using the SCCB protocol.
OV7670 Specs
Important: Both the OV7670 camera module and 2.8 inch TFT graphic lcd are working on 3.3v
power supply where as my arduino is working on 5v. So i used level shifters in my project for
interfacing arduino with camera and tft. I advise you to use arduino powered on 3.3v power
supply or better to used arduino nano whose 3.3v operating board is perfect for our project, this
will reduce extra level shifter hardware from project.
I found a pretty neat and clean circuit on internet which i used to build my project. You can
replace level shifter ics with normal level shift resistor circuit.
OV7670 camera with arduino and 2.8 inch tft LCD
Interfacing a 2.8 inch SPI TFT that has a ILI9341 chip to an Arduino Uno.
All you need is eight 1K resistors. Most people use a 4050 IC.
LiveOV7670Library
Adafruit_GFX_Library
One just need to make the circuit. Burn the code in arduino and its all done. Your camera will
start working. For future work one can interface an SD card with arduino and can save the
camera feed in SD card to view latterly as video or image. The project can be used as security
camera.
// set EXAMPLE to EXAMPLE_TFT_BUFFERED in setup.h to activate
#include "setup.h"
#if EXAMPLE == 1
#include "Arduino.h"
#include "Adafruit_ILI9341_mod.h"
#include <BufferedCameraOV7670_QQVGA_10hz.h>
#include <BufferedCameraOV7670_QQVGA.h>
#include <BufferedCameraOV7670_QVGA.h>
#include <BufferedCameraOV7670_QQVGA_10hz_Grayscale.h>
#include "GrayScaleTable.h"
uint8_t rotation=3;
#define GRAYSCALE_PIXELS 0
#if GRAYSCALE_PIXELS == 1
BufferedCameraOV7670_QQVGA_10hz_Grayscale camera;
#else
BufferedCameraOV7670_QQVGA_10hz camera(CameraOV7670::PIXEL_RGB565);
//BufferedCameraOV7670_QQVGA camera(CameraOV7670::PIXEL_RGB565,
BufferedCameraOV7670_QQVGA::FPS_5_Hz);
//BufferedCameraOV7670_QQVGA camera(CameraOV7670::PIXEL_RGB565,
BufferedCameraOV7670_QQVGA::FPS_2_Hz);
//BufferedCameraOV7670_QVGA camera(CameraOV7670::PIXEL_RGB565,
BufferedCameraOV7670_QVGA::FPS_2p5_Hz);
#endif
noInterrupts();
camera.waitForVsync();
camera.ignoreVerticalPadding();
void sendLineToDisplay() {
if (screenLineIndex > 0) {
screenLineStart();
#if GRAYSCALE_PIXELS == 1
for (uint16_t i=0; i<camera.getLineLength(); i++) {
sendPixelByte(graysScaleTableHigh[camera.getPixelByte(i)]);
sendPixelByte(graysScaleTableLow[camera.getPixelByte(i)]);
}
#else
for (uint16_t i=0; i<byteCountForDisplay; i++) {
sendPixelByte(camera.getPixelByte(i));
}
#endif
screenLineEnd();
}
}
void screenLineStart() {
if (screenLineIndex > 0) screenLineIndex--;
tft.startAddrWindow(screenLineIndex, 0, screenLineIndex, screen_w-1);
// tft.setAddrWindow(screenLineIndex, 0, screenLineIndex, screen_w-1);
}
void screenLineEnd() {
tft.endAddrWindow();
}
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
#if GRAYSCALE_PIXELS == 1
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
asm volatile("nop");
#endif
#endif