看门狗智能网关
目录 |
1 开发手记
1.1 PIN
1.2 PCB
- 打样工厂工艺限制:
- 最小线宽:6mil
- 最小间距:6mil
- 最小阻焊桥宽:0.1mm
- 板厚孔径比:8:1
- 钻孔孔径:0.3mm--6.35mm
- 成孔孔径:0.3mm--6.30mm
- 孔径公差:0.08mm
- 外形尺寸精度:± 0.2mm
- 字符字宽不能小于0.153mm(6mil),字高不能小于0.811mm(32mil), 宽高比最好为5的倍数,例如:字宽0.2mm 字高则为1mm
- Eagle 层:
- 17 Pads --> DIP 件焊盘
- 18 Vias --> 过孔
- 20 Dimension --> PCB 板外围形状尺寸
- 21 tPlace --> 顶层丝印
- 23 tOrigins --> 器件定位原点,隐藏后就无法移动器件
- 25 tNames --> 器件Name
- 29 tStop --> 阻焊层
- 31 tCream --> 焊膏层
- 39 tKeepout --> 器件最小需要的空间范围
1.3 RF TX
简单的使用声表谐振器的发射电路图:
L1:0.8mm 绕 3mm 圆柱 4.5 圈
减小8050基极电阻的值,通讯距离会加大 50% 甚至更远,但会导致电路工作状态不稳,有时发射失败
12V 供电的情形下,距离可达 800m
发射时,射频信号波形:
1.4 RF Decode
上图射频波形,有高频振荡的地方,表示高电平,否则为低电平,则:
1001 1111 0010 1111
---
433门磁解码:Pulse_Length = 300,前导:1:31
0110 0101 0110 0110 1000 1110
1.5 RF Switch
2179/G4C 电压 2.5 - 5.3V,最大输入功率 33dBm
2214/G4J 供电 1.8 - 5.3V,最大输入功率 30dBm
其他指标一样
1.6 Power
宽电压输入、至少 90% 转换效率的降压芯片 MP2307 典型应用电路:
R1 的大小,控制输出电压的值
1.7 BOM
Part Value Device Package Description ANT1 SMA--KE SMA-KE SMA 50 Ohm ANT2 SMA--KE SMA-KE SMA 50 Ohm C1 100uF CAP_POLF80 NIPPON_F80 Capacitor Polarized C2 100uF CAP_POLF80 NIPPON_F80 Capacitor Polarized C3 10nF CAP0603-CAP 0603-CAP Capacitor C4 100nF CAP0603-CAP 0603-CAP Capacitor C5 3.9nF CAP0603-CAP 0603-CAP Capacitor C6 22uF CAP_POL1206 EIA3216 Capacitor Polarized C7 22uF CAP_POL1206 EIA3216 Capacitor Polarized C8 22uF CAP_POL1206 EIA3216 Capacitor Polarized C9 100nF CAP0603-CAP 0603-CAP Capacitor C10 100uF CAP_POLF80 NIPPON_F80 Capacitor Polarized C100 100nF CAP0603-CAP 0603-CAP Capacitor C101 100nF CAP0603-CAP 0603-CAP Capacitor C102 100nF CAP0603-CAP 0603-CAP Capacitor C103 100nF CAP0603-CAP 0603-CAP Capacitor C104 100nF CAP0603-CAP 0603-CAP Capacitor C105 100nF CAP0603-CAP 0603-CAP Capacitor C106 100nF CAP0603-CAP 0603-CAP Capacitor C107 100nF CAP0603-CAP 0603-CAP Capacitor C108 100nF CAP0603-CAP 0603-CAP Capacitor C109 100nF CAP0603-CAP 0603-CAP Capacitor C110 12pF CAP0603-CAP 0603-CAP Capacitor C111 12pF CAP0603-CAP 0603-CAP Capacitor C112 100nF CAP0603-CAP 0603-CAP Capacitor C113 100nF CAP0603-CAP 0603-CAP Capacitor C114 100nF CAP0603-CAP 0603-CAP Capacitor C115 100nF CAP0603-CAP 0603-CAP Capacitor C200 12pF CAP0603-CAP 0603-CAP Capacitor C201 12pF CAP0603-CAP 0603-CAP Capacitor C202 100nF CAP0603-CAP 0603-CAP Capacitor C203 10uF CAP_POL1206 EIA3216 Capacitor Polarized C204 100nF CAP0603-CAP 0603-CAP Capacitor C205 100nF CAP0603-CAP 0603-CAP Capacitor C206 100nF CAP0603-CAP 0603-CAP Capacitor C207 100nF CAP0603-CAP 0603-CAP Capacitor C208 100nF CAP0603-CAP 0603-CAP Capacitor C209 10uF CAP0805 0805 Capacitor C210 10uF CAP0805 0805 Capacitor C211 10uF CAP0805 0805 Capacitor D1 S4 DIODESOD SOD-323 Diode D2 S4 DIODESOD SOD-323 Diode D3 S4 DIODESOD SOD-323 Diode D4 S4 DIODESOD SOD-323 Diode D5 1N4007 DIODESMB SMB-DIODE Diode D6 SS14 DIODESOD SOD-323 Diode D7 SS14 DIODESOD SOD-323 Diode ETH HLJ6115ANL HLJ6115ANL HR911105A IC1 ATMEGA168 ATMEGA168 TQFP32-08 IC2 W5100 W5100 LQFP-80 WIZnet W5100 J1 POWER_JACKPTH POWER_JACKPTH POWER_JACK_PTH Power Jack JP M04X2 M04X2 2X4 JP1 M06SIP 1X06 Header 6 JP2 M06SIP 1X06 Header 6 JP3 M081X08 1X08 Header 8 JP4 M081X08 1X08 Header 8 JP5 M04PTH 1X04 Header 4 JP6 M03PTH 1X03 Header 3 JP7 M04PTH 1X04 Header 4 JP9 M07 1X07 Header 7 L2 10uH INDUCTORCR54 CR54 Inductors LED_ETH_RX LED0603 LED-0603 LEDs LED_ETH_TX LED0603 LED-0603 LEDs PWR_IC MP2307 MP2302 SOIC8 MP2302 PWR_LED LED0603 LED-0603 LEDs R1 10K RESISTOR0603-RES 0603-RES Resistor R2 6.8K RESISTOR0603-RES 0603-RES Resistor R3 26.1K RESISTOR0603-RES 0603-RES Resistor R4 10K RESISTOR0603-RES 0603-RES Resistor R100 1K RESISTOR0603-RES 0603-RES Resistor R101 1K RESISTOR0603-RES 0603-RES Resistor R102 1K RESISTOR0603-RES 0603-RES Resistor R103 1K RESISTOR0603-RES 0603-RES Resistor R104 1K RESISTOR0603-RES 0603-RES Resistor R105 49.9 RESISTOR0603-RES 0603-RES Resistor R106 49.9 RESISTOR0603-RES 0603-RES Resistor R107 49.9 RESISTOR0603-RES 0603-RES Resistor R108 49.9 RESISTOR0603-RES 0603-RES Resistor R109 300 RESISTOR0603-RES 0603-RES Resistor R110 12K RESISTOR0603-RES 0603-RES Resistor R111 1M RESISTOR0603-RES 0603-RES Resistor R112 10K RESISTOR0603-RES 0603-RES Resistor R113 10K RESISTOR0603-RES 0603-RES Resistor R114 1M RESISTOR0603-RES 0603-RES Resistor R200 1K RESISTOR0603-RES 0603-RES Resistor R201 0 RESISTOR0603-RES 0603-RES Resistor R202 10K RESISTOR0603-RES 0603-RES Resistor R203 10K RESISTOR0603-RES 0603-RES Resistor RX_IC RXB6-MODULE RXB6-MODULE RXB6-MODULE S1 SMD SWITCH-MOMENTARY-2-SMD-1101NE TACTILE-SWITCH-1101NE T1 SI2302 -MOSFET-N-SMD SOT23-3 W25Q8 SPI_FLASH-X25XXSMD1 SPI_FLASH-X25XXSMD1 SO08-EIAJ 8pin SPI Flash series x25xx X1 16MHz CRYSTALHC49US HC49US Crystals X2 25MHz CRYSTALHC49US HC49US Crystals
2 智能遥控学习
自动学习家庭环境下,灯具、窗帘、晾衣架、插座等的遥控指令
存储格式:
cmd_id, meta_pluse, code, ch, ...
3 OTA
4 硬件调试
4.1 电源
注意滤波电容的重要性,虚焊会导致输出电压过高,烧坏芯片!
4.2 W5100
- 要点 http://www.hschip.com/news_show.aspx?id=183
- 晶振 http://www.hschip.com.cn/news_show.aspx?id=113
- 常见问题 http://www.hschip.com.cn/news_show.aspx?id=110
- 电源电感 http://www.iwiznet.cn/blog/?p=3459
5 微信UI
5.1 激活狗狗
1. 扫描带设备信息的二维码
2. 扫描不带设备信息的二维码;或者直接通过查找关注,然后输入“绑定SN”(SN为CAMGO的S/N号);或通过执行菜单“绑定设备”,再输入CAMGO的S/N号
第一个激活设备的微信用户为 root,拥有设备的管理权
此后再激活设备的用户,只是 user,可以接受设备的提示信息,但不能定制警告信息、控制哪些用户能收哪些信息等等
5.2 定制提醒
CAMGO 对新捕捉到的信息,提示为:“发现未知事件,点击设置此事件的提醒信息。事件编码 xxxx”
执行菜单“定制提醒”,输入事件编码和提醒信息(当CAMGO捕捉到编码为 xxxx 的事件时,会向您推送这个消息)
5.3 赶走狗狗
root 用户执行此菜单项,将反激活设备,恢复到出厂状态 (不提供事件编码)
user 用户执行此菜单项,将退出接受报警信息 (不提供事件编码)
执行菜单且传递参数:事件编码 将只取消该事件的报警信息接受
5.4 二维码生成
写了个工具,可以调微信API批量生成
5.5 公众号导航菜单
移步: 麦壳看门狗公众号导航菜单
6 测试记录
- A1 号门磁,315
- 环境:大雪科大住所,发收间距离5米左右
- 发射器贴木质门框上,收到的信号很微弱,狗狗没法辨识
- 拿手上,信号则很强
- 解决:早期原型机接受模块捕捉微弱信号能力略差,新的机器已经全面升级为更强健的接受模块,测试表明接受一直很稳定
6.1 兼容路由器列表
- 极路由 1s
- 360安全路由 P1
- NETGEAR 6300v2
- NETGEAR WNR3500L
- TP-LINK TL-WVR600G
- TP-LINK TL-WVR450G
- TP-LINK TL-MR13U
- TP-LINK TL-WR842N
- D-Link DIR-600A
6.2 控制类兼容设备
- 河森 Hesunse 射频遥控
- 福奈特射频遥控
7 资源
- MAC Find: http://coffer.com/mac_find/
稳定性增强:
- http://davidrobot.com/2014/12/arduino_watchdog_reset.html
- Watchdog in Arduino Library http://forum.arduino.cc/index.php?topic=128717.0
- Using the Internal WatchDog Timer for the Arduino http://www.switchdoc.com/2014/11/reliable-projects-3-using-internal-watchdog-timer-arduino/
- http://playground.arduino.cc/Main/ArduinoReset
- Arduino Nano 3.1 Watchdog not resetting / unable to change fuses http://forum.arduino.cc/index.php?topic=150419.0
- ATmega328 Watchdog http://www.avrfreaks.net/forum/atmega328-watchdog
- 给ATmega8使用新版arduino bootloader http://www.geek-workshop.com/forum.php?mod=viewthread&tid=174
- http://www.eepw.com.cn/article/148586.htm
UI:
- 在线配色:http://www.mcolor.sinaapp.com/
- 颜色代码:http://rgb.pin5i.com/
- Bootstrap layout: http://www.bootcss.com/p/layoutit/
- 墨刀:https://modao.io/
- readme: https://dash.readme.io/login