Preview Mode. Sign in to save progress!
You are in preview mode! Progress will not be saved!
Sign in to save your progress!

Brain Powered

Mini Project Controlling the LED

In past projects, you used a physical switch to control a circuit. In this project, you will be able to control the LED by running a program on the Arduino that controls the signal to the LED.

Required items and tools

Find the following components in your kit:

  • Arduino Uno Arduino Uno
  • Arduino Software Arduino Software
  • USB A-to-B cord USB A-to-B cord
  • Computer with USB port Computer with USB port
  • Multimeter Multimeter
  • Wire Stripper Wire Stripper
  • Header Pin Crimper Header Pin Crimper
  • 22 AWG Wire 22 AWG Wire
  • LED LED
  • Male and Female Header Crimps Male and Female Header Crimps
  • Header pin housings or shells Header pin housings or shells
Step 1: Connect Arduino to Computer
arduino-pc-connected

Using the USB A-to-B USB cord, connect the Arduino Uno to your computer.

Step 2: Install Arduino Software

If you haven’t done so yet, go to the Arduino site to download the latest version of the Arduino IDE programming software. This will be used to "program" your Arduino microcontroller to make an LED blink.

Step 3: Separate Wires
split-22AWG-wire

Take the 22 AWG 5 pin wire and separate the wires so that you only have the red and the black wire.

Step 4: Crimp male and female header pins to the wires
wire-with-header-connectors

Create your wires so that both the red and black wires have 1 male header on one end and 1 female header on the other.

(Optional) Module: Create Wires with Header Pins

Use the following steps to refresh yourself on attaching male header pins to wires.

Attaching Header Pins Connector: Required items and tools

To begin attaching and crimping spade connectors, you will need the following:

  • 22 AWG Wire 22 AWG Wire
  • Wire Cutter/Stripper Wire Cutter/Stripper
  • Header Pin Crimper Header Pin Crimper
  • Male or Female Header Crimps Male or Female Header Crimps
  • Header pin housings or shells Header pin housings or shells
  • Needle nose pliers or Wire Cutter / Stripper Needle nose pliers or Wire Cutter / Stripper
Note: Extra Components are very Usefull!

You may want to have extra crimps and wires. These crimps are small, require a special crimping tool, precise techniques and practice to create a proper crimp.

Understanding Header Pins

Header pin crimps are made up of three distinct portions: The mating pin zone is the portion of the crimp that interfaces with the component that you are connecting to. The other two portions interface with the wire. There is the conductor crimp zone which is the portion of the cimp that forms around the conductor and makes the electrical connection. The final part is the insulation crimp zone, where this part of the crimp forms around the wire’s insulation. This further securies the wire and creates a strain release. Both male and female header pins are crimped using the same process.

Step 1: Cut wire to length and separate

Cut a piece of the wire to the needed length and separate the number of wire you need from the .

Step 2: Strip the individual wires

Strip the ends of the wire so that 0.10 in or 2.5 mm of wire is exposed. It may be easier to strip the wires longer and trim the exposed wires to 0.10 in or 2.5 mm.

Step 3: Cut off a male or female connector

Cut off the male or female pin off of their connector strips. Keep the metal tab connected to the crimp, it will be used to align the crimp into the header pin crimper.

Step 4: Insert the wire into crimp

Place the wire into the crimp. Make sure the exposed wire is not in the mating pin zone.

Step 5: Fold over the Insulation-crimp

To give your crimp a better chance to be successful use your wire cutters or needle nose pliers to start to fold over the tabs on the insulation crimp zone.

Understanding the Crimper

The recommended crimper has 2 different crimping areas the larger anvil crimps the insulation zone while the smaller anvil crimps the conductor zone. Make sure to line up the zones correctly or the crimp will not crimp properly.

Step 6: Crimp the connector

Use the crimping tool to crimp the conductor crimp zone and the insulation crimp zone. Make sure the Mating pin zone is extended completely out of the crimping tool. If you crimp this part it will deform and will not function

After crimping, if you inspect the connection and see that the crimped parts are not fully compressed onto the wire you may want to crimp the connection a second time.

Step 7: Remove the metal carrier strip

Once the crimp is successfully attached to the wire you can remove the metal carrier strip by bending or cutting it off. After removing that, the crimp is ready to be placed into the plastic housing.

Step 8: Adding the housing

The plastic housing, or shields as they are sometimes called, add structure and support to make the crimp more durable. The plastic housings come in various sizes that can hold multiple connections in one block. Some projects will have all the connections next to each other which make the multi-connection block very convenient to use. Using single pin housing is easier to learn on and creates wires that have more flexibility in how they can be connected.

Both the male and female header pins have a small square or rectangle of metal in the pin mating zone. This metal “tab” will lock itself into the square opening or “slot” in the housing. Make sure the tab and the slot are facing the same direction and push the crimp into the larger opening in the housing. If done successfully the crimp will lock itself in the housing.

If the crimp is having trouble fitting into the housing you may want to use your wire cutters or needle nose pliers to compress the insulation crimp.

Step 9: Test the connection

Perform a pull test to confirm that the crimp will not slip out of the housing. If the housing does not easly slip off you have successfully made a crimp!

Step 5: Plug Wires Into Arduino
arduino-connected-closeup

Plug the Male Header Pins of the two wires into the Arduino. The black wire should go into a GND port, and the red wire should go into port 13.

Step 6: Plug in the LED
LED-connected

Plug the positive leg of the LED into the red wire and the negative end into the black wire.

Step 7: Set the Board to Uno
arduino-board-selection

Open up the Arduino software, and go to the Tools menu and select Board < "Arduino/Genuino Uno". This lets the Arduino software know which Arduino board you are using (there are several types!).

Step 8: Open a Sample Program
arduino-open-blink

On the menu bar, select “Open”, and in “01. Basic”, select “Blink”.

Step 9: Upload the Program
arduino-upload-blink

Click on the Upload button to upload the “Blink” program to the Arduino Uno.

What happens?

The LED should blink on and off every second! The Arduino Uno is sending a signal every second to either turn on the LED, or to turn it off.

arduino-blink-1-second

Explanation

To explain what’s happening, let’s take a look at the program that you uploaded to the Arduino Uno:

arduino-blink-code

The text that is "gray" are called Comments. The Arduino just ignores this text, but they’re really useful for times when you need to go back into a program to remember what different parts of the program do.

arduino-blink-comments

If you look further down, you will see “void setup()”. Inside of this, you will see something that says “pinMode”. This command lets the Arduino know that you’re setting the port to be an “Output” as opposed to an “Input”. So the Arduino is expecting that port to send signals OUT (output), not IN (input).

blink-void-setup

Inside of the “void loop()” is where the on and off commands happen. You’ll see “digitalWrite(LED_BUILTIN), HIGH)”. This line tells the Arduino to “turn on” the port called “LED_BUILTIN”, which is a built-in LED on the board and it happens to also be connected to Port 13.

blink-void-loop

The next line says “delay(1000);”, which tells the Arduino to just “wait” for 1000 milliseconds, or 1 second.

The next two lines tells the Arduino to set Port 13 to “LOW”, or off, and then wait again.

Since it is in a “loop”, it will do these things forever! This results in the light blinking on and off every second.

Contact Us