Skip to content

hideyuki/watering-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

水やりロボット 改め、"水やって!"というロボット

  • Jun. 14, 2914: Beatrobo ハードウェアハッカソン #brhack で作ったものです。
  • 私の作るものは「全自動水やりロボット」から「”水やって“と言ってくれるロボット」に変更となりました!
    • 人が水をやらないといけない。
    • ロボットにとってはヒトもシステムの一部なのです。
    • つまりは、ロボットがヒトを使って水やりを達成しております。

3D CAD

image

  • 湿度センサをむき出しにしていると怖いのでケースを作りました。
  • メインパーツと蓋パーツの2部品です。
  • 3d-cad ディレクトリに Autodesk Inventor 2014 形式(ipt) と STL 形式(単位: mm) が入っています。
  • Sculpteo にもデータをアップロードしています: メインパーツ, 蓋パーツ
    • そのままオンラインで注文できます。

Arduino

image

  • 利用しているボード: SainSmart UNO R3 ATmega328-AU Development Board Compatible With Arduino UNO R3
    • 普通のArduinoとは違い 3.3V zでの動作が可能。RaspberryPiと電圧変換なく接続できるようになります。
    • amazonから購入できます。¥1,990 (2014年6月15日現在)
    • マニュアルはこちら
  • シリアル経由で送られてくるコマンドにより、湿度センサ・温度センサのアナログ値をシリアルでRaspberryPiに送ります。
    • RaspberryPiとは、USB経由で接続
  • コマンド一覧
    • m: Moisture。湿度センサのアナログ値を返す
    • t: Temperature。温度センサのアナログ値を返す
  • 湿度センサは http://akizukidenshi.com/catalog/g/gM-07047/
  • シリアルの通信速度は 9600 bps
  • screenでシリアル通信するコマンド
$ screen /dev/tty.usbmodem1411 57600
  • screenの終了は [Ctrl+a, k]

土の湿度センサ

image

温度・湿度センサ

image

$ git clone [email protected]:adafruit/DHT-sensor-library.git
$ cp -rf DHT-sensor-library ~/Documents/Arduino/libraries/

RaspberryPi (Model A)

  • Arduino から温湿度のアナログ値を取得したらhubotのHTTP APIに投げる
  • Raspbian with 4GB SD Card
  • Arduino と RaspberryPi を USB で接続すると、RaspberryPi には /dev/ttyACM0 と認識される。

準備

$ sudo apt-get install python-serial

もしくはpip入っているなら

$ pip install -r requirements.txt

rpiでの無線LAN接続方法

  • USBタイプの無線LANドングル GW-USNANO2A を利用
  • 無線LANのつなげるためのコマンドは以下
# vi /etc/network/interfaces
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# wpa_passphrase ESSID PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf
# ifdown wlan0
# ifup wlan0
  • IPを知らなくても外部からSSHできるように avahi-daemon をインストール
# apt-get update
# apt-get install avahi-daemon
  • ホスト名が最初は raspberrypi なので、watering に変更しておく
# vi /etc/hostname
watering
# vi /etc/hosts
127.0.1.1       watering
  • そうすると、外部PCから以下のコマンドでsshできる
hide@mac$ ssh [email protected]

cronでのスクリプト実行

1日おきにhubotに温湿度情報を通知。

0 12 * * * export HUBOT_API_BASE_URL=http://hogehoge.com; python /home/pi/watering-robot/rpi/serial-hubot.py;

About

watering robot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published