Posts

Showing posts from 2011

Some old notes

I was browsing around some of my files on the clock and figured I'd post some of the notes I took on the drive components.  From my notes on 3/16/2011: Servos/motors: I thought about using stepper motors to drive the hands but gave up because the Arduino motor shield can only drive 3 steppers.  I need 5.  This is the model of sail winch servo I used:   GWS Sail Winch Servo S125-1T.  Most places have them for $20-30 each. After the fact, I think that steppers would be possible with the Arduino using some custom mux/demux circuits to select one of the multiple steppers to drive and an external driver board like this one:   http://www.sparkfun.com/products/10267 The mux/demux circuit could use this chip:   http://search.digikey.com/us/en/products/HEF4051BP,652/568-1689-5-ND/763293 Gears: I used these two types of gears:   A 1T 2-Y32048 from  https://sdp-si.com/index.asp drive gear on servo:  48 pitch, 96 teeth, 2" pitch dia hand shaft gear:  48 pitch, 72 teeth,

Clock Functional!

Image
I've been able to get lots done on the clock over the Thanksgiving weekend.  I haven't been able to work on it for a while.  I needed to make the hands for the clock and wrap it up to finish the top section with the actual functioning clock.  I drew out some hands in AutoCAD that I thought I could cut out by hand, but then I thought about having them laser cut and wanted something more intricate.  I had poked around a bit at having them cut, but couldn't get motivated to redesign the hands.  I opted to go back to my original plan and cut them out by hand.  With some sheet metal I had, an air nibbler, and a hand nibbler I set to work.  I managed to get them all cut out with only a handful of blisters and sore hands.  Here are some photos of the cutout hands: Hands cut out, but still with the paper templates attached. The templates have been removed and the hands cleaned up, ready for paint. With the hands cut out, I had to shorten each of the center shafts to

A non-clock post

Image
I figure I should post something non-clock related.  One of my other hobbies is collecting firearms and target shooting.  It's a hobby at this point as I'm not shooting competitively yet, but I have wanted to build a target rifle and/or hunting rifle for some time. I ran into a guy at my last range trip that was praising his Millett TRS scope .  I took a look at it and also liked it.  I also liked the price.  For $300 you get a 4-16x50mm scope with illuminated mil-dot reticle and other nice features.  I ordered one from Cheaper Than Dirt and it arrived very quickly.  I just ordered a mount for it from Wilson Combat.  I got the Accu-Riser scope mount for 30mm scopes. My plan is to see if this will fit on my current AR15 carbine, and if so I should be able to play with it for a while.  If it won't fit (it's a large scope) I plan to get a new 20" upper and be able to switch out the carbine or rifle uppers at will.  Right now I'm leaning toward this one

Lots done on the clock this weekend

Image
I was able to get quite a bit done on the Whereabouts Clock this weekend.  I had previously posted that the brass face for the clock has been silk-screened and it looks great.  I did put some clear lacquer on the front of it to protect it from tarnishing.  I had also been working on a frame to hold the face in the clock.  The original design of the grandfather clock had the face-mounted to the clock internals, and it left a lot of empty space surrounding the face.  It looked really bad, according to my wife.  I purchased some 1" x 6" red oak stock and built a frame to fit inside the cabinet and hold the brass face. The oak frame and brass face are glued to some 1/4" hardboard and glued inside the case.  In the original design of the grandfather clock, the front face was the only maintenance access to the internals. With the oak frame and face in place, there's no way to access the clock internals from the front.  I built a door to cover the back plywood and

Clock face brass completed

Image
I got the silkscreened brass back from James at Preston Screen Printing this morning. He did a great job with it. I was able to work quite a bit more on the clock today. I need to clear lacquer the brass face to keep it from tarnishing, but I have to do it when it's between 50 and 90 degrees. Our string of 100+ degree days isn't helping on that front. I got a lot done on the frame for the face. The original grandfather clock frame left a big gap around the brass face and looked rather bad, so I'm constructing an oak frame that will fill the gap. This will make the face a permanent fixture of the clock, so the mechanism will have to be accessed from the back instead of the front door of the clock. It's gluing this evening, so hopefully tomorrow I'll be able to get the router out and put a decorative finish to the face frame and start to get it installed.

Clock face to be silkscreened

I just dropped off the brass for the clock face and the design to James at Preston Screen Printing . His rate is very reasonable. When I get the piece back in a few days I'll post results pictures.

Update 8/7, Part 2

Aside from the clock face itself, I started work on the hands. I wanted each hand to be slightly different and hold a photo of each family member. I haven't figured out the photo mounting mechanism yet. I want the photos to be fairly easy to replace since I have young children and their appearance is likely to change over the years (imagine that). I got a trial copy of AutoCAD and drew up the five hands . I have a couple thicknesses of sheet steel I want to use for these, but I'm not sure yet how well I can cut and drill these out. I think between my drill press and nibbler that I should be able to do pretty well, but I'll have to try out a couple first.

Update 8/7, Part 1

