This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:fall2020:common:projects:iwb0 [2020/09/14 12:26] – created wedge | haas:fall2020:common:projects:iwb0 [2020/09/14 12:35] (current) – [The Circuit to Construct] wedge | ||
---|---|---|---|
Line 1: | Line 1: | ||
======PROJECT====== | ======PROJECT====== | ||
- | PROJECT: | + | PROJECT: |
=====Objective===== | =====Objective===== | ||
- | To expand upon our previous efforts, through wiring up a 10 LED block package and generating a " | + | In prior electronics projects, we played exclusively with output components, in the form of LEDs. Here, we introduce |
- | + | ||
- | We also further utilize time constraints, tying project credit to your starting on the project before | + | |
=====Abstraction===== | =====Abstraction===== | ||
Line 16: | Line 14: | ||
Please be sure to familiarize yourself with the following content in " | Please be sure to familiarize yourself with the following content in " | ||
- | * [[https:// | + | * [[https:// |
=====Background===== | =====Background===== | ||
- | For this project, you will be working with a C program using the wiringPi library on the Raspberry Pi, wiring up a 10 LED block package | + | For this project, you will be working with a C program using the wiringPi library on the Raspberry Pi, wiring up a circuit containing an LED and a button |
=====Input and Output via the GPIO pins on the pi===== | =====Input and Output via the GPIO pins on the pi===== | ||
Line 33: | Line 31: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
| | ||
| BCM | wPi | | | BCM | wPi | | ||
Line 60: | Line 58: | ||
| BCM | wPi | | | BCM | wPi | | ||
| | ||
- | yourpi: | ||
</ | </ | ||
Line 82: | Line 79: | ||
=====Wiring up our circuit===== | =====Wiring up our circuit===== | ||
- | This circuit is basically an expansion | + | This circuit is basically an enhancement |
- | In this project, we will be hooking up a peripheral | + | In this project, we will be hooking up two different peripherals |
You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", | You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", | ||
+ | |||
+ | You have also encountered buttons seemingly in just as ubiquitous a fashion: a button is essentially a switch, toggling something ON or OFF. A light switch is a prime example of this (although in our case, our button doesn' | ||
For this endeavour, you will need to obtain the following items out of the electronics kit you obtained for the class: | For this endeavour, you will need to obtain the following items out of the electronics kit you obtained for the class: | ||
- | ====(1) breadboard==== | + | {{ : |
- | In your electronics kit, what will serve as the base, or mounting point for our electronic circuits, will be the solderless breadboard, which resembles the following: | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | <WRAP round info>We will be inserting the metal legs of various components in various holes on the breadboard, to connect our circuit together.</ | + | |
- | + | ||
- | On the breadboard, there are 2 different pathways of connectivity. If you look along the top and bottom of the breadboard, do you see the red and blue strip running horizontal across the board? That means that ALL pins in that row are hooked together (all the pins along the blue line are hooked together with each other, all the pins along the red lines are hooked together with each other). We will be using that to to provide things like a common voltage (+) or a common ground (-) to components that need such things. | + | |
- | + | ||
- | In the middle of the breadboard, separated by the valley in the plastic molding, are columns of connected pins (unique columns, also separate from the other side of the valley). Each group of those 5 pins is hooked together. | + | |
- | + | ||
- | You'll notice occasional "by 5" counting off silkscreened on the breadboard, which can be used to try to keep things organized. | + | |
- | + | ||
- | Here's a logical diagram of the breadboard layout: | + | |
- | + | ||
- | {{ : | + | |
- | ====(1) T-cobbler and data cable==== | + | |
- | In your kit should be a T-shaped device (known as the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | <WRAP info> | + | |
- | + | ||
- | <WRAP info>The plastic rectangle should have a notch cut out from it, and notice that the ribbon cable connector has a notch included in it. That is a key to indicate how you need to connect the ribbon cable into the T-cobbler</ | + | |
- | ====(1) 10 LED block package==== | + | |
- | + | ||
- | 10 LEDs, all in one convenient package! | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The package has a set of pins, which allow us to hook each LED up as we would if they were separate: | + | |
- | + | ||
- | {{ : | + | |
- | ====(10) 220 Ohm resistors==== | + | |
- | Your kit should come with 3-4 packs of differently rated resistors (220, 1K, and 10K). You want TEN of the lowest rated ones, the 220 ohm variety. One for each LED. You should see the value marked on the paper strip holding the legs of the resistors. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | <WRAP round info>The color bands are important, not the body color itself. You resistor body may be beige, may be blue, but the color of the 4-5 rings is what is important. Here we have red (2), red (2), brown (x10); 22 * 10 = 220</ | + | |
- | + | ||
- | <WRAP round info> | + | |
- | + | ||
- | ====male to male jumper wire, as needed==== | + | |
- | As a final piece of equipment you will need, locate and have a few male-to-male jumper wires handy for use in our circuit: | + | |
- | + | ||
- | {{ : | + | |
=====The Circuit to Construct===== | =====The Circuit to Construct===== | ||
- | With those components, you will want to place them onto your breadboard, in a manner similar to last week' | + | With those components, you will want to place them onto your breadboard, in a manner similar to previous |
- | {{ : | + | {{ : |
Take note of how everything is being plugged in, and what connection on the T-cobbler is being utilized. | Take note of how everything is being plugged in, and what connection on the T-cobbler is being utilized. | ||
- | Notice how the circuit runs from ground to resistor to LED to pin " | + | <WRAP round info>Pay attention |
- | + | ||
- | Please keep in mind: | + | |
- | + | ||
- | * EACH LED needs to be interfaced with a unique GPIO pin | + | |
- | * EACH LED needs a corresponding resistor (no sharing!) Forgetting | + | |
- | * ground connections can be shared (we call this " | + | |
- | * take note of which GPIO pin you are using, | + | |
- | <WRAP info> | + | < |
=====Program===== | =====Program===== | ||
Line 172: | Line 119: | ||
</ | </ | ||
- | At which point you can change into the newly created and populated **led2** directory. | + | At which point you can change into the newly created and populated **iwb0** directory. |
====Getting project resources from lab46 to your pi==== | ====Getting project resources from lab46 to your pi==== | ||
Line 235: | Line 182: | ||
*:iwb0:post picture of powered LEDs in layout to #desig [8/8] | *:iwb0:post picture of powered LEDs in layout to #desig [8/8] | ||
*: | *: | ||
- | *:iwb0:led2.c code adequately modified per project requirements [12/12] | + | *:iwb0:iwb0.c code adequately modified per project requirements [12/12] |
- | *:iwb0:led2.c comments describing what is happening [8/8] | + | *:iwb0:iwb0.c comments describing what is happening [8/8] |
*: | *: | ||
</ | </ |