2017年11月7日 星期二

arduino手機控制開門

使用arduino控制開門,與上次不同的是這次code非常簡單,麻煩的反而是機構設計。光是馬達我就從continuous servo(因為是以時間定位會有位置誤差) -> step motor(扭力不足) -> servo才達成想要的目的。另外零件不好找也是一大問題,克難滑輪組(3M電線貼)阻力過大的問題也是後來才發現。

另外一開始沒發現買到的是continuous servo而不是servo,在code上面也卡了一下,continuous servo的數值是速度而非角度。

另外供電不足會造成馬達抖動。由於有接紅外線的module,本來是想用並聯的方式供電,結果馬達就抖動不受控制,找了一些資料以為是電磁干擾,後來獨立拉一條線路供電後就沒事了。供電不足時arduino yun會重啟,並且l13 LED會閃。

這次同時也使用了電晶體想增加紅外線LED的遙控距離,不過還是沒辦法達到理想的要求,換過LED本身也沒用。最後是拉線解決。

第一版

第二版


2018/11/4更新
發現Yun在太久連不到網路後會回復網路預設值,需要再一次手機重新連上後設定無線網路。並且會出現"Could not connect to YunServer 146 Connection refused"的錯誤訊息。解決方法是再重新上傳一次sketch即可解決。另外如果序列埠那邊找不到yum wifi ip,電腦需安裝bonjur後yun重開即可搜尋到。

2019/5/22更新


參考資料

步進馬達
http://ee543.blogspot.tw/2016/01/arduino-uno420.html
http://atceiling.blogspot.tw/2013/04/arduino.html

continuous servo
https://arduino.stackexchange.com/questions/1321/servo-wont-stop-rotating

servo
http://atceiling.blogspot.tw/2017/03/arduino.html
http://www.hobbytronics.co.uk/arduino-tutorial2-servos
http://thats-worth.blogspot.tw/2013/12/arduino-controlling-servo-motor.html

MG995 spec
http://bugworkshop.blogspot.tw/2016/09/diy-robot-towerpro-mg995-servo.html

string to int(角度控制)
https://www.arduino.cc/en/Tutorial/StringToIntExample

電晶體腳位判斷
http://gc.digitw.com/MyDocument/Recognize-Transister/RecognizeTR.htm
http://coopermaa2nd.blogspot.tw/2011/03/lab21-12v.html
http://cms.35g.tw/coding/arduino-remote-daikin/

USB ping腳供電
http://www.coolaler.com/threads/3pinusb.240842/
http://yehnan.blogspot.tw/2013/09/arduinotower-pro-sg90.html

麵包板並聯
https://www.guokr.com/post/718305/

"Could not connect to YunServer 146 Connection refused"
http://yehnan.blogspot.com/2016/04/arduino-yunwi-fi.html
自己

arduino email solution

想使用arduino在需要時發email通知。一開始找ethernet library,結果要使用的話必須要有public ip,後來找到的方法是利用arduino sdk寫code再利用外部網站API達到目的,不過那個需要付費並且掌握在別人手上。後來找到直接install apk在arduino linux上即可達到目的,為了這個還發現arduino出廠時是使用factory image,必須要自己upgrade才能獲取全部的arduino society support。看到download.linino.org就代表你是連到factory自己建的repository,不但常常掛資源也少,正確的應該是downloads.arduino.cc

參考資料

ethernet lib
https://forum.arduino.cc/index.php?topic=126829.0

arduino sdk
http://tronixstuff.com/2013/11/23/tutorial-send-email-with-the-arduino-yun/

arduino linux
http://www.binarypower.com/2014/07/use-arduino-yun-to-send-emails-simple.html

download.linino.org
https://forum.arduino.cc/index.php?topic=286191.0