User:Batmaneatsgrass/project 2

My Instructor's user page which points to this.

Project 2 : Light Switch Turner

Week1 Narrative
During week one, I had to find a motor that would be strong enough to turn the switch off and the other available materials. The final design would be based off of what was available. I found an unused motor lying around and searched various information written on it online. I found a wikiversity page that had information on this motor, uploaded by Mr. Foerster.

Stepper Motor Info Then, I measured the dimensions of the motor, as shown in the photo below. Next, I found a gear to fit the motor. In order to ensure that the gear doesn't fall off, i placed a spring around the attached part of the gear.
 * 5 wire
 * 75 ohm
 * ASTROSYN Minebea Tandon
 * 17PS-C007-04 966000-001

Week2 Narrative
During this week, I had to find the rest of the supplies and measure the height of the light switch off the wall and come up with a design. The middle of the light switch was about 15mm off of the wall. In order for the large motor to hit that spot, I would have to put it on a platform. Other materials I found to my use were an arduino and a sparkfun monster motor shield. I also went out and bought two 9V batteries for power. The platform would have to fit all. The switch was also on a platform about 5mm off the ground. To solve the problem of the motor not lining up with the switch I decided to put gears on top of a wooden platform about the same height off the wall as the light switch platform. Both the middle of the light switch and the light switch platform were 15mm off the ground (not just the switch). I found and measured an 8mm thick platform to hold everything.

The motor would sit on top of another wood platform, high enough to attach to the top part of the first smaller gear. And the bottom part of the smaller gear would connect to a bigger gear that would go over the wooden platform and over the platform of the switch so it would be on the same level as the switch. Behind the motor would be the arduino (with the motor shield on top of it) and then the battery - with room for two batteries if necessary. After laying the gears down on the board, I place various pieces of wood next to the gears to see if for any of them the motor would come just high enough to connect to the smaller gear. Before placing them, I measured the pieces to make sure that they were about 3mm longer than the motor from the axis to the end of the gear that was on it. I measured the smaller gear to be 14.17mm high with digital calipers.

Week3 Narrative
In week 3, my job was to make the platform with gears and attach the motor.

First, I measured (with digital calipers) the interior diameters of the gears to see how wide/narrow something would have to be to fit through the gear and keep it in the same spot while it is turning, but without restricting it. The inner diameter of the smaller gear was about 2.04mm while the inner diameter of the larger gear was 5.10mm. Then I looked through a huge bin of old printer parts measuring any metal stick I found that I thought the gears would be able to spin around pretty easily. All were either too thick or too thin. I also had no means to put them through the wood. Then I decided to use nails as axes for the gears to spin around. I also tried to use rollers I found in the printer parts bin to keep the gears down, but when i cut the rollers to the size that I wanted, the rubber on them was too uneven and I decided to simply use the flat heads of the nails. The gears would sit directly on the wood. I first hammered a nail through the bigger gear, and the wooden platform chipped at the bottom a bit. It did the same for when I attached the smaller gear in the same way but didn't break all the way through. Gear one spun freely, but I hammered in the nail for gear two too much which stopped its and gear one's movements. I then hammered the nail from the other side to fix the problem. Then, I tried to use epoxy to fill in the chipped holes before the nail tails were cut off to ensure stability, but when the epoxy was mixed, it didn't start hardening properly and was deemed "faulty" and thrown away. I used hot glue instead to fill the holes. Then I asked Mr. Dolge to cut the metal for me. The nails stayed in place nicely with the hot glue. When I spun the second gear, it came too high up and restricted the first one. To solve that I tried to hammer the nail in a little more but that restricted the second gear completely. After hammering the nail off of the gear, I put masking tape over the top of the nail's head which disallowed the gear to come too high up but still let it spin freely. After the gears were in proper place and spinning with little resistance, I measured the width of the wooden platform (72mm) and then the piece of wood that the motor would rest on top of to be the same length and then asked Mr. Dolge to cut it to that length with the arm saw (since students aren't allowed to use it).

Week4 Narrative
In week 4, I had to get the stepper motor I had to function - at least spin around. I first looked on sparkfun to find out to what pins I should connect the motor to but I couldn't find it there or even on google after searching for hours. I tried attaching wires to the pins there were there, and when I spun the motor LED lights cam on but nothing more. At least from that I knew that electricity was passing through. I tried to do it with the wires on the motor I paired up and it worked with all. Then I asked Mr. Foerster if he knew any good online info sources, and I was told that I was using the wrong motor shield. Apparently, the LEDs would light up as long as there was any current - even if the wires were wrong. I looked up the type of stepper motor I had so I could get a proper shield. 5 wire = unipolar motor. A motor shield from adafruit would be the right choice. I also used a multimeter, as suggested by Foerster, to make sure I had the right wire combos. I didn't. The right combos were red/brown, green/white, and black as the ground wire. I tried to get the motor to work by using the stepper tutorial on adafruit. I plugged in the black wire into ground and the rest into ports M1 and M2. I downloaded the sample code into the arduino and added the battery supply for the motor but it still didn't work. I then realized that there were two areas for stepper motors on the shield and I had it coded for the wrong one. I changed the code but the motor still didn't work. Then, I realized that I didn't have the AF_Stepper library downloaded. I downloaded it and tried running the code but the motor still didn't work. Then I noticed that you had to divide 360 degrees by the amount of degrees the stepper turns with each step. I did not have that information, so I tried the general 1.8 degrees. 360/1.8=200. AF_Stepper(steps, stepper#) with steps being how many steps it takes per 360 degrees. I typed in 200 for steps and 1 for stepper# as the pins I was using to put the stepper into were in port 1 rather than 2, which I had gotten wrong earlier. Still did not work. My next step is to try every general step degree combination.