Smart Curtain

by Zhangyifan in Circuits > Arduino

18600 Views, 139 Favorites, 0 Comments

Smart Curtain

3FC07B5AD928CF4E862BAFACD150595E.jpg
2DE58C8946D48B2A8D3090EAE91C3A95.jpg

Tired of opening and closing the curtain every morning and evening, I tried to design a device that can open and close the curtain in my room automatically according to the illumination outside. My initial design is to use a motor to move a a rubber conveyor that is connected with the curtain. Here's a scratch of my design. In fact, I have several different designs, including using a screw rod, using two motors with a line, and using conveyor. Finally, I decided the use adopt the conveyor design because its both cheap and easy.

Purchase Needed Items on the Internet

261C06ED6046343706D4DF1AB308F8C4.jpg
35EFDCB20D7EACFBC25CEF81565E3A2E.jpg

I afraid the common motors may not pull the curtain to the right place every time, so I decided to use steppers. I bought steppers, conveyors, gears, and light-sensitive resistors from the internet. With the help of the internet, I also learned the correct way to use steppers. The limited voltage one the stepper is definitely wrong--3.3V DC is too low. I used a 12 volt power supply.

Write Program

My program consists of two parts: stepper drive part and light measurement part. Every minute, the light measurement part will measure the ligth intensity 10 times and save all these data into a array. Than all elements of the array is added together to get the final value that determines the opening or closing of the curtain. I decided to measure the light intensity 10 time mainly to avoid sudden and short variations of light intensity. For example, if the light-sensitive resistor is illuminated by someone's electric torch at the mid night for a second, my Smart Curtain won't open because a single high light intensity value will not increase the sum of all ten values too much. There is also a gap between opening and closing value in order to prevent the constant opening and closing when the light intensity is close to the threshold value. If the opening and closing values are the same number, for instance, 100, the usual light intensity fluctuation near 100 will cause the curtain to open or close many times. I also set long delays because it is not important to measure the light intensity so often. The txt of my Arduino program is provided above.

Connect the Wires and Test

9A69EA10425AC57E39B12064D8D821A5.jpg
6AF94ECC1EE72D95841726F49842AF76.jpg

Connect the wires according to my program, and test the motor drive, stepper, light-sensitive resistor, and program before implementing them on the wall. The first picture was taken during my testing part, and the second picture is my motor drive. I used A4988ET motor drive. The threshold light intensity for opening or closing was also determined during the testing process. After testing, it is the time to make containers of the motor and gear.

3D Print Containers

3FA31CE9F27D475607429CC62C1E28A0.jpg
9B83B33FD986C854F4C03F216B9DBA0D.jpg
DEE01E6437F65C53C5B9B5771DCB96E4.jpg
6BE89408EDFA6CC40FAE2386AF002806.jpg
16D659DFAA7EA33D53513C59A5B75BAB.jpg
DC527B519FFF147FFBA9A16FDFB229EB.jpg
D4DD3BA0E45919095426ACA0316F309C.jpg

I designed my containers using 3D One( Education version), and cut it to slices which are acceptable for 3D printers through Repetier-Host. I because the size of my container must match the size of my motor, an accurate measurement of the size of my motor, gear, and space under the ceiling is crucial. A vernier caliper is preferred. The thickness of my containers is 5mm, and the density is 20%. After I had finished my model, I printed that out using the 3D printer in the XmakerSchool, South West JiaoTong University, China.

Implement Containers and Connect to the Curtain

C49071535A59473B6192B4F5FB44502E.jpg
A54EB6265D23C82A1927C34BEC65A323.jpg
C9ED99F88D7E97ED27A5537CA8F82AA5.jpg
A196D98B798DF95F0262120A6CA3EA5B.jpg
A9FA838CC57E33B5F1D9335CD4BA7361.jpg

I used electric drill to make setscrews into the ceiling and put gaskets between the containers and the setscrew because I afraid that my containers are not strong enough. Don't forget to put some newspaper on the floor before beginning to drill, because the powder from the ceiling is extremely difficult to collect. In my design, the conveyor is directed connected to the curtain, and the length between the curtain and the conveyor shorter than the distance of the link between them. As a result, the link will have a angle which enables the stepper to pull the curtain easily.

Power Supply and Final Adjustment

5183EC8A8DBE95789B1531940FFB8B1D.jpg
3FC07B5AD928CF4E862BAFACD150595E.jpg
0B639174DB0460A5A7C04D5E160140F9.jpg

I put my Arduino board on the frame of the window using Scotch tape. Because my wire is too short, I had to use patch board. Because the total mass of the patch board and wire is too heavy for Scotch tape, I used a rope to hold the patch board. The light-sensitive resistor was also put on the window with Scotch tape. After examining the heat generation and the stability of the system, my Smart Curtain was finally finished! I can now stop opening and closing the curtain in my room with my hand.

Even though, I think that my curtain should also be able to be control by human, but just light intensity. I was now trying to use Bluetooth to control it, and I will publish new Instructables after by Bluetooth part has been finished in the future. If you have any suggestions or advice, please tell me! Also, I think there must be some grammar mistakes in this Instructable because I'm a non-native English speaker. Thanks for your tolerance of my poor grammar and thanks for viewing!

Bluetooth Control Added

23094A33BBC6EEFE4A29F6B7059FE18E.jpg
2866D50300284D9522B35B3D594F5FB1.png
AC074A6B893625697E291D6C9FA2A027.png
810610BEE938CD1EB4A1800CBF13D3BA.jpg
84CC5C4A0CD56C60EE4123B3A9CCD644.jpg
D460679B51B35F1990F69099F8F37955.jpg

I have finally completed my study the use of Bluetooth in Arduino and improved my previous Smart Curtain with Bluetooth technology. First, get a Bluetooth part and implement it on Arduino. Remember that the TX and RX on the board should be connected to the RX and TX of Bluetooth, respectively. Second, I improved my program by adding a condition change. The user can change the condition of the curtain using Crazy Car, an app on cell phones. When in Automatic mode, the curtain respond to the light intensity; while in manual mode, the curtain only respond to signal sent by the cell phone using Bluetooth. I used an LED to indicated the status of the curtain. By the way, I found that there was not enough GND on the Arduino board so I soldered two wires to it. My new Arduino program and app Crazycar were provided here.