總網頁瀏覽量
2014年3月15日 星期六
2014年1月25日 星期六
S4A IO Board/Shield for Arduino 詳細介紹
一.簡介
S4A
IO Board/shield主要設計給Arduino或S4A初學者使用的一塊擴充板,除了支持一般杜邦接頭3 pin腳位外還可以連接10組RJ11的接頭(五組數位及五組類比)感測元件(另購),如溫濕度感測器、土壤濕度感測器等。另外預留一個藍芽孔位給需要無線傳輸的使用者,可利用此無線傳輸跟Android手機或電腦溝通。此外也提供外部電源切換。此擴充板相容於Arduino Duemilanove 、UNO、Leonado。
特點:
1. 五組RJ11(6P4C電話線)數位接頭及五組類比接頭容易外接其他裝置或感測器,可以連接至少10公尺長距離的終端感測器或裝置(另購)。
2. 電源紅色LED。
3. 一顆 綠色LED 連接D13腳位
4. 預留一個藍芽孔位(UART)
5. Jumper可切換Vcc為內部電源(5V)或外部電源供給。
三. RJ11(6P4C電話線)接頭腳位說明
RJ11接頭中其中兩接腳為VCC及GND,另外兩根接腳為IO訊號接腳,也就是說連接RJ11的感測元件可以利用此兩根IO溝通訊號,例如I2C訊號就可以利用A4、A5那個孔位連接裝置。
四. 安裝藍芽模組說明
#### 請注意安裝藍芽模組腳位一定要正確對應IO Board上的藍芽預留孔位###
參考網站: http://motoduino.com
2014年1月5日 星期日
Raspberry (樹莓派) 與 Arduino Shield 橋梁: MotoPiduino 介紹及I2C檢測
此塊MotoPiduino的功能之前大概說明過,這次說明一下IO 腳位的用途及對應Raspberry Pi的腳位.
從下圖板子可以看出有兩排腳位,此腳位剛好可以對應Arduino 腳位, 相容於Arduino UNO/Deumilanove. 也可以接兩顆DC馬達.
從下圖板子可以看出有兩排腳位,此腳位剛好可以對應Arduino 腳位, 相容於Arduino UNO/Deumilanove. 也可以接兩顆DC馬達.
下圖是使用MotoPiduino時, Raspberry Pi 跟 Arduino腳位的對應. 可以看出都是Digital Pin腳位對應Raspberry Pi, 只有 A4及A5對應到Raspberry GPIO02 GPIO03, 主要是I2C 控制IO. 所以可以把以前接Arduino的 I2C 周邊接到此處(A4/A5).
接下來說明如何 enable raspberry Pi 的 I2C 功能. 把MotoPiduino連接到Raspberry Pi後,如下圖.
sudo
nano
/etc/modules
#加入底下兩行
i2c-bcm2708
i2c-dev
#安裝I2C
tools
sudo
apt-get install python-smbus
sudo
apt-get install i2c-tools
#修改raspi-blacklist.conf
sudo
nano
/etc/modprobe.d/raspi-blacklist.conf
#blacklist
spi-bcm2708 ß
前面加個
#
#blacklist
i2c-bcm2708 ß
前面加個
#
#Check連接的裝置
sudo
i2cdetect -y 1
看到顯示48表示MotoPiduino上的 I2C address為 48(16進制) 處於溝通狀態. 接下來試試疊上一個Arduino Proto Shield, 在Proto Shield上有一個I2C介面重力加速度計及陀螺儀 (9DOF), Data Pin接到A4及A5. 如下圖.
在試著在command line下 sudo i2cdetect -y 1 則可以看到顯示 53數字, 表示偵測到9DOF的裝置(I2C address為 0x53).
#下一次再來說明接I2C LED 七段顯示器如何顯示數字,如下圖!
Data: http://motoduino.com
2013年9月20日 星期五
樹莓派(Raspberry Pi)手機遙控車(Part 1) = MotoPiduino + Raspberry Pi (樹莓派) + USB WiFi dongle
最近開發的MotoPiduino持續改良修正問題,目前MotoPiduino搭配Raspberry Pi測試已告一段落,預計下個月應該可以上市! MotoPiduino主要是搭起Raspberry Pi跟Arduino之間的橋樑,可以把Arduino的擴充板直接插在MotoPiduino上作運用,除此,MotoPiduino還有內建馬達驅動IC,可以直接驅動兩顆DC直流馬達. 此影片範例即是利用Android手機遙控Raspberry Pi來控制馬達運轉! 在Part 2中將接上Raspberry Pi專用的攝影模組,可以即時傳輸影像(這是Arduino所辦不到), 敬請期待!!
使用材料:
1. Raspberry Pi
2. MotoPiduino
3. 5V 行動電源
4. 9V 電池 (驅動馬達)
5. USB WiFi Dongle
6. 圓形車體
遙控車程式(Python):
----------------------------------------------------
#Get the GPIO module
import RPi.GPIO as GPIO
#Get the time module
import time
#Get the socket module
import socket
#Some IP constants for this, the server
UDP_IP = "192.168.0.113" // 請修改成自己的 IP Address
UDP_PORT= 8888 // default port : 8888
#A routine to control a pair of pins
def ControlAPairOfPins(FirstPin,FirstState,SecondPin,SecondState):
print("Controlling pins")
if FirstState == "1":
GPIO.output(int(FirstPin),True)
else:
GPIO.output(int(FirstPin),False)
if SecondState == "1":
GPIO.output(int(SecondPin),True)
else:
GPIO.output(int(SecondPin),False)
#Just retur
return
####Main body of code
#Get rid of warnings
GPIO.setwarnings(False)
#Set the GPIO mode
GPIO.setmode(GPIO.BOARD)
#Set the pins to be outputs
GPIO.setup(11,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
#Set up the IP related details
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
print "Pi_Robot server started ...."
while True:
#Wait for a UDP command to be received
print("Waiting for UDP command")
MyChar, addr = sock.recvfrom(1024) #buffer size is 1024
print "I received: " + MyChar
if MyChar == "forward":
ControlAPairOfPins("12","1","13","1")
ControlAPairOfPins("11","1","15","1")
print "Forward"
elif MyChar == "stop":
ControlAPairOfPins("12","0","13","0")
ControlAPairOfPins("11","0","15","0")
print "Stop"
elif MyChar == "back":
ControlAPairOfPins("12","1","13","0")
ControlAPairOfPins("11","1","15","0")
print "Back"
elif MyChar == "left":
ControlAPairOfPins("12","1","13","1")
print "Left"
elif MyChar == "right":
ControlAPairOfPins("11","1","15","1")
print "Right"
else:
print "Not a command"
相關資訊:
http://www.motoduino.com (motopiduino user guide and android app download)
http://sinocgtchen.blogspot.tw/
使用材料:
1. Raspberry Pi
2. MotoPiduino
3. 5V 行動電源
4. 9V 電池 (驅動馬達)
5. USB WiFi Dongle
6. 圓形車體
遙控車程式(Python):
----------------------------------------------------
#Get the GPIO module
import RPi.GPIO as GPIO
#Get the time module
import time
#Get the socket module
import socket
#Some IP constants for this, the server
UDP_IP = "192.168.0.113" // 請修改成自己的 IP Address
UDP_PORT= 8888 // default port : 8888
#A routine to control a pair of pins
def ControlAPairOfPins(FirstPin,FirstState,SecondPin,SecondState):
print("Controlling pins")
if FirstState == "1":
GPIO.output(int(FirstPin),True)
else:
GPIO.output(int(FirstPin),False)
if SecondState == "1":
GPIO.output(int(SecondPin),True)
else:
GPIO.output(int(SecondPin),False)
#Just retur
return
####Main body of code
#Get rid of warnings
GPIO.setwarnings(False)
#Set the GPIO mode
GPIO.setmode(GPIO.BOARD)
#Set the pins to be outputs
GPIO.setup(11,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
#Set up the IP related details
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
print "Pi_Robot server started ...."
while True:
#Wait for a UDP command to be received
print("Waiting for UDP command")
MyChar, addr = sock.recvfrom(1024) #buffer size is 1024
print "I received: " + MyChar
if MyChar == "forward":
ControlAPairOfPins("12","1","13","1")
ControlAPairOfPins("11","1","15","1")
print "Forward"
elif MyChar == "stop":
ControlAPairOfPins("12","0","13","0")
ControlAPairOfPins("11","0","15","0")
print "Stop"
elif MyChar == "back":
ControlAPairOfPins("12","1","13","0")
ControlAPairOfPins("11","1","15","0")
print "Back"
elif MyChar == "left":
ControlAPairOfPins("12","1","13","1")
print "Left"
elif MyChar == "right":
ControlAPairOfPins("11","1","15","1")
print "Right"
else:
print "Not a command"
----------------------------------------------------------------
http://www.motoduino.com (motopiduino user guide and android app download)
http://sinocgtchen.blogspot.tw/
2013年9月11日 星期三
2013年8月9日 星期五
2013年7月19日 星期五
MotoPiduino : 搭起Raspberry Pi(樹莓派) 跟 Arduino 之間的橋梁
Motoduino Lab最近開發出一塊Raspberry Pi及Arduino的轉板稱為MotoPiduino, 此塊板子目的在使Arduino及Raspberry使用者,可以很容易把Arduino Shield跟Raspberry做連結. 轉板上有一顆馬達驅動IC,可接上外部電源驅動直流馬達,很適合應用在無線遙控車的製作, 目前正在測試階段.........
MotoPiduino 背面
MotoPiduino 正面
S4A Sensor board疊在 MotoPiduino上
CTIMES 雜誌介紹:
訂閱:
文章 (Atom)





























