Week 1-4    Using an Arduino to control LEDs and SSDs

1. Introduction

In this lecture, we used an Arduino Uno  R3 to control LED lights and  SSD's. We learned about the GPIO pins, LED's, SDD's, and using I/O to work with external hardware and complete this project.

2. The Code and the Results

In Figure 1 we can see an example where we used an internal pin on the Arduino to light up it's onboard LED.

Figure 1. An example of using an internal pin to light up the onboard LED


In Figure 2 we can see an example where we use a regular pin on the Arduino to recreate the same light up sequence we did on the onboard LED in the last example.

Figure 2. An example blinking an external LED using the Arduino


In Figure 3 we can see an example of 'running LEDs' where the LEDs are turned on and off in order.

Figure 3. An example of 'running LEDs' using an Arduino


In Figure 4 we can see an example of using a button to light up an LED by reading the button.

Figure 4. An example of using a button directly to light up an LED


In Figure 5 we can see an example of using the push button to turn the LED off when it's already on by reading the push button.

Figure 5. An example of using a push button to turn off an LED


In Figure 6 we can see an example of using a push button to set the state of the LED. When it is not pushed, the LED is off. When it is pushed, it will blink once per second.

Figure 6. An example of a push button changing the state of the LED


In Figure 7 we can see an example of using a push button to set the state of the LED. When it is not pushed, the LED blinks four times per second. When it is pushed, it will blink once per second.


Figure 7. An example of a push button changing the state of the LED


In Figure 8 we can see the digits 0-9 displayed by manually removing power from the necessary inputs.



Figure 8. The digits 0-9 displayed by manually removing power


In Figure 9 we are using a decoder and four connections to the Arduino to control the 8 inputs of the SSD to display the numbers 0-9.


Figure 9. An example using a decoder to display the digits 0-9 using only 4 board connections


In Figure 10 we can see an example of using a single wire to control the 8 inputs of the SSD using a shift register. This example is using the LSBFIRST method.


Figure 10. An example of using a shift register to control an SSD using a shift register


In Figure 11 we can see the final example of using the same methos to diplay 4 digits to a 4-digit SSD. This can be done by displaying each number individually in the loop, then ensuring it is fast enough the effect looks constant.



Figure 11. An example of displaying 4 digits to a 4-digit SSD using a shift register