2014年1月6日 星期一

2013年6月18日 星期二

使用 Raspberry Pi 驅動 LCD 顯示 DHT-11 所測得的環境溫濕度

需要 DHT-11 (溫濕度感測器) 的話請到露天賣場訂購:DHT11 - 溫濕度感測器

DHT-11 使用 DATA 接腳與處理器之間做通訊與同步,採用串行單線數據格式,一次通訊時間在 4ms 左右,數據分為整數與小數部分,一次完整數據輸出為 40-bit,高位元先輸出:

數據格式:8-bit 濕度整數數據 + 8-bit 濕度小數數據 +
                    8-bit 溫度整數數據 + 8-bit 溫度小數數據 + 8-bit 檢驗和

檢驗和是溫濕度整數與小數四個數據相加之後取末 8 位元數據資料,至於詳細的通訊過程請參閱 "DHT11溫濕度感測器說明書" 的說明。

下面的例子將使用 Raspberry Pi (樹莓派) 與 DHT-11 作通訊取得溫濕度數據,並將數據顯示在 LCD上。

首先,我們延用部落格網頁 "驅動 16x2 LCD 螢幕 (英文文字型)" 的線路,並增加 DHT-11 於線路中;DHT-11 使用 3.3V 電源供應,資料通訊使用樹莓派 GPIO P1 第 10 支 pin 腳 (也就是 RxD, #15) 連接 DHT-11 DATA 接腳。

ps. #15 表示是 BCM2835 GPIO 15 的意思


材料列表:

2013年6月7日 星期五

[ 認識與使用 Gertboard ] 第五部曲 - 數位轉類比 ( MCP4802 ) 和類比轉數位 ( MCP3002 ) 轉換器 ( D to A and A to D converters )

學習樹莓派週邊不容錯過的學習利器 "Assembled Gertboard (Rev2.0)",心動不如馬上行動!!露天賣場:

Assembed Gertboard (Rev2.0) - 利用 Raspberry Pi (樹莓派) 學習與開發電子 (週邊) 的最佳拍檔

PiGertboard 套件 (A) - Raspberry Pi (樹莓派) Gertboard 嵌入式套件

PiGertboard 套件 (B) - Raspberry Pi (樹莓派) Gertboard 外接式套件

Gertboard - A to D and D to A Converters ( 橙色部分 ),source: Gertboard User Manual (Rev 2.0)

Gertboard - D to A Converter 電路圖,source: Assembled Gertboard Schematics

Gertboard - A to D Converter 電路圖,source: Assembled Gertboard Schematics

Gertboard -  電路圖,source: Assembled Gertboard Schematics

2013年6月5日 星期三

pidora 遠端桌面與編輯環境設定

from: Pidora_18_Firstboot
不知道大家開始使用了 pidora 了沒有 ?

我想,關於如何安裝與指令介紹這些東西都可以在網路上找到一大堆資料,此篇網頁主要是與下面三個部落格文章做連結,說明如何使用 pidora 來設定以下的編輯環境

重啟 pidora 第一次開機 ( firstboot ) 的設定畫面

pidora firstboot welcome 畫面
第一次安裝 pidora 的時候,因為直接使用 4.3吋螢幕做設定,而且在未設定解析度的情形之下,有些字實在看不清楚,因此就 Next Next 一直按下去,結果 .. 變成了一開機就會直接進入到圖形介面之下。對我來說,這真的有點不方便 !

一開始安裝好 pidora 的時候,也沒有看什麼說明,安裝好作業系統之後,就插上小螢幕開機,因為我只想快點進入到 pidora 的世界,但也因為這樣,才有這篇文章的出現,因為我搞錯了一堆設定,不想重新安裝或是輸入一堆指令做修改,只好看看能不能再次叫出 firstboot 畫面,讓我再做一次設定!

2013年5月6日 星期一

[ 認識與使用 Gertboard ] 第四部曲 - 馬達驅動控制器 ( Motor Controller )

學習樹莓派週邊不容錯過的學習利器 "Assembled Gertboard (Rev2.0)",心動不如馬上行動!!露天賣場:

Assembed Gertboard (Rev2.0) - 利用 Raspberry Pi (樹莓派) 學習與開發電子 (週邊) 的最佳拍檔

PiGertboard 套件 (A) - Raspberry Pi (樹莓派) Gertboard 嵌入式套件

PiGertboard 套件 (B) - Raspberry Pi (樹莓派) Gertboard 外接式套件

Gertboard - Motor Controller ( 粉紅色框線 ),source: Gertboard User Manual (Rev 2.0)
GertBoard 使用 ROHM BD6222HFP 做為馬達驅動控制器,可以驅動最大電壓 DC 18V 電流 2A 的直流有刷馬達。晶片 ( 如下圖 ) 有兩支接腳 MOTOR_AMOTOR_B 可以輸入高或低準位控制直流馬達轉動方向,並且可以在單一接腳輸入 PWM 訊號對馬達進行轉速的控制,這兩支接腳位於電路板中間偏右下的位置,標示名稱是 J5,接腳名稱為 MOTAMOTB
Gertboard - Open Collector Driver 電路圖,source: Assembled Gertboard Schematics

2013年5月2日 星期四

[ 認識與使用 Gertboard ] 第三部曲 - ULN2803 開集極驅動 ( Open Collect Driver )

學習樹莓派週邊不容錯過的學習利器 "Assembled Gertboard (Rev2.0)",心動不如馬上行動!!露天賣場:

Assembed Gertboard (Rev2.0) - 利用 Raspberry Pi (樹莓派) 學習與開發電子 (週邊) 的最佳拍檔

PiGertboard 套件 (A) - Raspberry Pi (樹莓派) Gertboard 嵌入式套件

PiGertboard 套件 (B) - Raspberry Pi (樹莓派) Gertboard 外接式套件

Gertboard - Open Collector Driver ( 黃色框線 ),source: Gertboard User Manual (Rev 2.0)
GertBoard 的 open collector driver ( 開集極驅動,位置位在 GertBoard 的右上方 ) 使用八通道 ULN2803 達靈頓驅動 IC,電壓輸出最大可達 DC 50V,每一通道最大電流可達 500mA,可以用來驅動 LEDs、直流馬達、步進馬達以及繼電器,但在 GertBoard 只開放六個通道做使用。

Gertboard - Open Collector Driver 電路圖,source: Assembled Gertboard Schematics

[ 認識與使用 Gertboard ] 第二部曲 - 輸出入緩衝線路 ( 開關和 LED )

學習樹莓派週邊不容錯過的學習利器 "Assembled Gertboard (Rev2.0)",心動不如馬上行動!!露天賣場:

Assembed Gertboard (Rev2.0) - 利用 Raspberry Pi (樹莓派) 學習與開發電子 (週邊) 的最佳拍檔

PiGertboard 套件 (A) - Raspberry Pi (樹莓派) Gertboard 嵌入式套件

PiGertboard 套件 (B) - Raspberry Pi (樹莓派) Gertboard 外接式套件

Gertboard - Buffer I/O ( + switches and LEDs ),source: Gertboard User Manual (Rev 2.0)
緩衝器可以作為輸出的驅動也可以保護內側的電路。也就是將原本的輸出訊號在經過緩衝器之後可以驅動更多的元件;或是當外部輸出短路或是有突波訊號時,會先衝擊到緩衝器,進而保護接收輸出訊號的元件。

另外,在網路上找到這英文的說明可作為參考,若還是存在疑問請自行 Google 一下 !!!

Buffers (in analog circuits) are used when you need to lower the impedance/increase current capability. They're also useful if you want to tap a signal in a circuit and don't want to put a load on that circuit that might cause the voltage to drop. For example, you might have a circuit that generates a signal and you want to bring that signal out to an external connector that you can plug a data logger or whatever into. If you put a buffer in between the original signal and the data logger output, you don't have to worry about the data logger causing a voltage drop on the original signal. Or if you accidentally short out the output, the circuit won't be affected or damaged.

Another use for a buffer is if you have a chip that has a high output impedance (such as an accelerometer) which you want to feed into a ADC that has a lower input impedance. The ADC would load the accelerometer too much and the voltage will drop; the buffer will prevent that.

Digital buffers are used as logic inverters (inverting buffers) or as simple buffers similar to the analog example above (to increase fan-out capabilities or to protect circuits against shorts when going to an external connector).

2013年4月30日 星期二

[ 認識與使用 Gertboard ] 首部曲 - 瞭解 GertBoard 電路板、建置編輯環境與測試程式碼下載與安裝

Gertboard 可說是 Raspberry Pi (樹莓派) 一個理想的添加裝置,特色有:
  • 可直接插入到樹莓派上

  • 可以檢測與響應外部物理事件

  • 檢測與輸出類比電壓

  • 驅動 (直流、步進) 馬達 (18V, 2A max)

  • 檢測按鍵動作

  • 點亮 LED

  • 驅動繼電器

  • 六大區塊各自獨立,可互相結合使用,更富使用上的彈性 ! (請看下面說明)

  • 以上全部都可由樹莓派直接做控制

  • 豐富的軟體資源與使用者手冊,讓使用上更加的方便 !

2013年4月8日 星期一

[AlaMode][PIR] AlaMode 與人體紅外線感應 (PIR) 模組


AlaMode + Raspberry Pi + PIR + Relay + Buzzer

還記得我們在 "使用人體紅外線感應 (PIR) 模組,製作家中安全防護及警報系統" 使用樹莓派控制 PIR 模組與繼電器,並發送電子郵件嗎 ?

這次樹莓派除了負責接收從 AlaMode 發送過來的訊息,並由訊息中確認是否開始發送電子郵件之外,所有週邊的控制都是由 AlaMode 負責。

或許有人會問,這不是都一樣嗎 ? no! No! NO! 同款隔不同師傅!

AlaMode 只要有電,裡面的程式會一直執行,當你想要在 PIR 模組被觸發時發送電子郵件再把樹莓派裡的接收程式開啟就可以了。

使用此程式,樹莓派裡的 UART 功能必須已經被打開了。如果您不是一開始就依照 "AlaMode: Get Started (中文入門說明)" 作設定,那設定的方法請參考 "使用樹莓派模擬 HT12E 遙控器編碼晶片的編碼格式" 網頁中關於 "樹莓派接收無線訊號" 這一段的說明,照著做再重開機就可以!

另外,也請在閱讀此網頁之前先瀏覽