20151123_jeffrey - silenceuncrio/diary GitHub Wiki

  • 0905 review diary
  • 1100 read Arduino Cookbook
  • 1300 read Arduino Cookbook
  • 1350 review the reading
  • 1410 composite the chapter for our device in the plan
  • 1445 arrange the IoT Platform Plan
  • 1720 review the IoT Platform Plan today

0905

新增 issue 4
感謝 綜晏 提醒, 早上來自台中家裡的未接來電應該也是這個事情

review 昨天的日記
目前將 智慧家庭 這個環境定義為由下列成分所組成

  • Normal Router
  • Normal Ethernet Switch
  • Normal Ethernet AP
  • IoT Smart Control Center
  • IoT Wifi Control Box
  • IoT Ethernet Control Box
  • IoT Control Box

這應該由投影片來呈現比較合適

1100

新增了一些投影片, 來 review 一下

再來為了要帶出為了 IoT Device(Control Center and Control Box, ) 的需求, 我們得描述什麼用的服務需要這些 IoT Device
參考一下 Arduino Cookbook 尋求一些靈感
arduino 是目前 DIYer 最流行的玩具, 先看看現成的應用有哪些再來長出我們對家庭的自動化需求

    1. Getting Input from Sensors . . . 181
    1. Visual Output . . . 241
    1. Physical Output . . . 289

先從第六章來看一下 Arduino 有哪些 Sensors 可以搭配, 稍微看個書, 列一下重點, 太進階的就先放掉

  • 6.1 Detecting Movement 183
    • You want to detect when something is moved, tilted, or shaken.
    • This sketch uses a switch that closes a circuit when tilted, called a tilt sensor.
  • 6.2 Detecting Light 186
    • You want to detect changes in light levels. You may want to detect a change when something passes in front of a light detector or to measure the light level—for example, detecting when a room is getting too dark.
    • The easiest way to detect light levels is to use a light dependent resistor (LDR).
  • 6.3 Detecting Motion (Integrating Passive Infrared Detectors) 187
    • You want to detect when people are moving near a sensor.
    • Use a motion sensor such as a Passive Infrared (PIR) sensor to change values on a digital pin when someone moves nearby.
  • 6.4 Measuring Distance 189
  • 6.5 Measuring Distance Accurately 193
  • 6.6 Detecting Vibration 197
    • You want to respond to vibration; for example, when a door is knocked on.
    • A Piezo sensor responds to vibration.
  • 6.7 Detecting Sound 198
    • You want to detect sounds such as clapping, talking, or shouting.
    • This recipe uses the BOB-08669 breakout board for the Electret Microphone (Spark-Fun).
  • 6.8 Measuring Temperature 202
    • You want to display the temperature or use the value to control a device; for example, to switch something on when the temperature reaches a threshold.
    • This recipe displays the temperature in Fahrenheit and Celsius (Centigrade) using the popular LM35 heat detection sensor.
  • 6.9 Reading RFID Tags 206
    • You want to read an RFID tag and respond to specific IDs.
    • Figure 6-13 shows a Parallax RFID (radio frequency identification) reader connected to the Arduino serial port.
  • 6.10 Tracking Rotary Movement 208
  • 6.11 Tracking the Movement of More Than One Rotary Encoder 211
  • 6.12 Tracking Rotary Movement in a Busy Sketch 214
  • 6.13 Using a Mouse 216
  • 6.14 Getting Location from a GPS 220
  • 6.15 Detecting Rotation Using a Gyroscope 225
  • 6.16 Detecting Direction 230
  • 6.17 Getting Input from a Game Control Pad (PlayStation) 235
  • 6.18 Reading Acceleration 237

