Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Created July 16, 2021 20:08
Show Gist options
  • Save TheGroundZero/51b6416bdcd3fb5b0bbc7901091bbd52 to your computer and use it in GitHub Desktop.
Save TheGroundZero/51b6416bdcd3fb5b0bbc7901091bbd52 to your computer and use it in GitHub Desktop.
ESPHome config for LILYGO® TTGO T-Camera ESP32
# https://s.click.aliexpress.com/e/_9y4QA5
# Based on https://gist.github.com/Snipercaine/d8345571563536e9661422c3509d1119
# And https://community.home-assistant.io/t/working-esphome-config-for-ttgo-esp32-camera-board-with-microphone/126231
# Note: pins are not the same as in the docs above and even the picture on AE differs from the picture in the box
#
# Folder structure based on Frenck's config
# https://github.com/frenck/home-assistant-config/tree/master/config/esphome
substitutions:
slug: esp32_tcam
name: Lilygo T-camera
description: LILYGO TTGO T-Camera
packages:
<<: !include_dir_named common
board: !include boards/esp32_dev.yaml
i2c: !include components/i2c_esp32.yaml
binary_sensor:
# Motion sensor
- platform: gpio
pin: GPIO19
name: ${name} PIR
device_class: motion
# Right Button
- platform: gpio
pin:
number: GPIO15
mode: INPUT_PULLUP
inverted: True
name: ${name} Button
status_led:
pin: 2
esp32_camera:
name: ${name} Camera
external_clock:
pin: GPIO4
frequency: 20MHz
i2c_pins:
sda: GPIO18
scl: GPIO23
data_pins: [GPIO34, GPIO13, GPIO14, GPIO35, GPIO39, GPIO38, GPIO37, GPIO36]
vsync_pin: GPIO5
href_pin: GPIO27
pixel_clock_pin: GPIO25
# Camera resolution
# Demo FW max. res CIF(400x296) for face recognition
resolution: 800x600
jpeg_quality: 10
vertical_flip: true
horizontal_mirror: false
font:
- file: "fonts/times-new-roman.ttf"
id: tnr1
size: 20
- file: "fonts/times-new-roman.ttf"
id: tnr2
size: 35
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
rotation: 180°
address: 0x3C
lambda: |-
it.strftime(64, 0, id(tnr1), TextAlign::TOP_CENTER,"%d-%m-%Y", id(time_homeassistant).now());
it.strftime(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "%H:%M", id(time_homeassistant).now());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment