Arduino 專案 - 以電視遙控器控臥室天花板電燈開關 (1) - Arduino Project - Switch Ceiling Light with TV remote Part 1

這一兩個月來,一直在看 Arduino 的相關資料,終於有一個 "勘用" 的東西...
It's been a month a or two that I have been studying Arduino related information.
Finally, I came up with a useful cases for a project that could potentially solve my pain point.

睡覺前,在寒冷的冬天,要從床上起關燈時,總覺得很麻煩...
所以當初看到 Arduino, 第一個想完成的 project 就是,利用電視遙控器來控制天花板上的燈了...上網找了一下資料,沒想到已有很多前輩已經有寫類似的,所以就參考來用了!這是我做初版,coding 太久沒寫了,所以很亂,還好能運作...
It must be happened to you before that in a very cold night watching TV or movie in bed and you were ready for bed. You turned off the TV or DVD player with remote control easily. However, for the bedroom light, you just had to get out of the bed to turn the light off. What a pain point!!

So, my first project is called "Remote control light switch with Arduino and TV remote".  After I searched the internet, there are many examples already out there, such as IR receiver, relay module, RGB LED shift hue and most of them have codes that I could utilize on my project.  It's been a long time since my last coding, so the code is kind of messy, but it worked!


零件清單(全部在台灣拍賣上取得: Components used list (All acquired on auction sites) 
Arduino mini pro * 1 = NT$125

Arduino USB 上傳模組 
(Arduino USB upload module) *1 = NT$140 
5V / 10A 125V 繼電器模組 (Relay module) * 1 = NT$65
IR 接收器 (IR Receiver) * 1 = $4
RGB LED *2 = $6
一些線材 (Some wires) $10
家裡電視 or DVD遙控器 (TV or DVD remote) Free

麵包板 (Breadboard ) * 1
創作過程樂趣 (Effort and enjoyment of this creativity, priceless) * 1 無價! 

模組搖控功能如下:(Remote module Function)

Assign two button on your TV or DVD remote to control:

Button 1: A) LED 小燈亮
橘色 (取代原本小夜燈), B) LED 彩色循環,C) LED Off 
_________ Switch among A) LED bed room night light B) Shift RGB LED colour hues C) LED offButton 2: 切換繼電器開關 (以後把110V燈接上去,就可以開關了)
________ Turn light switch (I have to plug 110V power plug on the relay later)

設定的 Button 要是最不常用的,最好是電視關掉時,按下去的鈕不會有任何反應。像電源鈕就不建議,以免使用時關燈時又把電視打開.... 那就很 Orz..
You can share the TV remote for this project, so there is no need to use a separate remote. Make sure the buttons you are going to use are less frequently used on the remotes. Power buttons on the remote are not recommended, since it's likely that you turn off the light, but the TV or DVD is turned on. I assume that's not something you would like to see.
模組線路圖:(My first drawing of the wiring chart)

原型電路板 +電視遙控器:
Here is prototype + TV remote used for the project

小燈 +LED 彩色循環 +繼電器關關。注意聽,影片中有切換繼電器的聲音。
Bed room night light -> Shift LED colour hue -> LED off
Relay on / off (Listen carefully, you can hear the relay switch in the video)




PS:你可以多設幾支搖控器,以免要用的那支沒在床邊,還是得起床!像我設了兩支臥室常用的。
PS:  You may setup few more remote for the same function. Just in case, the light remote is not with you and then you need to get out of the bed eventually. In  my project, I have setup 2 most frequently used remote in the bed room.

接下來: 我要想想如何才能裝到天花板的電燈裡!
What's next, I need to figure out how to connect this module to the light on the celling.



Comments

Popular posts from this blog

Arduino - DFPlayer Mini MP3 Module

Android control color RGB LED using HC-05 Bluetooth with Arduino (Part I)

Arduino #27 AsyncWifimanager ElegantOTA ESP32 (WiFi Password Mgnt. + WiFi Firmware Update)