[PYTHON] I couldn't escape from the futon, so I made a fully automatic futon peeling machine.

Overview

Escaping from the futon on its own on a cold winter morning is known to be very psychologically distressing, and reduced activity in the morning in the winter has caused great losses to the Japanese economy. I don't know if this is the case, but if I don't leave home early in the morning, my graduation will be in jeopardy, so I decided to take measures. The method that comes out by searching for "how to escape from the futon" (keeping the alarm clock away from the bed, sleeping with heating, etc.) seems to be effective at first glance, but when I actually tried it, I stopped the alarm clock. It became clear that he would fall asleep twice after turning off the heating or turning off the heating. I'm a lazy person, so I have to somehow disable the futon to really escape. Therefore, in this paper, we will consider the production of a machine that peels off the futon using a Raspberry Pi. The outline of the implementation is shown in the figure below. The goal is to pull the thread attached to the futon with an electric reel and wind it up, thereby peeling off the futon. In addition, the Raspberry Pi will be turned into a Web server so that it can be peeled off from a smartphone and set the time. スクリーンショット 2020-01-04 16.36.39.png

Things to prepare

material Quantity Remarks
Raspberry Pi 3 Model B+ 1 piece I think it's possible to have a lower-end one
AC adapter for Raspberry Pi 1 piece
bread board 1 sheet
Jumper wire 15
Electrical wire 4m
Motor driver module 1 piece
Gearbox 1 piece
Battery box(AA x 3) 1 piece
Masking tape holder 2 pieces
Kamaboko board 1 sheet
string 5m in total OK with PP rope
Shock non-tape 20cm
AA batteries 3
Safety pin Two

In addition, I used a screwdriver set, a set of soldering irons, nippers, and adhesives (cellophane tape, gum tape, Aron Alpha).

Implementation

Assembly of electric reel part

After assembling the twin motor gearbox, I made a hole in the kamaboko board that was the right size for some reason and fixed it. In order to link the bobbin (masking tape holder cut in half) with the shaft of the gearbox, I cut out about 8 cm of the one with a large coefficient of friction (shock non-tape), wrapped it tightly around the shaft, and inserted the bobbin. The progress of the work up to this point is shown in the figure below. I'm too bad at soldering, and it smells like fish, but it's okay ... 図1.png

Connection with futon

Next, the reel part is connected to the futon. Attach a safety pin to the top of the duvet, tie a thread to it, and tape the other end of the thread to the white spool. I think it's aesthetically pleasing, but the completed drawing is as follows. IMG_3548.png

The reel part is hung from the upper clothesline. Since the reel will rotate around the suspended thread, the cardboard used as the underlay in the Amazon box is attached to the clothesline, and the reel is tied to the clothesline to ensure a certain degree of stability. ing.

Try rotating the reel

This figure It can be realized by controlling GPIO as follows (see here for the code).


import RPi.GPIO as GPIO
import time

# init gpio
GPIO.setmode(GPIO.BCM)
channel_list = [24, 25]
GPIO.setup(channel_list, GPIO.OUT)
#Try rotating clockwise for 10 seconds
GPIO.output(24, True)
GPIO.output(25, False)
time.sleep(10)
# stop
GPIO.output(24, False)
# cleanup
GPIO.cleanup()

Let's run it now. IMG_3551.png

** You did it! !! !! ** (There are various problems, but they will be described later)

Setting of peeling time

Using WebIOPi, Raspberry Pi was made into a Web server, and the execution time of the script that turns the reel can be set from a smartphone or the like. When you access the setting page, the screen shown below is displayed. When you send the time

--The task of pulling up the futon by rotating the reel for 10 seconds at the set time --The task of releasing the futon by rotating the reel in the reverse direction for 10 seconds 3 hours after the set time.

Two of them are now registered in Raspberry Pi's crontab (the idea is that if you disable the futon for 3 hours, you won't sleep twice). For the implementation of this area, I have summarized the code in this repository, so if you are interested, please. スクリーンショット 2020-01-04 21.01.13.png

problem

The position of the reel is too unstable and the string goes off course

Due to the design of hanging the reel from above, it is difficult to fix the position of the string with respect to the winding part, and the string is caught between the white spool and the plastic part surrounding it, and it gets stuck while making some terrible noise. The situation that it ends up occurs quite often. This has a big problem in practical use.

The sound is amazing

Probably because this gearbox wasn't designed for use in the air (?), It makes noise beyond human intelligence every morning while winding the cord. I don't know because I haven't measured it, but I can feel the sound about twice the maximum volume of the iPhone's alarm clock from above, so honestly, the sound is too noisy regardless of the futon, so I have to get out of bed. It has become. Although it is good because the original purpose has been achieved, there is a concern that it may be a nuisance to the neighborhood, so this is where improvement is required.

If you have come up with a better way to remove the futon based on the above problems, please let us know in the comments. Thank you for reading to the end.

Recommended Posts

I couldn't escape from the futon, so I made a fully automatic futon peeling machine.
I touched "Orator" so I made a note
I made a browser automatic stamping tool.
I couldn't refer to Homebrew libmms from mimms, so it's a symbolic link.
I made a tool to generate Markdown from the exported Scrapbox JSON file
[Python] I made a system to introduce "recipes I really want" from the recipe site!
[Python] I made a classifier for irises [Machine learning]
I made a command to markdown the table clipboard
I made a function to crop the image of python openCV, so please use it.
I made a tool to automatically generate a simple ER diagram from the CREATE TABLE statement
〇✕ I made a game
I tried the site "Deploy Azure virtual machine from Go"
I installed the automatic machine learning library auto-sklearn on centos7
I made a tool to create a word cloud from wikipedia
I made a function to check the model of DCGAN
I made a dot picture of the image of Irasutoya. (part1)
I made a dot picture of the image of Irasutoya. (part2)
I made you to execute a command from a web browser
I made a Line bot that guesses the gender and age of a person from an image