User:Osanusi2151/ENES-100/project 2

Project #2 Continuation of Combo lock project https://en.wikiversity.org/wiki/User:1sfoerster

Week1
Material: This is a continuation of the combo Lock Project. This week, my job is to create a program that works with both the Solenoid and Sensor.the first curve was understanding how to use an arduino so i can get the arduino communicating with the solenoid. the plain for this project is, when ever the stepper motor stops the solenoid checks if the lock is undone this is do to the large magnet that retracts the arm when giving power.
 * Arduino
 * Power Switch Tail
 * Sensor
 * Solenoid

After playing around with the arduino program, i was able to modify the current blink program to help the solenoid snap a lot better by decreasing the High output to 50ms and increasing the Low output to 2000ms. this gave the solenoid a faster snap then a longer release when the solenoid is active.

The modify Blink code that gave the solenoid a more Natural snap: http://www.youtube.com/watch?v=JkO884DU_N4&feature=youtu.be

Code One
This was a basic program used to check the operation of the solenoid using the Arduino program for the first time. this code was to allow us to use pin 13 as an output for then switch tail to operate the solenoid.

Code Two
Code two was use to operate the sensor that go's between the the solenoids telling it when to stop pulling. the plan was to bridge the gap between the sensor pillar and have the led turn off/on when ever the gap is bridged.

Code Three
Code two had new effect, the led stayed on after the bridge was gaped. Code three was writing and configure a more complex manner giving it more layers and detail. come to find out, making something more complicated doesn't allows guarantee positive results. same goes for the the Third code.

the regular wire on the Optical switch was very weak. I soldered new wire on to exciting wire to increase it strength and durability. this will allow for a better connection point for the the arduino. after these connection as been made, this should give better contact points on the arduino.

Code One
when using this code to operate the machnical switch, i was not getting any response from the led after the switch was activated. this program was suppose to label pin 13 as led, and label pin 8 as switch pin. when the switch is activated the arduino reads the signal as high and turns the led on, else the led should be low.

Code Two
For part two, the boolean was added to check the current state of the led. (boolean lastButton = LOW;) keeps track of watch the button did in the previous loop, and (boolean ledOn = false;) is used to keep track of the current state of the led. and they will help check things in the loop to help set thing to where there suppose to be.

this is the youtube video showing the problem: http://www.youtube.com/watch?v=t-3kIytQPeQ&feature=youtu.be

Code Three
Code to works, but has a bit of a problem. the led turns of and on but you can still see a dim light coming from the led. in order to solve this problem i made my own function. the function is suppose to return a boolean. (boolean debounce(boolean last)) debounce is now a function with input last, this is now define as a that determine the current value with the remaining of the program.

this is the youtube video showing the problem: http://www.youtube.com/watch?v=ib1kVmWDMzU&feature=youtu.be

Hooking up a Switch to Arduino
if your not confortable with writing you own code, the Analog in out Serial program can be found in the arduino software under (File, Example, Analog, and number three AnaloginoutSerial). this program works perfectly with the switch with now problem what so ever.

Week4 Narrative
Making the final mount for the motor, the 2in x 2in block is where the motor will sit so it will be next to secondary gear for the rubber mount.

Next step is to began making progress on the IR switch, and start figuring a way condense the combo lock into a portable product.