User:SuperBlobMonster/Room Access

Week1 Narrative
Need to look into what people have done with linking raspberry pi to video inputs, namely usb webcams

So far I have browsed through youtube and found some fairly straight forward examples for running the raspberry pi and it seems simple enough to get a webcam to interface with the program. Main difficulties in running programs is the fact that it is running on a Linux based system, which not all software supports.

http://www.youtube.com/watch?v=r456d0imYPE http://www.youtube.com/watch?v=NVrqNaLxU_g

At this point I need to get my hands on a raspberry pi and get to work with it using my monitor at home.

Link to associated /CDIO/ documents.

Week2 Narrative
Getting a better vision for this project and tossing ideas back and forth. Goal for the week is to look more into the raspberry pi, start working with it, and look into getting servos controlled by it.

I gathered the materials I will be needing to work with for the software end of the project, and set about familiarizing myself with each of my tools.

I wound up reformatting the SD card for the raspberry pi to get it to boot correctly. after setting it up cleanly, I spent some time getting acquainted with its layout and capability. should have no trouble getting the arduino program onto it to run the chip. still need to look into coding in python

Downloaded the arduino program and learned a bit of its interface as well, but I have not yet looked into how to run a motor or take input from a vibration sensor.

exploited doccumentation:

http://arduino.cc/en/ -Arduino information

https://github.com/raspberrypi/noobs/blob/master/README.md -information on NOOBS for the raspberry pi

http://elinux.org/RPi_Easy_SD_Card_Setup#Using_Windows_7_or_Windows_XP -SD formatting guides.

Mounting concept
The idea initially was to use a motor that pivots a weight and changes the center of gravity of what is attached to the door, to apply weight to the handle, and open the door. However after some consideration of other options, we found mounting a bracket to the bottom of the door and attaching the motor at a point on that string, with a draw string to the handle that a motor would pull.

Some things to keep in mind:


 * 1) When deciding where to mount the motor, I marked the point on the string where the string attached to the handle pulls at 90 degrees for maximum force
 * 2) When tying the knot for the string that the motor mounts on, Use sharpie to mark the placement of the knot and tie it off of the door so that it is not under tension. Very hard to tie a knot under tension.

Door mount
The flange at the bottom of the door is made from a 90 degree bracket cut with tin snips to shorten one edge, then on the short end, pieces cut again with tin snips to make flanges that are bent into a 'hook' for grabbing the bottom of the door.

A hole is drilled (or a piece chosen already with a hole) at the top of the long side of the bracket for a spring to attach to, which will keep tension on the system.

spring creation
Initially, I had used two tension springs to hold the system in place, but after considering the abuse it could get, I decided to create a single more powerful spring that would not be able to overstretch.

I used a compression spring that I modified to be a tension spring so that it could not be pulled and deformed.

Simply found a strong compression spring, and got some thick metal wire/thin metal rod that will hold it's shape after being bent.

measured the length of the spring and cut a piece of metal wire about 2.5x the length of the spring. folded it in half, and put it through the spring.

Bent the ends over the edge of the spring so that it captures the spring on one side of the metal wire.

Did the same for the other side, but measured the original length to be more on the order of 2.7x the length of the spring, so that I could bend the end over to be a hook for holding onto the metal bracket.

I had first attempted this with spring wire, which was too difficult to work with, and I was unhappy with the result. I then used ~1/16th steel rod, which was much more workable.

I did my bending with two pairs of pliers, and the large vice in the engineering room.

Door bracket
Egan used a lamination process to create a sleeve for the door handle that we can attach the system to. This what I did to create the mounting point for the string, will link to his lamination process when I find it.

I initially just drilled a hole in the flange at the bottom of the mount, but quickly found it to not be sturdy enough to support a load. So I went about creating a reinforcement system

I found and bent a small L-bracket that was narrower than the sheath, and bent it with the vice to create a beefy attachment point. I was lucky enough to have found a bracket that already had a hole in it where I want to attach the spring later on, so I only have to drill through epoxy, and not through the metal.

I attached it to the sheath with a large amount of epoxy, creating a combination of stiff metal as structural support and the epoxy as filler material and a strong fixative.

I had to rotate the piece while the epoxy was setting to prevent it from dripping or pooling on one side or the other.

NOTE- When clamping a piece like this, be VERY careful not to over-compress it and deform/break your piece!! Vices like this are VERY powerful!!

