Wednesday 31 January 2018

Super Amazing Button using Arduino

Hello Everyone.
This is my very first Instructable so please go easy on me. This was more or less a test project to see if my new arduino board worked. Any friendly advice will be greatly appreciated so my future posts can be even better. I am going to show you how to create the best device on earth. Well i mean if you brought this back to the 1600s then it would be the best device on earth. Anyways lets get started.

I don't take full credit for this project as i set out on a witch hunt on the web in search of guidance. If i could remember where half of the info i learned came from i would point you to it, but unfortunately i have looked at so many things involving arduino and easy buttons and LEDs it just all blended together.

Step 1: Materials

So Here is the list of materials i used mostly from things i had lying around the house.

Easy button
1 Red LED
1 Arduino Uno
1 Box
Speaker wire
Electrical tape
1 9 volt battery
1 9 volt battery adapter
1 2.1mm center-positive plug
1 Phillips head screwdriver
heat shrink tubing (optional)

Step 2: Preparing the Easy Button

I had this hacked easy button from a previous project. the the pictures are scarce in this department but don't fret it is quite easy.

Start by unscrewing the four screws in the bottom of the easy button. This should enable you to take the top part off.
Then cut the wires to the speaker and the battery casing, you wont need either.
Then solder one piece of wire ( i used speaker wire because it was all i had lying around) to the positive spot n the picture
Then solder another piece of wire to the ground spot in the picture
take the battery compartment door off the easy button and run the wires through the hole and out the battery compartment door.
Reassemble the easy button *side note: there is a little groove in the outside ring part that has to line up with the button part.

Step 3: Make the Power Supply

take the 9 volt battery adapter and strip the wires
do the same for the 2.1mm jack
connect them together

all i did was twist the wires together and used heat shrink tubing to secure them.

Step 4: Prepare the Box

Feel free to use any box imaginable for this project. i just happen to have this box laying around. You can use any thing from cereal boxes to wooden box or even an invisible box if you feel like it.

Cut a hole for the LED and cut a hole for the easy button wire
Done

Step 5: Preparing the LED

There are far better ways to wire an LED than the way i did it but i was excited and rigged it up as quick as i could

long end of your led is positive, short end is ground

I attached a piece of wire to each and taped it down.

I should have probable used a resistor but i didnt have one and everything seems to be ok. The world is still standing.

Step 6: Connecting All the Wires

OK here we go.

connect the positive wire from the easy button to the number 2 on you arduino board
connect the ground of the easy button to a ground on the arduino board

connect the positive end of the LED to the number 8 on your arduino board
connect the ground end of the LED to a ground on the arduino board

connect the power supply the the power jack on the arduino board

wait to connect the battery till the end

Step 7: Set Up Arduino With Code

im going to assume (i know i know... assuming makes an......) that your arduino is set up with computer and all the drivers and whatnot are working and that you have the arduino IDE

anyways plug the arduino in your computer and fire up the ide
ether this code and upload it to the arduino

int buttonInput = 2;
int lightOutput = 8;
int buttonState = 0;

void setup() {
    pinMode(lightOutput, OUTPUT);
    pinMode(buttonInput, INPUT);
    digitalWrite(buttonInput, HIGH);
}

void loop() {
    buttonState = digitalRead(buttonInput);
    if (buttonState == HIGH) {
        digitalWrite(lightOutput, LOW);
    } else {
        digitalWrite(lightOutput, HIGH);
    }
}

Step 8:

stuff everything inside your box ( of course this step is going to differ from box to box) and seal it up

PUSH THE BUTTON!

Congratz! you have wasted probably a good couple hours on making this amazing contraption

seriously though this can be just a starting point for the most amazing device the world has ever seen, and it has limitless potential. Think about it what if you were to connect 2 LEDs. *gasp*

Thanks for taking the time to check out my first Instructable and any advice like i said in the beginning would be greatly appreciated.

No comments:

Post a Comment