XBees, Arduinos, Serial Data

I made some huge progress over the last week or so on this ongoing Arduino / LCD project — it’s finally gone wireless!
With some more silly mistakes behind me, I’m finally getting a better handle on how to break down the problems I run into and solve them a lot faster. I remember back in February, it seemed as though it was going to be impossible to actually get this wireless part happening, so I’m super relieved to know it’s at least partly working.
Also, there have been people asking for the code used in this project (in terms of PHP and Arduino scripts), I will upload them! I just haven’t had the time to go through and appropriately clean them up and comment them, so I’m not sure how useful they would be at this point. I just wanted to note that I will indeed be doing that soon though!
Lots of photos of wireless glory ahead…

First up, opening the familiar Arduino IDE serial window.

The simple configuration I had last time — a de-chipped Arduino to act as an FTDI converter (I’ve since ordered the cable so as not to waste the Arduino), sending messages on to a receiving XBee.

At first though, I was receiving messages that you can see above, Warning: Specified serial port is not valid, etc…

Basically, for reasons unknown to me at first, the PHP script that I had hacked together wasn’t able to communicate with the Arduino anymore.

Though I’m not 100% sure, I think that the reason this was happening was that instead of communicating directly to the Arduino, I was now just sending data through the XBee. So, I had to change back the device to /dev/tty.usb…, which was the default setting, as in a previous configuration, I had it set to /dev/cu.usb… to get it to work with the Arduino and LCD wired to the computer via usb.

I also ran the same old Magpie RSS test getting a feed from Twitter just to make sure the LCD was still wired up appropriately.

And, again the red LED lit up on the receiving LCD means it’s received some information wirelessly, all good signs!

So, using the simple serial monitor in the Arduino IDE…

…I successfully passed a message to the LCD screen wirelessly!

However, I was running into some over power draw type issues, which I resolved by just disconnecting the TX pin on the receiving Arduino board. Since I’m just using the Arduinos to run the code that parses the text data to display on the LCDs, there was no reason to have the Arduino also being able to send data.

The XBee is wired to send the data it receives to the Arduino with the attached LCD.

Oh, and I also changed over the power settings to run this from a 9V battery.

Oh, the mess…

Some more soldering ahead, I had to do the basic assembly on this 9V battery adapter.

I’m definitely not good at soldering, but at least this is a lot of practice … so much more ahead.

Anyways, the battery connected and powering the Arduino, the LCD, and the XBee.

Lit up and ready.

And finally receiving information wirelessly from Twitter.

More text being received wirelessly!

XBee receiving data.

And some more.

On the other side, the XBee and Arduino standing in for the FTDI cable, sending along the text that has already been parsed by PHP, and will be formatted by the Arduino script on the receiving end.

So, it worked, but now I knew I needed to redo the wiring to actually make this portable.

It took a while to try to remember how I had got the screen working in the first place, and at first I had stupidly soldered wires right to the LCD, rather than soldering some pins to it.

And, I struggled a bit to make it all fit on a breadboard.

And then I realized I shouldn’t have soldering wires right to the LCD.

And so I went back to my old notes…

…and tried to make sense of them. Eventually, hand-written notes combined with previous blog posts filled in the gaps in my memory.

And so the rewired LCD / Arduino / XBee was ready for action…

I took this shot to try to remind myself of the configuration for future reference. Oh, and to explain the plastic above, in the process of soldering wires directly to the LCD screen, I think I killed it, so I had to use a new screen.

And finally, in another room, across the house, there is still successful wireless transmission!

