Have you ever been working on a microcontroller project in Proteus and wished you could simulate a camera module without having to buy the actual hardware? Well, I’ve been there too, and that’s exactly what led me to create the ProteusCAM simulation model.
What Does ProteusCAM Actually Do?
The ProteusCAM model is pretty straightforward, it’s a virtual camera that captures a portion of your desktop and sends it over serial communication, just like a real camera module would. When you trigger it, it literally takes a screenshot of a specific area on your screen, converts it to a simple black and white image, and transmits the data via UART.
The coolest part? It even draws a red rectangle around the area it’s capturing, so you can see exactly what the “camera” is looking at. It’s like having a magic window into your desktop that your microcontroller can peer through.
Why I Built It This Way
I wanted something that felt real but was also practical for simulation purposes. Here’s what I decided on:
Screen Capture Instead of Static Images: Sure, I could have just loaded pre-made images, but where’s the fun in that? By capturing the actual screen, you can test your image processing algorithms with real, changing content. Move your mouse, open different windows, display test patterns – your simulated camera sees it all.
Simple 1-bit Format: I kept the image format super simple, just black and white pixels. This makes the data easier to handle in your microcontroller code and keeps transmission times reasonable. Plus, many real embedded vision applications start with simple binary images anyway.
UART Communication: I chose standard serial communication because it’s what most people are comfortable with, and it’s how many real camera modules communicate. No fancy protocols or USB simulation needed.
Smart Parameter Handling: ProteusCAM automatically validates and adjusts configuration parameters. If you set invalid dimensions, it corrects them to valid ranges and logs the changes, preventing simulation errors while keeping you informed.
Features
- Screen Capture: Captures a rectangular area from your desktop
- Visual Feedback: Draws a red rectangle around the capture area
- Serial Communication: Transmits image data via UART
- Configurable Resolution: Adjustable width and height parameters
- 1-bit Format: Converts captured images to monochrome (black/white)
- Trigger-based: Image capture initiated by rising edge on TRIG pin

How It Works
- Trigger Detection: Rising edge on TRIG pin initiates capture
- Screen Capture: Captures specified region from center of screen
- Visual Feedback: Draws red rectangle around capture area
- Image Processing: Converts to 1-bit monochrome format
- Data Transmission: Sends via UART with custom protocol
Pin Configuration
The ProteusCAM model has four pins:
Pin Name | Type | Direction | Description |
---|---|---|---|
TX | Digital Output | Output | Serial data transmission pin |
TRIG | Digital Input | Input | Trigger pin to initiate image capture |
VCC | Analog Power | Power | Power supply pin (must be > 4.95V for proper operation) |
GND | Analog Power | Power | Ground reference pin (must be connected for proper operation) |
Serial Communication
ProteusCAM serial communication is implemented with a proper state machine that handles start bits, data bits, and stop bits just like real UART hardware. The protocol I designed is pretty simple:
- Baud Rate: 9600, 19200 bps
- Data Format: 8 bits, no parity, 1 stop bit
- Protocol: Custom frame format (see below)
[HEADER][LEN_HI][LEN_LO][INDEX][FORMAT][W_HI][W_LO][H_HI][H_LO][IMAGE_DATA][CRC]
- HEADER: 0xA5 (constant)
- LEN_HI/LEN_LO: Total frame length (16-bit, big-endian)
- INDEX: Frame index (always 0)
- FORMAT: Image format (0 = 1-bit monochrome)
- W_HI/W_LO: Image width in pixels (16-bit, big-endian)
- H_HI/H_LO: Image height in pixels (16-bit, big-endian)
- IMAGE_DATA: Packed 1-bit pixel data
- CRC: XOR checksum of all bytes
ProteusCAM Resolution & Image Format Details
- Resolution Configuration:
- Width: 8 to 240 pixels (must be divisible by 8 for byte alignment)
- Height: 8 to 320
- Image Format:
- Monochrome 1-bit (black & white)
- Packing: 8 pixels per byte (MSB first)
- Thresholding: Pixels with grayscale value greater than 128 are converted to white (
1
); others to black (0
)
- Frame Size Calculation:
- Maximum frame: 240×320 = 76,800 pixels = 9,600 bytes of image data
- Complete frame: 9,610 bytes including the 10-byte header
- Transmission time: About 5 seconds at 19200 baud
Capture Area Positioning
Default Behavior – Center Capture: ProteusCAM automatically captures from the center of your desktop, not from a corner or random location.
The Math Behind It:
The formula ((screen_width - width) / 2, (screen_height - height) / 2)
calculates the top-left corner position of the capture rectangle to center it perfectly.
Example with real numbers:
- Your screen resolution: 1920×1080 pixels
- ProteusCAM configured for: 64×64 pixels
- Calculation:
- X position: (1920 – 64) ÷ 2 = 1856 ÷ 2 = 928 pixels from left
- Y position: (1080 – 64) ÷ 2 = 1016 ÷ 2 = 508 pixels from top
So ProteusCAM would capture a 64×64 square starting at position (928, 508), which centers it perfectly on your screen.
Why Center?
- Predictable: You know exactly where to place test images
- Convenient: Most people naturally put important content in the center
- Visible: Easy to see the red capture rectangle
- Universal: Works on any screen size automatically
Wiring the ProteusCAM Module
Here’s how to connect each of the four pins on the ProteusCAM to your circuit:
- TX: Connect to the microcontroller’s UART RX pin to receive image data.
- TRIG: Connect to a digital output pin on your controller or to a push button/switch. The camera captures an image when this pin goes from LOW to HIGH (rising edge).
- VCC: Connect to a regulated power supply of at least 4.95V.
- GND: Connect to the common ground of your circuit.

