Give Your AI a Pair of Eyes: Connect a Camera to Your AI

MAKER PROJECTS / ESP32-CAM

Give your camera a pair of AI eyes

Start with a small ESP32-CAM, connect it to your Wi-Fi network and open its live view in a browser. Then capture a picture and ask an AI assistant to describe what it sees. This guide takes you from the workbench to your first experiment.

Project status: Browser access and AI analysis of captured images have been demonstrated. Autonomous event detection and remote 4G access are future extensions. The source package is available in the Downloads section.

Contents

  1. Hardware
  2. Software and board setup
  3. Find your local network
  4. Configure and upload
  5. Open the camera
  6. Ask AI to look at a picture
  7. Experiment with video frames
  8. Troubleshooting
  9. Example prompt for Claude
  10. Downloads and next steps
  11. Watch the video

1. Hardware

ESP32-CAM with OV5640 camera and USB base board used in this project
ESP32-CAM and USB base board used in this project.

For this project, I used an AI Thinker ESP32-CAM with an OV5640 camera and its ESP32-CAM-MB USB base board. That’s it. No external circuit, separate serial adapter or jumper wires are needed.

Fit the ESP32-CAM onto its USB base board and connect it to your computer with a USB data cable. A 2.4 GHz Wi-Fi network is required. A small tripod is optional if you want to position the camera for your experiment.

Illustration of the ESP32-CAM mounted on a small tripod
Illustration of the completed camera setup on a small tripod.

2. Software and board setup

Install Arduino IDE. In Preferences, add the Espressif board package URL:

https://espressif.github.io/arduino-esp32/package_esp32_index.json

Install esp32 by Espressif Systems version 4.0.0 in Boards Manager, open BTF_ESP32CAM_LiveView.ino, select AI Thinker ESP32-CAM and choose the serial port. The sketch was tested with Arduino IDE 2.x and esp32 core 4.0.0. Other core versions may not compile or may lack autofocus support. No external libraries are needed: everything ships with the esp32 core.

3. Find your local network

Connect your computer to the same network as the camera. On Windows, open Command Prompt and run:

ipconfig

Find the active Wi-Fi adapter, its IPv4 address, subnet mask and default gateway. On Linux, use:

ip -4 addr
ip route

For a typical /24 network, a router at 192.168.1.1 and a camera address ending in 200 give 192.168.1.200. Check that this address is unused and outside the DHCP allocation pool or reserved appropriately. Other subnet sizes need separate verification.

4. Configure and upload

Open config.h and fill in the three settings. Use your own network name and password. The following example uses empty credentials:

#pragma once
#define WIFI_SSID ""
#define WIFI_PASSWORD ""
#define CAMERA_IP_LAST 200
#include "config_advanced.h"

Change 200 if necessary. Select Upload in Arduino IDE. Reset the board into normal boot mode and use the Serial Monitor at 115200 baud to check the camera address. Never share a configuration file or compiled firmware containing real credentials.

5. Open the camera

From a device on the same network, open the camera IP in your browser. Using the example above:

http://192.168.1.200/
http://192.168.1.200/capture
http://192.168.1.200:81/stream

The first address opens the web interface, the second requests a JPEG snapshot and the third is the MJPEG stream. Keep the camera on a trusted local network; do not expose these endpoints directly to the internet.

ESP32-CAM live-view demonstration.

6. Ask AI to look at a picture

I tested capturing a JPEG from the camera and opening it with Claude Code. An assistant with local network access and image-reading capability can fetch the JPEG and inspect it. For example:

Access http://192.168.1.200/capture, save the JPEG locally, open the image and describe what you see. Report any limitations such as glare or poor focus.

Alternatively, download the JPEG with a browser and upload it to an AI assistant. A cloud-only chat cannot normally reach a private local IP address. In the original experiment, the assistant inspected a 640 × 480 JPEG and noticed overexposed areas. AI interpretation can be wrong; verify important findings yourself.

7. Experiment with video frames

With FFmpeg installed, capture ten seconds of the local stream, then extract one frame per second for analysis:

ffmpeg -i http://192.168.1.200:81/stream -t 10 clip.mp4
ffmpeg -i clip.mp4 -vf fps=1 frame_%03d.jpg

These are example commands adapted to the example IP. Select frames and provide them to an image-capable assistant. This is sampled-frame analysis, not continuous autonomous monitoring.

8. Troubleshooting

SymptomCheck
Upload failsSerial port, USB data cable and USB base board connection.
Camera resetsUSB power and cable connections.
Page unreachable2.4 GHz network, actual camera IP, subnet, DHCP conflicts and client isolation.
Image too bright or blurryLighting, camera position and focus.
AI cannot reach cameraDownload the JPEG locally and upload it manually.

9. Example prompt for Claude

Open Claude Code on a computer connected to the same local network as your ESP32-CAM. Replace the IP address in this example with your camera’s actual address.

Access my ESP32-CAM at http://192.168.1.200/capture.
Download the JPEG image and save it locally.
Open the image and describe what you can see.
Tell me if anything is difficult to identify because of lighting, reflections or focus.

This is an example prompt. Claude Code needs permission to access the camera over the local network and read the downloaded image. If you use Claude in a browser without local network access, capture the JPEG yourself and attach it to the conversation.

10. Downloads and next steps

ESP32-CAM Live View — source package

Arduino sketch, README and MIT license. v1.0, 18 KB. No passwords inside: you fill in config.h yourself.

Download v1.0 (.zip)

Watch the full episode in section 11 below.

Future experiments include periodic image capture, event alerts, remote connectivity with a 4G modem and a Raspberry Pi camera. These are not features of the current Wi-Fi demonstration.

11. Watch the video

Prefer YouTube? Watch it on the Bench to Field channel.

Version history

December 2026 — Initial public documentation and source package v1.0.

Have you tried a similar experiment? What would you ask your camera to look for?

Leave a Comment