It looks kind of suspicious, I know, but I’m just happy both sides are talking to one another.
There’s a lot more work ahead, but the next steps will be building a few more of these to test the possibility of setting these up as a mesh type of network, or more realistically, having a one-to-many kind of setup. More work once the new parts arrive!
–
Annotated Bibliography
http://www.arduino.cc/en/Guide/ArduinoXbeeShield (XBee shield info, not what I’m using, but still helpful)
http://www.faludi.com/projects/arduino-and-xbee-battery-test-results/ (battery tests with Arduino + XBee ***important***)
http://www.kobakant.at/DIY/?p=772 (XBee Serial Communication)
http://forums.trossenrobotics.com/tutorials/how-to-diy-128/xbee-basics-3259/ (basic XBee tutorial)
http://hcgilje.wordpress.com/resources/xbee_arduino_code/ (tutorial, shows timed “waking up” and some unfolding of data packets)
http://www.youtube.com/watch?v=7A7coLAUyfQ (wireless temperature sensor, XBee, Arduino + solar)
http://www.glacialwanderer.com/hobbyrobotics/?p=15 (PHP, XPort, Arduino)
http://www.flickr.com/photos/35434449@N08/4324916783/in/pool-adafruit (basic how-to photo for soldering 9v Arduino battery adapter)
http://www.ladyada.net/learn/lcd/charlcd.html (reminder on how to hook up LCD to Arduino)
I would like to thank the Canada Council for the Arts for their generous support.