Image
I was able to work a bit on the clock for the past couple of weekends. First, an update on the clock face: I found that ironing the toner to a clean, shiny piece of brass was a non-starter. I found the best technique to be scrubbing the brass with a green Scotch-Brite pad in perpendicular directions improved the toner adhesion quite a bit. The second was to thoroughly clean it with acetone to remove any oils or other dirt that may have accumulated. Regular alcohol was not sufficient. After I did both of these I got what I hoped would be two good sample tries. The first was using laser printed on inkjet photo paper like many online sites recommend, and the second was a glossy laser paper. I liked the second better because I was able to get it printed at tabloid size, whereas the inkjet photo paper was letter size only. I should have grabbed some shots of the two samples. The inkjet paper left only toner behind and it was nice and shiny, the glossy laser paper left quite a bit

Starting to work on the clock face

I haven't touched the whereabouts clock in quite a while. A few weeks back I did complete the woodwork on the upper third of the grandfather clock that I'm using to house the project. I think it looks pretty slick. I also was able to mount the mechanism inside, so now it's on to creating the clock face. I studied up on how previous folks have etched brass. Mostly here and here . I took my design down to Office Depot to print since I don't have a laser printer. They didn't have ledger size inkjet photo paper, but the guy did say he had some glossy ledger paper. I gave it a try on a sample piece of brass. I ironed on the paper like the instructions said and soaked it in water to dissolve the paper. What a failure! I think that 1) I didn't have him print it with enough toner, and 2) the paper is not quite right. Large chunks of toner stuck to the paper and came off instead of sticking to the brass. Fortunately, the prints from Office Depot cost me les

Slow Progress on the Clock

