loading

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 build our simple circuit!

Step 1: Connect Power and Ground

As usual, start by connecting the 5V and GND pins on your Arduino to the bottom voltage rails of the breadboard. You'll also connect the two ground rails to each other.

  1. Connect the 5V and GND pins on the Arduino to the bottom voltage rails of the breadboard.

  2. Connect the two ground rails (black) of the breadboard to each other. Continue to the next step.

Step 2: Add the Buttons

Next add the two momentary switches to the breadboard. The button on pin 4 will control motor direction and the button on pin 5 will turn the motor on and off. You will also need a 10 k-ohm pull-down resistor on both buttons.

  1. Connect two pushbuttons to the breadboard across the center gap. Place these towards the left edge, a couple of sockets apart from each other.
  2. Connect the left terminal of each button to the bottom 5 volt rail on the breadboard.
  3. Connect the right terminal of the first button to digital pin 5.
  4. Connect the right terminal of the second button to digital pin 4.
  5. Finally, connect the right terminal of both buttons to ground through 10 k-ohm resistors. It might be easiest to use the top ground rail of the breadboard.
  6. Continue to the next step.

Step 3: Connect the Potentiometer

Next connect the potentiometer to the breadboard. The potentiometer will act as an input on analog pin A0. Later you will use this to change the speed of the motor.

  1. Attach the potentiometer to the breadboard around column 14. In the simulator, you will need to place this across the center gap.
  2. Connect the left terminal of the potentiometer to the 5 volt rail on the breadboard.
  3. Connect the right terminal of the potentiometer to the ground rail.
  4. Connect the center pin, or wiper, of the potentiometer to analog pin A0.
  5. Continue to the next step.

Step 4: Wire Up the H-bridge (1)

Place the H-bridge on your breadboard so it straddles the center, with the U-shaped notch facing to the left.

Before connecting any pins, refer to the diagram for the H-bridge to recall the pin numbering. It starts at 1 at the pin with the white dot - then increases counter clockwise to 16.

  1. Place the H-bridge on the breadboard, as shown.
  2. Connect pin 1 of the H-bridge to digital pin 9 on the Arduino.
  3. Pin 1 on the H-bridge is the "enable pin." When it receives 5V, it turns the motor on, when it receives 0V, it turns the motor off. You will use pin 9 on the Arduino adjust the speed of the motor using PWM.
  4. Continue to the next step.

Step 5: Wire Up the H-bridge (2)

Digital pins 3 and 2 are going to communicate with the H-bridge, telling it which direction to spin the motor.

If pin 3 is LOW and pin 2 is HIGH, the motor will spin in one direction.

If pin 2 is LOW and pin 3 is HIGH, the motor will spin in the opposite direction.

If both the pins are HIGH or LOW at the same time, the motor will stop spinning.

These Arduino pins 3 and 2 will connect to pins 2 and 7 on the H-bridge, respectively.

  1. Connect pin 2 on the H-bridge to digital pin 3 on the Arduino.

  2. Connect pin 7 on the H-bridge to digital pin 2 on the Arduino.

  3. Continue to the next step.

Step 6: Wire the H-bridge (3)

Next, you will power the H-bridge. The IC gets its power through pin 16, which is plugged into the 5 volt rail. Pins 4 and 5 both go to ground.

  1. Connect pin 16 of the H-bridge to the 5 volt rail on the breadboard.

  2. Connect both pins 4 and 5 to the ground rail of the breadboard.

  3. Continue to the next step.

Step 7: Connect the Motor

Attach your motor to pins 3 and 6 on the H-bridge. These two pins will switch on and off depending on the signals you send to pins 2 and 7.

  1. Connect the ground pin of the motor to pin 3 on the H-bridge.
  2. Connect the other pin on the motor to pin 6 on the H-bridge.
  3. Continue to the next step.

Step 8: Connect the 9V Battery

Next plug the 9V battery into the top voltage rails on your breadboard. If you are using the Arduino kit, just plug in the battery adapter. You will attach the 9V battery before powering up the Arduino.

You will also connect pin 8 from the H-bridge to the battery power. This is the pin that the H-bridge powers the motor from.

  1. Attach the 9V battery, or battery adapter, to the top voltage rails on the breadboard.
  2. Connect the 9 volt rail to pin 8 on the H-bridge
  3. After connecting the battery, notice that the battery's ground terminal is connected to the Arduino's ground. Make sure you do not have your 9V and 5V power lines connected! They must be separate, only ground should be connected between the two.
  4. Continue to the next lesson to learn how to program the zoetrope!

Next Lesson:Writing the Code

About This Instructable

780views

3favorites

License:

More by circuits:Move Circuit Assembly Glow Circuit Assembly Introduction 
Add instructable to: