本文只是描述如何複製以及使用該貼片
1.購買晶片零件
1.
Name
of Product: Voltage Stabilizer
Company
Name: Mouser Electronics
Catalog
Number: MIC5205-3.3YM5
Function:
The voltage regulator can provide a constant voltage regardless of changes to
its input voltage or load conditions.
Address:
8F No. 411 Ruiguang Road NeiHu District, Taipei City, 114 Taiwan
Tel
: +886-2-2799-2096
2.
Name of Product: Bluetooth
Company
Name: Microchip Technology Inc.
Catalog
Number: RN4871
Function:
This is a wireless communication technology standard used to allow fixed and
mobile devices to change data between short distances.
Address:
2355 West Chandler Blvd. Chandler,rizona,USA
85224-6199
Tel
:(480)792-7200
3.
Name
of Product: Arduino
Company
Name: Microchip Technology Inc.
Catalog
Number: ATMEGA 328
Function:
Collect and export data to Bluetooth device
Address:2355
West Chandler Blvd. Chandler,rizona,USA
85224-6199
Tel
:(480)792-7200
4.
Name
of Product: Oscillator
Catalog
Numbers: XTAL
Company
Name: Diodes
Function:
Support Arduino to output frequency
Address:4949
Hedgcoxe Road, Suite #200 Plano, TX 75024 USA
Tel
:972-987-3900
5.
Name
of Product: Temperature Sensor
Catalog
Numbers: LM20
Company
Name: Texas Instruments Semico...es (Shanghai) Co., Ltd.
Function:
Measure temperature
Address:
32/F China Fortune Tower, 1568 Century Avenue Pudong New Area,
Shanghai,
200122, P. R. China
Tel
: (86.21) 23073288
6.
Name
of Product: Battery x2
Catalog
Number: maxell CR2032
Company
Name: Dunhua Electronic Materials Co., Ltd.
Function:
Supply Power to Bluetooth device
Address:
No.18, Huanhe Rd., Xitun Dist., Taichung City 40757, Taiwan (R.O.C.)
Tel
: 04-3602-6363
7.
Name
of Product: Dupont Line
Catalog
Number: 2.54mm
Company
Name: Dunhua Electronic Materials Co., Ltd.
Function:
Connect external battery to give power to Bluetooth
Address:
No.18, Huanhe Rd., Xitun Dist., Taichung City 40757, Taiwan (R.O.C.)
Tel
: 04-3602-6363
8.
Name
of Product: FPCB
Company
Name: FLYING INTERNATIONAL CO.,LTD.
Catalog
number: FPCB (Flexible Printed Circuit Board)
Function:
circuit board
Address:
19F., No.226, Zhongyang Rd., Xinzhuang Dist., New Taipei City 242, Taiwan
(R.O.C.)
Tel :
02-85219966
2.將BOM表與layout圖送給印刷廠商製作
BOM表
Designators (position)
|
Name of Product
|
Comment
|
Footprint
|
Quantity
|
C1, C4, C7, C11
|
晶片電容
|
0.1uF
|
0603
|
4
|
C3
|
晶片電容
|
1uF
|
0603
|
1
|
C2, C9, C10
|
晶片電容
|
10uF
|
0603
|
3
|
C5, C6
|
晶片電容
|
4.7uF
|
0603
|
2
|
R1, R2
|
晶片電阻
|
10k, SMD
|
0603
|
2
|
R3, R4
|
晶片電阻
|
0k, SMD
|
0603
|
2
|
Designator439 (SIP4)
|
connector
|
|
SIP4
|
1
|
Designator442 (442)
|
|
|
1206
|
5
|
Designator443 (443)
|
Designator444 (444)
|
Designator462 (462)
|
Designator463 (463)
|
atmega 328 (328)
|
Arduino
|
HEADER 16X2
|
ATMEGA328
|
1
|
JP1
|
connector
|
HEADER 5
|
SIP5
|
1
|
JP3
|
connector
|
HEADER 6
|
SIP6
|
1
|
JP4
|
connector
|
HEADER 2
|
SIP2
|
1
|
MIC5205 (5205)
|
Voltage Stabilizer
|
HEADER 3X2
|
SOT23
|
1
|
RN4871 (4871)
|
Bluetooth
|
HEADER 8X2
|
RN4871
|
1
|
XTAL
|
Oscillator
|
HEADER 3
|
XTAL
|
1
|
S1
|
switch
|
SW SPST
|
1206
|
1
|
Arduino晶片可以買Arduino mini來拆,就不用再灌燒錄程式進去了
注意:本Layout沒有設計燒錄程式的線路進去!
本layout圖的電路圖是參考Arduino官方提供所改成的
Layout圖
製作好後
3.開通晶片與上傳程式
準備USB to TTL燒錄器(CP2102
Arduino pro mini)
下載並安裝該燒錄器驅動程式
將燒錄器的Rx、Tx接再貼片的D8、D9上,燒錄器的3.3V接在EN上燒錄器的GND接在貼片的GND上
開通藍芽晶片
下載USR-TCP232-Test V1.4.exe程式
設定好序列埠,選擇燒錄器的port(COM?)
設定好胞率12500
HEX取消打勾
按Open
CMD輸入
$$$
S-,<你要設定的名子> <CR> /*設定BLE名字為<你要設定的名子>,<CR>是按Enter換行就可以了*/
SS,C0
<CR> /*是C零喔!*/
--- <CR>
/*每次輸入指令成功的話會回覆"CMD>AOK"*/
/*這樣基本上設定完成*/
上傳Arduino程式
將燒錄器的Rx、Tx接再貼片的Tx、Rx上,燒錄器的3.3V接在EN上燒錄器的GND接在貼片的GND上
打開Arduino
工具->開發粄->選擇Arduino Pro or Pro Mini
工具->序列埠->選擇燒錄器的port(COM?)
上傳程式碼
#define sensor_pin A1
#include <SoftwareSerial.h> // 引用程式庫
#define rxPin 8
#define txPin 9
SoftwareSerial BT(rxPin, txPin);
void setup()
Serial.begin(9600);
Serial.println("BT is ready!");
pinMode(rxPin,INPUT);
pinMode(txPin,OUTPUT);
BT.begin(115200);
}
void loop()
{
int
sensor_value = analogRead(sensor_pin); // 讀取FSR
double val = sensor_value
*3.3/1024;
Serial.println(val);
BT.print(val);
BT.print("\n");
delay(100);
}
4.完成
貼片操作
有線連電腦操作:
將燒錄器的Rx、Tx接再貼片的Tx、Rx上,燒錄器的3.3V接在EN上燒錄器的GND接在貼片的GND上
打開Arduino
工具->開發粄->選擇Arduino Pro or Pro Mini
工具->序列埠->選擇燒錄器的port(COM?)
看數據呈現
工具->序列埠監控視窗
看數據圖的呈現
工具->序列繪圖家
無線連手機操作:
將直流電源3.3V正極接在貼片的EN上、直流電源負極接在GND上
(電池(3.3V~12V)或是燒錄器皆可)
打開手機APP BLE Scanner
選擇該貼片名稱的connect
選COSTOM SERVICE
點 CUSTOM CHARACTERISTIC 的 I圈圈便可以看到及時數值