Cat Type Robot Cleaner 猫型ロボット掃除機
by asatomomoka in Circuits > Arduino
499 Views, 9 Favorites, 0 Comments
Cat Type Robot Cleaner 猫型ロボット掃除機



猫型ロボット掃除機です(ぼくドラ〇もん)
レーザー距離センサーを使い、高速で部屋中を走り回ってモップがけします
I'm not good at English. I will post a Japanese machine translation
It's a cat robot cleaner
Use the laser distance sensor to run around the room at high speed and mop
Supplies

Circuit Creation 回路作成



Arudoino Nanoに次のパーツを接続します
- レーザー距離センサー、OLEDディスプレイをI2Cで接続します。同じ端子に接続していますが、レーザー距離センサーとOLEDディスプレイのI2Cアドレスが違うので使用できます。
- 5V端子に電池の+、GNDに-を接続します。
- モータードライバをGPIO8,7,6,10,12,11,9に接続し、ギアボックスのモーターに接続します。その時モーターにはセラミックコンデンサを使ってノイズを取る事を忘れずに。
- 抵抗1MをGPIO14,15入力に接続することで、静電容量センサーとして使います。片方をタッチすると静電容量が変化します。変化したら起動開始。
- サーボをGPIO5に接続します
- 圧電スピーカーをGPIO3に接続します
Connect the following parts to the Arudoino Nano
- Connect the laser distance sensor and OLED display with I2C. Although it is connected to the same terminal, it can be used because the I2C address of the laser distance sensor and the OLED display are different.
- Connect the + of the battery to the 5V terminal and-to the GND.
- Connect the motor driver to GPIO8,7,6,10,12,11,9 and connect it to the motor in the gearbox. At that time, don't forget to use a ceramic capacitor for the motor to remove noise.
- By connecting a resistor of 1M to the GPIO14 and 15 inputs, it can be used as a capacitance sensor. Touch one to change the capacitance. Start starting when it changes.
- Connect the servo to GPIO5
- Connect the piezo speaker to GPIO3
Body Creation ボディ作成

.png)


- 3Dプリンタで(Cat_sensor.stl)を作成します
- レーザー距離センサーをビスで取り付けます
- 3Dプリンタでベース(Cat_base.stl)を作成します
- サーボを取り付けます
- サーボとモップを繋ぎます
- サーボとロッド(Cat_rod.stl)を繋ぎます
- ロッドとレーザー距離センサーを繋ぎます
- Create (Cat_sensor.stl) with a 3D printer
- Attach the laser distance sensor with screws
- Create a base (Cat_base.stl) with a 3D printer
- Install the servo
- Connect the servo and mop
- Connect the servo and rod (Cat_rod.stl)
- Connect the rod and the laser distance sensor
Code コード
コードの基本的な機能は下記になります
- 障害物が遠くであれば、全速前進
- 障害物が近くであれば、減速
- 障害物にぶつかりそうであれば、左旋回
- 長時間障害物にぶつからなければ、スタックしているとしてバックして旋回
- 尻尾をフリフリ
- 左に障害物があれば右に曲がる(逆も)
- 最初、待機モードで起動ボタン押下で走行モード
- 掃除時間が終了したら、待機モードに戻る
- 待機モード中は「帝国のマーチ」が鳴ります
The basic functions of the code are as follows
- If the obstacle is far away, move forward at full speed
- Decelerate if obstacles are nearby
- If you are about to hit an obstacle, turn left
- If you do not hit an obstacle for a long time, back and turn as if you are stuck
- Flirt the tail
- If there is an obstacle on the left, turn right (and vice versa)
- First, in standby mode, press the start button to drive mode.
- When the cleaning time is over, return to standby mode
- "Imperial March" sounds in standby mode