Introduction: Example Lab Activity

This is an example lab tutorial to help demonstrate my expectations for using Instructables on Labs and Projects. This lab will create a simple binary counter with the help of a button and three LEDS. As you can see, this simple project has been broken down into a few basic steps, followed by the code needed to run the project. All labs will require at a minimum:

1. Fritzing diagrams to explain how components are connected to the board.

2. Explanation of what each component is and how it is used. (i.e. don't just upload a series of images!)

3. Provide any code used to create the project. This too can be broken down into parts as well, to help better explain how the code works and/or can be modified.

*Optional But Encouraged* Whenever possible, add a help section to explain how to handle common errors with building the project.

Step 1: Add an Led

1. Place an LED (any color) into the breadboard

2. Connect one end of 220 Ω (ohm) resistor to the top lead (+), should be the longer lead, and the other end into Pin 12 on your Arduino Board.

3. Connect a Jumper Wire to the bottom lead (-) and to the grounded rail on the breadboard.

5. Connect a Jumper Wire from the grounded rail to the GND (ground) Pin on the Arduino.

Step 2: Led Errors

Step 3: Add a Green LED

The green LED has the same setup as our red LED.

1. Connect the led to the breadboard.

2. Connect a 220Ω resistor to the positive(+) lead of the LED and to a Pin 10 on the Arduino.

4. Connect the negative lead to the ground rail.

Step 4: Add a Blue LED

The blue LED has the same setup as our red and green LEDs.

1. Connect the led to the breadboard.

2. Connect a 220Ω resistor to the positive(+) lead of the LED and to Pin 8 on the Arduino.

4. Connect the negative lead to the ground rail.

Step 5: Add a Push Button

1. Attach the push button to the breadboard by having it connect to the “E” and “F” columns. The “E” and “F” columns are used to separate our rows, i.e. components on A-E are connected and components on F-J are connected, to make two separate sections.

2. Place a 10kΩ resistor to connect the right side of the button to the grounded rail.

3. Place a Jumper Wire to connect the left side of the button to the power rail.

4. Place a Jumper Wire to connect the right of the bottom to pin 4. (It can technically be on the same side as the resistor. The Jumper Wire is on the other side of the button to make the diagram more organized)

Step 6: Push Button Errors

Step 7: Explain Binary Counter

In programming, we count using a numbering system called binary, which is represented with 1’s and 0’s. Ex 011 in binary is what you and I would call 3. LEDs are great because they can easily represent binary values! 1 can be represented with the LED on and 0 can be represented with the LED off. Since we have three LEDs, we have three binary bits we can work with. The potential values for our LED counter are detailed in the chart above.

Step 8: Code for Binary Counter

Attached is the BinaryCounter.ino which contains all of the code for running the binary counter project on an Arduino Uno.