再來是第七章

  • 7.1 Connecting and Using LEDs 245
    • You want to control one or more LEDs and select the correct current-limiting resistor so that you do not damage the LEDs.
    • Turning an LED on and off is easy to do with Arduino, and some of the recipes in previous chapters have included this capability
  • 7.2 Adjusting the Brightness of an LED 248
    • You want to control the intensity of one or more LEDs from your sketch.
    • Connect each LED to an analog (PWM) output.
  • 7.3 Driving High-Power LEDs 249
    • You need to switch or control the intensity of LEDs that need more power than the Arduino pins can provide. Arduino chips can only handle current up to 40 mA per pin.
    • Use a transistor to switch on and off the current flowing through the LEDs.
  • 7.4 Adjusting the Color of an LED 252
    • You want to control the color of an RGB LED under program control.
  • 7.5 Sequencing Multiple LEDs: Creating a Bar Graph 255
  • 7.6 Sequencing Multiple LEDs: Making a Chase Sequence (Knight Rider) 258
  • 7.7 Controlling an LED Matrix Using Multiplexing 259
  • 7.8 Displaying Images on an LED Matrix 262
  • 7.9 Controlling a Matrix of LEDs: Charlieplexing 265
  • 7.10 Driving a 7-Segment LED Display 271
    • You want to display numerals using a 7-segment numeric display.
  • 7.11 Driving Multidigit, 7-Segment LED Displays: Multiplexing 274
    • You want to display numbers using a 7-segment display that shows two or more digits.
  • 7.12 Driving Multidigit, 7-Segment LED Displays Using MAX7221 Shift Registers 276
  • 7.13 Controlling an Array of LEDs by Using MAX72xx Shift Registers 279
  • 7.14 Increasing the Number of Analog Outputs Using PWM Extender Chips (TLC5940) 281
  • 7.15 Using an Analog Panel Meter as a Display 285

看完有種相見恨晚的感覺, 感覺過去三個月的自己一定說過不少像井底之蛙的話... 只因為不知道有那麼多現成的 "食譜"
該死... 趕快看喔

1300

第八章 Physical Output

  • 8.1 Controlling the Position of a Servo 292
    • You want to control the position of a servo using an angle calculated in your sketch. For example, you want a sensor on a robot to swing through an arc or move to a position you select.
    • Use the Servo library distributed with Arduino.
    • openHAB 利用 yahoo weather 的服務, 了解到會下雨, 某個小玩偶舉起了雨傘
  • 8.2 Controlling One or Two Servos with a Potentiometer or Sensor 294
  • 8.3 Controlling the Speed of Continuous Rotation Servos 296
  • 8.4 Controlling Servos Using Computer Commands 298
  • 8.5 Driving a Brushless Motor (Using a Hobby Speed Controller) 299
  • 8.6 Controlling Solenoids and Relays 300
  • 8.7 Making an Object Vibrate 302
  • 8.8 Driving a Brushed Motor Using a Transistor 304
  • 8.9 Controlling the Direction of a Brushed Motor with an H-Bridge 306
  • 8.10 Controlling the Direction and Speed of a Brushed Motor with an H-Bridge 309
  • 8.11 Using Sensors to Control the Direction and Speed of Brushed Motors (L293 H-Bridge) 311
  • 8.12 Driving a Bipolar Stepper Motor 317
  • 8.13 Driving a Bipolar Stepper Motor (Using the EasyDriver Board) 320
  • 8.14 Driving a Unipolar Stepper Motor (ULN2003A) 323

都太進階... 不過可以把上次去 Rayson 的 風扇轉速控制器帶進來

繼續往下看, 第九章 Audio Output

  • 9.1 Playing Tones 329
    • You want to produce audio tones through a speaker or other audio transducer. You want to specify the frequency and duration of the tone.
    • Use the Arduino tone function.
  • 9.2 Playing a Simple Melody 331
    • You want Arduino to play a simple melody.
    • You can use the tone function described in Recipe 9.1 to play sounds corresponding to notes on a musical instrument.
  • 9.3 Generating More Than One Simultaneous Tone 333
  • 9.4 Generating Audio Tones and Fading an LED 335
  • 9.5 Playing a WAV File 338
  • 9.6 Controlling MIDI 341
  • 9.7 Making an Audio Synthesizer 344

