Posts

Showing posts from March, 2011

Arduino Servo Shield

Image
I bought a piece of breadboard and was able to solder up a shield for the Arduino to power the 5 servos. I'm taking the direct supply power from the 'Vin' pin and the ground to a bus connecting all 5 servos, and pins 2, 3, 5, 6, and 7 to each signal pin of the servo. Each servo gets its own 3-pin header. It looks really nice and give a solid connection to everything. If I ever need to add other small components it'll be really easy because I left plenty of space. Here's a small video of all 5 servos cycling back and forth for a little while.

Power Options

I discovered earlier, that I would need an external power supply to drive the servos and that it would need to power the Arduino as well so that the grounds are common. This is no problem as I don't plan on having my clock plugged into the USB port on the computer all the time. I bought some stuff to build my own "Servo shield" to plug in the servos. It's a piece of breadboard and some header pins to connect it all. I was thinking that I would need to split the 5V power leads to provide separate (but equal) power to the servo board and to the Arduino, but I was wrong. On the Arduino boards, there's a pin marked "Vin" on the Arduino UNO (or 9V on older models) that provides pass-through power when using external power. This is not the limited 5V regulated power to the Arduino, this is the unmodified power from the external supply. (The same pin can be used to power the board if desired.) My servo board just got really simple. I bring the power an

Arduino Data Parsing

Tonight I started looking at having the Arduino parse the location output stored on the server. With the Ethernet shield on the Arduino I call a PHP script that fetches the last locations of each of the family members. That's great and all, but I need to get it down to a person and a location. The Arduino is not Perl and has no regular expression capability or split functions, but it does have some string functions that might be useful. After poking around for the best solution, I found this forum where a guy was using an Arduino to parse NOAA XML weather data. His code worked like a champ, so I'm using it with some modification. I had to go back and alter my PHP script to output some XML formatted data, but that's a piece of cake. Now I have two arrays in the Arduino. One for people, and one for locations that have been parsed from the data off the webserver. Next up: how to translate that location data into physical servo locations.

Servos

I decided recently that I would design my mechanism similar to the guy over at themagicclock.com , so I ordered 5 of the GWS S125 1T 2BB servos online . They arrived on Friday so I hooked one up to my Arduino with an external power supply, loaded the sample servo sweep sketch, and watched in horror as the servo spun continuously clockwise. I browsed all over the web looking for the source of the problem. I read that some people had servos where the pinion gear that drives the potentiometer inside the servo was not firmly attached to the driveshaft and a little lock-tite was the solution. I tried that but had no luck. I think it actually stripped out the little plastic gear attached to the potentiometer. Metal pinion gear vs. plastic potentiometer gear is not a good recipe for success. I tried using different pins on the Arduino. No good. I tried running the servo off the Arduino power. It made the Arduino croak due to the load. I tried manually setting the PWM frequency of

Ethernet Shield Added

I've been working on my own Whereabouts clock for a while now. For the most part I've just been thinking through some things, but now I'm actually trying to make it a reality. I got my Arduino Ethernet Shield in the mail today. I revamped the fetch locations script on the web server to update a MySQL database instead of a flat file. Now I have a table for each family member instead of a group of flat files. I also created a fetch script that's used by the Arduino to fetch the latest entry in the database. I plan to parse the results to have the Arduino move the servo motors to the correct location. My servo motors should be on their way here, but I've still got plenty to work on until they arrive. I'll have to fill in more on this project as I have time.

The Location Data

So after looking at a couple examples of a working "Whereabouts Clock" I decided that I wanted to try to make my own. After all, it's really cool! Before I spent any money buying parts and diving into the mechanics of it all, I really wanted to nail down the location data. Other examples use a Twitter feed and keyword searching to grab the locations, but I wanted mine to be fully automatic requiring nothing from me. My wife and I both have iPhones, so I figured "how hard could it be?" I started thinking about this project over 5 months ago and wanted to start with the location data. I browsed around the App Store looking for some way to grab the location data off my phone periodically and upload it to my home server. I found a couple examples that I purchased and found that the folks over at device-locater.com had a really cool product. I downloaded the App and configured it on my phone along with its server. Ta-Da! I now had a way to get the locatio

The Whereabouts Clock -- Background

I've been a fan of the Harry Potter series since the movies first hit the big screen in 2001. Since then I've read all the books, and I can't wait until the final movie is out. In a couple of the books and in the movies the re are a few references to a magical clock at the Weasley's house: The first specific description of the family clock is from Goblet of Fire (pages. 151-153): Mrs. Weasley glanced at the grandfather clock in the corner. Harry liked this clock. It was completely useless if you wanted to know the time, but otherwise very informative. It had nine golden hands, and each of them was engraved with one of the Weasley family’s names. There were no numerals around the face, but descriptions of where each family member might be. “Home,” “school,” and “work” were there, but there was also “traveling,” “lost,” “hospital,” “prison,” and, in the position where the number twelve would be on a normal clock, “mortal peril.” Eight of the hands were currently poin