Unit CAM

SKU:U109

Description

Unit CAM M5 launched a very cost-effective WiFi camera, using ESP32-WROOM-32E control core + 2MegaPixel image sensor (OV2640) solution on the hardware, using the most simplified design, no extra peripherals. The factory software integrates image transmission firmware, provides image data acquisition, image parameter (white balance, exposure, gain, size and other attributes) adjustment interface, users can directly acquire image data through UART or WiFi, and interact with the camera. Support UIFlow graphical programming call, realize zero development, out-of-the-box user experience. The compact design and cost performance are suitable for various wireless camera application scenarios.

Product Features

  • Simplified design
  • ESP32 control core
  • 2MegaPixel camera (OV2640)
  • UART communication (support image data acquisition, image parameter adjustment and other interfaces)
  • WIFI image transmission
  • Programming platform: ESP-IDF/Arduino/UIFlow

Include

  • 1x Unit CAM

Applications

  • WiFi camera
  • Remote monitoring

Specification

Resources Parameter
Flash 4M
Firmware default communication method UART: 115200bps 8N1
Camera OV2640
Maximum resolution 2MegaPixel
Unit CAM firmware default picture transfer rate 12fps
OV2640 supports output format YUV(422/420)/YCbCr422, 8-bit compressed data, RGB565/555, 8-/10-bit Raw RGB data
OV2640 supports the maximum image transfer rate UXGA/SXGA: 15fps, SVGA: 30fps, CIF: 60fps
DFOV 66.5°
Net weight 4.7g
Gross weight 5.3g
Product Size 45*20*12mm
Package Size 60*60*15mm

Flash Download

Unit CAM does not include a program download circuit. When users need to download the ESP32 update program, they can burn the program through an external connection with a USB-TTL downloader.

PinMap

OV2640 Interface

Interface Camera Pin Unit CAM
SCCB Clock SIOC IO23
SCCB Data SIOD IO25
System Clock XCLK IO27
Vertical Sync VSYNC IO22
Horizontal Reference HREF IO26
Pixel Clock PCLK IO21
Pixel Data Bit 0 D0 IO32
Pixel Data Bit 1 D1 IO35
Pixel Data Bit 2 D2 IO34
Pixel Data Bit 3 D3 IO5
Pixel Data Bit 4 D4 IO39
Pixel Data Bit 5 D5 IO18
Pixel Data Bit 6 D6 IO36
Pixel Data Bit 7 D7 IO19
Camera Reset RESET IO15
Camera Power Down PWDN -1
Power Supply 3.3V 3V3 3V3
Ground GND GND

HY2.0-4P Interface

HY2.0-4P Unit CAM
RX IO16
TX IO17
5V 5V
GND GND

LED (blue)

LED Unit CAM
D1 IO4

Schematic

Example

Arduino

UIFlow

UnitCAM's default factory firmware supports two working modes of UART and WiFi. The WiFi mode supports timed shooting and automatically uploads pictures to the M5 cloud and returns to the picture calling interface (URL). Under UART mode, users can use other master devices to obtain picture frames through UART communication and modify picture parameters. The following will use the main control CORE as a case to connect to UnitCAM and obtain image data.

Unit CAM UIFlow Block Instructions

Unit CAM UIFlow Use Case

Press A to enable WiFi connection mode, connect to the designated WiFi, the camera takes pictures at 5s intervals and upload them to the M5 cloud, and press B to obtain the camera Token, and use the cloud image URL generated by the Token to create a QR code.

Press C to enable UART connection mode, configure the picture size to be 320*240, and start the picture display thread to continuously refresh the picture to the screen.

Unit CAM UIFlow Block function description:


- Cloud Mode Functions:

#Configure the camera to connect to the specified WiFi
Set-unitcam-connect-wifi-ssid

#Configure the camera image upload cloud interval
Set-unitcam-cloud-mode-upload-interval

#Get camera Token
Get-unitcam-cloud-token

#Get the URL of the camera cloud image
Get-unitcam-cloud-image-url

- UART Mode Functions:

#In UART mode, start the screen display image thread, the default display coordinates are 0,0
Set-unitcam-image-show-in-screen

#Set the camera to return the image size
Set-unitcam-image-size

#Set the image display position
Set-unitcam-image-position-x-y

- Command:


#Switch UART/CLOUD mode
Switch-unitcam-mode-to-UART/CLOUD

#Set the brightness of the onboard LED of the camera
Set-unitcam, led-brightness

Micropython API


import unit

#Create unitcam instance
unitcam0 = unit.get(unit.UNITCAM, unit.PORTB)

#UART Mode: unitcam0.UART_MODE
#WIFI mode: unitcam0.CLOUD_MODE
unitcam0.set_mode(unitcam0.UART_MODE)

#WiFi mode, configure the camera to connect to the specified WiFi
unitcam0.set_wifi('','')

#WiFi mode, configure the camera image upload cloud interval
unitcam0.set_upload_time(5)

#Get camera token
unitcam_token = unitcam0.get_token()

#Stitching a fixed domain name field to get the URL of the camera cloud image
unicam_image_url ='camera.m5stack.com/timer-cam/image?tok=' + unitcam0.get_token()

#UART mode, start the screen display image thread, the default display coordinates are 0,0
unitcam0.set_show(True)

#Set the camera to return the image size
#unitcam0.SIZE_800_600
#unitcam0.SIZE_640_480
#unitcam0.SIZE_320_240
#unitcam0.SIZE_240_240
#unitcam0.SIZE_160_120
unitcam0.set_image_size(unitcam0.SIZE_320_240)


#Set Unit CAM onboard LED brightness value: 0~100
unitcam0.set_led_brightness(0)

Video