My friend asked me to make him a Head Crab costume for Halloween, so I combined his request and this homework assignment!
I started my making a skeleton. This was a cardboard circle with strips of sheet metal hot glued to create the legs. I used sheet metal so it could be bent into place and used to attach to the head once it was finished. I then crinkled up a piece of paper, and wrapped it around the metal frame. I attached it to the frame using masking tape. This gave it a fleshy appearance. I used a second layer of paper and tape on the upper leg so that the leg appeared segmented.
The body of the crab is made from two metal strips I bent and attached at 90 degrees to form a dome. I then used a deflated blow up ball to cover it, and then wrapped it all in masking tape. This gave a cavity where I could put the electronics.
Now for the wiring:
The servo inputs are connected to pins 6 and 9, and the led input is connected to pin 2. The leds are connected in series to a 200 ohm resistor. Now for the interesting part: all the grounds and powers are tied together on a board, including the output and input from the batteries (for this I used 4 AA batteries). I then connected the power to the 5V out and the ground to the GND pins on the arduino. This powers the servos, the leds, and the arduino itself!
the code can be seen here:
Arduino Sketch: RandomServoMotion
The short version is that I use the random(min, max) function to force each servo to move to a randomly generated position between 0 and 180, and then I wait for a random amount of time between 100 and 750 milliseconds. Each time the program loops the eyes either turn on or off.
For a finishing touch, I spray painted it red and black. The whole rig works pretty well, though I have some concerns about it heating up and lighting on fire. Future work, I need to install a motion sensor so that I can leave it sitting on a table, and also installing an on off switch. I may also add a headband so that it sits more firmly on the head. As it is, the metal bands do a decent job, but it’s not as secure as I would like it. I also want to make some more details on the paint.