January 15, 2008
Well, it finally works. For a while, anyway. I built a simple train garden with a loop around the outside and a windy piece of track that went through the center of a very sparse town. I eventually used photoresistors, two bright white LEDs shining at them, and the basic stamp’s RCTIME function to measure the resistance to detect when the trolley got to the end of the track. It worked pretty well for a while, but then something happened to the 5V transformer i was using to power the switching circuit and now it doesn’t work anymore. I’ll fiddle with it some, but now that I know what I need to do it should be a lot easier next year. The trolley also had problem with my hodgepodge of track that I’ve gathered over the years. Half the time the circuit woudl work fine, but the trolley would get stuck on the curved track and just stop moving. I may have to come up with a mod to this trolley and it’s -very- weak motor. Or, at least, invest in some new, cleaner track.
I also build some model houses for the garden for the town. It was the fist time since i was like 15 that I’d put together a model. I’d forgotten how much fun it was. I wound up using some Faller “Super Expert” Polystyrene glue that came in a bottle with a long needle tip, and man, it sure made putting those building together very easy. MUCH better than the old bottles of Testor’s glue I remember using. It’s probably due to the tip, which was very good at getting just the right amount of glue where I needed it. Good stuff.
All in all, it was a great experience, and I’m very glad I did it, even with the frustrating hours of work that went into getting that damn auto-reversing circuit to work. But work it does, and I was able to create something from scratch, and I learned quite a bit about myself in the process.
Posted by john under trains | Comments (0)
December 17, 2007
Karma is coming back to eat my dogmafood.
In 1998, I took a course at RPI called Introduction to Engineering Design. It’s the big engineering project course, where they take teams of engineering students of different types (chemical, mechanical, computer, electrical, etc..), give them a problem and a budget, and then it is each team’s job to design a solution and build a working prototype by the end of the semester. It’s required for every engineer, and it’s really important because it’s one of the few classes at RPI where you actually have to both design and build something. You get out from behind the computer simulations an go rummaging around junk yards and wielding power tools to actually create things with your hands. Every engineering school has a course like this. It’s a right of passage.
In my IED course, my part of the project was to design a motor controller with random movements using a microcontroller. That’s when I bought the BASIC Stamp controller that I still have today and am using to control my point-to-point trolley setup. Everything worked great until the day of the final project, when the microcontroller simply refused to do anything but spin the motor in one direction. Not devastating for the project as a whole, but it cost me an A in the class and I never did really figure out what went wrong. I had my suspicions, but when you’re done with a class like IED where you spend the last few weeks basically living with your team working day an night to get things built and working, you want nothing more than sleep. And sleep I did, for about a day and a half if I recall correctly.

