
第三天
展示你們的成果!
|
|||||||||||||||||||||||||||||||||||||||||
Recognize it: RFID 我們可以找到有很多用於識別物件/人的方法, 比較常見的就是 Bar Code:
Bar Code is simply a pattern of dark and light lines or cells used to encode an alphanumeric string. A scanner read the "image" and send it to the computer to interpreting the widths of the light and dark bands as zeros or ones. Of course, it is done by the photodiode, it is far away from what we will use: QRCode.
另外, 有不同類型的識別方法: 例如 Face detection:
路牌識別
其實以上種種都是 Pattern Recognition. 你們可能看過 reactable, 或者 micro+playground的 react memory.
另外, 由日本研究, 現在日本非常流行的有 QRCode. "QR stands for Quick Response. It is created in Japan originally for tracking the vehicle parts. But you can see it is attached to every single items in Japan everywhere like magazine, product, even can use QRCode to pay bill in shops. It is kind of the optical way to do the pattern recognition. If you have your mobile phone a Japan version or from Japan Brand, most of them has a QRCode reader as most of the mobile phone comes with camera. Even the JAVA platform J2ME has a library to read the QRCode. "
Daniel Shiffman has made a library for Processing: pqrcode. http://www.shiffman.net/p5/pqrcode/. Just simply download the library and put into Processing. Online QRCode generator: Case Studies The voice of the street: The voice of the street have provided a service for street artists. Combining street art, QR codes and Google Maps the service allows street artists to communicate with the viewer and visa versa.
ConQwest
http://playareacode.com/work/conqwest/
我們現在要玩的就是用於你們休悠卡的 RFID: 射頻識別 Radio Frequency Identification: RFID "Radio-frequency identification (RFID) is an automatic identification method, relying on storing and remotely retrieving data using devices called RFID tags or transponders. An RFID tag is an object that can be applied to or incorporated into a product, animal, or person for the purpose of identification using radiowaves. Some tags can be read from several meters away and beyond the line of sight of the reader. Most RFID tags contain at least two parts. One is an integrated circuit for storing and processing information, modulating and demodulating a (RF) signal, and other specialized functions. The second is an antenna for receiving and transmitting the signal. A technology called chipless RFID allows for discrete identification of tags without an integrated circuit, thereby allowing tags to be printed directly onto assets at a lower cost than traditional tags." Here in Hong Kong, we have a very great RFID system around us everyday: Octopus Card!
Or in Taiwan "悠遊卡"
RFID and Art By using RFID, there are many interactive art interact with their audience. Here is some of the references. "RFID Light Sequencer"
"iTea" Straitjacket Embrace!
"Transmission"
"Filter"
"ET"
Extension of "Amagatana"
S.U.I. -Smart Urban Intelligence-
Zapped! (http://www.preemptivemedia.net/)
Reverse Engineering: RFID Killer!!!!! Google RFID Zapper!
|
|||||||||||||||||||||||||||||||||||||||||
RFID with Arduino RFID with Arduino and Processing And it is your time to make it. Instead, you just simply need the Arduinio as an input device. I should say just use the serial communication of Arduino, and nothing more. So you don't even need to program the Arduino, but just simply program the client program (reading program), may be, in Processing. Let's see which devices we will use: ID12 Breakout (Optional) Even ID12 Breakout is cheap and useful, but it is just out of stock when we order the equipment and parts. This is the datasheet of ID12, let's take a look. Before you do the program in Arduino and Processing, we must need to know the specification of the RFID Tag.Let's take a look now. The format of the tag is:
If you do not have the ID-12 Breakout, you need to connect the ciruit like this:
if you are using the breakout board from sparkfun:
The following is the program for Arduino
So you are receiving this information from the RFID Tag Reader.
Class Works: RFID Trigger Big Load Device Now you can grab the unique ID of the RFID Tag from the reader. Can you do something with this information? Okay, you can take some time to think about the interaction. Here is a very little suggestion: Remember we can use the Relay box to trigger some high load device like a Desktop Light? It just like something Home Automation: When your is RFID reconginzed Door, once you use the RFID to enter the room, the system knows who you are. Then the system will help you to trigger something like the TV.
Or, you may want this complex but powerful version later on:
|
|||||||||||||||||||||||||||||||||||||||||
討厭電線: Xbee無線通訊 如果你一定要跟其他的Arduino溝通, 或者跟電腦溝通, 你得要用usb或其他線將他們連在一起 你可以用Bluetooth, wifi等無線通訊代替討厭的電線. 這次我們就玩玩Xbee. Xbee在電子工程同學的眼中應該很熟悉, 他是非常常見用來作無線通訊的module. (模組)
看看藝術家怎樣用Xbee Perform-o-shoes Zygote Interactive Ball Shell house
Radio Transceivers: XBee
In the pervious examples, we have tried RFID to do with something "wireless". But it is super close RF transmission/receive. How about we want to transmit or receive the radio frequency wireless not just in near distance? Just like we receive radio programme with our FM receiver? "This is the very popular 2.4GHz XBee module from Digi (formally Maxstream). These modules take the 802.15.4 stack (the basis for Zigbee) and wrap it into a simple to use serial command set. These modules allow a very reliable and simple communication between microcontrollers, computers, systems, really anything with a serial port! Point to point and multi-point networks are supported."
This is, as describe, a low cost way to do with Wifi. You can do the prototype with Arduino and build the circuit like this:
But you are so luckily that you have me to support you and thanks nkcelectronics selling the Freeduino Arduino XBee Shield Kit. With this kit, you just need to solder them together like playing LEGO. Or you are lazy and have "financial flexible", you can even go spark fun to buy the Kit with Xbee come with. No assemble even needed.
The Freeduino Arduino XBee Shield Kit is the PCB board already, what you need to do is just to pick the correct parts and solder in correct location. And finally you will have something like this:
Pair of XBee, Pair of transmit and receive:
Step 1: Configuring the XBee Shield To configure the XBee shield, you need to know the speciciation of the XBee first. You should at least know the protocol of the XBee. To do the configuration, you need a program to send data via serial communication. In PC, there is many program can do this but Hyper Terminal can do this which is come with Windows. (e.g. Bray++) In MAC or Linux, you can also use the console to do this. (e.g. Zterm, Ubuntu)
You are setting it with the XBee factory setting: 9600:8:n:1. But later on you may change the BPS to 19200 to enhance the faster communication. You may too scare of the Hyper Terminal. We are so nice to Tom Igoe again. He wrote a Processing Program, which is not even user friendly, (even no interface!) but in the environment that you are familiar and/or comfortable with. Here you go the Processing Program:
After you copy and Paste it in Processing and run it, you will see something like this
So at this moment, you can type something here to send to the XBee. WAIT! You should do few more steps before you send the command.
Set the Jumper Now, extract the processor from Arduino board and plug the shield in. So if you set the jumper to USB, it allows you to do the direct serial communication between USB and XBee.
Sending commands for first node Now, this is a very important step!!!! Follow it up carefully and quickly! (CR is Enter) 1) Enter command mode : +++ 2) It returns you "OK" 3) Then backspace to delete those +++ 4) Type ATDL <CR> 5) If return "0", it means no node address has been set in the XBee 6) Type ATBD <CR> 7) If returns you the bps, 3 means 9600bps, 4 means 19200bps 8) In order to change the speed to 19200bps, type ATBD4 <CR> 9) Type ATWR <CR> to write the data to memory 10) Type ATCN <CR> to leave the command mode 11) Now you cannot send any data to Xbee as the bps has been change 12) So now go to the program and change 9600bps to 19200bps 13) Type +++ enter the command mode again 14) It returns "OK" 15) Type ATMY1234 <CR> to set the node source address to 1234 16) To confirm it, Type ATMY <CR> and it will returns you the address "1234" 17) Type ATDL5678 <CR> to se the node destination address "5678" 18) Type ATDL <CR> to confirm the address 19) Type ATDH0 <CR> to set it transmit using a 16-bit address 20) To confirm, type ATDH <CR> 21) Type ATID1111 <CR> to set the PAN (personal address network) 22) To confirm, type ATID <CR>
After you finish setting up the first node, go and set the other nodes. 1) repart the step 1) to 12) 2) Do the step 12) to 22) but 5678 instead 1234, 1234 instead 5678
Finally the information of the pair of radio is:
Step 2: Programming the Arduino to send data with XBee Module We can even do the command above to set the XBee. But just make it as simple as possible, we just simply program one Arduino with XBee to set out data. The Arduino you are connecting to the computer is JUST receiving data from other module. So you don't need to program that Arduino.
Is that simple?! Yes! Thanks to the lovely XBee module. It plugs to the TX and RX, so nothing more you need to set, just send and receive! For the Arduino connect to the computer, no program for it. Just simply plug-out the microprocessor and use it as a serial reader, DONE! Now turn on the Arduino and Serial Monitor, you will something like this:
Move around and try this!
Advanced Try 1: More than 1 XBee sending data In the last example, you set both node address and destination address for both XBee. It just a simple example that you can just exchange between two nodes. How about more than 2 paired nodes? You SHOULD NOT set the destination address on the nodes which is connected to the computer. You SHOULD make three nodes like this:
Radio 1 is the node connected to the computer. ATDL 0 means receiving all data which is aim to send to it. Radio 2 and Radio 3 both sending data to ATDL 1234, that is sending data to Radio 1. Of course, if you have already programmed the Microcontroller of Radio 2, you should now program the Radio 3 as well. At least make something different in order to see in the terminal 2 different nodes are sending data to the Radio 1. Do it yourself now! This is for Radio 2 (from the perviously example
This is for Radio 3 (amend by yourself)
Advanced Try 2: Dim the LED at Radio 1 from Radio 2 In the past few examples and exercises, you know how to send the data and receive just in the terminal. How you can apply this transmission-receive? Here now you come with a very simple exercise: change the LED from Radio 2 to Radio 1.
Radio 1 is attached a LED light; Radio 2 is attached with a VR to change the LED light of Radio 1.
It is just about how you program the Arduino (if you are using with microcontroller)
Let's take a look on how you program to send the data out:
Send and Receive Data This is for the node which is sending data
This is for the node which is receiving data
Advanced Try 3: Two-ways Trans-receive XBee If the advanced try 2, you know how to do the simple-way transmit or receive. But it is so stupid to fix 1 node is sending data and another node is receiving data. We want the node can do the trasmit and receive at the same time, how you can do this? Hint: just simple combine the program above! But pay attention of the destination. You should pair the XBee.
Advanced Try 4: Broadcast the XBee In the lat exercise you can just simply do the pair-to-pair send and receive. How about you want to broadcast it? Open the XBee manual, Page 26 can help you. Do the same thing with Advanced Try 3, but this time you can get the data from more than 1 XBee.
|
|||||||||||||||||||||||||||||||||||||||||
iPod + Arduino = Fun! SparkFun 推出了這個PodGizmo, 將iPod的pin完全breakout. http://pinouts.ru/Devices/ipod_pinout.shtml 我們在這個網頁裡看到iPod每一支pin的功能. 我們可以直接讀取或寫iPod的資料. 最基本的, 你至少也可以做個廉價 iPod speaker , 當然, 這個很爛, 去買一個算吧! 但你可以想個點子玩玩 iPod!! 立即來試試看!
|
|||||||||||||||||||||||||||||||||||||||||
More to explore 1: Fritzing
"Fritzing is an open-source initiative to support designers and artists to take the step from physical prototyping to actual product. We are aiming to create a software in the spirit of Processing and Arduino, that allows the designer/artist/researcher/hobbyist to document their Arduino-based prototype and create a PCB layout for manufacturing. The complimenting website helps to share and discuss drafts and experiences as well as to reduce manufacturing costs. Fritzing is essentially an Electronic Design Automation software with a low entry barrier, suited for the needs of designers and artists. It uses the metaphor of the breadboard, so that it is easy to transfer your hardware sketch to the software. From there it is possible to create PCB layouts for turning it into a robust PCB yourself or by help of a manufacturer. This functionality is currently based on EAGLE."
PDK: Part Development Kit If you want to create your own part for Fritizing, you can download the PDK.
Arduino With Flash? Some of you are so friend with other application like MAX/MSP, PD or Flash. Would you interfacing with other application other than Processing? Here you go: http://www.arduino.cc/playground/Main/InterfacingWithSoftware Take Flash as an example, you can make the Serial reading or sending in Processing. By using XML, Processing act as a middleman between Flash and Arduino. In Flash, you need to use XMLSocket class to communicate with Processing. In the above link, you can find some application help you to do this in a simple way. Or you can try this: Basic Proxy in Processing
This is the Action Script to Test with
Or you can try it: http://www.tinker.it/en/Projects/TinkerProxy
Except Thinker Proxy, Tinker.it also written an application for OSX to receive serial information and fenerates Apple Script event for OSX. It can allow you to control almost all application on Mac.
More Protocols AppleScript Proxy Except Thinker Proxy, Tinker.it also written an application AppleScript Proxy for OSX to receive serial information and fenerates Apple Script event for OSX. It can allow you to control almost all application on Mac.
SketchTools
Sketchtools is a proxy tool as well. It takes MIDI, serial and OSC. And it is originally design for Phidgets, work with MAKE Controller and Teleo.
Griffin Proxi You may know Griffin if you are MAC user. They have a lot of MAC product like powerMate, Airclick, etc.
Girder
OSC DMX512
Work with Telephone? You can work with telephone system! Asterik is an open source private branch telephone exchange (PBX) . You can manage a phone exchange over an IP network. Just like the ordinary phone system, it can make and tak phone calls, save messages, etc. With Asterik, you can connect the phone and the internet. For example you can let the user send a email over the phone by clicking on the touchtone keypad. Sure you can imagine, with Arduino/Microcontroller, you can let the user control something physical (a lamp, a motor) over the telephone.
|
|||||||||||||||||||||||||||||||||||||||||
追加例子1 A Networked Sensing We are going to apply some of the technique we have learned before: light sensive detector, VR, even a simple button, or complex sensor; And sensing something: movement, light or any motion in a remoted place "A" with Arduino connected to the computer which is available for connecting to internet;
We provide one of the option and a set of technique and you decide what you gonna make.
Making webcam and upload image to a FTP How about we put a computer with webcam in remote location A. Once it sense some motion with varies sensor and trigger by something, it takes a photo with webcam and upload it to the internet. And we write a Processing program to send us a email to tell us: There is motion! Click this link for photo! You might need some programs like this: MAC: Evocam , Evological, http://www.evological.com Evocam is shareware while Fwink is freeware. These kind of webcam application would help you capture a photo from webcam and upload it to a FTP server. You need to provide username and password in order to let the program to upload the captured photo to the FTP server. Of course you can change make a web page to display your lovely captured photo.
Sending Email (php: server side) You can refer the pervious lecture for the Arduino and sensor construction. Let's take a look on how we can write a Processing program to send an email. You have many method to send email: Javamail, javascript, etc. Now I would like to show you the most simplest and common way to do this with PHP.
This is the "send_mail" function in the php. We have prepared a sensor reading value named sensorvalue (we will do the program in Processing later on). Then we receive the sensorvalue, we should check out whether the value is over the thershold. (Of course, we are doing the same thing in Processing, but just in case.) And then we can prepare the email content.
This is the most simplest way to do it. Of course, you need a PHP server with you. I am trying this with my own server. And you NEED to change the domain for sure. Sending Mail (Processing: front end side) We have finished the Server Side, but it will nothing until the Front end side is calling it to take action. To communicate with HTTP server in Processing, we can use Net Library. With net library, we can make HTTP request and get the echo back.
In the above setup function, we build the connection with the server that contain the php file and sending request to the php directly. "requestInProgress" is the variable that will be used to monitor whether it is requesting the php, if yes, don't request for twice. In Draw function, we check the response of the request from the server.
If you have a php supported server, you can just simply upload the php, then run the processing and see whether you can send the email. Of course in you are not sending email when sensor sense something in front of with this simple Processing program. Now, you can make something like this:
It just simple reconstructe the "setup": sending HTTP request into a function "makeHTTPCall". And reconstructe more on "draw" into a function "checkNetClient".
In setup(), just setup what you need to set to do with the sensor. In draw(), you just need to check the sensor value and call the makeHTTPCall and checkNetClient once you got the specific value.
It looks very simple right? Make you own work now! Extended Readings: |