Integrate OV3660 Camera to ESPHome& Home Assistant

by Lan_Makerfabs in Circuits > Cameras

95 Views, 2 Favorites, 0 Comments

Integrate OV3660 Camera to ESPHome& Home Assistant

C81C078D8002FF79F133C7466B721B92.jpg

In the world of DIY smart home automation, combining powerful microcontrollers with smart sensors and cameras opens up endless possibilities. Today, we’re going to show you how to integrate the OV3660 camera with the ESP32S3 to bring high-quality video streaming to your Home Assistant setup.

OV3660 features 3M pixel, while the ESP32S3 features 16M flash+8M PSRAM, could be a good parter for the OV3660 remote monitoring via Home assistant.

We’ll walk you through each step of the process, from hardware setup to configuring the software, and how we leverage Home Assistant for seamless automation. In this guide, I use the MaTouch 2.8” as the hardware platform, I do not used its display/SD card, etc, just using its on board OV3660 camera and the core controller ESP32S3.

Whether you’re adding security cameras, monitoring your home’s environment, or building your own smart system, this tutorial will give you the tools to get started!

Supplies

1.png

Install Python Environment

2.png
3.png
4.png

ESPHome requires a Python environment to run, so we must install it first.

1. Download the Installer

  1. Visit the official Python download page in your browser: https://www.python.org/downloads/windows/
  2. Once the page opens, locate the "Stable Releases" list.
  3. Find the latest “Python 3.1x.x” version (e.g., Python 3.11 or 3.12).
  4. Click on "Windows installer (64-bit)" to download.

2. Run the Installer

Double-click the downloaded .exe installation file.

  1. [VERY IMPORTANT] At the bottom of the installation window, locate the two checkboxes.
  2. Make sure to check Add python.exe to PATH (or Add Python to PATH).
  3. If this step is skipped, subsequent commands will fail. Please double-check this!
  4. Click the large "Install Now" button in the center of the interface.
  5. Wait for the progress bar to complete, then click "Close".

For more details, refer to: install-python-windows-10

Install Git

5.png
6.png

ESPHome often needs to download additional code repositories from the internet when compiling firmware. If Git is not installed on your computer, errors will occur when running commands.

1. Download the Installer

  1. Visit the official Git download page: https://git-scm.com/download/win
  2. Click "64-bit Git for Windows Setup" to start the download.

2.Run the Installer

  1. Double-click the downloaded Git installer (filename similar to Git-2.xx.x-64-bit.exe).
  2. Click Next repeatedly: The Git installation interface has many complex configuration options. For beginners, there is no need to modify any settings.
  3. Simply keep clicking the "Next" button at the bottom.
  4. Even if you see options you do not understand, keep the defaults and continue clicking "Next".
  5. When the button changes to "Install", click it.
  6. Wait for the progress bar to complete, then click "Finish".


Verify Python Installation

7.png

We need to open a Command Prompt (CMD) window to enter instructions.

How to Open Command Prompt (CMD):

  1. Press the Windows Logo Key on your keyboard (usually between Ctrl and Alt), or click the "Start" button in the bottom left corner of the screen.
  2. Type: cmd
  3. In the search results, you will see a black icon program named "Command Prompt".
  4. Click it, or press Enter to open.
  5. A CMD window will appear with a blinking cursor, waiting for input.

Input Verification Command:

  1. In the CMD window, type the following command (note the space in the middle):
python --version
  1. Press the Enter key.
  2. Result Interpretation:
  3. Success: If you see text similar to Python 3.11.5, the installation was successful.
  4. Failure: If " 'python' is not recognized as an internal or external command..." appears, it means "Add to PATH" was not checked in Step 1. It is recommended to uninstall Python and reinstall it following Step 1, ensuring that option is checked.


Install ESPHome

8.png
9.png

1. Execute Installation Command

Keep the CMD window open and copy the following command:

pip install esphome
  1. How to paste: Right-clicking inside the CMD window usually pastes automatically (or press Ctrl+V).
  2. After pasting, press the Enter key to execute.

2. Wait for Installation

Text will scroll rapidly on the screen, indicating that files are being downloaded ("Downloading...") and installed ("Installing...").

  1. Please wait patiently until the progress bar finishes and the cursor stops blinking, waiting for input again.

3. Verify Installation

In the CMD window, type:

esphome version

Press Enter. If the screen displays text similar to Version: 2025.x.x, congratulations, ESPHome is successfully installed!

Driver Installation (Connecting the Board)

10.png
11.png

To allow your computer to recognize your device (ESP32 or ESP8266) via USB, you usually need to install drivers.

  1. Preparation: Do not plug in the development board yet.
  2. Download Drivers: If you are unsure which chip your board uses, it is recommended to install both:
  3. CP210x Driver: Click to Download (Silabs Official). Detailed steps: install-esp32-esp8266-usb-drivers-cp210x-windows
  4. CH340 Driver: Click to Download (WCH Official). Detailed steps: how-to-install-ch340-drivers
  5. Installation: Download, unzip, and run the installer (usually setup.exe or install.exe). Simply click "Next" or "Install" through the process.
  6. Connect Device: Plug the development board into the computer's USB port using a USB data cable.
  7. Confirm Connection:
  8. Right-click the "Start" button -> Select "Device Manager".
  9. Expand the "Ports (COM & LPT)" list.
  10. If you see a device similar to Silicon Labs CP210x... (COM3) or USB-SERIAL CH340 (COM4), the computer has successfully recognized it. Remember this COMx number.