再往下走, 第十章 Remotely Controlling External Devices

  • 10.1 Responding to an Infrared Remote Control 348
    • You want to respond to any key pressed on a TV or other remote control.
    • Arduino responds to IR remote signals using a device called an IR receiver module.
  • 10.2 Decoding Infrared Remote Control Signals 350
    • You want to detect a specific key pressed on a TV or other remote control.
    • This sketch uses remote control key presses to adjust the brightness of an LED.
  • 10.3 Imitating Remote Control Signals 354
    • You want to use Arduino to control a TV or other remotely controlled appliance by emulating the infrared signal. This is the inverse of Recipe 10.2—it sends commands instead of receiving them.
  • 10.4 Controlling a Digital Camera 357
    • You want Arduino to control a digital camera to take pictures under program control. You may want to do time lapse photography or take pictures triggered by an event detected by the Arduino.
  • 10.5 Controlling AC Devices by Hacking a Remote-Controlled Switch 359
    • You want to safely switch AC line currents on and off to control lights and appliances using a remote controlled switch.

這一章很讚

第 11 章 Using Displays

  • 11.1 Connecting and Using a Text LCD Display 364
    • You have a text LCD based on the industry-standard HD44780 or a compatible controller chip, and you want to display text and numeric values.
  • 11.2 Formatting Text 367
  • 11.3 Turning the Cursor and Display On or Off 370
  • 11.4 Scrolling Text 372
  • 11.5 Displaying Special Symbols 375
  • 11.6 Creating Custom Characters 377
  • 11.7 Displaying Symbols Larger Than a Single Character 379
  • 11.8 Displaying Pixels Smaller Than a Single Character 382
  • 11.9 Connecting and Using a Graphical LCD Display 385
  • 11.10 Creating Bitmaps for Use with a Graphical Display 389
  • 11.11 Displaying Text on a TV 391

再來 12. Using Time and Dates

  • 12.1 Creating Delays 397
  • 12.2 Using millis to Determine Duration 398
  • 12.3 More Precisely Measuring the Duration of a Pulse 402
  • 12.4 Using Arduino as a Clock 404
  • 12.5 Creating an Alarm to Periodically Call a Function 412
  • 12.6 Using a Real-Time Clock 415
    • You want to use the time of day provided by a real-time clock (RTC). External boards usually have battery backup, so the time will be correct even when Arduino is reset or turned off.

趁這個機會讓 IoT Team 熟悉 RTC

再來 13. Communicating Using I2C and SPI

  • 13.1 Controlling an RGB LED Using the BlinkM Module 425
  • 13.2 Using the Wii Nunchuck Accelerometer 430
  • 13.3 Interfacing to an External Real-Time Clock 435
  • 13.4 Adding External EEPROM Memory 437
  • 13.5 Reading Temperature with a Digital Thermometer 441
    • You want to measure temperature, perhaps using more than one device, so you can take readings in different locations.
  • 13.6 Driving Four 7-Segment LEDs Using Only Two Wires 445
  • 13.7 Integrating an I2C Port Expander 449
  • 13.8 Driving Multidigit, 7-Segment Displays Using SPI 451
  • 13.9 Communicating Between Two or More Arduino Boards 454
    • You want to have two or more Arduino boards working together. You may want to increase the I/O capability or perform more processing than can be achieved on a single board. You can use I2C to pass data between boards so that they can share the workload.
  1. Wireless Communication
  • 14.1 Sending Messages Using Low-Cost Wireless Modules 459
  • 14.2 Connecting Arduino to a ZigBee or 802.15.4 Network 465
  • 14.3 Sending a Message to a Particular XBee 472
  • 14.4 Sending Sensor Data Between XBees 475
  • 14.5 Activating an Actuator Connected to an XBee 480
  • 14.6 Sending Messages Using Low-Cost Transceivers 486
  • 14.7 Communicating with Bluetooth Devices 491
    • You want to send and receive information to another device using Bluetooth; for example, a laptop or cellphone.

