Assignments
Group Assignment
- Send a message between two projects.
Individual Assignment
- Design, build and connect wired or wireless node(s) with network or bus addresses and a local input and/or output devices.
GROUP ASSIGNMENT
More specific detailed from the worked done with Ernesto Castro in Fab Lab Universidad de Lima here
S E N D a m e s s a g e

Both Ernesto and I had our boards designed and fabricated from week 6 and week 8. So, for this group assignment we decided to communicate each. He was at 14km from me, and tried to connect our boars by wifi. Connecting to a broker server with MQTT Broker and each wifi. For my case I connected to wifi from my celphone to have good connection.


Mottor moved by a button.
TEST 1: button -> motor
First, the current is measured in amperes. I had to make sure the multimeter is in the correct mode to amperes.
It measured 0.1 ohms.
Led rgb V O L T A G E f o r m u l a:
FIRST ATTEMPT
V: is the voltage in volts
I: is the current in amperes
R: is the resistance in ohms

Resistance
V = I X R
First, the current is measured in amperes. I had to make sure the multimeter is in the correct mode to amperes.
It measured 0.1 ohms.

Voltage in volts
V = X R
First, the current is measured in amperes. I had to make sure the multimeter is in the correct mode to amperes.
It measured 2.2 volts.
V = I X R
V=2.2
Individual extra assignment
Once I measure the power consumption of the LED RGB as one, I asked my instructor if it was the same for each color. However as this led works with 3 different colors that need 3 different pins, the power is not the same. Each color needs its own power. So I made another measure by myself to be sure about the power of its color.
R G B powerconsumption
Diagram of how I measure each led
To measure each color I had to interrupt the circuit between the color pin. So I extended the circuit in a breadboard and make this diagram to identify the different energy consumption each led makes following this diagram:
Diagram of how I measure each led
I identify 3 moments to measure: Each led directly to VCC, resistance between each led and their pins, and the energy difference between each resistance and VCC.
voltage
LED
LED + R
Red
1.38 v
0.46
0.46
Blue
3.3 v
1.77
2
Green
3.3 v
1.77
3.67
CONCLUSION:
For the led rgb each color makes an specific energy consumption to show its color. It is different to measure each part of the circuit since each component makes something specific. And all this is important to make sure the energy supplier is enough.
INDIVIDUAL ASSIGNMENT
For this assignment I decided to try for output a led rgb since my final project will need a lot of color combinations and for now I tried to catch the colors i wanted and make a palette for the final.
Personal assignments left by the local instructor
- PCB board for the led rgb. ☑
- Programm the led rgb colors ☑
- Try to cut or print a case for the led.
Output LED RGB tested
before starting
First I tried the rgb led in a breadborad to make sure to understand how it works. And tried to programm to turn on each led color in its pure code being 0 the maximum color of each led (because it is common anode) and 255 turn off.
pcb board solded
The first code I made to understand each color:
Red
255
Blue
255
Green
0
I turn on the green led by being the only one at 0 and the other two at 255.
As this rgb led works with common anode 255 is to turn off the color and 0 is the maximum of the pure color.For this test I only turn the colors in a void loop.
int ledRojo = 9;
int ledVerde = 8;
int ledAzul = 7;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
void loop() {
//
analogWrite(ledRojo, 255);
analogWrite(ledVerde, 0);
analogWrite(ledAzul, 255);
}
Personal assignments
1. PCB board LED RGB
In week 8 I made my pcb board thinking about connecting in the future a board with a rgb led since I knew I need it for my final project. So apart from free pins to try different components I exclusively make a space for this output board. I left for it 4 digital pins, two VCC pins and one for GND. The plan for this was to connect this new board directtly yo the pins without using cables.
Week 8 pcb board
Then I made the schematic and the pcb design for TWO rgb leds controlled by the same pins. So they will change in pair. I tried this since for the final project all the leds will be the same since I dont have 20 free pins.
PCB design process
From weeks before I fabricated from the schemtic design the board for two leds. I had some problems soldering the components as it is really small but I did my best at the end.
When I was solding the pcb I noice I didn't consider that the connection will be upside down since is on the other side of the board. However it still works and better because I am left blind by the led intensity so being upside down helps with eyes a lot.
lgb board upside down
2. Programm the led rgb colors
So in a previous test I understand how the values of each rgb color worked. So, for this week I want to test finding a color palette I like for my final lightstick.
Chaging intensity of the first color of the palette:
Red
0
0
0
0
0
0
0
0
0
0
Blue
0
0
0
0
0
0
0
0
0
0
Green
25
50
75
100
125
150
175
200
225
255
Magenta I want to find a variation of magenta from more intense to less intense pink. So I made the code to decrease green in steps of 25 in 10 changes of color between 1 sec.
for (int verde = 255; verde >= 0; verde -= 25) {
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
void loop() {
for (int verde = 255; verde >= 0; verde -= 25) { // Decreases green in steps of 25
analogWrite(ledRojo, 0); // RED max
analogWrite(ledVerde, verde); // Green gradually decreases
analogWrite(ledAzul, 0); // BLUE max
delay(1000); // 1 sec between each
}
}
10 changes of magenta in 10 seconds
Finding the 3 main colors of the palette:
RGB
PINK
BLUE
PURPLE
Red
0
200
150
Blue
0
0
50
Green
200
255
255
I want the main colors to be pink, blue and purple. To find the palette I first wanted to find the 3 shades of this colors I prefer. After mixing a lot of values these are the 3 I like the most.
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
void loop() {
// PINK
analogWrite(ledRojo, 0); // MAX
analogWrite(ledVerde, 200); // LITTLE GREEN
analogWrite(ledAzul, 0); // MAX
delay(2000);
// PURPLE
analogWrite(ledRojo, 150); // MEDIUM RED
analogWrite(ledVerde, 255); // OFF
analogWrite(ledAzul, 50); // MUCH BLUE
delay(2000);
// BLUE
analogWrite(ledRojo, 200); // MEDIUM RED
analogWrite(ledVerde, 255); // OFF
analogWrite(ledAzul, 0); // MAX
delay(2000);
}
Color picks for the palette
Fading colors for a smooth change:
For fading the color change I ask chat gpt how I can make the color change better than just looping between 2 seconds with this prompt:
I have this code and I want it to change color between each code smooth:
void loop() {
// PINK
analogWrite(ledRojo, 0);
analogWrite(ledVerde, 200);
analogWrite(ledAzul, 0);
delay(2000);
// PURPLE
analogWrite(ledRojo, 150);
analogWrite(ledVerde, 255);
analogWrite(ledAzul, 50);
delay(2000);
// BLUE
analogWrite(ledRojo, 200);
analogWrite(ledVerde, 255);
analogWrite(ledAzul, 0);
delay(2000);
}
I found out this is the main code why it makes the color fade after finding the intermediate color of each combination:
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) {
for (int i = 0; i <= steps; i++) {
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
// fade to color
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) {
for (int i = 0; i <= steps; i++) {
// intermediate color between each
int r = map(i, 0, steps, r1, r2);
int g = map(i, 0, steps, g1, g2);
int b = map(i, 0, steps, b1, b2);
// apply this value to each color
analogWrite(ledRojo, r);
analogWrite(ledVerde, g);
analogWrite(ledAzul, b);
delay(delayTime);
}
}
void loop() {
// PINK TO PURPLE
fadeToColor(0, 200, 0, 150, 255, 50, 100, 20); // 100 pasos, 20ms de delay
delay(1000); // Pausa de 1 segundo al final de la transición
// PURPLE TO BLUE
fadeToColor(150, 255, 50, 200, 255, 0, 100, 20);
delay(1000);
// BLUE TO PINK
fadeToColor(200, 255, 0, 0, 200, 0, 100, 20);
delay(1000);
}
Fading 3 main colors
What's next?
- The light is too intense. I need to find a way to fade this to the eye. I can make a traslucent case of resin or maybe transparent PLA to try to smooth this light.
- Make the microphone board and try it.
Update. Week 14
I have been trying materials to see which difuses the light the better to make the case for the leds that will be the modules od my final lightstick.
I tried with Aqua Clear 8K Resin:
And with transparent PolyLite PETG:

Diagram of how I measure each led
To measure each color I had to interrupt the circuit between the color pin. So I extended the circuit in a breadboard and make this diagram to identify the different energy consumption each led makes following this diagram:

Diagram of how I measure each led
I identify 3 moments to measure: Each led directly to VCC, resistance between each led and their pins, and the energy difference between each resistance and VCC.
voltage | LED | LED + R | |
---|---|---|---|
Red | 1.38 v | 0.46 | 0.46 |
Blue | 3.3 v | 1.77 | 2 |
Green | 3.3 v | 1.77 | 3.67 |
CONCLUSION:
For the led rgb each color makes an specific energy consumption to show its color. It is different to measure each part of the circuit since each component makes something specific. And all this is important to make sure the energy supplier is enough.
INDIVIDUAL ASSIGNMENT
For this assignment I decided to try for output a led rgb since my final project will need a lot of color combinations and for now I tried to catch the colors i wanted and make a palette for the final.
Personal assignments left by the local instructor
- PCB board for the led rgb. ☑
- Programm the led rgb colors ☑
- Try to cut or print a case for the led.
Output LED RGB tested
before starting
First I tried the rgb led in a breadborad to make sure to understand how it works. And tried to programm to turn on each led color in its pure code being 0 the maximum color of each led (because it is common anode) and 255 turn off.

pcb board solded
The first code I made to understand each color:
Red | 255 |
Blue | 255 |
Green | 0 |
I turn on the green led by being the only one at 0 and the other two at 255.
As this rgb led works with common anode 255 is to turn off the color and 0 is the maximum of the pure color.For this test I only turn the colors in a void loop.
int ledRojo = 9; int ledVerde = 8; int ledAzul = 7; void setup() { pinMode(ledRojo, OUTPUT); pinMode(ledVerde, OUTPUT); pinMode(ledAzul, OUTPUT); } void loop() { // analogWrite(ledRojo, 255); analogWrite(ledVerde, 0); analogWrite(ledAzul, 255); }
Personal assignments
1. PCB board LED RGB
In week 8 I made my pcb board thinking about connecting in the future a board with a rgb led since I knew I need it for my final project. So apart from free pins to try different components I exclusively make a space for this output board. I left for it 4 digital pins, two VCC pins and one for GND. The plan for this was to connect this new board directtly yo the pins without using cables.
Week 8 pcb board
Then I made the schematic and the pcb design for TWO rgb leds controlled by the same pins. So they will change in pair. I tried this since for the final project all the leds will be the same since I dont have 20 free pins.
PCB design process
From weeks before I fabricated from the schemtic design the board for two leds. I had some problems soldering the components as it is really small but I did my best at the end.
When I was solding the pcb I noice I didn't consider that the connection will be upside down since is on the other side of the board. However it still works and better because I am left blind by the led intensity so being upside down helps with eyes a lot.
lgb board upside down
2. Programm the led rgb colors
So in a previous test I understand how the values of each rgb color worked. So, for this week I want to test finding a color palette I like for my final lightstick.
Chaging intensity of the first color of the palette:
Red
0
0
0
0
0
0
0
0
0
0
Blue
0
0
0
0
0
0
0
0
0
0
Green
25
50
75
100
125
150
175
200
225
255
Magenta I want to find a variation of magenta from more intense to less intense pink. So I made the code to decrease green in steps of 25 in 10 changes of color between 1 sec.
for (int verde = 255; verde >= 0; verde -= 25) {
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
void loop() {
for (int verde = 255; verde >= 0; verde -= 25) { // Decreases green in steps of 25
analogWrite(ledRojo, 0); // RED max
analogWrite(ledVerde, verde); // Green gradually decreases
analogWrite(ledAzul, 0); // BLUE max
delay(1000); // 1 sec between each
}
}
10 changes of magenta in 10 seconds
Finding the 3 main colors of the palette:
RGB
PINK
BLUE
PURPLE
Red
0
200
150
Blue
0
0
50
Green
200
255
255
I want the main colors to be pink, blue and purple. To find the palette I first wanted to find the 3 shades of this colors I prefer. After mixing a lot of values these are the 3 I like the most.
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
void loop() {
// PINK
analogWrite(ledRojo, 0); // MAX
analogWrite(ledVerde, 200); // LITTLE GREEN
analogWrite(ledAzul, 0); // MAX
delay(2000);
// PURPLE
analogWrite(ledRojo, 150); // MEDIUM RED
analogWrite(ledVerde, 255); // OFF
analogWrite(ledAzul, 50); // MUCH BLUE
delay(2000);
// BLUE
analogWrite(ledRojo, 200); // MEDIUM RED
analogWrite(ledVerde, 255); // OFF
analogWrite(ledAzul, 0); // MAX
delay(2000);
}
Color picks for the palette
Fading colors for a smooth change:
For fading the color change I ask chat gpt how I can make the color change better than just looping between 2 seconds with this prompt:
I have this code and I want it to change color between each code smooth:
void loop() {
// PINK
analogWrite(ledRojo, 0);
analogWrite(ledVerde, 200);
analogWrite(ledAzul, 0);
delay(2000);
// PURPLE
analogWrite(ledRojo, 150);
analogWrite(ledVerde, 255);
analogWrite(ledAzul, 50);
delay(2000);
// BLUE
analogWrite(ledRojo, 200);
analogWrite(ledVerde, 255);
analogWrite(ledAzul, 0);
delay(2000);
}
I found out this is the main code why it makes the color fade after finding the intermediate color of each combination:
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) {
for (int i = 0; i <= steps; i++) {
int ledRojo = 10;
int ledVerde = 9;
int ledAzul = 8;
void setup() {
pinMode(ledRojo, OUTPUT);
pinMode(ledVerde, OUTPUT);
pinMode(ledAzul, OUTPUT);
}
// fade to color
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) {
for (int i = 0; i <= steps; i++) {
// intermediate color between each
int r = map(i, 0, steps, r1, r2);
int g = map(i, 0, steps, g1, g2);
int b = map(i, 0, steps, b1, b2);
// apply this value to each color
analogWrite(ledRojo, r);
analogWrite(ledVerde, g);
analogWrite(ledAzul, b);
delay(delayTime);
}
}
void loop() {
// PINK TO PURPLE
fadeToColor(0, 200, 0, 150, 255, 50, 100, 20); // 100 pasos, 20ms de delay
delay(1000); // Pausa de 1 segundo al final de la transición
// PURPLE TO BLUE
fadeToColor(150, 255, 50, 200, 255, 0, 100, 20);
delay(1000);
// BLUE TO PINK
fadeToColor(200, 255, 0, 0, 200, 0, 100, 20);
delay(1000);
}
Fading 3 main colors
What's next?
- The light is too intense. I need to find a way to fade this to the eye. I can make a traslucent case of resin or maybe transparent PLA to try to smooth this light.
- Make the microphone board and try it.
Update. Week 14
I have been trying materials to see which difuses the light the better to make the case for the leds that will be the modules od my final lightstick.
I tried with Aqua Clear 8K Resin:
And with transparent PolyLite PETG:

Week 8 pcb board




PCB design process
From weeks before I fabricated from the schemtic design the board for two leds. I had some problems soldering the components as it is really small but I did my best at the end.


lgb board upside down
Red | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Blue | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Green | 25 | 50 | 75 | 100 | 125 | 150 | 175 | 200 | 225 | 255 |
Magenta I want to find a variation of magenta from more intense to less intense pink. So I made the code to decrease green in steps of 25 in 10 changes of color between 1 sec.
int ledRojo = 10; int ledVerde = 9; int ledAzul = 8; void setup() { pinMode(ledRojo, OUTPUT); pinMode(ledVerde, OUTPUT); pinMode(ledAzul, OUTPUT); } void loop() { for (int verde = 255; verde >= 0; verde -= 25) { // Decreases green in steps of 25 analogWrite(ledRojo, 0); // RED max analogWrite(ledVerde, verde); // Green gradually decreases analogWrite(ledAzul, 0); // BLUE max delay(1000); // 1 sec between each } }
10 changes of magenta in 10 seconds
Finding the 3 main colors of the palette:
RGB | PINK | BLUE | PURPLE |
---|---|---|---|
Red | 0 | 200 | 150 |
Blue | 0 | 0 | 50 |
Green | 200 | 255 | 255 |
I want the main colors to be pink, blue and purple. To find the palette I first wanted to find the 3 shades of this colors I prefer. After mixing a lot of values these are the 3 I like the most.
int ledRojo = 10; int ledVerde = 9; int ledAzul = 8; void setup() { pinMode(ledRojo, OUTPUT); pinMode(ledVerde, OUTPUT); pinMode(ledAzul, OUTPUT); } void loop() { // PINK analogWrite(ledRojo, 0); // MAX analogWrite(ledVerde, 200); // LITTLE GREEN analogWrite(ledAzul, 0); // MAX delay(2000); // PURPLE analogWrite(ledRojo, 150); // MEDIUM RED analogWrite(ledVerde, 255); // OFF analogWrite(ledAzul, 50); // MUCH BLUE delay(2000); // BLUE analogWrite(ledRojo, 200); // MEDIUM RED analogWrite(ledVerde, 255); // OFF analogWrite(ledAzul, 0); // MAX delay(2000); }



Color picks for the palette
Fading colors for a smooth change:
For fading the color change I ask chat gpt how I can make the color change better than just looping between 2 seconds with this prompt:
I have this code and I want it to change color between each code smooth: void loop() { // PINK analogWrite(ledRojo, 0); analogWrite(ledVerde, 200); analogWrite(ledAzul, 0); delay(2000); // PURPLE analogWrite(ledRojo, 150); analogWrite(ledVerde, 255); analogWrite(ledAzul, 50); delay(2000); // BLUE analogWrite(ledRojo, 200); analogWrite(ledVerde, 255); analogWrite(ledAzul, 0); delay(2000); }
I found out this is the main code why it makes the color fade after finding the intermediate color of each combination:
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) {
for (int i = 0; i <= steps; i++) {
int ledRojo = 10; int ledVerde = 9; int ledAzul = 8; void setup() { pinMode(ledRojo, OUTPUT); pinMode(ledVerde, OUTPUT); pinMode(ledAzul, OUTPUT); } // fade to color void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int steps, int delayTime) { for (int i = 0; i <= steps; i++) { // intermediate color between each int r = map(i, 0, steps, r1, r2); int g = map(i, 0, steps, g1, g2); int b = map(i, 0, steps, b1, b2); // apply this value to each color analogWrite(ledRojo, r); analogWrite(ledVerde, g); analogWrite(ledAzul, b); delay(delayTime); } } void loop() { // PINK TO PURPLE fadeToColor(0, 200, 0, 150, 255, 50, 100, 20); // 100 pasos, 20ms de delay delay(1000); // Pausa de 1 segundo al final de la transición // PURPLE TO BLUE fadeToColor(150, 255, 50, 200, 255, 0, 100, 20); delay(1000); // BLUE TO PINK fadeToColor(200, 255, 0, 0, 200, 0, 100, 20); delay(1000); }
Fading 3 main colors
What's next?
- The light is too intense. I need to find a way to fade this to the eye. I can make a traslucent case of resin or maybe transparent PLA to try to smooth this light.
- Make the microphone board and try it.
Update. Week 14
I have been trying materials to see which difuses the light the better to make the case for the leds that will be the modules od my final lightstick.
I tried with Aqua Clear 8K Resin:


And with transparent PolyLite PETG:

