Skip to the content
2 layers30 × 74.5 mmLamp ver2, the printed circuit board in 3D

라즈베리파이 5 + ESP32 기반 스마트홈 IoT: AI 음성대화봇 · 음악 스피커 · 스마트 전등 (펌웨어, 서버, KiCad PCB)

Size
30 × 74.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
46
Nets
41
Pads
188
Tracks, vias
198, 15
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
2 Oct 2026
Updated
2 Oct 2026

Overview

Lamp ver2 is an open-source printed circuit board by trsh-mn, from the trsh-mn/smart-home-iot repository on GitHub. It is a 2-layer board of 30 × 74.5 mm with 46 parts on 41 nets, routed with 198 tracks and 15 vias.

It is built around the 74AHCT1G126GV, ESP32-C3-WROOM-02-H4 and MT3608, with the ME6211C33M5G-N, TP4056-42-ESOP8 and TPS22919DCK among its other parts. Its parts include 6 ICs, 5 resistors, 5 connectors, 3 diodes and 1 inductor. It belongs with the lEDs and displays boards and the ESP32 and RISC-V boards of this library.

Main components

7

README

README.md

스마트홈 IoT 시스템

라즈베리파이 5를 두뇌로, AI 음성대화봇 · 음악 스피커 · 스마트 전등 세 기기가 하나의 시스템으로 동작합니다. 무거운 판단(음성인식 · LLM · TTS)은 Pi가, 입출력은 각 기기의 ESP32가 맡도록 역할을 나눴습니다.

시스템 전체 모습: 라즈베리파이, 음악 스피커, 스마트 전등, 음성대화봇

시스템 구성

mermaid
flowchart TB
    PI["<b>Raspberry Pi 5</b><br/>Gemini · edge-tts · mosquitto(MQTT)"]
    BOT["<b>AI 음성대화봇</b><br/>ESP32-WROOM-32E"]
    SPK["<b>음악 스피커</b><br/>ESP32-WROOM-32E"]
    LAMP["<b>스마트 전등</b><br/>ESP32-C3"]
    PHONE["휴대폰"]

    BOT -- "UDP 5005 · 마이크 PCM" --> PI
    PI -- "UDP 6000 · 음성 응답 PCM" --> BOT
    PI -- "TCP 6001 · 음악 스트림" --> SPK
    PHONE -. "Bluetooth A2DP" .-> SPK
    PI -- "MQTT · 전원/색상/밝기" --> LAMP
    PI <-- "MQTT · 상태 · 볼륨" --> BOT
    PI <-- "MQTT · 모드 · 볼륨" --> SPK
데이터방식이유
상태 전환 · 제어 명령MQTT작고 가벼운 메시지
짧은 음성 (마이크 · 응답)UDP지연이 적음
긴 음악 스트림TCP손실 없이 순서 보장

폴더 구조

text
firmware/
├── voice_bot/       AI 음성대화봇 (Arduino)
├── music_speaker/   Wi-Fi · Bluetooth 음악 스피커 (Arduino)
└── smart_lamp/      스마트 전등 (ESP-IDF)
server/              라즈베리파이 코드 (Python)
hardware/
├── lamp_v1/         전등 PCB v1 — KiCad 원본, 거버, BOM, CPL
└── lamp_v2/         전등 PCB v2 (진행 중) — KiCad 원본
docs/images/         사진 · 회로도 · PCB 이미지

1. AI 음성대화봇 — firmware/voice_bot

  • ESP32는 마이크 · 스피커 입출력만, Pi는 음성인식 · LLM · TTS를 담당
  • 상태(idle · listening · thinking · speaking · playing_music)는 MQTT, 음성은 16-bit / 16kHz mono PCM을 UDP로 전송
  • RMS 기반 VAD로 말할 때만 전송. 음악이 재생 중이면 역치를 높여 음악 소리를 무시
  • 응답 재생 중(+300ms)에는 녹음하지 않아 자기 목소리를 명령으로 인식하지 않음