這裡的 Zigbee 和 Bluetooth 要放在進階的 milestone 了, 屬於 communication 的範疇

  1. Ethernet and Networking
  • 15.1 Setting Up the Ethernet Shield 498
  • 15.2 Obtaining Your IP Address Automatically 500
  • 15.3 Resolving Hostnames to IP Addresses (DNS) 502
  • 15.4 Requesting Data from a Web Server 504
  • 15.5 Requesting Data from a Web Server Using XML 508
  • 15.6 Setting Up an Arduino to Be a Web Server 511
  • 15.7 Handling Incoming Web Requests 514
  • 15.8 Handling Incoming Requests for Specific Pages 517
  • 15.9 Using HTML to Format Web Server Responses 521
  • 15.10 Serving Web Pages Using Forms (POST) 525
  • 15.11 Serving Web Pages Containing Large Amounts of Data 528
  • 15.12 Sending Twitter Messages 535
    • You want Arduino to send messages to Twitter; for example, when a sensor detects some activity that you want to monitor via Twitter.
  • 15.13 Sending and Receiving Simple Messages (UDP) 539
  • 15.14 Getting the Time from an Internet Time Server 545
  • 15.15 Monitoring Pachube Feeds 550
  • 15.16 Sending Information to Pachube 556

這一章待細看...

回頭看 4. Serial Communications

  • 4.1 Sending Debug Information from Arduino to Your Computer 94
  • 4.2 Sending Formatted Text and Numeric Data from Arduino 97
  • 4.3 Receiving Serial Data in Arduino 100
  • 4.4 Sending Multiple Text Fields from Arduino in a Single Message 105
  • 4.5 Receiving Multiple Text Fields in a Single Message in Arduino 111
  • 4.6 Sending Binary Data from Arduino 114
  • 4.7 Receiving Binary Data from Arduino on a Computer 118
  • 4.8 Sending Binary Values from Processing to Arduino 120
  • 4.9 Sending the Value of Multiple Arduino Pins 122
  • 4.10 How to Move the Mouse Cursor on a PC or Mac 125
  • 4.11 Controlling Google Earth Using Arduino 130
  • 4.12 Logging Arduino Data to a File on Your Computer 135
  • 4.13 Sending Data to Two Serial Devices at the Same Time 138
  • 4.14 Receiving Serial Data from Two Devices at the Same Time 141
  • 4.15 Setting Up Processing on Your Computer to Send and Receive Serial Data 145

這一章根本就是再說 openHAB 的 Serial Binding 可以怎麼跟 Arduino 互動

  1. Simple Digital and Analog Input
  • 5.1 Using a Switch 150
  • 5.2 Using a Switch Without External Resistors 154
  • 5.3 Reliably Detecting the Closing of a Switch 155
  • 5.4 Determining How Long a Switch Is Pressed 158
  • 5.5 Reading a Keypad 163
    • You have a matrix keypad and want to read the key presses in your sketch. For example, you have a telephone-style keypad similar to the SparkFun 12-button keypad (Spark-Fun COM-08653).
    • 可以來模擬一個大門的密碼鎖: 密碼對了才能進來, 密碼錯了會觸發事件
  • 5.6 Reading Analog Values 166
  • 5.7 Changing the Range of Values 168
  • 5.8 Reading More Than Six Analog Inputs 170
  • 5.9 Displaying Voltages Up to 5V 173
  • 5.10 Responding to Changes in Voltage 176
  • 5.11 Measuring Voltages More Than 5V (Voltage Dividers) 177

1350

可以用的素材暴量了
回顧一下我看了哪幾個章節

    1. Serial Communications
    1. Simple Digital and Analog Input
    1. Getting Input from Sensors
    1. Visual Output
    1. Physical Output
    1. Audio Output
    1. Remotely Controlling External Devices
    1. Using Displays
    1. Using Time and Dates
    1. Communicating Using I2C and SPI
    1. Wireless Communication
    1. Ethernet and Networking