To display the images captured by the ProteusCAM module, you can use a 240×320 SPI TFT display based on the ILI9341 driver. Since the camera outputs monochrome 1-bit image data, you can render it on the TFT by scaling each pixel to a visible block or color-mapping black and white pixels accordingly. The display connects to your microcontroller via the SPI interface using five wires: CS (chip select), DC (data/command), RESET, MOSI (data), and SCK (clock). To store the captured images, connect an SD card module, which also uses SPI but with a separate CS pin.
Arduino Code
This code is designed to capture black-and-white images from a camera module connected via serial and display them on a small TFT screen, while also saving each image to an SD card. To make this work, we first set up the display, the SD card, and the serial connection with the camera. The camera sends image data starting with a special header byte (0xA5), which tells the Arduino that a new image is coming.
Once we detect this, we read the full image, including some information like its width, height, and pixel data, and write it to a file on the SD card. Each image gets a unique filename so nothing gets overwritten. After saving, we open the file again and draw the image pixel by pixel on the screen, centering it neatly. So overall, this code listens for incoming images, saves them, and shows them, creating a simple but complete system for capturing and viewing images with Arduino.

Download Library
Simply click on the button to download the library. You can refer to this post for instructions on how to install the library in Proteus 8. How to Download and install Library in Proteus (electronicstree.com)
ZIP Password : electronicstree.com
If you have any requests for Arduino Module Libraries in Proteus, please leave a comment or message us using the contact form.
Camera Capture Area Guide — Overlay Tool
This simple tool is designed to help you visually align the screen area that your ProteusCAM is capturing. It acts like a laser guide for your camera’s frame showing exactly what part of your screen will be sent over UART as an image.
Why You Need This Tool
When using ProteusCAM
, you’re capturing a small portion of your screen (e.g., 128×64 or 240×320 pixels). But without any visual indication, it’s hard to know what area is being captured.
That’s where this overlay tool comes in. Think of it like a digital viewfinder, it draws a red rectangle right on your screen, centered, matching your camera’s capture dimensions.
What This Tool Does
- Lets you set the width and height of the capture area
- Displays a transparent overlay with a red rectangle in the center of your screen
- Helps you align what content appears inside the virtual camera’s captured frame
- Stays always on top and doesn’t interfere with your mouse
How to Use It
- Run the tool.
- Choose resolution.
In the small control window, set your desired:- Width (e.g., 240)
- Height (e.g., 320)
- These should match the WIDTH and HEIGHT you configure in your ProteusCAM model in Proteus.
- Click “Show Overlay”
A red rectangle will appear on your screen this is exactly what the camera will capture. - Move your windows/content so the important area fits inside the red box. Once aligned, trigger the camera (e.g., via Proteus TRIG pin), and it’ll capture that area.
- Click “Hide Overlay” when you’re done