Halloween Robot controlled by an old wingman joystick.
I don't reccommend this for beginners with electronics only because some things like joysticks and power adapters are not all the same and must be modified. Additionally I provide programming code which will only be useful for particular stepper motors without modification.
**This is still unfinished, but Halloween is coming up so I'm going to publish it and add to it as I go**
Step 1: Materials
-Microcontroller (I'm using Attiny 261)
-Microcontroller programmer, AVRISP mkII or AVR Dragon recommended
-Power supply(s) (Old phone charger, over 5V will burn out uC, so I have one supply for the motors and one for the uC)
-(2) Motors (I'm using stepper motors)
The motors can be anything, but you'll have to do your own microcontroller coding to make them work unless they're 8 wired unipolar/ bipolar stepping motors. I would have used a regular DC motor, but don't want to deal with the feedback design work.
-2/3 yards of black fabric (or a black sheet but it will have to be starched probably)
-Empty Milk Jug
-2x4 piece of wood
-Black garbage bag
Step 2: Joystick Modification
You'll want to use both axes of you joystick. Take off the bottom and you'll see a potentiometer on each side connected to the joystick's moving parts. You probably will need to rewire the potentiometers. Connect the right pin to a ground wire, the left pin to a power wire, and the middle wire on each will be your control wire that our microcontroller reads the tilt from! It shouldn't be complicated, but can be messy making the connections.
Step 3: Microcontroller
Gotta program up the uC. 2 axis Joystick, so I can control 2 motors. I motor turns body, 1 turns the head.
The simplest way would be to just check whether the tilt signal is high (over 2.5V) or low. But I want to have some sense of speed, it makes the range of the joystick count for something. This i accomplish in the code so that there are 2 speeds and the faster speeds go with the joystick pushed all the way over.
I'm going to use ADC pins on the microcontroller to sense how far I push the joystick in either direction. See connections diagram for that sort of thing. If the ADC is anywhere besides near half, the motor will turn the appropriate way, and faster the farther from half.
Since I'm using steppers, I could count steps and not put a mechanical stopper, but I don't trust that as much. add that to the code if you like.
So you need to load up the C program in AVR studio, build it, and then flash it to the microcontroller. FYI, your motor/ transistors will have to be disconnected from ground unless you program in a seperate circuit. I actually included the aps file so it should be super easy to load up.
Step 4: Frame and Motors
Attach a mounting post to each motor. Some motors have a pin hole or some other feature to couple it to a shaft. I think it's easier to just drill a hole in some wood slightrly smaller than the motor shaft and hammer it on.
The 2x4x6 that I use is first cut so there's a 45 degree angle at the top. Then i drill a hole in the bottom. The hole must go in straight, at a right angle to the bottom surface! Then I drill a hole in the top, slanted face. Once again the hole must be normal to the surface. The first motor i press into the bottom and hammer the wood on. The next motor i press into the top from the cut side.
Now i have one motor that turns the wood from the bottom. The other is at an angle so the head will turn on a different axis. This creates a seemingly more complex motion, but everything is still very well balanced and easy to assemble rigidly.
For the frame, I made it in the shape of an upside down "L" with a base. It should make the ghost or robot appear more like it's floating. I used duct tape to attach the breadboard on the horizontal portion and a power strip on the vertical portion.
The movie shows how the motors interact with my joystick.
Step 5: Build the Head
The head needs to be lightweight and have form, I hope you have an empty milk jug! The jug is covered with fabric on one side. I leave the other uncovered so i can place 2 red LEDs inside for creepy eyes.
I turned it upside down and cut a hole in the back. Then poke two holes in the front where the LEDs would be pushed into. I soldered on some wires to the LED leads and pushed them into the head. Then using regular paper I made slits so the eyes look better. Fold the paper in half twice and then fold again to cut the slits. Tape them on and then tape the fabric around the front of the head.
The hood is very simple, just a wide strip of cloth, I taped it in the back and viola, instant hood.