Introduction: Setting Up the Circuit

Picture of Setting Up the Circuit

The following information is a single lesson in a larger project. Find more great projects here.

Return to Previous Lesson: Introduction

Lesson Overview:

Now we'll set up our circuit!

Step 1: Hacking a Lamp

Picture of Hacking a Lamp

In order to do this project in the simulator, we needed to give you a device to hack! There is a lamp circuit in the Workplane next to the breadboard and Arduino.

  1. Try simulating the circuit and press the button to turn on the light!
  2. The pushbutton is the perfect component for us to hack. The terminals that are part of the lamp circuit are connected to the terminals on the left -- we will attach the Arduino to the right-hand terminals to remotely "push" the button.
  3. Instructions for hacking a real button will come later!
  4. Continue to the next step.

Step 2: Connect Ground

Picture of Connect Ground

In this project, you will just connect the GND pin on your Arduino to the ground rail of the breadboard.

  1. Connect the GND pin of the Arduino on the bread

  2. Continue to the next step.

Step 3: Connect the Optocoupler

Picture of Connect the Optocoupler

The optocoupler should straddle the center of the breadboard, so you can access all pins independently. The text on the optocoupler will be right-side-up when you place the chip on the breadboard.

  1. Place an optocoupler across the center gap on the breadboard, near column 23.

  2. Connect the lower left pin of the optocoupler (anode) to digital pin 2 through a 220 ohm resistor. Remember there is an LED inside the optocoupler that we don't want to burn out!

  3. Connect the bottom center pin on the optocoupler (cathode) to the ground rail on the breadboard.

  4. Continue to the next step.

Step 4: Hacking a Button (simulator)

Picture of Hacking a Button (simulator)

In the circuit simulator, you're ready to hook up the breadboard circuit to the flashlight. You'll do this by connecting the to middle and right pins (collector and emitter) to the button terminals.

  1. Connect the top right pin of the optocoupler (emitter) to the bottom button terminal (which is connected to ground on the 9V battery).

  2. Connect the top center pin of the optocoupler (collector) to the top terminal of the button.

  3. Continue to the next step to learn how to prepare a button on another device.

Step 5: Hacking a Button (your Own Device - 1)

Picture of Hacking a Button (your Own Device - 1)

Now take a look at your own device that you want to hack! The instructions below explain how to find the right button features for wire soldering.

Remember, starting with something simple like a flashlight might be a good idea!

  1. To control a switch, you will have to remove the button cover. You might have to take out the circuit board that it is attached to, flip it over, and gently bend back some tabs that keep the button in place.
  2. Under the button are two small metal plates. The pattern shown in the diagram below is typical of many electronic devices with pushbuttons.
  3. The two "forks" of this pattern are the two sides of the switch. A small metal disc inside the pushbutton connects these two forks when you press the button.
  4. Continue to the next step.

Step 6: Hacking a Button (your Own Device - 2)

This method only works only if one of the one of the two sides of your pushbutton is connected to ground on your device.

  1. If you're not sure, take a multimeter and measure the voltage between one of the forks and the ground on your device. You need to do this with the device turned on, so be carful not to touch anywhere else on the circuit board.

  2. Once you know which fork is ground, disconnect the power to your device.

  3. Continue to the next step

Step 7: Hacking a Button (your Own Device - 3)

Picture of Hacking a Button (your Own Device - 3)

Next, connect one wire to each of the small metal plates.

If you are soldering these wires, be careful to not join the two sides of the switch together. If you are not soldering, and using tape, make sure your connection is secure or the switch won't close! Finally, attach the button to the breadboard using the instructions below.

  1. Connect the side of the switch that is grounded to the upper right pin on the optocoupler (pin 4). This is the black wire in the picture.
  2. Connect the other side of the switch to the middle top pin of the optocoupler (pin 5). This is the green wire in the picture.
  3. Continue to the next step to learn how to write the code for hacking the button! We're going to make your device's output blink on and off.

Next Lesson:Writing the Code

Comments

About This Instructable

568views

2favorites

License:

More by circuits:IntroductionArduino Project 15: Hacking ButtonsArduino Project 14: Tweak the Arduino Logo
Add instructable to: