Week 11 Lab Report
Objective – to control our RGB LED with3 potentiometers and alter the code and change the output
Materials – Arduino Uno, bread board, 3 potentiometers, wires, one RGB LED, 3 220 ohm resistors. Arduino Playground code (RGB LED Color Chooser)
Procedure –
Visually inspect all elements
Find code on line
Wire potentiometers to bread board (done according to lights on RGB LED – red into power, black to ground and yellow) One had to be put back because it had a lot of gook on it and it wouldn’t fit in slot
LED to bread board Must determine if longest is power or ground. To do this we went into Arduino code and loaded blink file. This proves that it is ground. (By changing out the pin on the LED so that we can test it we to observe that one of the colors – green – is broken. So we switch LEDs and test it and the problem is resolved.
Arduino to bread board
We then attach the signal wires (yellow) from the potentiometers to the bread board
We then attach the resistors to our bread board
Then the bread board is connected to Arduino
First we connect the bread board power strip to the Arduino 5v input pin
Then bread board’s ground strip to the ground pin
Then the power pins to the Arduino – but we still have too determine which pins run to which LED channel
According to the code our red to 9, green to 10 and blue to 11
Next we cut and past the playground code into the Arduino IDE, compile it, and then we SHOULD have control over each color with each potentiometer.
Green worked but blue and red didn’t
So we changed slots on the board. That didn’t fix the problem so we then we switched the potentiometer that worked and wired it to the LED color that didn’t
Unfortunately the green LED lit up again. This meant that we really missed the source of the problem
We then realized that we were off by one pin on the connection to the Uno so we moved it over and rewired the potentiometer
Blue still not working properly
After switching out the potentiometer again the blue LED still didn’t light up
Blue still beyond our control
Prof Baker determined that we were running resistors in series instead of into 0,1,2
So we tried that. Then to the resistors then to the power – this didn’t work either.
We then try to run to pins 9, 10, 11
We then switch the resistor for the blue
YAY – it works!!!! Thank you Miguel
Result – This process was very trial and error. In the end, it was a faulty resistor that was causing all our problems. Once we swapped it out we had a fully functioning LED with each channel controlled by a different potentiometer.