Remotely Controlled VGA Camera – Overview Using Arduino

Remotely Controlled VGA Camera Overview1

The idea behind this project was very straightforward: design an inexpensive remotely controlled system capable of taking still pictures and uploading them to a remote file storage with a camera to be activated by either remote commands or sensor events. And after numerous brain storms the following solution has been found.In base configuration the system comprises of at least two parts: main (MCU) and transport modules. Main module is driven by ATMega1280 chip with four hardware serial ports, dedicated I2C realtime clock and thermometer/thermostat, primary and backup stabilized power supplies, microSD card, parallel interface for 2 lines x 16 chars alphabetical LCD display, speaker output, four independent digital inputs for sensors, one input line for tamper detection, two 10A 240 VAC relay outputs, JTAG and ISP interfaces for programming/debugging and numerous extension connectors. The module also has USB-to-Serial interface allowing to reprogram, reconfigure and debug the system by connecting it to a desktop PC/notebook via USB port.Interaction with the outer world is achieved by using unified interchangeable transport modules to make the system independent from any communication interface. For example, if the system is to be deployed at a remote location then the most appropriate way of communication would be GSM network accessed through GPRS modem.Remotely Controlled VGA Camera Overview1

Potentially, transport module could provide just about any interface, for example, Ethernet, Zigbee, Bluetooth or something else. In this instructable we will be using GSM transport module.In this particular application the project used as a security system with a picture triggered by PIR sensor and immediate uploading to a remote storage. The system could be set to active/inactive mode by either a RC from broken TV/DVD or by sending SMS. Apart from sensors picture may also be requested by sending SMS.

Step 1: Remotely Controlled VGA Camera – Circuit Diagram

Let’s start from designing schematics. As an electronic design automation tool called gEDA is chosen ( Despite its enormous popularity Eagle system was eventually rejected as the dimensions of main PCB are not covered by Eagle’s free license and the cost of license of substantial. At the same time, gEDA has enough capabilities to allow us design this project.

Two circuit diagrams need to be designed – one for main module and one for GSM transport module.

Step 2: Remotely Controlled VGA Camera – PCB design

Using PCB tool ( design PCB layouts for both boards. We route them manually to achieve best possible results and taking into account technological capabilities of a PCB manufacturer. An inexpensive Chinese fabrication house Pcbart has been picked up, its capabilities for ‘standard PCBs’ might be found at To bring overall cost down we design two layer boards.
After submitting Gerber files for both PCBs in two weeks our boards are finally delivered. At the same time ordering electronic components in accordance with BOM files so that upon PCBs arrival we will be able to start soldering straight away.

Step 3: Remotely Controlled VGA Camera – Soldering

Not just saying that soldering of those small SMD components is possible, it is actually easy. It is fun. The most difficult component to be soldered is ATMega1280. But all we need to accomplish our mission is:

– A clamp tool with magnifier (available at,
– A soldering station. We used old Duratech TS1560 and were pretty happy with the results,
– Soldering paste in syringe packaging (we used SMD291SNL available at

That is it. That is all we need. Believe us, you can do it.

When soldering is completed, clean your PCBs and do visual check. If it is all good, time to flash bootloader.

Step 4: Remotely Controlled VGA Camera – Flashing Bootloader

A bootloader is a compact executable code often flashed in upper program memory area implementing basic transfer protocol and facilitating self-programming function, making possible firmware updates without need to have an external programmer.

Next we need an ISP programmer, let’s take as an example USBtinyISP AVR ISP Atmel Programmer (for example, this one: It costs around $15USD, supplied with two flat cables (for 10 and 6 pin connectors) and is capable of providing a flashing board with +5V. Download USB drivers required for the programmer, they are available at Connect the programmer to a PC over a USB cable, Windows should report about newly found device and will ask for drivers. Unzip and install just downloaded archive. Now in Device Manager a new device called USBtinyISP AVR Programmer should appear in LibUSB-Win32 Devices group.

Donwload and install WinAVR from Open Command Prompt and type ‘avrdude’ – you should get list of options as a result.

Connect main module and the programmer with 10-wire flat cable but before make sure that programmer’s ‘PWR’ jumper is closed – in this case the module will be powered by USBtiny.

Donwload latest firmware from Already compiled bootloader could be found at CPP\BootLoader\ATmegaBOOT_168_atmega1280.hex. Now it could be flashed to the board, type the following line in Command Prompt:

avrdude -p m1280 -c usbtiny -U flash:w:ATmegaBOOT_168_atmega1280.hex

When programming is done, set FUSE bits with the follwoing consecutive commands:

avrdude -p m1280 -c usbtiny -U hfuse:w:0x98:m
avrdude -p m1280 -c usbtiny -U lfuse:w:0xD7:m
avrdude -p m1280 -c usbtiny -U efuse:w:0xFF:m

Disconnect USBtiny from your PC and main module. Now the main module may be programmed without USBtiny.

Step 5: Remotely Controlled VGA Camera – Flashing Firmware

Connect the main module to external power supply and to PC via USB, Windows should report about newly found virtual COM port and will install the drivers automatically. Alternatively, VCP drivers could be downloaded from and installed manually. When it is done, in Device Manager a new device called USB Serial Port should appear in Ports (COM&LPT) group.

To activate bootloader hold SB1 button while the module is being powered up and until red LED starts blinking. Without releasing SB1 enter the following command (substitute ‘com4’ with appropriate COM port):

avrdude -p m1280 -c avrisp -P com4 -b 57600 -U flash:w:DefendLineII.hex

Note, that this time we use ‘avrisp’programmer type and explicitly defined COM port and baud rate.

When the flashing process is completed the module automatically restarts and it is ready for configuration process.

The good news is that the firmware comes with source code – you are free to modify it to meet your own needs!Remotely Controlled VGA Camera Overview Schematic1

Step 6: Remotely Controlled VGA Camera – Server Side

Server-side application is implemented as a set of PHP scripts using MySQL database as data storage. If you want your scripts to be easy accessible from GSM network it would be very reasonable to install them at a host provided by a webhoster. The following applications should be available on a hosting site: PHP5, PHPMyAdmin, MySQL.

Using create_struct.sql from the archive attached here, create a new DB structure by means of PHPMyAdmin. Grant full privileges to a DB user that will be used to access the database.

Copy the whole structure PHP/dl/*.* to your remote host. Make sure that *.php files have permissions for execution and upload and mixed folders have write permissions.

Now a few modifications in /dl/include/ must be done. Redefine db_user and db_pass by filling them with database  credentials. Fill web_user_MD5 and web_pwd_MD5 with MD5 sums, calculated for web username and web password  appropriately.

You should be able to login to access DefendLine data http://yourhost/dl/dlRep.php. There should be an empty list.

Imitate some data submitted by a remote security system. Open the following link: http://localhost/dl/dlLog.html, fill the fields appeared then submit the form. Check http://localhost/dl/dlRep.php again. There should be one record.  Setting up procedure complete.

The picture attached shows our web interface with some pictures uploaded.

Step 7: Remotely Controlled VGA Camera – Assembling

Connecting everything together: inserting SIM card, attaching GSM antenna, connecting GSM module and Main Module with flat cable, inserting MicroSD card, plugging in PIR sensor and Camera Module.

Read more: Remotely Controlled VGA Camera – Overview

Leave a Comment

Your email address will not be published. Required fields are marked *