risknfun's blog    |  go to risknfun's homepage
Blog Main
Tag | Guestbook | Admin   
 
sensor에 해당하는 글 3건
2007/03/21   Actions, Events and Filtering (254)
2007/02/28   [W6] Network data-logging through through Xport (2046)
2007/02/14   [Sensor] W5: Sensor Reports - 1 (207)


Actions, Events and Filtering
For Actions, Events and Filtering assignment, I made a very simple game that uses a flex sensor and a player only can solve it by a specific way of bending it rather than just bend normally.


Here is the description of this assignment.



I simply build the hardware part using Arduino and software part using Processing that are connected through serial communication. In this game, which is similar to unlock the padlock, a player should bend the flex sensor a specific way and the specific time. For example, Step 1. bend forward and keep it more than 5 seconds but less than 8 seconds, Step 2. release and keep about 3 seconds, Step 3. bend backward and keep it more than 7 seconds.

(cubic equation graph from wikipedia)


Actually, my initial concept was that using a differential of a equation such as a cubic equation, however, my flex sensor was quite unstable so I needed an extra work(ex, averaging). Therefore,  I just use the sensor value and the time as a variable.


the lock will not be solved when a player bend it without knowing specific steps.



the lock was solved by the specific way described above.
Tag : Arduino, ITP, Processing, sensor


[W6] Network data-logging through through Xport
Build a long-term datalogging system. Capture data from the physical world in a database and build a web interface to display the data gathered over time.

1. Arduino -> Processing -> PHP -> Text
2. Arduino -> Processing -> PHP -> MySQL
3. Arduino -> Xport -> PHP -> MySQL

I did the second option of this assignment during last weekend, but I wanted to try the third one that uses Xport because I was super impressed by Tom's Email clock before. Using Xport means the system becomes a 'stand-alone' one that doesn't need computer at all.

Anyway, this assignment was very challenging because I should have dealt with so many stuffs to work through this path, Sensor -> Arduino -> (serial communication) -> Xport -> (internet) -> PHP -> MySQL -> (internet) -> Web Browser.


- Hardware part


(click to see descriptions)


- Programming part

The code what I wrote, or modifed from the Network Datalogging Suite and the Arduino-Xport-PHP were:

1. A MySQL table setting code (click to expand)


2. An Arduino code on a chip of Arduino, which reads sensor values and send them to a Xport using an HTTP Request via a serial communication.

3. A PHP code on a remote Web server, which accepts data from the Xport by a GET method, and then save them to the MySQL database. This code is also used as a viewer for the saved data.

And, here is a simple version of the Arduino code just for a test.

Simple code of from Arduino to Xport to PHP. (click to expand)



- Result

I finally made it works and here is what I got. (temporary)

the last few lines of the result (click to expand)




- Problems what I faced

1. My Xport didn't response a ping command so I checked and checked again the network configurations.

2. MySQL Admin page didn't work properly. I couldn' create a table through it.

3. I forgot my MySQL DB password so I used a web server in Korea instead, which is quite slow from here.

4. I was confused the usage of GET statements. I couldn't find the sample code above so I've googled a lot.

5. I couldn't find my Xport through a device installer provided by Lantronix.

6. An IP address is needed not a domain name while connecting to the server via an HTTP Request command. But, one of my server I used at the moment didn't give me a way to connect through. Maybe it used a virtual host setting on the web server, I guess. So I move all files to an another server.


- Conclusion and Future Plan

Since the Xport was very hard to figure out how it works, I couldn't pick a sensor and a project that a timescale that’s longer than a typical human-reaction timescale. However, I think I can apply this knowledge to my project. For example, someone who lives in opposite side of the earth can visits my web page to see how my brain waves are changing when I'm sleeping in real-time.


Referece: http://www.lantronix.com/support/documentation.html
Tag : ITP, sensor