Successfully reported this slideshow.
Your SlideShare is downloading. ×

Shine a little LED

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Physics Project Guidelines
Physics Project Guidelines
Loading in …3
×

Check these out next

1 of 3 Ad

Shine a little LED

Download to read offline

Teaching Notes (extremely technical) detailing my Raspberry Pi program. This is for the first set of classes, teaching how to use the breadboard, the wires, and the LED lights with the software.

Teaching Notes (extremely technical) detailing my Raspberry Pi program. This is for the first set of classes, teaching how to use the breadboard, the wires, and the LED lights with the software.

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Advertisement

Similar to Shine a little LED (20)

Recently uploaded (20)

Advertisement

Shine a little LED

  1. 1. 1-3: A bit of hardware Objectives:  More practice with setup and teardown  Create a simple circuit  Understand that computing is not all about the keyboard, mouse, and monitor Do the setup as normal, but before powering on the Pi, also connect the GPIO ribbon cable. Be sure the red stripe is aligned with pin 1 at the top left. Do not connect the breadboard to the other end of the cable yet. When the login prompt appears, DO NOT LOG IN. Turn the monitor off for now. Take the GPIO to Breadboard Interface breakout board and plug it in to the breadboard. Align pin 1 (3.3v) so that it is plugged into D1. The breakout board will leave columns A, B, and J unobstructed for rows 1 through 16, and then the entirety of rows 17 through 30 will be open. It is important to seat the breakout board well, with gentle but firm straight-down pressure. It is also not easy to remove once it has been plugged in, so you might want to leave it once it is in place. Review electrical safety. If it's metal, don't touch it unless you are 100% certain that it is de-energized. Ask for assistance if in doubt, and it is a decent idea to ask for a double-check anyway. Notice the 5V pins. These are important because the Raspberry Pi operates at 3.3V. If you accidentally run a 5V circuit back to any of the non-ground (GND) pins, it is possible that you will FRY AND DESTROY your Raspberry Pi. For the purposes of these exercises, double-check that only the 3.3V power sources are in use. The breadboard works by connecting the + and – columns vertically, and the numbered/lettered rows horizontally on each half of the board. A1, B1, C1, D1, and E1 are all connected to each other. F1, G1, H1, I1, and J1 are connected to each other. A1 is not connected to F1, and none of those are connected to the + or – columns. That's what the wires are for. Next, go over a little electrical theory. A metaphor that seemed to work well was one of plumbing – electricity is like water, it flows from high places (voltages)to low places (ground). As it flows “downhill,” it can do things like light an LED, much like a stream can turn a water wheel. Now, if the water flows too fast, it could break the water
  2. 2. wheel, so we can alter the stream so it flows at the right speed; in a similar fashion, we have to protect LEDs and other components from too much electricity, so we put resistors in front of them. This is the circuit we will create: lighting an LED. Connect a wire from the 3.3V in row 1 (1A)to the + column on the left -hand side. This will get power conveniently to any row we choose to connect it to. Connect a wire from the + column on the left-hand side to 18A. There are two types of resistors in the kit, five 10K-ohm ones (brown-black-orange- gold) and ten 160-ohm ones (brown-blue-brown-gold). We want to use a 160-ohm resistor. Connect one side of the resistor to 18C. Connect the other side of the resistor to 22C. Now for one of the LEDs. As a Light-Emitting Diode, current only flows one direction through the component. Choose any of the two-pole colors. Connect the LONG side of the LED to 22E. Connect the SHORT side of the LED to 25E. Now to get the electricity to ground. Connect a wire from 25A to the left-hand – column. Connect a wire from GND (13A)to the left-hand – column. Do a double-check to make sure the connections are correct and solid. Plug in the ribbon cable to the GPIO breakout. It only fits one way, and the red wire should be on top, at row 1. The LED should immediately begin to glow! If not, the following troubleshooting tips might help:  Check the connections, starting from the Pi. Before touching metal, unplug the breadboard! ◦ Is the ribbon cable seated properly on the Pi, with the red wire by pin 1 (at the same edge as the SD card and the power plug)? ◦ Is the ribbon cable seated properly on the GPIO breakout board? ◦ Is the GPIO breakout board seated properly on the breadboard? ◦ Is pin 1 on the breakout board (3.3V) lined up with row 1 on the breadboard? ◦ Is each of the connections correct and firmly seated? (3.3V to +, + to resistor, resistor to LED, LED to -, - to ground)
  3. 3. ◦ Do each two things to connect have a “leg” in the same row? ◦ Are the “legs” of each component in different rows? ◦ Is the LED seated the correct direction? This is perhaps the most common misstep. Try reversing the LED and see if it works. Once you have basked in the glow of the LEDs, it's time for teardown. Log in to the Pi (pi, library). At the command prompt, immediately issue the “sudo shutdown -h now” command, and watch the Pi shut down. Notice that the LED continues to glow after the shutdown completes – this is important. Just because the operating system is down doesn't mean the hardware itself is off. Disconnect power from the Pi, and tear it down. Straighten the resistors again for storage, and be sure that all electrical components go back to the kits from which they came.

×