家庭自動化 UniPi 開箱

家庭自動化是物聯網的應用之一

IMG_1276

規格:

  • Compatible with Raspberry Pi B and B+
  • 8 x changeover relays rated 250V AC/5A or 24V DC/5A
  • 14 opto-isolated digital inputs triggered by 5-24V DC voltage with minimum pulse length of 5ms
  • 2 x 0-10V analogue inputs
  • 1 x 0-10V analogue output
  • 1 x 1-wire port for connection to 1-wire temperature and humidity sensors
  • 1 x I2C port for expansion
  • 1 x UART port for external serial communications
  • Supplied with Raspberry Pi mounting supports and ribbon cable (select B or B+ model)
  • Optional DIN Rail mount, I2C relay board expanion, 1-wire temperature sensor
  • Requires external 5V 2.5A external PSU with 2.1mm DC jack
  • Dimensions: 198 x 86 x 12mm (without Raspberry Pi)

軟體安裝文件:

Official unipi software EVOK (https://github.com/UniPiTechnology/evok)

Home automation GNU/GPL v.2 perl server FHEM (http://fhem.de/fhem.html)

Professional PLC software REX (http://rexcontrols.com)

Home automation professional software Home seer (http://www.homeseer.com/)

IMG_1277

功能平面圖

a

Relays: 8 relays 250VAC@5A or 24VDC@5A – control switching elements
UART port: Standard serial port to connect serial console or many other devices (NFC
readers, … )
1Wire port: Provides 1Wire bus interface to connect 1Wire devices such as temperature and humidity sensors
I2C port: For connecting other extension modules for example relay or analog output
modules
I2C configuration pins: To connect the I2C_0 bus from the RPi (only for advanced users)
RTC (Real Time Clock) module: Provides real time in case of internet or power outage
(backup battery not included in the package).
Power 5V: 2.1mm connector for power supply
RPI connector: 26-pin connector for Raspberry Pi
Digital inputs: 12(+2) galvanically isolated digital inputs for reading signals from external
devices
12V out: Power supply 12V@200mA – only for use with digital inputs of the UniPi
Configurable ports: To configure digital inputs for use with external power source
Analog in: Two 0-10V analog inputs for reading analog signals from external devices
Analog out: One 0-10V analog output for proportional controlling
AO trimmer: For precise adjustment of the analog output

安裝底座及上蓋

IMG_1290

先鎖上四角的螺絲

IMG_1291

IMG_1292

鎖上銅柱

IMG_1293

IMG_1294

IMG_1295

背面裝上角座

IMG_1296

插上排線,如需要RTC功能,建議裝上電池 CR2032

IMG_1297

樹莓派 GPIO 40 pin

IMG_1298

將樹莓派固定在銅柱上

IMG_1299

IMG_1301

完成

IMG_1302

上蓋是壓克力,夾住底座。

 

 

pHAT DAC 體驗

隨著 Pi Zero 上市一起推出,pHAT DAC 這是一款優質的音效裝置

top_efcc6d1d-3094-4616-8679-29de7070888f_1024x1024

它的核心是 Texas Instrument’s PCM5102A stereo audio DAC chip,它的規格:

  • 24-bit audio at 192KHz
  • Line out stereo jack
  • Optional landing for dual RCA phono connector
  • 適用於樹莓派 Pi 2/B+/A+/Zero
  • pHAT format board
  • Uses the PCM5102A DAC to work with the Raspberry Pi I2S interface

在板子下方偏右有一個空位是給這個使用。

phono_1024x1024

焊接後

IMG_1265bIMG_1266b

接上 Pi 2 來使用,安裝步驟請參考網頁

IMG_1272

用 CCRMA 來試試看 192k 的聲音

IMG_1274

選擇一個 mid 的音樂播放

IMG_1275

看看錄影

聲音輸出非常優質,大家可以玩玩看

 

The MagPi issue 40 到了

The MagPi 在 32 期之後由基金會直接編輯出版。在 Pi Zero 上市當月凡有購買 The MagPi 40 期就隨贈一片 Pi Zero,讓很多人搶不到 Pi Zero 的人多了一個取得管道。

IMG_1352

打開一看才知道贈品不只 Pi Zero 一片而已。

IMG_1353

The MagPi 也明顯變厚了。

IMG_1354

贈品不只有 Pi Zero 還有 Mini-HDMI 轉 HDMI 母、MicroUSB 轉 USB type A 母 OTG 線。真的物超所值。

IMG_1187

Pi Zero 的保護殼

Adafruit Pi Protector 試裝

IMG_1309

上下蓋壓克力,四組螺絲,左邊是下蓋右邊是上蓋

IMG_1310

先鎖下蓋

IMG_1311

GPIO 邊用短的螺絲,另一邊用長螺絲

IMG_1312

螺絲從下蓋穿上來

IMG_1313

螺帽轉到底

IMG_1314

穿過長螺絲,蓋上蓋,鎖緊螺帽

IMG_1315

Pi Zero 底面焊上排母

IMG_1317

Pi Zero 底面焊上轉90度排母

IMG_1318

MicroSD 卡裝上

IMG_1319

拿下SD 卡

IMG_1320

這個使用很方便,組裝也很簡單。

 

repaper 的體驗

repaper 是不是紙呢?

1346-00

想要學習使用請先參考 adafruit 網頁介紹(網頁)(adafruit 之答客問)

開箱

IMG_1242

排線有標示 pin 1

lcds___displays_2013_04_20_IMG_1678-1024

在這裡介紹一下安裝方法,硬體連接

IMG_1246

IMG_1253IMG_1254

連接樹莓派的 GPIO:

  • (Red #1) -> P1-01
  • (Green #6) -> not used (ext ADC required)
  • (Yellow #7) -> P1-23
  • (Orange #8) -> P1-22
  • (Brown #9) -> P1-12
  • (Black #10) -> P1-18
  • (Red #11) -> P1-16
  • (White #12) -> P1-10
  • (Grey #13) -> P1-08
  • (Purple #14) -> P1-21
  • (Blue #15) -> P1-19
  • (Orange #18) -> P1-26
  • (Brown #19) -> P1-24
  • (Black #20) -> P1-25

IMG_1258

確認驅動硬體是否正確?

使用樹莓派 B+ 來測試,接下來軟體安裝

# RePaper eInk Development Board for ARM + GNU/Linux
# get source code

git clone https://github.com/repaper/gratis.git

# compile and install

cd gratis/PlatformWithOS/
PANEL_VERSION=’V230_G2′ make rpi
sudo PANEL_VERSION=’V230_G2′ make rpi-install

# modify config file

sudo nano /etc/default/epd-fuse
more /etc/default/epd-fuse

# Default settings for epd-fuse file is sourced by /bin/sh from
# /etc/init.d/epd-fuse

# Options to pass to epd_fuse
EPD_MOUNTPOINT=/dev/epd
EPD_SIZE=2.7
EPD_OPTS=’-o allow_other -o default_permissions’

sudo nano /etc/init.d/epd-fuse
more /etc/init.d/epd-fuse
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          epd-fuse
# Required-Start:    udev
# Required-Stop:     udev
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start epd_fuse to control E-Ink panel
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /lib/lsb/init-functions

DAEMON=/usr/sbin/epd_fuse
#PIDFILE=/var/run/epd_fuse.pid

test -x “${DAEMON}” || exit 5

# default configuration (change /etc/default/epd-fuse, not these)
EPD_MOUNTPOINT=/dev/epd
EPD_SIZE=2.0
EPD_OPTS=’-o allow_other -o default_permissions’

if [ -r /etc/default/epd-fuse ]
then
. /etc/default/epd-fuse
fi

case $1 in
(start)
log_daemon_msg “Starting EPD” “epd_fuse”
mkdir -p “${EPD_MOUNTPOINT}”

####### 關鍵處 modified
modprobe spi-bcm2835
“${DAEMON}” –panel=”${EPD_SIZE}” ${EPD_OPTS} “${EPD_MOUNTPOINT}”
log_end_msg “$?”
;;
(stop)
log_daemon_msg “Stopping EPD” “epd_fuse”
umount -f “${EPD_MOUNTPOINT}”
log_end_msg “$?”
rm -f “${PIDFILE}”
;;
(restart|force-reload)
“$0” stop && sleep 2 && “$0” start
;;
(try-restart)
if “$0” status > /dev/null
then
“$0” restart
else
exit 0
fi
;;
(reload)
exit 3
;;
(status)
status_of_proc “${DAEMON}” “EPD FUSE”
;;
(*)
echo “Usage: $0 {start|stop|restart|try-restart|force-reload|status}”
exit 2
;;
esac

# enable devicetree spi
/boot/config.txt
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

這裡有 Python 的範例程式,請自行參考學習

IMG_1257

畫面:

看第二個

IMG_1259

看第三個

ctrl-C 強迫停止程式後

IMG_1262

第四個

IMG_1260

第五個

IMG_1263

關機後

IMG_1251

畫面會停留在最後的畫面,即使沒電依然會保留2天。

這一款 2.7 吋,規格:

  • Pixel Number:264 x 176 pixel
  • Pixel Pitch:0.217 x 0.217 (117dpi) mm