Skip to content

Commit bdf0542

Browse files
committed
add README
1 parent bbc7469 commit bdf0542

File tree

15 files changed

+1903
-0
lines changed

15 files changed

+1903
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Timer-CAM Library
2+
3+
English | [中文](README_cn.md)
4+
5+
## Description
6+
7+
This library provides some basic arduino cases for **TimerCAM**, including web surveillance cameras, sleep functions, etc. **TimerCAM** is a camera module based on ESP32, integrated with ESP32 chip and 8M-PSRAM. The camera (ov3660) with 3 million pixels can view 66.5 ° and shoot 1600 x at most 1200 resolution photo, built-in LED status indicator, featuring ultra-low power consumption design. Through RTC (BM8563), timing sleep and wake-up can be realized. sleep current can be reduced to 2μA.The battery interface is reserved on the board, and users can access the battery power supply by themselves. The module supports WiFi image transmission and USB port debugging. The bottom HY2.0-4P port output can be connected to other peripherals.
8+
9+
## Applications
10+
11+
- Take pictures regularly
12+
- Remote video monitoring
13+
14+
## PinMap
15+
16+
**Camera Interface PinMap**
17+
18+
| *Interface* | *Camera Pin*| *TimerCamera* |
19+
| :------------------- | :--------:| :------: |
20+
| SCCB Clock | SIOC |IO23 |
21+
| SCCB Data | SIOD |IO25 |
22+
| System Clock | XCLK |IO27 |
23+
| Vertical Sync | VSYNC |IO22 |
24+
| Horizontal Reference | HREF |IO26 |
25+
| Pixel Clock | PCLK |IO21 |
26+
| Pixel Data Bit 0 | D0 |IO32 |
27+
| Pixel Data Bit 1 | D1 |IO35 |
28+
| Pixel Data Bit 2 | D2 |IO34 |
29+
| Pixel Data Bit 3 | D3 |IO5 |
30+
| Pixel Data Bit 4 | D4 |IO39 |
31+
| Pixel Data Bit 5 | D5 |IO18 |
32+
| Pixel Data Bit 6 | D6 |IO36 |
33+
| Pixel Data Bit 7 | D7 |IO19 |
34+
| Camera Reset | RESET |IO15 |
35+
| Camera Power Down | PWDN |-1 |
36+
| Power Supply 3.3V | 3V3 | 3V3 |
37+
| Ground | GND | GND |
38+
39+
**GROVE Interface**
40+
41+
| *Grove* | *TimerCamera* |
42+
| :-----------: | :------: |
43+
| SCL | IO13 |
44+
| SDA | IO4 |
45+
| 5V | 5V |
46+
| GND | GND |
47+
48+
**LED Interface**
49+
50+
| *LED* | *TimerCamera* |
51+
| :-----------:| :------: |
52+
| LED_Pin | IO2 |
53+
54+
**BAT Interface**
55+
56+
| *BAT* | *TimerCamera* |
57+
| :-----------:| :------: |
58+
| BAT_ADC_Pin | IO33 |
59+
60+
## Related Link
61+
62+
- **datasheet**
63+
- [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
64+
- [OV3660](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/OV3660_CSP3_DS_1.3_sida.pdf)

README_cn.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Timer-CAM Library
2+
3+
[English](README.md) | 中文
4+
5+
## 描述
6+
7+
该库为**TimerCAM**产品系列提供了一些arduino基础案例,包含web监控摄像头,休眠功能等内容,**TimerCAM**是一款基于ESP32的摄像头模块,集成ESP32芯片,板载8M PSRAM,采用300万像素的摄像头(OV3660)可视角66.5°,最高可实现拍摄1600 x 1200分辨率的照片,带有状态指示灯,主打超低功耗设计,通过RTC(BM8563)可实现定时休眠与唤醒,休眠电流可降低至2μA,板上预留电池接口,用户可自行接入电池供电。模块支持WiFi图像传输和USB端口调试,底部HY2.0-4P端口输出,可连接其他外设。
8+
9+
## 应用
10+
11+
- 定时拍照
12+
- 远程监控
13+
14+
## 管脚映射
15+
16+
**摄像头驱动芯片 OV3660 接口**
17+
18+
| *接口* | *Camera Pin*| *TimerCamera* |
19+
| :------------------- | :--------:| :------: |
20+
| SCCB Clock | SIOC |IO23 |
21+
| SCCB Data | SIOD |IO25 |
22+
| System Clock | XCLK |IO27 |
23+
| Vertical Sync | VSYNC |IO22 |
24+
| Horizontal Reference | HREF |IO26 |
25+
| Pixel Clock | PCLK |IO21 |
26+
| Pixel Data Bit 0 | D0 |IO32 |
27+
| Pixel Data Bit 1 | D1 |IO35 |
28+
| Pixel Data Bit 2 | D2 |IO34 |
29+
| Pixel Data Bit 3 | D3 |IO5 |
30+
| Pixel Data Bit 4 | D4 |IO39 |
31+
| Pixel Data Bit 5 | D5 |IO18 |
32+
| Pixel Data Bit 6 | D6 |IO36 |
33+
| Pixel Data Bit 7 | D7 |IO19 |
34+
| Camera Reset | RESET |IO15 |
35+
| Camera Power Down | PWDN |-1 |
36+
| Power Supply 3.3V | 3V3 | 3V3 |
37+
| Ground | GND | GND |
38+
39+
**GROVE 接口**
40+
41+
| *Grove* | *TimerCamera* |
42+
| :-----------: | :------: |
43+
| SCL | IO13 |
44+
| SDA | IO4 |
45+
| 5V | 5V |
46+
| GND | GND |
47+
48+
**LED 接口**
49+
50+
| *LED* | *TimerCamera* |
51+
| :-----------:| :------: |
52+
| LED_Pin | IO2 |
53+
54+
**BAT 接口**
55+
56+
| *BAT* | *TimerCamera* |
57+
| :-----------:| :------: |
58+
| BAT_ADC_Pin | IO33 |
59+
60+
## 相关链接
61+
62+
- **数据手册**
63+
- [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
64+
- [OV3660](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/OV3660_CSP3_DS_1.3_sida.pdf)

examples/wakeup/wakeup.ino

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include "Arduino.h"
2+
#include "freertos/FreeRTOS.h"
3+
#include "camera_pins.h"
4+
#include "battery.h"
5+
#include "led.h"
6+
#include "bmm8563.h"
7+
8+
void led_breathe_test() {
9+
for (int16_t i = 0; i < 1024; i++) {
10+
led_brightness(i);
11+
vTaskDelay(pdMS_TO_TICKS(1));
12+
}
13+
14+
for (int16_t i = 1023; i >= 0; i--) {
15+
led_brightness(i);
16+
vTaskDelay(pdMS_TO_TICKS(1));
17+
}
18+
}
19+
20+
void setup() {
21+
Serial.begin(115200);
22+
23+
// will hold bat output
24+
bat_init();
25+
26+
led_init(CAMERA_LED_GPIO);
27+
bmm8563_init();
28+
29+
// 5 sec later will wake up
30+
bmm8563_setTimerIRQ(5);
31+
32+
// rtc_date_t date;
33+
// date.year = 2020;
34+
// date.month = 9;
35+
// date.day = 20;
36+
// date.hour = 15;
37+
// date.minute = 59;
38+
// date.second = 06;
39+
// bmm8563_setTime(&date);
40+
led_breathe_test();
41+
}
42+
43+
void loop() {
44+
rtc_date_t date;
45+
bmm8563_getTime(&date);
46+
Serial.printf("Time: %d/%d/%d %02d:%02d:%-2d\r\n", date.year, date.month, date.day, date.hour, date.minute, date.second);
47+
Serial.printf("volt: %d mv\r\n", bat_get_voltage());
48+
49+
// disable bat output, will wake up after 5 sec, Sleep current is 1~2μA
50+
bat_disable_output();
51+
52+
// if usb not connect, will not in here;
53+
esp_deep_sleep(5000000);
54+
esp_deep_sleep_start();
55+
}

examples/web_cam/web_cam.ino

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#include "esp_camera.h"
2+
#include <WiFi.h>
3+
4+
#include "camera_pins.h"
5+
6+
const char* ssid = "ssid";
7+
const char* password = "********";
8+
9+
void startCameraServer();
10+
11+
void setup() {
12+
Serial.begin(115200);
13+
Serial.setDebugOutput(true);
14+
Serial.println();
15+
16+
camera_config_t config;
17+
config.ledc_channel = LEDC_CHANNEL_0;
18+
config.ledc_timer = LEDC_TIMER_0;
19+
config.pin_d0 = Y2_GPIO_NUM;
20+
config.pin_d1 = Y3_GPIO_NUM;
21+
config.pin_d2 = Y4_GPIO_NUM;
22+
config.pin_d3 = Y5_GPIO_NUM;
23+
config.pin_d4 = Y6_GPIO_NUM;
24+
config.pin_d5 = Y7_GPIO_NUM;
25+
config.pin_d6 = Y8_GPIO_NUM;
26+
config.pin_d7 = Y9_GPIO_NUM;
27+
config.pin_xclk = XCLK_GPIO_NUM;
28+
config.pin_pclk = PCLK_GPIO_NUM;
29+
config.pin_vsync = VSYNC_GPIO_NUM;
30+
config.pin_href = HREF_GPIO_NUM;
31+
config.pin_sscb_sda = SIOD_GPIO_NUM;
32+
config.pin_sscb_scl = SIOC_GPIO_NUM;
33+
config.pin_pwdn = PWDN_GPIO_NUM;
34+
config.pin_reset = RESET_GPIO_NUM;
35+
config.xclk_freq_hz = 20000000;
36+
config.pixel_format = PIXFORMAT_JPEG;
37+
config.frame_size = FRAMESIZE_UXGA;
38+
config.jpeg_quality = 10;
39+
config.fb_count = 2;
40+
41+
// camera init
42+
esp_err_t err = esp_camera_init(&config);
43+
if (err != ESP_OK) {
44+
Serial.printf("Camera init failed with error 0x%x", err);
45+
return;
46+
}
47+
48+
sensor_t * s = esp_camera_sensor_get();
49+
//initial sensors are flipped vertically and colors are a bit saturated
50+
s->set_vflip(s, 1);//flip it back
51+
s->set_brightness(s, 1);//up the blightness just a bit
52+
s->set_saturation(s, -2);//lower the saturation
53+
54+
//drop down frame size for higher initial frame rate
55+
s->set_framesize(s, FRAMESIZE_QVGA);
56+
57+
Serial.printf("Connect to %s, %s\r\n", ssid, password);
58+
59+
WiFi.begin(ssid, password);
60+
61+
while (WiFi.status() != WL_CONNECTED) {
62+
delay(500);
63+
Serial.print(".");
64+
}
65+
Serial.println("");
66+
Serial.println("WiFi connected");
67+
68+
startCameraServer();
69+
70+
Serial.print("Camera Ready! Use 'http://");
71+
Serial.print(WiFi.localIP());
72+
Serial.println("' to connect");
73+
}
74+
75+
void loop() {
76+
// put your main code here, to run repeatedly:
77+
delay(10000);
78+
}

library.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Timer-CAM",
3+
"description": "Library for M5Stack Timer-CAM development kit",
4+
"keywords": "Timer-CAM",
5+
"authors": {
6+
"name": "Eeebin, M5Stack",
7+
"url": "http://www.m5stack.com"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/m5stack/TimerCam-arduino.git"
12+
},
13+
"version": "0.0.1",
14+
"framework": "arduino",
15+
"platforms": "espressif32"
16+
}
17+

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=Timer-CAM
2+
version=0.0.1
3+
author=M5Stack
4+
maintainer=Eeebin<Eeebin@@m5stack.com>
5+
sentence=Library for M5Stack Timer-CAM development kit
6+
paragraph=See more on http://M5Stack.com
7+
category=Device Control
8+
url=https://github.com/m5stack/TimerCam-arduino.git
9+
architectures=esp32

0 commit comments

Comments
 (0)