User:RaRickert/ENES-100:/Pet Food Controller (continued)

Week 4
After last weeks education in potentiometers and the "knob" sketch, I decided to move onto the "sweep" sketch. If I haven't clarified already, a "sketch" is an arduino code. The basic sketch is in the arduino application. After you load the program, (Arduino version 1.0.5) click File, go down to Examples, go down to Servo and click Sweep and the arduino will pull up the basic sketch for Sweep. I learned how to hook up and arduino to a servo. I connected the brown wire (which was the ground) to a blue wire that connected to the GND on the arduino. I connected the red wire to an orange wire that connects to the 5V signal input on the arduino. I then connected the orange wire to a white wire that plugged into the ~9 digital input connector. The brown wire is your ground, the red wire is the servo's power, and the orange wire is where the digital input (the sweep sketch) tells the servo when to move and how far.

When I originally set this up, I used a breadboard for connectors, but then realized that since I only had 3 wires, it'd be easier just to plug the wires directly from the servo to the arduino. I used a 9-volt battery to supply the power since the end goal is not to have this connected to a computer for power. I used [http://playground.arduino.cc/Learning/SingleServoExample#.UzmlYvldWaI/? Single Servo Example on the Arduino website] to figure most of this out. It made sense to use digital input vs the analog input since we weren't using a potentiometer. After talking to Hiedi, I learned that the servo needed to rotate 105.4 degrees. To see that the servo would turn as needed I used the sketch below. I figured 2500ms was a good interval time between spins just for an example. I talked to Mike and he told me that his program would tell mine when to spin, so that's coding for another day. Basically his program would read that the pet had approached, then tell my program to turn 105.4 degrees, which would open the lid. Then when the pet walked away, his program would tell mine to spin back which would close the lid.

Week 5
Moving forward. Now that I have the servo working I'm moving onto building the housing. Hiedi printed the gears and the lid, I got the servo working and the next step is the assembly to house the components and the bowl. I took measurements from Hiedi's sketchup, as hers were far more accurate than my original sketchup design. [insert Hiedi's sketchup file here]. Since there were some issues with the makerbot, I decided that the next-best material to house the components would be wood.

Week 6
Moving forward. Next we needed to hold the gears up and see if the servo would turn as expected. After an awful lot of trial and error we ended up drilling two holes for two of the gears. The first hole would have a screw that held up the smallest gear which would pull the lid open and push it closed. The hole was drilled on the side 3 7/8" from the bottom and 5 1/2" from the side. The second hole would have a screw that held up the bigger gear which would connect the servo and had to be low enough so that the lid wouldn't touch it when it was pulled over it. This hole was 4 1/8" from the side and 1 7/8" from the bottom. After we screwed in the screws, we noticed there was a bit of an angle. Since we weren't concerned with keeping the screws straight, I warped them so that they would line up right. We also noticed that the lid slid too far back now and again.

You can see the final product of the gear box on my youtube channel