從智慧家庭的架構來看 Arduino 的話, Arduino 屬於 IoT Control Box
把上面的章節從 IoT Control Box 的角度來看的話, 我們可以這麼分

  • I/O
      1. Simple Digital and Analog Input
      1. Getting Input from Sensors
      1. Visual Output
      1. Physical Output
      1. Audio Output
      1. Communicating Using I2C and SPI
  • Displays
      1. Using Displays
  • Time and Dates
      1. Using Time and Dates
  • Remotely Controlling External Devices
      1. Remotely Controlling External Devices
  • Communications
      1. Serial Communications
      1. Wireless Communication
      1. Ethernet and Networking

由 Communications 就可以定義出 智慧家庭架構 裡的

  • IoT Control Box - Serial Communications
  • IoT Wireless Control Box - Wireless
  • IoT Ethernet Control Box - Ethernet

1410

幾乎可以來定義產品了, 就把各章節做個排列組合即可... 哈哈

IoT Control Box

  • I/O
    • Simple Digital and Analog Input
    • Getting Input from Sensors
    • Visual Output
    • Physical Output
    • Audio Output
    • Communicating Using I2C and SPI
  • Displays
    • Using Displays
  • Time and Dates
    • Using Time and Dates
  • Remotely Controlling External Devices
    • Remotely Controlling External Devices
  • Communications
      1. Serial Communications

IoT Wireless Control Box

  • I/O
    • Simple Digital and Analog Input
    • Getting Input from Sensors
    • Visual Output
    • Physical Output
    • Audio Output
    • Communicating Using I2C and SPI
  • Displays
    • Using Displays
  • Time and Dates
    • Using Time and Dates
  • Remotely Controlling External Devices
    • Remotely Controlling External Devices
  • Communications
    • Wireless Communication

IoT Ethernet Control Box

  • I/O
    • Simple Digital and Analog Input
    • Getting Input from Sensors
    • Visual Output
    • Physical Output
    • Audio Output
    • Communicating Using I2C and SPI
  • Displays
    • Using Displays
  • Time and Dates
    • Using Time and Dates
  • Remotely Controlling External Devices
    • Remotely Controlling External Devices
  • Communications
      1. Ethernet and Networking

IoT WiFi Control Box

  • I/O
    • Simple Digital and Analog Input
    • Getting Input from Sensors
    • Visual Output
    • Physical Output
    • Audio Output
    • Communicating Using I2C and SPI
  • Displays
    • Using Displays
  • Time and Dates
    • Using Time and Dates
  • Remotely Controlling External Devices
    • Remotely Controlling External Devices
  • Communications
      1. Ethernet and Networking

1445

在 pjeffrey 的 github 新增 iot_platform, 開始整理 wiki

1720

發現自己整理的速度又變快了

目前 pjeffrey 的 iot_platform 的 wiki 已經具有下列框架

  • Home
  • Architecture

IoT Devices

  • IoT Control Center - 未完成
  • IoT Control Box - ok
  • IoT Wi-Fi Control Box - ok
  • IoT Ethernet Control Box - ok

I/O

  • 參考 IoT Control Box 做修改
  • Sensors Input
  • Simple Digital and Analog Input
  • Visual Output
  • Physical Output
  • Audio Output

Communications

  • 未完成
  • Serial
  • Ethernet
  • Wi-Fi

Miscellaneous

  • 參考 IoT Control Box 做修改
  • Displays
  • Time and Dates
  • Remotely Controlling External Devices

其實有些工作我可以不用寫了... 直接排成工作項目指派給誰之後再做就好了
倒是 milestone 要想一下
到明年六月底前怎樣把這計畫階段性完成
而且每個階段都可以有驗收的的方式

總之先把最後一個階段的目標寫完再來拆