WEEK 9

Output Devices

Group Assignment:

Individual Assignment:

  • Add an output device to a microcontroller board you've designed, and program it to do something.

1. Tools and overall look

This week, I aimed to work with RGB LED as an output device. Also, this experiment will help me to develop my final project. During the process, I used the following tools and items.

Component Name Purpose of Having
3 Female Cable Attaching to LED
3 Male to Female Cable Connecting the PCB to the breadboard.
Wire Striper Peeling to cable skin for soldering.
Power Supply Supplying power to LED.
Force Sensitive Sensor Using like a button.
Breadboard Connecting sensor, PCB and LED to each other.
RGB LED Output device.
My pcb design Controlling the circuit .

Here you can find my pcb design.

2. Preparing RGB LED

It was my first time working with LED and power suppliers, so my instructor helped me with it. Firstly we cut one side of the 3 female cables and then peeled them with wire stripper. Thus, we could solder them to LED.

  • The black cable is used for ground.
  • The red cable is for 5V.
  • The orange cable is for transferring information such as color and brightness from PCB to LED.
wiring

3. Connecting led to Power Supplier

To connect the LED to the power supplier, we used two big different cables. To turn on the power supply, you should plug in the cable and then switch on it. To send electricity through the cables, you should turn on the output. I set the voltage as 5V. Because RGB LEDs output says 5V. On the power supplier;

  • Red cable goes to 5V.
  • Black goes ground.
power supply

4. Connecting led to PCB

To connect the PCB to the LED and power supplier, we attached the orange cable to the breadboard. For the orange cable, it wasn't important which pin of PCB they needed to connect. However, for the red and black cables, we choose the ground and 5V pins.

5. Controlling RGB LED

For controlling the LED I combined the button codes from the embedded programming week and example "Adafruit NeoPixel" codes.

Here you can find codes for FSR and button.

Adafruit NeoPixel codes
Adafruit NeoPixel codes
  • Similar to the button code, to turn on the LED, value must be bigger than 1022.
  • pixels.setPixelColor(i, pixels.Color(102, 102, 255)) —-- This line set LED color.
  • pixels.clear(); --- use for turning off the LEDs, when all of them turn on.

6. Testing RGB LED

For testing I changed the colors of the LEDs. I picked one of the blue shades on the RGB color generator.

RGB color generator.

7. Testing power supply for group Assignment

Aim of the test: How does current affect the LED? I tested my LED connected to my PCB as an output device for the assignment. For the test, I used these components;

  • Power supplier.
  • Black and red cables for power supplier.
  • My circuit design- It has RGB LED which can be controlled with a touch-sensitive resistor.
circuit design
Steps of the first test;
  1. Voltage was around 5.
  2. Current was around 10
  3. I pressed the FSR.

Led worked as usual. I didn't observe any strange situation.

circuit design
Steps of the second test;
  1. Voltage was around 5.
  2. I aimed to change the current for the circuit. Therefore I used the rotating switch of the supplier and I went up.
  3. I pressed the FSR.

LED worked as in the first test. I didn't observe any change.

circuit design
Result of test;

The current depends on how much voltage the circuit needs. The reason why I couldn't observe any change on the LED even if I tried to change the current on the power supplier, the need of voltage for the circuit is stable.