Monday, July 25, 2011

Arduino is Hard!

This challenge has not been going well at all! When I chose to do it I thought to myself, "it's only a couple of hours a day!" But it turns out that I don't have a couple of hours a day on a regular basis! I am still making plans and working out the details for the aquarium light but it's much slower going than I could have imagined!

Monday, July 18, 2011

Tuesday, July 12, 2011

Monday, July 11, 2011

Arduino Update

This week started out strong! I got the GPS hooked up after only a little trouble (it's amazing what having the right pin-out will do for you!) and I was able to print the raw NMEA message through the Serial Monitor. It was pretty much downhill from there. I am having quite a bit of trouble using the data that I get from the GPS. I can read the messages using a software serial implementation or through the actual hardware serial port and print it out but anytime I try to parse it and use it for anything it just completely stops updating. I started out using a software serial implementation and using String::substring() to get the parts of the messages but that was really ugly and didn't work so I wrote a String Tokenizer using strtok which also didn't work. The next thing I tried was to switch to using the hardware serial port and tweaking my StringTokenizer and that works some of the time. I don't know if there is an error in my code that crashes the Arduino or what! I have been working on it for the last four days so I think I may just move on to something new and come back to this! I got my USB Host Shield so I am going to try to get that working tonight with my Nexus S.

Still struggling with the GPS


Friday, July 8, 2011

Still working on the GPS Code

I'm still working on parsing the NMEA messages that come from the GPS. I wrote a little String Tokenizer to help with that.

StrinkTokenizer

Wednesday, July 6, 2011

GPS Code

This is a much less exciting set of pictures! Sorry about that! I'm working on writing the code to parse the NMEA Messages (the text from the last post) that come from the GPS.

GPS Header GPS Code

Tuesday, July 5, 2011

GPS Data

GPS Module Photobucket

First Full Arduino Update

I hope you have been enjoying the pictures that I've been posting! Now to give a little more information about them! The first day I was getting the Arduino development environment set up and running some of the test sketches (A sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to and run on an Arduino board).

I stared out by blinking an LED and reading a button press so I decided to put those together and change the color of my common cathode tri-color led on a button press. I wired each of the anodes to a digital pin on the Arduino and rotated the active output each time the button was pressed.

The next day I decided to take this one step further and learn how to use the analog inputs. I used three 10K ohm potentiometers that were tied from +5V to ground and took the sweeper output and fed that into an analog input on the Arduino. I had one of these for each color and used the value I read from them to adjust the duty cycle of the colors in the LED in order to mix them to create any color you want.

Then I decided to try to get the LCD working. The code for this was really straight forward since someone has written a really nice library that takes care of all of the nitty gritty details but I had a lot of trouble getting it wired correctly. Thankfully Arduino is open source and has a very large development community! So after spending a long time struggling to make sense of the pinouts on my own I was able to find a really nice step by step guide to getting the LCD wired up complete with pictures from Ada Fruit! (Lady Ada is my hero!)

For the last project of the week I decided to try a more design centric project. My goal was to use the ability of the LCD to display special characters to create a set of numbers that filled both rows of the display. I found out that the LCD can only accept 8 special characters before it's memory is full and then it just starts overwriting the earlier characters. I spent a long time trying to get the parts that I needed down to only 8 characters and was not able to so I decided to cheat and use Google. A quick search showed that this is not possible and that the only successful "Bug Number" fonts are based on numbers that are 3x3 instead of 2x2. I still think there should be a way to do it by reprogramming the special characters before printing each number, but I don't know how slow that would be. I am going to shelve that project for now and move on to others that will help me learn more.

Keep checking back as I will continue to post pictures every day with a full description every week of this challenge!!

Friday, July 1, 2011

Arduino Setup







Arduino Challenge

What is Arduino?

From the Arduino website:

Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.

Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be stand-alone, or they can be communicate with software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free.

The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment.



Basically, Arduino is a microprocessor that was intended to be used by artist and people with no technical background and was designed to be extremely simply to program and connect to a whole host of sensors so that it can gather information about the work around it and actuators so that it can affect that world.

The goal of this challenge is to learn to use the Arduino and some of it's myriad attachments.

Rules:
Being that I don't know much about the gritty details of working with Arduino the rules for this challenge are going to be a little free form. There are basically three stages of each project:
  1. Designing
  2. Building
  3. Programming
Depending on what I am working on the steps may or may not be in that orders and some steps may repeat if I have done something wrong! Designing will require some amount of research depending on what I am trying to connect to the Arduino and drawing out how it's all going to fit together. Building will be the actual construction of the circuit and hardware. Programming is writing the code to make it all go. This may not be only Arduino code, but it will all be pertinent to the project. The loose rules that I will go by will be to perform at least one full step in a project per day. In the beginning it is likely to be more than one step since I am going to start out with very simple projects and tutorials to learn from but then, as I move on to more complex examples each step may take more time. There are two hard rules that I will comply with:
  1. I will take a picture of the progress at the end of each day and post it to this blog.
  2. I will post an update each week describing what has transpired during the week. Fridays haven't really worked out all that well for me so I am switching to Mondays.