Mobile Sensor

March 31st, 2009. Filed under: arduino, processing, programming.

Nik and I created this mobile sensor that broadcasts light levels and accelerometer data to an online database via text message. The above visualization was created by running around for five minutes. Light levels are represented by the opacity of blue and faster changes in tilt (when one is running with the sensor in hand, for instance) are represented by longer lines. 

We are currently working on a proper write up that will include code and schematics. 

9 Responses to Mobile Sensor

  1. Gary

    Cool project. Great choices in your components. 😉

  2. Mike

    I’ve been thinking about building this for a while now but haven’t been able to get my feeble brain around how to do the mobile bit – talk of ATT commands scared me off.

    Be great to know what mobile phone you used, and how 🙂

    Mike

  3. nick

    @Mike: until we do a proper write up, nik’s post might help you since it includes links to the phone and the code we modified: http://nikhanselmann.com/index.php?/experiments/arduino–motorola-c168i/

    and remind me if i haven’t released schematics and code in the next couple months

  4. Mike

    @Nick – nice one, thanks loads. Will check out the post and call back in a bit. Interesting that you went for the c168i – I spotted the serial2mobile thing but wondering if anyone has had success with cheap nokia’s..

    Cheers

    Mike

  5. John

    How did you physically connect the 168i to arduino? To be more specific, what voltage does the arduino have to output to successfully communicate with the phone via its stereo jack? Could you email me a schematic of just that connection? thanks

  6. nick

    You don’t send power to the phone. You use a mini stereo jack with the sleeve connected to the Arduino ground, the ring connected to the Arduino RX and the tip connected to the Arduino TX (instructions on this page).

    We’re working on the full schematic/instructions for this project which we should have available very soon!

  7. John

    Thanks for your quick reply!! when i hook up as described the phone’s display only lights brightly… it does not seem to be responsive. The brightening of the screen made me think that the output from arduino was too much and that i needed some resistance…. any thoughts would be appreciated. Thanks again

  8. amy

    hi there
    i am so interested with your blog, doing arduino project.
    i have did once but have trouble in connect between database and arduino. my arduino isnt get the data from the DB. im wondering on how you pull the data from DB to your phone?

  9. nick

    the arduino doesn’t connect to a database, it only sends a command to the phone to send a text message. the text message goes to an email address, which is then added to the database.

    if i were to do this project again, i would either have the phone send a text message directly to an email address or have it send a text message to a dedicated google voice or 3jam.com phone number, which is then forwarded to an email address. i would then parse the emails using a python script which adds the info to a text file, thereby avoiding using a database.

    parsing email using python is explained here: http://docs.python.org/library/poplib.html and only requires a short bit of code, something like this:

    import getpass, poplib

    M = poplib.POP3('localhost')
    M.user(getpass.getuser())
    M.pass_(getpass.getpass())
    numMessages = len(M.list()[1])
    for i in range(numMessages):
    for j in M.retr(i+1)[1]:
    print j

    hope this helps!

Leave a Reply

You must be logged in to post a comment.