Now, fast forward to today. I’m building another circuit with the BASIC Stamp. After spending all night wiring up all the IR circuits and detectors to the real 8′x4′ layout, and running wire back to my protoboard, I turned everything on for the first time. Of course, the IR circuits aren’t working for some reason, so I’ll have to figure that out somehow. So I decided to just make sure my auto reversing circuit worked. This circuit consists of 2 5V relays, hooked up to pins on the Stamp through a transistor. One relay stops the train (breaks the circuit), and the other reverses the direction of the train. The microcontroller simply runs the train for 5 seconds, stops it, waits 2 seconds, reverses the train, waits 2 more seconds, and then starts it for 5 seconds again. It does this in a loop. But when I run even just that code, it fails to run correctly. Instead it runs in one direction only (or stops, and the continues in the same direction.)
It slowly dawns on me.. This is exactly the same type of circuit (2 relays), and exactly the same problem I had 9 years ago that I never solved. I have my suspicions, I think I left the reset pin floating, which is probably getting wiggled by the relay coil flipping about an inch away. It’s too late to do more tonight. If that’s not it, I don’t know where to go next.
Sometimes, karma really is a bitch.
Posted by john under trains | Comments (0)
December 7, 2007
So the STAMP has a bad pin on it but I managed to solder it back together, so that works. After building another serial cable from scratch I was able to get the STAMP to work under Linux using the BStamp project. Using the STAMP and a RadioShack IR emitter/detector pair, I was able build a simple circuit that detected the presence of a train and lights an LED. Good to know I can still build simple circuits.
This past weekend, I borrowed my friends truck and we bought the wood needed to build the train platform. I knew roughly what I wanted to do, which was build a 4′x8′ platform with removable legs and a hinge in the middle so it would fold up for easy storage. So we grabbed the following from the local Home Depot:
- (1) 4′ x 8′ sheet of particle board
- (6) 8′ long 2×4′s
- (2) door hinges
- (8) 5/16″ 5″ long bolts
- (8) 5/16″ wing nuts
- (16) 5/16″ washers
- several drywall screws
We had Home Depot cut the particle board in half for us, and all the 2×4′s in half as well. Thus everything fit pretty easily in the back of Eric’s truck. We came back and started assembling, basically making it up as we went. We took two of the 2×4′s and attached them together with the two door hinges so that they swung out. Then we took each 4×4 piece of particle board, and added a frame made up of the 2×4′s along three of the four sides, securing the boards to each other and then flipping over and securing them to the particle board with screw from the top. Finally, take the two 4×4 sections and lay them so the open ends of the frame point at each other. Line them up to be as flush as possible, and then use the set of hinged 2×4′s to make the fourth side of each frame. This will join the two sides together through the hinge. When open, the force of gravity on the center of the table will hold the hinge closed, but lifting up on the middle of the table will cause the table to fold in half. Ours turned out to fold beautifully, which is remarkable since we were just eyeballing everything.
Th add the legs, we cut the remaining 2×4′s into ~25″ sections. We then lined up the legs in the corner of the bottom frame 2×4′s, and cut two 5/16″ holes through the fram and the leg. We then secured the legs to the frame using the bolts, washers, and wingnuts. This allows them to be removable so the table can collapse when the holliday is over. Fully assembled, the hinge+gravity trick works, but was pretty unstable. The real solution is to add another to the center of the table, but we were out of wood (due to the fact we originally cut 3′ legs, which were too high), so we wound up just screwing in cross braces across the joint that I’ll have to remove in the future.
With the platform now set, I’ve laid out my simple track plan. A basic oval around the outside with a curvy point-to-point track in the center. It should work out rather well. I also got my shipment of 5V relays in, so I started to try and coax the STAMP to trigger one to no success to far. They require mroe curren than a stamp can supply. I have some opto-isolators that I need to figure out how to use that should do the trick…
Posted by john under trains | Comments (0)
November 27, 2007
So I’ve decided to take on a somewhat more ambitious project than I probably should this Christmas season. Now that we have a house, I’m putting up a train garden again. Those who know me will know that I’ve done one off and on over the years, culminating when I was up in MA with a large 2-story apartment when I put up an 4′x8′ display that took up most of a spare room. I got into trains when I was little, and my late grandfather always put up a train garden every Christmas.
I have the trains, I have (some) houses, but I’ve decided to do something a little different this year. In order to have an excuse to build some custom electric circuits, I’ve decided to build my own point-to-point trolley setup that will travel from one side of the town to the other. It should be doable, but I haven’t done any electronics work in years and I don’t have any parts anymore, so it’s time to stock up again.
I do still have a prototype board, a soldering gun, and an old BASIC Stamp from college that I doubt even works anymore, and has at least one loose pin. So, off to jameco.com to order some grab bags of resistors, caps, diodes, IC’s, and a drawer set, and another microcontroller (Atmel MEGA8) in case the Stamp is dead; and off to Radio Shack to the items that were cheaper there. I already went to a hobby store with Katy a week or so ago and bought an HO trolley, some houses, and some lamps. I’ll also need to go to Home Depot this weekend to get some particle board and 2×4′s to build a platform.
With any luck, I’ll have a mini electronics lab up and running, and a simple train layout with a few neat twists within the next few weeks.
Posted by john under trains | Comments (0)