부품연결 (ESP32 GPIO)
INMP441 마이크 (I2S)SCK 32 · WS 33 · SD 34
MAX98357A 앰프 (I2S)BCLK 26 · LRC 25 · DIN 22
스피커8Ω 3W
음성대화봇 실제 배선

2. Wi-Fi · Bluetooth 음악 스피커 — firmware/music_speaker

  • 대화 응답과 음악이 한 스피커에서 충돌하지 않도록 기기를 분리
  • Wi-Fi 모드: Pi의 음악을 TCP로 수신 (44.1kHz 스테레오) / Bluetooth 모드: 휴대폰과 직접 연결
  • 모드 전환: BOOT 버튼 1초 또는 MQTT music/mode ← bt / wifi
부품연결 (ESP32 GPIO)
MAX98357A 앰프 (I2S)BCLK 26 · LRC 25 · DIN 22
모드 전환 버튼BOOT (GPIO 0)

완성된 음악 스피커 음악 스피커 내부 배선

3. 스마트 전등 — firmware/smart_lamp

  • 18650 배터리로 동작하는 무선 전등. PCB를 KiCad로 직접 설계하고 JLCPCB에서 제작
  • Arduino → ESP-IDF로 이전, MQTT 토픽 세 개로 전원 · 색상 · 밝기 제어
  • 제어 함수를 Pi 쪽 server/lamp/core.py로 모아 Gemini · 알람 · (향후) 앱이 같은 함수를 호출
  • 원하는 시간에 켜고 끄는 알람 예약 (APScheduler, cron 방식)
항목내용
MCUESP32-C3
LEDWS2812B 30구 · GPIO 4 · RMT 제어
전원18650 셀 · 5V 부스트
레벨 시프터74AHCT125 (3.3V → 5V)

PCB v1 → v2

v1 (제작 완료)v2 (아트웍 진행 중)
PCB
MCU개발보드를 꽂아서 사용ESP32-C3-WROOM-02 모듈 직접 실장
전원외부 부스트 모듈 사용충전(TP4056) · 부스트(MT3608) · LDO(ME6211) 내장
레벨 시프터74AHCT125 (4채널)74AHCT1G125 (1채널)
LED 전원항상 공급로드 스위치(TPS22919)로 펌웨어가 켜고 끔
펌웨어 업로드개발보드 USBESP32-C3 내장 USB (USB-C)

회로도: v1 · v2


MQTT 토픽

토픽값보내는 쪽 → 받는 쪽
lamp/poweron / offPi → 전등
lamp/brightness0 ~ 100Pi → 전등
lamp/color[r, g, b] 또는 r,g,bPi → 전등
device/stateidle / thinking / speaking …Pi →
music/stateplaying / stoppedPi → 음성대화봇 (VAD 역치 조절)
speaker/volume0 ~ 100→ 음성대화봇
music/volume0 ~ 100→ 음악 스피커
music/modebt / wifi→ 음악 스피커

트러블슈팅

마이크에 잡음만 들어오는 문제 (음성대화봇)

  • 문제: 한 보드에 마이크와 스피커(앰프)를 함께 배선하자 마이크 입력에 "지지직" 잡음만 들어옴
  • 확인: 멀티미터로 각 부품의 전압을 측정하며 하나씩 정상 동작을 확인
  • 해결: 마이크와 스피커(앰프)의 GND 선을 분리해 연결 → 잡음 해결

Wi-Fi · Bluetooth 동시 사용 시 용량 부족 (음악 스피커)

  • 문제: Wi-Fi와 Bluetooth 오디오를 동시에 쓰기엔 ESP32의 용량이 부족
  • 해결: 두 모드로 나누고, Bluetooth 사용 중에는 Wi-Fi 오디오를 끄도록 전환 설계

ESP32-C3는 클래식 Bluetooth 미지원 (음악 스피커)

  • 문제: 휴대폰 음악을 받으려면 클래식 Bluetooth(A2DP)가 필요한데 ESP32-C3는 미지원
  • 해결: 클래식 Bluetooth를 지원하는 ESP32-WROOM-32E 선택