![Micro-Residency #1: CreateHere.org “CreateHere works with one guiding principle in mind: we love our city for what it is, has been and could become.” The non-profit organization started in 2007 and does things like provide over $300,000 in artists grants to area creatives, connecting talented artists to homes in Chattanooga, and asking everyone in their city what they [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2009/11/web_oct5-createhere-150x150.jpg)
![Open Engagement, Group Work: The Collective Impetus Danielle and I will head to Portland State University this weekend to participate in Open Engagement, the conference that asks questions like, “Does socially engaged art have a responsibility to create public good? Can there be transdisciplinary approaches to contemporary art making that would contribute to issues such as urban planning and sustainability?” We’ll be [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2010/05/openengagement-150x150.jpg)
![ATTC Calgary Day 1: Shortcuts for Urban Resistance & Algorithmic Walks We’re in Calgary working with Truck Gallery’s CAMPER Urban Discovery project, doing a residency based on our “…and then the city…” (ATTC) research. Developed after a six-month community research project back in Windsor called, Save the City, ATTC was initially realized as two billboards in Windsor and an accompanying publication that looked at the cyclical [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2011/07/DSC26601-150x150.jpg)

![Poster Sketches, outcomes from the Workshop with All Tomorrow’s Problems All Tomorrow’s Problems doesn’t aim to necessarily solve anything, but it takes up the position that we can’t wait for anyone else’s solutions either. Every Monday night, a group of people (artists, communicators, designers, academics, students, researchers, strangers, and just all-around passionate people) get together and try to spark conversations around the problems we’re encountering [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2013/03/wpid22180-IMG_3779-150x150.jpg)

![New Exhibition: Unrest Everywhere (Tools for Playing with Halifax) Just back from an incredible week installing at Eye Level Gallery for our show, Unrest Everywhere (tools for playing with Halifax), which runs until May 12, 2012. The show features a number of multiples and interactive works, all of which are yours for the taking and borrowing. The premise for the show was to create [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2012/04/IMG_7792-150x150.jpg)
![Pop-Up Possibilities: Sketches Tom Provost came by a couple weeks ago with an idea for a new collaboration. We’ve work with Tom before on How to Forget the Border Completely — in particular the proposals for 1,000 Pedestrian Walkways and the Windsor-Detroit Portals. In short, the new project is to take the form of a triangular sign, something [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2012/05/IMG_8460-150x150.jpg)
![Making Lists: Sites of Apology / Sites of Hope (Part 1) Just a quick update from Sunday’s Save the City event: Sites of Apology / Sites of Hope … Thanks to the amazing group of people who turned out, we have nearly 50 sites between the two lists (which you can see in progress, above). A part of this project involves us going around to each [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2010/03/IMG_7554-150x150.jpg)
![Finishing Phase Three and Experimenting with Colour We are already nearing the end of our priming process for our letters after only beginning last week! While we got to painting the rest of the letters on Friday, I prepared a few things earlier in the week for our next step, painting the letters in a fabulous bright red. After deciding on a [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2010/11/leadRosinaPic-150x150.jpg)
![Anxious to Explore the Border Bookmobile’s Winter Reading Room I stopped by the Ecohouse today (where our collective studio is housed) to check out one of our new neighbours — The Border Bookmobile Winter Reading Room. Collected and curated by Border Bookmobile founder, Lee Rodney, the books assembled as part of the winter reading room are going to be incredible helpful for our upcoming [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2011/01/IMG_5136-150x150.jpg)
![Installing at Forest City Gallery We spent the weekend in London, Ontario. We were installing for our upcoming exhibition at Forest City Gallery, while also briefly wondering about what it would be like to not do site specific work. Anyways, you should plan to come to the opening on September 9th! We’re working on an installation using our “…and then the city” [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2011/08/IMG_0548-150x150.jpg)
![A Toolkit for Saving a City Though we have a lot more to say about Save the City than I’ll attempt right now, you should know that we put together a toolkit that describes the processes we figured out throughout the last five months. We put together a nice one-page fold up list of instructions, so to speak, for how one [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2010/05/IMG_9640-150x150.jpg)


![1W3KND: Call for Submissions for a New Writing Residency We want to invite you to participate in our new residency program, 1W3KND aimed at developing essays, interviews, manifestos, critiques, reviews, and other texts around ideas of collaboration, socially engaged works, artist-run culture, and public practices. We’re hoping to publish these in one form or another some time next year. There have been a number [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2012/09/IMG_2759-640-150x150.jpg)
![Detroit bus services… A note from Stephen Hargreaves after our conversation last night about the bus system in Detroit and possibilities for cross-border transportation… the image above is of a different Detroit map just to give some reference. On the map Stephen mentions, the routes go far beyond Detroit’s city limits. Check out the “System Map”, where the [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2011/01/Screen-shot-2011-01-03-at-1.35.48-PM-150x150.png)
![BCL Report – August 29, 2008 The last Friday we had before the upcoming Dance Party and Seedbomb Demo… We now have flyers, seedbomb containers, seedbomb germination (in the wild), and tea container labels. Michelle begins the process of spraying 50-something flyers after expertly cutting out the detailed info of the party. Many, many flyers (I like the silver ones the [...]](http://d1ugx41kvdwavn.cloudfront.net/wp-content/uploads/2008/08/Broken-City-Lab-Friday-August-29-2008-stenciling-origami-seedbombs-150x150.jpg)
holla!
For some reason this post made more sense to me than your other ones, and now I slightly understand what you’re doing! This is some crazy stuff, Justin.
Glad to hear this one made more sense to you — hopefully it will make sense to me when I look back on it in a week or so when I start up the next part of this.
The bigger idea is to have these installed in some public space, and not just receiving any Twitter messages, but messages that are responding to where the LCDs are installed, and also the potential to have text messages there as well!
You should help me solder! :)
Justin,
Glad to see you got it working :)
I am curious to see the code. I am actually creating something similar except I am using Processing to send data.
Kevin, thanks!
The Arduino code mainly just looks for characters to insert line breaks where needed, as directed by the PHP script. Since the LCDs I’m working with like to jump the text from Line 1 to Line 3 then Line 2 to Line 4, I had to manually keep track of it. I think that there’s a library that does this now (though I can’t recall it off the top of my head), and I imagine my implementation is considerably cruder, but it works for me for now. The PHP code basically does some string analysis and manipulation (and now with the help of Magpie, parses the RSS feed from Twitter), and then passes the text through a serial port.
Your graphic LCD project is interesting … looking forward to seeing what comes of it!
PS. I like the look of your blog … interesting to not just seeing things happen in a linear time line, but it really allows a readability across space a bit as well.