After the Actuator in the Lionel Nutcracker Gateman tried to burn down the house last year, it was deemed best to get rid of the noise and hot actuator. This a overview of what was done and pictures of finished product.
- I built a control board using a Arduino Pro Mini 5V/16MHz sourced from Sparkfun (Adafruit now also has a version of it). The 5VDC 16MHz version works best with the servo library that Adafruit has for Arduino. I originally wanted to try to use a ATTiny, but could not get the servos to work well with it, so I went to the easier to use Pro mini.
- Since I reused the lights on for the Christmas tree on the gateman, I needed to have 12VDC to get them bright. For power to the control board, I used a 5VDC regulator fed from a 12VDC power supply. The 12VDC is used for the tree lights. I used the output from the 5VDC supply to power the Arduino, the servo, and the LEDs. The LEDs are all triggered via FETs to provide higher currents. The FETs are probably overkill, but were needed for the first attempt at LEDs. The Pro Mini board does not have as much current source support, so it is best to trigger external anyways.
- I used Candle Flickering LEDs (sourced from http://www.evilmadscientist.com/ for the interior lights and also hot glued one to the lantern of the gateman. This one activates prior to the door opening and soon after it closes. Just like the gateman lighting his lantern before heading out. I have LEDs by the windows that are always on. There are 2 more by the front door that come on when the Gateman comes out. The front LEDs shut off a few seconds after the door closes.
- For the trigger, I used a pressure sensitive round resistor with a voltage divider. When the train presses the resistor, the divider voltage changes. In code, I have tuned it when the train is present, but not just the track alone. It works pretty well. I think a improvement would be to run two of them to be able to activate in either direction so the gateman is out before the train comes by. This could be done using separate inputs pins and just monitoring both of them.
- I also have a pin on the Arduino set to activate on a contact closure in the AIU. There are enough pins that another contact could be added for a localized push button. I have this set with a pull up resistor to provide 5VDC to the pin when the contact is open and ground (0VDC) when closed.
- To move the gateman, I am using a small servo that uses the original pivot and mech sans the actuator. The servo moves about 80 degrees or so. I do not use the full extent of the movement possible, leaving a bit of space on open and closing to ensure there is no binding. The door closes enough to not have light show, but it is not a tight fit. Even with the 16MHz arduino, the servos have a tendency to chatter a bit. I use the detach and attach commands just before and soon after the movement to be sure that there is no extra buzz. Also, if you have the movement to tight on open and close there will be chatter.
- Mounting and Holes added:
- The control board was glued to the side of the house on the inside. The L shape allowed for the wind to not be blocked.
- I made a hole in the top that is big enough to gain access to the FTDI pins for programming. The Pro Mini needs a FTDI adapter to program it.
- There are 4 LEDs installed in the roof, 1 by each window and 2 by the front door.
- I did not have to modify the metal as I used the cut out provided for the servo to swing the arm in.
- The actuator required it to be cut out. So the tabs were removed via a dremel.
- The external wires exit out the rear of the base. The cardboard bottom is also present.
- The servo is attached to by double side tape. The action wire is stripped 20AWG wire.
- Some other comments:
- I had tried to add movement to the Nutcracker's arm; my hope was to have the arm swing back and forth. This did not work. The first servo tried was too small and did not have the torque to move the arm will out killing itself. The attempt had the servo glued to the back of the nutcracker. I did order a better servo, but in trying to get it to work, the arm of the gateman broke off. That sealed the deal that the arm was not going to move. His arm is glued tight.
- The Candle Flicker LEDs are a too white. It would be better to get a more yellow LED to simulate the lantern. It still looks cool though. I started with basic Yellow LEDs, they just did not look right and needed a lot of power to get bright. That is also why I started with the FETs. The Candle Flicker LEDs are a lot brighter on on 20mA. So the FETs are overkill.
- I went to the pressure resistor for the trigger as it would act funny trying to do a common rail. The ground on the AC and ground on the DC supply do not like to sync. This was just easier than trying to figure out the grounds. It is probably about 90% reliable and sometime will not continue to trigger if the train is slow and the cars are light or long. No big deal though. If you did not know this and were watching the layout you would have not thought it to be odd.
- Coding this is very simple overall. There are many examples on Adafruits learning pages that give you most of the code. You just need to arrange it and do minor adjustments to get it too work. Young or old could do this as a first project and have success.
Parts
https://www.sparkfun.com/products/11113 Arduino Pro Mini 5V/16MHz, Adafruit has a one here that is equivalent: http://www.adafruit.com/products/2000
http://www.evilmadscientist.com/ Lots of LEDs to chose from
http://www.adafruit.com/products/166 Round force resistor. This is the same one that also comes in the Arduino beginners kit
http://www.adafruit.com/products/169 Servo, this is the same servo that comes in the Arduino beginners kit
http://www.adafruit.com/products/355 Mosfets, I had these from another project, so they are highly over rated for this application.
http://www.lionel.com/Products...neID=&CatalogId= Gateman
Here it is in action on Youtube http://youtu.be/dNq0s1oYLf8
Nutcracker has come out to play
You can see the control board inside
Rear of control board
Front of control board
Top of house with old LEDs shown and FETs.
The Flicker LEDs were very bright and bled out of the roof. A bit of black tape keeps the light from showing under the roof.