ESP-IDF 전환 후 Wi-Fi 연결 실패 (스마트 전등)

  • 문제: Arduino에서는 잘 되던 Wi-Fi가 ESP-IDF로 옮기자 연결 실패 (인증 타임아웃)
  • 확인: ESP32-C3 저가 보드에서 송신(TX) 출력이 너무 강해 같은 문제가 생기는 사례 확인
  • 해결: 송신 출력을 낮춰 연결 안정화 (34 × 0.25dBm = 8.5dBm)
    c
    ESP_ERROR_CHECK(esp_wifi_set_max_tx_power(34));

빌드 · 실행

공통: 비밀 정보 설정

Wi-Fi · MQTT 계정과 API 키는 GitHub에 올리지 않습니다. 각 폴더의 예시 파일을 복사해 값을 채우세요.

위치복사할 파일 → 만들 파일
firmware/voice_bot/secrets.example.h → secrets.h
firmware/music_speaker/secrets.example.h → secrets.h
firmware/smart_lamp/main/secrets.example.h → secrets.h
server/.env.example → .env

음성대화봇 · 음악 스피커 (Arduino IDE)

  • 보드: ESP32-WROOM-32E 개발보드 (Arduino ESP32 core 3.x)
  • 라이브러리: PubSubClient, 음악 스피커는 추가로 ESP32-A2DP
  • 음악 스피커는 Tools → Partition Scheme → Huge APP (3MB No OTA) 필요

스마트 전등 (ESP-IDF v5.3.1)

bash
cd firmware/smart_lamp
idf.py set-target esp32c3
idf.py build flash monitor

MQTT 브로커 주소는 idf.py menuconfig → Example Configuration → Broker URL에서 설정합니다.

라즈베리파이 서버 (Python 3.13)

bash
sudo apt install mosquitto ffmpeg
cd server
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
set -a; source .env; set +a      # .env 의 값을 환경변수로 불러오기
python assistant.py

ESP32 기기들의 IP 주소는 server/audio_client.py 상단의 VOICE_IP, MUSIC_IP에 입력합니다.


앞으로 할 일

  • 전등 PCB v2 아트웍 완료 및 제작
  • 휴대폰 앱에서 전등 제어 (Pi lamp/core.py 함수 재사용)

Parts

46
QtyValueFootprintReferences
510kResistor_SMD:R_0603_1608MetricR_boot1, R_btn1, R_en1, R_IO2, R_IO8
410uCapacitor_SMD:C_0805_2012MetricC_in1, C_out1, C_out3, C_vdd2
30.1uCapacitor_SMD:C_0603_1608MetricC_IO1, C_level1, C_vdd1
21kResistor_SMD:R_0603_1608MetricR_led1, R_led2
21uCapacitor_SMD:C_0603_1608MetricC_en1, C_in3
222Resistor_SMD:R_0603_1608MetricR_usb_dm1, R_usb_dp1
222uCapacitor_SMD:C_1206_3216MetricC_in2, C_out2
25.1kResistor_SMD:R_0603_1608MetricR1, R2
2Conn_01x02Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ2, J5
2Conn_01x03Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ3, J4
2SW_PushButton_Switch_SMD:SW_SPST_SKQG_WithStemSW_boot1, SW_rst1
11.2kResistor_SMD:R_0603_1608MetricR_prog1
1100Resistor_SMD:R_0603_1608MetricR_TPS1
1100kResistor_SMD:R_0603_1608MetricR_IO1
122kResistor_SMD:R_0603_1608MetricR3
1330Resistor_SMD:R_0603_1608MetricR5
13kResistor_SMD:R_0603_1608MetricR4
14.7uHInductor_SMD:L_Cenker_CKCS5040L1
1470uf / 10VCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC_led1
174AHCT1G126Package_TO_SOT_SMD:SOT-23-5U5
1ESP32-C3-WROOM-02RF_Module:ESP32-C3-WROOM-02U6
1LED_chrgLED_SMD:LED_0603_1608MetricD1
1LED_doneLED_SMD:LED_0603_1608MetricD2
1ME6211C33M5Package_TO_SOT_SMD:SOT-23-5U4
1MT3608Package_TO_SOT_SMD:SOT-23-6U3
1SS34Diode_SMD:D_SMAD3
1TP4056-42-ESOP8Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm_ThermalViasU1
1TPS22919DCKPackage_TO_SOT_SMD:SOT-363_SC-70-6U2
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J1