I've been working on the whereabouts clock in fits and starts since I got the grandfather clock body. I've disassembled the top third of the clock (since that's the part that I really care about at the moment) and started stripping off the old stain and making some small repairs as needed. I've polished up some of the hardware to make it a little shinier, but still retain some antiqued look to it. I bought some glass to insert into the door, but it might be too thin. I may need to have Heather get some from a stained glass shop or custom glass shop to get it to fit right. We'll see what happens when we get there. I finally found a decent supply of brass for the face. I tried all the big-box stores first (since I was there anyway) and got nothing. The hobby shop had some, but only tiny pieces. I ended up going to Metals4U up the road and got a pretty big piece for about $30. I hope it's thick enough to etch. I will have to glue it onto some thin ply o

Clock body

Image
I've been looking for the past several weeks for a suitable clock body to install the whereabouts clock. I tried calling around to a few clock shops to see if they had any busted clocks with intact frames, but I didn't have any luck with that. Seems that most people have busted clock mechanisms in pretty frames that they want to be fixed. I pretty much left my search up to Craigslist after that. I found a guy in Austin selling a broken wall clock that I thought would work. $50 later and I have a clock that is too shallow for my parts. It's a beautiful clock, so for a few more bucks at Hobby Lobby I replaced the movement. Of course, after doing that the old movement works again. Oh well. I kept looking through old posts and found someone selling a "Baby Grandfather Clock." Its design is more like a mantle clock, but it was really about the size I was looking for. However, it too was too shallow. If I left it as a tabletop clock (as it could be) the dept

Improved Location Code

Tonight I worked quite a bit on the location code. I had started just to expand the list of known locations in the script, but that proved to be very long and probably not very efficient. I figured that adding the known location data into the MySQL database would provide an easier way to search for that data. I also added a couple tables to the database. One is a simple username and location table for storing override data. When a user is not set to "GPS" it will turn the clock to the specified location instead of using the GPS data. This will be used quite a bit for testing and also in the iPhone App I want to write. I also added a scheduling table for the kids. When the script runs it will check to see if there is a defined schedule for "now" and set the location according to the schedule. The next thing I want to do with the code is to utilize the override table to attach the kids (who don't have phones) to a specific user. Now it's just hardcod

Functioning Clock

Image
I got the clock together and functioning today. It gets the data wirelessly over the Arduino Ethernet shield and wireless AP that I bought. The servos have been calibrated and it checks every minute for any new updates on the server and moves the hands to the proper location. There's still a long list of stuff to do before I consider it completed, but today really marks a milestone in the project.

Servo calibration

I'm working some more with the servos and with the gearing I have the servos will move the hands 540 degrees (1-1/2 turns). The Arduino servo class takes inputs between 0 and 180. On my clock, this translates to 3 o'clock position being 0, 12 o'clock as 90 and 9 o'clock as 180 going around clockwise. I needed a method to make sure that each of the 5 servos: start and end at the same positions can reliably hit each of the 12 clock positions reliably The first one is pretty easy. When attaching a Servo object to a pin you specify the minimum and maximum time (in us) that the servo will use. Most servos use 1000us as a minimum and 2000us as a maximum. By altering this slightly for each servo I could get all the servos to start and end at the same position. The second one was a little tougher. It turns out that a 10 degree Arduino input corresponds to one clock face position (30 degrees) for all the servos, but one servo would not reliably move to a position if the

Wireless Bridge

I picked up a 3Com Wireless b/g access point off of Amazon for $20 used. I want the clock to get its data over the home wireless network and not have to run one more cable for this thing. It took a bit of messing around with the access point to get it into a working bridge mode, but I did finally get it to work. Hooray! I can move the clock around the house now.

Alternative Drive Idea

Before I embarked on the build of the project I was torn between using servo motors or using stepper motors. I had originally opted for the servos because an Arduino can only control 2 steppers with the motor shield, and up to 3 with the EasyDriver Stepper controller. I need 5 motors, so each of these options was out and I went with servos instead. After some frustration with the servos, I started to reconsider how I might control more steppers with the Arduino. I remembered back to my college days of basic circuit design and remembered a device called a demuxer that could control multiple output lines with fewer input lines triggered by a binary pattern. I checked out the EasyDriver again, and it has an "enable" pin that "enables" the board and the motor. If I could take 3 digital lines from the Arduino through a demux I should be able to control up to 8 stepper motors (each with their own EasyDriver). I took down some notes (which I will add later) to detai

Some Servo Problems

I ran into some servo problems a while back that I haven't had time to try to fix. The first one turned out to be a programming error where I was using a byte data type to hold too much data. I'm finding that the C-like programming of the Arduino is very limited, and it's taking some getting used to from my experience with more fully featured Perl/PHP languages that I'm used to. The second thing was that one of the servo motor brass gear shafts kept popping off the plastic servo output shaft. I fit the 1/4" o.d. brass tubing over the slightly less than 1/4" servo drive shaft by expanding the brass tubing slightly. The problem was that the alignment between the servo and the end of the brass tubing was off slightly causing the tube to "walk" off of the plastic shaft as it rotated. I took my micrometer and measured the vertical and horizontal variations from back to front on all the servos. Most of them were off by .02" at most (which is ab

Adding some error checking

I figured that it would be nice for the Arduino to be able to indicate that there was a problem without having to have it connected to a PC. I added a single LED to an unused pin and created a routine to blink it on and off based on an error condition. Works pretty well. Well enough to tell me that for some reason the Arduino w/ Ethernet shield doesn't like to work without being plugged into USB as well as the external power. It could be that my power supply isn't clean enough or enough voltage to operate everything at once. More investigation is needed. I was hoping to only have a single power cord for this clock.

Positioning Code and First Breakage

Tonight I was able to work on some of the positioning code for the clock. Yesterday I was able to get all 12 positions working, but the servos allow for up to 540 degrees of movement in the configuration I have. I want the hands to randomly move to the location if more than one direction is possible. I was able to do just that right before one of the drive shafts came off the servo. I'll have to repair it to get back on track. It does concern me that these may come off fairly easy. I don't want to glue them to the servo, but I may have to find an alternative to pressure fitting them.

First Arduino Clock Code

Image
Tonight I hooked up the possibly completed clock movement to the Arduino and started to assemble the network fetching code with the servo movement code to actually make the clock be a clock. I think I have the twelve locations that I want the clock to have. I chose all of the locations mentioned in the book along with a few of my own to round out twelve. It turns out that the 30 degrees between clock points is almost exactly 10 degrees in the Arduino servo code when using these sail-winch servos. With the gearing I have in the clock I get a little more than 540 degrees out of each servo. I will eventually add some code that will make the servo move in the most optimum direction to get to the location. That'll have to be part of LOTS of other optimizing I will need to do to polish this thing up. For now, I have a paper dial with the 12 locations and small zip ties for each of the five hands. Here's a sample pic:

Movement Almost Finished

Image
I was able to run by the hobby shop after church today to pick up more servo mounting screws, and I was able to get the last of the servos mounted on the backplane. I also was able to complete the nested shafts for the hands of the clock. I had 5 sizes of brass tubing that all nested nicely into each other, but all my gears have 1/4" holes. I had to cut small spacers of each of the necessary sizes to make the small diameter shafts fit snugly with each drive gear. Here's a picture of the finished hand shafts: I used 5 min epoxy to glue the brass tubing together. I know that most glues won't work on metal (it's non-porous). Epoxy should do the trick. It's not like any part of this clock requires lots of torque or has lots of pressure on it. I was able to attach the brass drive shafts to the servos by expanding the tubing slightly and pressing them onto the plastic shaft of the servo. So far, it's holding well and aligns perfectly. Here are some more p

Build Started

Image
I stopped by the hobby shop on Friday and picked up some more hardware to work on the Whereabouts clock. I've been working with Sketchup to model the clock in 3D before I start cutting brass tubing and plywood. I was able to model the servos and gears and got a good top-view of the mechanism. I printed it out full-scale and was able to use my drill press to drill the 6 holes for each servo shaft and the center shaft. I then used the scroll saw to open up the holes in one piece of plywood to make the holes where the servos mount. For the brass tubing, I was planning on using a regular tubing cutter, as the guy at themagicclock.com had used, but I must say it was a dismal failure. I knew that the cutter would leave a bit of a lip on the inside of the tubing that would need to be filed off, but it actually resized the end of the tube slightly smaller where the next smaller tube would no longer fit. I quickly abandoned the tubing cutter and went with a Dremel tool fitted with a

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