{"id":159987,"date":"2025-03-28T20:00:57","date_gmt":"2025-03-28T14:30:57","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=159987"},"modified":"2025-03-28T20:01:35","modified_gmt":"2025-03-28T14:31:35","slug":"video-streaming-camera","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/video-streaming-camera","title":{"rendered":"Smallest Spy Video Streaming Camera"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"161\" height=\"147\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Ashwini-EFY-Tested-2.webp\" alt=\"EFY Tested Project\" class=\"wp-image-160183\" style=\"width:135px;height:auto\"\/><\/figure><\/div>\n\n\n<p>The <a href=\"https:\/\/indus.electronicsforu.com\/\">IndusBoard Coin V2<\/a>, a compact <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/esp32\">ESP32-S2<\/a>-based development board measuring just 3.3 cm, is an excellent platform for building ultra-small embedded projects. Combined with the OV2640 camera module, this project showcases <strong>how to create a compact, Wi-Fi-based spy camera capable of live video streaming<\/strong>. This makes it suitable for home security, baby monitoring, or discreet surveillance applications.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"402\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-1024x402.jpeg\" alt=\"Wi-Fi-based spy camera Project\" class=\"wp-image-159988\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-1024x402.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-500x196.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-1536x603.jpeg 1536w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-1069x420.jpeg 1069w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-696x273.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam-1920x754.jpeg 1920w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcam.jpeg 1996w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 1. Smallest SPY Camera <br><br><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Uses and Applications<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Security &amp; Surveillance:<\/strong> Deploy in small spaces for remote monitoring.<\/li>\n\n\n\n<li><strong>Home Automation:<\/strong> Monitor rooms, doorways, or restricted areas.<\/li>\n\n\n\n<li><strong>Wearable Technology:<\/strong> Can be used for body-worn spy cameras.<\/li>\n\n\n\n<li><strong>IoT &amp; Embedded Vision:<\/strong> Useful for AI-based visual processing projects.<\/li>\n<\/ul>\n\n\n\n<p>The project utilizes the IndusBoard Coin V2\u2019s onboard Wi-Fi capabilities to host a web server that streams real-time video. The OV2640 camera captures images and transmits them via Wi-Fi in multiple pixel formats, which can be viewed on any device connected to the same network. <\/p>\n\n\n\n<p>The camera operates in AP mode, meaning it creates its own Wi-Fi network, making it highly portable and independent of existing networks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bill of Materials<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"270\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/billodmaterial.jpeg\" alt=\"Components required for Wi-Fi-based spy camera project\" class=\"wp-image-159991\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/billodmaterial.jpeg 1012w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/billodmaterial-500x133.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/billodmaterial-696x186.jpeg 696w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Circuit <\/strong><\/h2>\n\n\n\n<p>Coin V2 uses specific GPIO pins to interface with the <strong>OV2640 camera module<\/strong>. Below is a breakdown of the key pin connections:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>XCLK (GPIO 44)<\/strong> \u2192 Provides an external clock signal to the camera (20 MHz).<br><\/li>\n\n\n\n<li><strong>PCLK (GPIO 39)<\/strong> \u2192 Pixel clock, synchronizing data transfer from the camera to the ESP32.<br><\/li>\n\n\n\n<li><strong>VSYNC (GPIO 21)<\/strong> \u2192 Vertical synchronization signal, marking the start of a new frame.<br><\/li>\n\n\n\n<li><strong>HREF (GPIO 1)<\/strong> \u2192 Horizontal synchronization signal, marking the start of a new line in a frame.<br><\/li>\n\n\n\n<li><strong>SDA (GPIO 8) &amp; SCL (GPIO 9)<\/strong> \u2192 I2C communication pins used for camera configuration.<br><\/li>\n\n\n\n<li><strong>RESET (GPIO 2)<\/strong> \u2192 Used to reset the camera module if needed.<br><\/li>\n\n\n\n<li><strong>PWDN (GPIO -1)<\/strong> \u2192 Power-down control (not used, so set to -1).<br><\/li>\n\n\n\n<li><strong>Camera Data Pins (D0-D7)<\/strong><\/li>\n<\/ul>\n\n\n\n<p>The camera captures images as <strong>raw pixel data<\/strong>, which is transmitted over an <strong>8-bit parallel interface<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"517\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-1024x517.jpeg\" alt=\"OV2640 camera module and IndusBoard Coin Connection\" class=\"wp-image-159993\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-1024x517.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-500x252.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-1536x776.jpeg 1536w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-832x420.jpeg 832w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-696x351.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit-1920x970.jpeg 1920w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Spycamircuit.jpeg 2004w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 2. OV2640 camera module and IndusBoard Coin Connection<br><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"742\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-1024x742.jpeg\" alt=\"IndusBoard Coin and OV2640 camera module Connection\" class=\"wp-image-159994\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-1024x742.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-500x362.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-579x420.jpeg 579w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-696x504.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring-324x235.jpeg 324w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/SPYcamwiring.jpeg 1490w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 3. IndusBoard Coin ESP Chip and  OV2640 camera connected \n<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Code<\/strong><\/h2>\n\n\n\n<p>Code starts by including the necessary libraries: esp_camera.h for camera control, WiFi.h for wireless connectivity, and WebServer.h for hosting a web interface. <\/p>\n\n\n\n<p>The <strong>pin configuration<\/strong> is defined using GPIO assignments for clock, sync, and data signals to correctly initialize the OV2640 camera. The initCamera() function sets up the camera parameters such as <strong>frame size, pixel format, and clock frequency<\/strong> before initializing it with esp_camera_init().<\/p>\n\n\n\n<p>The <strong>webpage HTML<\/strong> is embedded within the code, designed with a simple layout to display the live camera feed inside a <strong>resizable frame<\/strong>. It includes a dropdown menu to switch between different pixel formats (JPEG, YUV422, RGB565, or Grayscale) and dynamically updates the stream.<\/p>\n\n\n\n<p>The Coin V2 camera operates in <strong>WiFi Access Point (AP) mode<\/strong>, allowing users to connect directly to the device, however, the STA mode can also be used. <\/p>\n\n\n\n<p>When the server receives a request at \/stream, the handle_jpg_stream() function captures frames from the camera buffer using esp_camera_fb_get() and transmits them as <strong>multipart images<\/strong>, enabling live streaming. The loop() continuously handles client requests, ensuring a smooth video feed<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"738\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-1024x738.jpeg\" alt=\"Ov2640 Camera module pin configuration\" class=\"wp-image-159997\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-1024x738.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-500x360.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-583x420.jpeg 583w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-696x501.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet-324x235.jpeg 324w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/codesnippet.jpeg 1452w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 4. Ov2640 Camera pin configuration \n<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing<\/strong><\/h2>\n\n\n\n<p>Now, power the device and then either with a 3.3V DC\u00a0adapter or a 3.3V DC battery using the 3.3V and GND pins on the board. <\/p>\n\n\n\n<p>Then open your wifi settings, search for Indusbaord CAM wifi SISD, and connect to it using the password you have set in the code. And then after connection, open any web browser and search 191.168.4.1, and then you can see the live-streamed video.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"609\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-1024x609.jpeg\" alt=\"Indusboard Camera\" class=\"wp-image-159998\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-1024x609.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-500x297.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-1536x914.jpeg 1536w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-706x420.jpeg 706w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-696x414.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo-1920x1142.jpeg 1920w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/livestreamvideo.jpeg 2034w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 5. Testing Indusboard Camera<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-64c9b1c0-e693-4bcf-9021-a94fa5282ab9\" href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/LiveStrean.zip\"><strong>Source Code<\/strong><\/a><a href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/LiveStrean.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-64c9b1c0-e693-4bcf-9021-a94fa5282ab9\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The IndusBoard Coin V2, a compact ESP32-S2-based development board measuring just 3.3 cm, is an excellent platform for building ultra-small embedded projects. Combined with the OV2640 camera module, this project showcases how to create a compact, Wi-Fi-based spy camera capable of live video streaming. This makes it suitable for home security, baby monitoring, or discreet [&hellip;]<\/p>\n","protected":false},"author":33369,"featured_media":160002,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23,7786,6196,1944,6189,11851],"tags":[11666],"class_list":{"0":"post-159987","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-hardware-diy","9":"category-ai-ml-projects","10":"category-dev-boards-projects","11":"category-editor-choice","12":"category-esp32-projects","13":"category-super-innovative-projects","14":"tag-indusboard"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/33369"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=159987"}],"version-history":[{"count":2,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159987\/revisions"}],"predecessor-version":[{"id":160186,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159987\/revisions\/160186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/160002"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=159987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=159987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=159987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}