{"id":23064036,"url":"https://github.com/timcsy/servoswitch","last_synced_at":"2025-04-03T08:16:40.763Z","repository":{"id":267384851,"uuid":"900609135","full_name":"timcsy/ServoSwitch","owner":"timcsy","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-16T10:44:26.000Z","size":2499,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T21:46:12.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timcsy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T06:15:40.000Z","updated_at":"2024-12-16T10:44:30.000Z","dependencies_parsed_at":"2024-12-10T11:34:46.751Z","dependency_job_id":null,"html_url":"https://github.com/timcsy/ServoSwitch","commit_stats":null,"previous_names":["timcsy/servo_switch","timcsy/servoswitch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcsy%2FServoSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcsy%2FServoSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcsy%2FServoSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcsy%2FServoSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timcsy","download_url":"https://codeload.github.com/timcsy/ServoSwitch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961929,"owners_count":20861186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T04:14:59.518Z","updated_at":"2025-04-03T08:16:40.736Z","avatar_url":"https://github.com/timcsy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Servo Switch 無線懶人開關\n\n![](demo.gif)\n![](ServoSwitchWebsite.png)\n\n## 特色\n- 操作彈性客製化：可通過寫程式（附預設專案程式碼）、API 遙控\n- 支援 WiFi（ESP8266 系列開發版）或藍芽（ESP32 系列開發版）\n- 具備可儲存的定時、閃爍功能\n- 非侵入式安裝：不需要拆除原本開關，不留殘膠，黏著穩固\n- 材料取得方便，都是一些基本元件，成本不高\n- 可用 OLED 螢幕顯示設定網頁的 QRCode，方便操作\n\n## 設置\n\n### 硬體\n\n材料：\n- ESP8266 或 ESP32 系列開發版 x 1\n  - [ESP8266串口wifi模塊 NodeMcu Lua WIFI V3 物聯網 開發 CH340](https://www.ruten.com.tw/item/show?21647522108581)\n  - [ESP32 開發板](https://www.ruten.com.tw/item/show?22133499835548)\n- SG90 伺服馬達 180 度 x 2\n  - [SG90 伺服馬達 舵機 9克伺服機 180度](https://www.ruten.com.tw/item/show?21513817238652)\n- 3M 無痕迷你膠條 x 2 小片\n  - [3M™ 無痕™ 迷你膠條 18964, 文具通路獨家包](https://www.3m.com.tw/3M/zh_TW/p/d/v000064184/)\n- 杜邦線（公母 x 6，母母 x 4 如果選用 OLED）\n  - [杜邦線 10公分 公對母 10條1單位 彩色排線](https://www.ruten.com.tw/item/show?21535514541815)\n  - [杜邦線 10公分 母對母 40條1單位 彩色排線](https://www.ruten.com.tw/item/show?21535514562032)\n- 電源（充電頭或是行動電源）、Micro USB 電源線\n- OLED SSD1306 x 1 （可選）\n  - [0.96寸 白色 I2C IIC通信 12864 OLED顯示屏模塊 提供例程](https://www.ruten.com.tw/item/show?21715781100384)\n\n接線（如果選用 [ESP8266 系列開發版](https://honeststore.com.tw/esp8266-pin-out/)）：\n- OLED 螢幕\n  - GND 接 GND\n  - VCC 接 D5\n  - SDA 接 D2\n  - SCL 接 D1\n- 上方伺服馬達\n  - 棕線接 GND\n  - 紅線接 3V3\n  - 橘線接 D4\n- 下方伺服馬達\n  - 棕線接 GND\n  - 紅線接 3V3\n  - 橘線接 D8\n\n接線（如果選用 [ESP32 系列開發版](https://zerotech.club/esp32-gpio/)）：\n- OLED 螢幕\n  - GND 接 GND\n  - VCC 接 GPIO19\n  - SDA 接 21\n  - SCL 接 22\n- 上方伺服馬達\n  - 棕線接 GND\n  - 紅線接 5V\n  - 橘線接 GPIO12\n- 下方伺服馬達\n  - 棕線接 GND\n  - 紅線接 3V3\n  - 橘線接 GPIO23\n\n請把伺服馬達附的單邊舵角安裝上去，並且按以下的說明校正之後用螺絲固定。\n\n### 軟體\n\n請先下載 Arduino IDE\n\n如果是 ESP8266 系列開發版，請參考 [Arduino core for ESP8266 WiFi chip](https://github.com/esp8266/Arduino) 來安裝設定\n\n如果是 ESP32 系列開發版，請參考 [Arduino core for the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2](https://github.com/espressif/arduino-esp32?tab=readme-ov-file) 來安裝設定\n\n去 Arduino IDE 的程式庫管理員安裝以下套件：\n- [ArduinoJson](https://arduinojson.org/)\n- [WiFiManager](https://github.com/tzapu/WiFiManager)（如果選用 ESP8266 系列開發版）\n- [ESP32Servo](https://github.com/madhephaestus/ESP32Servo)（如果選用 ESP32 系列開發版）\n- [QRcodeOled](https://github.com/yoprogramo/QRcodeOled)（如果選用 OLED）\n\n可以依照需求修改程式，最後選擇你的開發板與連接埠，將 `ServoSwitch.ino` 燒錄至開發版。\n\n\n## 使用說明\n\n### ESP8266 系列開發版\n\n由序列埠或是 OLED 來取得板子的 IP 位址，並且去 http://你的IP位址 進行 UI 操作。\n\n### ESP32 系列開發版\n\n在瀏覽器（iOS 或是 iPadOS 用戶請使用 [Bluefy 瀏覽器](https://apps.apple.com/tw/app/bluefy-web-ble-browser/id1492822055)，因為蘋果的一般瀏覽器無支援 [Web Bluetooth API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API)）開啟 https://timcsy.github.io/ServoSwitch/，並且連接到藍芽裝置 `Servo Switch`。\n\n連接成功後即可進行 UI 操作。\n\n### UI 操作\n\n有提供即時操作的功能（懶人開關），開啟、關閉以及閃爍（閃爍的部分可以指定時長與終止狀態，3 秒會切換一次狀態）。\n\n`CALIBRATE` 是校正的功能，在一開始安裝伺服馬達的時候可以使用，會在一段時間內讓馬達從 0 度轉向 180 度，會後會停在 90 度，請讓單邊舵角的方向跟馬達的機身平行，並且指向前面。之後就可以鎖上螺絲，兩顆馬達都校正之後可以試試 `TURN ON` 或是 `TURN OFF`。\n\n也有提供鬧鐘設定功能，可以設定狀態、時間以及重複的頻率，也可以瀏覽刪除鬧鐘。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimcsy%2Fservoswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimcsy%2Fservoswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimcsy%2Fservoswitch/lists"}