More from trsh-mn/smart-home-iot

1
  • 2 layers35 × 75 mmLamp v1, the printed circuit board in 3D

    Lamp v1

    trsh-mn/smart-home-iot

    라즈베리파이 5 + ESP32 기반 스마트홈 IoT: AI 음성대화봇 · 음악 스피커 · 스마트 전등 (펌웨어, 서버, KiCad PCB)

    8 parts

Similar boards

  • 4 layers65 × 65.5 mmTiltbox, the printed circuit board in 3D

    Tiltbox

    Freek-Freak/tiltbox-kicad

    kicad files voor tiltbox

    225 parts
  • 2 layers60 × 40.5 mmEnvironmental Monitoring Node, the printed circuit board in 3D

    Environmental Monitoring Node

    kothanikhil9/Environmental-Monitoring-Node

    The system continuously measures environmental temperature using a digital sensor and processes the data through a microcontroller.

    35 parts
  • 4 layers58 × 75 mmTS VDAC A5, the printed circuit board in 3D

    TS VDAC A5

    andrewinsidelazarev/VDAC4

    Графический сопроцессор + HDMI конвертер для ZX Evolution / TS-Config + сетевая карта + звуковой модуль

    61 parts2MIT
  • 4 layers144 × 133 mmTerkaPCB, the printed circuit board in 3D

    TerkaPCB

    kaszmirek/TerkaPCB

    99 parts
  • 2 layers61 × 61 mmESP32 FC, the printed circuit board in 3D

    ESP32 FC

    MAATHES-THILAK-K/ESP32-S3_FLIGHT_CONTROLLER

    A custom-designed flight controller based on the ESP32-S3 module, built for compatibility with the esp-fc firmware and Betaflight-like configuration.

    69 parts7Apache-2.0
  • 2 layers80 × 34 mmDji fcc, the printed circuit board in 3D

    Dji fcc

    nikolaus018/dji-fcc-esp32

    ESP32-S3 firmware that switches a DJI N1 remote to FCC mode over USB (replaces the Android app)

    69 parts3MIT
  • 2 layers30 × 25 mmProject2, the printed circuit board in 3D

    Project2

    devKOff/pcb-lipo-power-management-system

    An integrated PCB power management system for single-cell Li-Po batteries featuring onboard charging, circuit protection, and a DC-DC boost converter with selectable 5V and 12V DC outputs.

    28 parts2
  • 2 layers96 × 74 mmMacroController, the printed circuit board in 3D

    MacroController

    alex1klimovich/nrf52840-macro-controller

    Custom nRF52840 productivity controller for digital artists — PCB, BLE/USB firmware, OLED, haptics, RGB, and enclosure CAD.

    78 parts1

Questions

How big is the Lamp ver2 PCB?

It measures 30 × 74.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Lamp ver2 use?

46 parts, built around the 74AHCT1G126GV, ESP32-C3-WROOM-02-H4, MT3608 and ME6211C33M5G-N. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Lamp ver2 KiCad files?

From the trsh-mn/smart-home-iot repository on GitHub, at the commit this page was made from: the board is hardware/lamp_v2/lamp_ver2.kicad_pcb and its schematic hardware/lamp_v1/전등.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Lamp ver2 design in my own project?

Its repository states no licence, so its author keeps all rights: ask trsh-mn before reusing the design.