Sunday, June 17, 2012

Blue(Tooth) Skies... Smiling at Meeee


Controlling Arduinos by Pinging an Internet Relay Chat Bot

Ping the bot, flip the light! David took the lead on this one. We got this working earlier in the week.

Turning the lights on and off - Arduino + Android + Bluetooth (+spit&tape)


Sending one character by bluetooth (D or L) to flip the light switch. The servo is 360 and continuous, which was more difficult than a stepper. Currently, we attach and detach the motor rather than dictate angle or position. We rely on timing, which explains the multiple rotations in the video each time we flip the light.

Also, we didn't have a flag-like arm to reach back and trigger the lights. A whole bunch of hacker schoolers got involved, helping us extend the light switch and add the knife-arm you see above.

Here's the code. Needs some tweaking, but pretty (stupid) simple.

Notes:
  • Remember to run the Arduino BT Init Sketch  -- Just in case!
  • Select "To Board" (deal w/ Arduino shield, not BTchip specifically)
  • Default Baud rate for ITEAD shield is 9600
  • Default password is 1234
  • 4.5 volts is NOT enough to power the system. (Needs 5- don't be cheap.)
  • Disconnect USB Serial before bluetooth communication. (Defaults to using USB when Serial.available() or Serial.print() called)
  • Ensure Tx/Rx pins are not in use/connected on Arduino when programming. 
    • Had to remove shield EVERY time. Inconvenient. If we were continuing with this, I'd insist on a switch of some sort.

I love how we didn't use other people's Arduino libraries or resources. We stuck with the core Arduino ones. I did, however, use something called Bluetooth Viewer on my Android. It is very basic. Send and receive raw data after making a connection. If we dug further, we might dig there. For now, back to bash! Then javascript/python for Chordulator implementation (see first post.)

Resources : 
BT0417C DataSheet (sans data)
BT Shield DataSheet ( - the data)
Nearly Informative BT0417C Command Sheet

Arduino Servo (Important to read Arduino documentation. Arduino-servo commands != Arduino-stepper commands.)

No comments:

Post a Comment