While I didn't, you should likely use the latex gloves by the sink for working with epoxy as it is not great for your skin...

Motor assembly
The motor is a part cut off of an inkjet printer, modified in 3 ways to suit the project needs.

1: I cut the excess frame of the assembly to trim it down a bit

2: I designed, built, and added a belt tensioner to prevent the motor from slipping.


 * Bering from an old skateboard wheel in the back; ask a professor to get one for you if you need.


 * Nut, washer and bolt from bins in the back


 * Noticed the nut dimensions and berring hole were almost the same size, and I used the vice to press the nut into the center of the berring, simplifying the design.


 * Put the bolt through the board, put the washer on the bolt- to go between the bearing and the board, then threaded the bearing onto the bolt and used a screwdriver to tighten the system down where it would tension the belt.

3: I epoxied the gear mount at an off angle to act as a spring, pushing it into the other gear, again to prevent slipping.

Spool
Egan designed and prototyped a spool in Google sketch-up, but it printed to no avail, for several reasons, though it was a good design. I found and used an STL sketch-up plug-in, and re-designed his spool with a few modifications, though functioning on the same principals. Saved it, compiled it with Makerware, and printed successfully.

When I tried to put it on the spindle, it was a VERY tight fit. feared I would break it if I forced it. I took a file set above the sink and enlarged the spindel's hole by a teeny smidge (Technical term, less than a quarter millimeter in radius) until it was able to fit onto the spindle. Still a VERY tight fit. Did not modify the other half, just used the vice to press fit it on. Deformed the plastic a bit, but it worked well in joining the spool, and it was such a tight fit I doubted I would have to glue it. (I wound up gluing it)

Testing
I measured earlier that the door took 25N to open fully.

A very boring section of this project, I did a lot of testing to find a good power supply and to make sure the motor could handle the loads

I initially tested with a variable power supply, but maxed that out and could not get my proper readings.

I wound up hooking in the 16v 4a laptop charger to the monster motor shield and uploaded some test code to run the motor once, then stopped, modifying the power setting and re-uploading each time. Tested both under full load(holding the spool in place) and running 'no load' (free to spin other than the friction of the mechanism).

Through that, I found the power setting - 200 - to be powerful enough, and would not be too much of a strain on the motor or shield or motor.

Epoxy
Found in my testing that I could get the spool to slip at power 200 with full load, which is not something we wanted... so I took the spool off and separated the two halves. I widened them a tiny smidge (technical term again for less than 1/4mm) so that I could epoxy them, and there would be a tiny space for epoxy to reside, instead of getting all squished out. They still slid on with no wiggle room, but they were no longer 'press fit'

I also added 2 notches for the epoxy to reside in and hopefully give a better bond.

Before gluing, I cleaned everything off with Clean Streak, a bicycle degreaser, to make sure that no oil would get in the way of the materials bonding.

I applied epoxy to the inside of each of the spindle halves and slid them on, then applied a glob to the outside of the outer spindle half.

I had quite a lot of epoxy left over, so I decided to glue the strings in place to prevent chafing when the mechanism was used.

integrating the peizo sensor and motor shield
I had a lot of trouble getting the peizo sensor to work with the motor shield, EVENTUALLY found that analog pin 2 was unoccupied by the motor shield.

How I came to that conclusion? In short, I created an output to the computer reading each pin, and attached the peizo to each one. Later found the code also described what pins it used, but not in a clear manner. had to filter through the pin declaration.

When programming, adding debugging feedback will help you find the problem 14/15 times for arduino the computer feedback is: Serial.pringln("message");

-Add screen caps of debugging-

This helped me fix all of the bugs when smashing the motor control code with the knock detection code...

Final construction testing and debugging
All the hardware has been previously designed and built, ready to be assembled. Very straight forward

Soldered the wires, and hardware is done.

All software here on out!! I have the knock detection code, and the code for running the motor, but I have to mash the two together and edit out sections of the knock detection code meant for changing the knock

Other notes
Bugs- The door sometimes opens the latch multiple times after inputting the knock.

Base code for motor control- Spark fun's example monster moto shield code: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Shields/MonsterMoto_Shield_Example.pde

Base code for Knock detection taken from open source instructable: http://www.instructables.com/id/Secret-Knock-Detecting-Door-Lock/

I had children literally running around me screaming while I typed up about half of this page. GGRRAAAAAAAAAAAA

Demonstration video!!!
http://www.youtube.com/watch?v=Nz-IEjaghUg