Flashing Firmware & Viewing Logs (Critical Step)

12.png
13.png
14.png
15.png
16.png
17.png
18.png

We will use the command-line tool to flash the configuration file provided directly to your device.

1. Prepare Folder

Create a new folder on your desktop (or D drive), for example, name it my_device.

[Critical] Copy and paste the provided configuration file (usually with a .yaml extension) into this folder.

2. Open Command Line

  1. Double-click to enter the my_device folder where the .yaml file is located.
  2. Open secrets.yaml with Notepad or another editor and modify wifi_ssid and wifi_password.
  3. Click once in the Address Bar at the top of the folder window (where the file path is shown) and delete all the text inside.
  4. Type cmd and press Enter.
  5. A CMD window will pop up, with the path already automatically set to this folder.

3.Run Flash Command

In the CMD window, enter the following command:

esphome run ai-28-s3-camera.yaml

Press Enter to execute.

4. Compile and Select Port

  1. The program will automatically start downloading dependencies and compiling the firmware (the first run may take a few minutes, please be patient).
  2. After compilation is complete, the screen will prompt "Found multiple serial ports", asking which one you want to use.

Example display as above.

Please enter the corresponding number (e.g., 1) and press Enter. Usually, choose the option containing "USB" or "Silicon Labs/CH340"

5. Auto-Flashing and Monitoring

  1. After selecting the port, the program will automatically start writing the firmware.
  2. Once writing is successful, the window will automatically switch to Log Monitoring Mode.
  3. If you see log information similar to [I][app:100]: ... scrolling on the screen, it means the device has started successfully and is working! You can see the obtained IP address in the output logs.

*Tip: If you want to exit the view, you can press `Ctrl + C` on your keyboard.*


Connect to Home Assistant

19.png
20.png
21.png
22.png
23.png
24.png

Once the device is successfully flashed and connected to WiFi, we can integrate it into Home Assistant (HA) for control.

Prerequisites:

  1. You have already installed and are running Home Assistant.

If not installed, please refer to the official tutorial: https://www.home-assistant.io/installation/

  1. Your ESPHome device and Home Assistant server are connected to the same Local Area Network (LAN/WiFi).

Beginner's Guide (What is the same LAN?):

  1. Simple Explanation: Your ESPHome device and the computer/Raspberry Pi running Home Assistant must be connected to the WiFi signal from the same router.
  2. Common Mistakes:

❌ ESPHome is connected to home WiFi, but the Home Assistant computer is connected to a phone hotspot.

❌ ESPHome is connected to the router's "Guest Network" (this usually isolates devices from each other).

Note: Most ESPHome devices (like ESP32/ESP8266) only support the 2.4GHz WiFi band. If your router has separate 2.4G and 5G names, ensure the device connects to the 2.4G one.

Method 1: Auto Discovery

This is the simplest method and is usually triggered automatically within a few minutes after the device connects to the network.

  1. Open your Home Assistant web interface (usually http://homeassistant.local:8123 ).
  2. Check the left sidebar and click "Settings".
  3. Click "Devices & Services".
  4. At the top of the page, you will usually see a blue "Discovered" section alerting you to a new ESPHome device.
  5. Click the "Add" button.
  6. Enter Encryption Key:
  7. The system will pop up a window prompting for the Encryption Key (API encryption key).
  8. Where to find this key?
  9. Return to the configuration file on your computer (the ai-28-s3-camera.yaml file you just flashed).
  10. Open it with Notepad, find the api: section, verify the encryption: line below it, and find the key: "xxxxxxxx..." line.
  11. Copy the long string of random characters inside the quotes.
  12. Paste the copied characters into the input box in Home Assistant.
  13. Click "Submit".
  14. The system may ask if you want to add it to a specific area (e.g., Living Room, Bedroom). Select one and click Finish.

Method 2: Manual Addition

If the prompt does not appear automatically, you can add it manually.

  1. In Home Assistant, go to "Settings" -> "Devices & Services".
  2. Click the blue button "+ ADD INTEGRATION" in the bottom right corner.
  3. Type ESPHome in the search box and click the icon.
  4. In the popup window, enter the device address.
  5. The address format is usually: devicename.local (e.g., if your yaml filename is livingroom-lamp.yaml and the name field inside is also the same, enter livingroom-lamp.local).
  6. If .local does not connect, you can check the device's IP address in your router's admin panel and enter the IP address directly (e.g., 192.168.1.50).
  7. Enter Key:
  8. After clicking Submit, if the connection is successful, it will prompt for the Encryption Key (API Key).
  9. Similarly, copy the content from api -> encryption -> key in your .yaml configuration file and paste it.
  10. Click "Submit" to complete the addition.

Usage After Integration

After adding successfully, you can find the device in the "Overview" dashboard of Home Assistant.

  1. Click the card to view the camera.

Result

OV3660 Camera Integration with ESP32S3 for Home Assistant - Final Results

For how well it works, the final results of integrating the OV3660 camera with the ESP32S3 for high-quality video streaming in Home Assistant! In this video, we showcase the smooth, real-time video streaming and remote monitoring capabilities.