Week 09 - Output devices

RGB LED

Using SAMD11 microcontroller as development board from Week 08

1. Very usefull basics reference from SAMDino from Adrián Torres in Fab Lab León.

2. Checking available pins from SAMD11 datasheet and schematic from development board, which are: 5, 8, 9.


KiCad

Schematic design

***Before tracing: Set as default

It's important to change the tracing values for a correct offset between the design paths.

Go to: File / Board Setup / Net Classes

  1. - Clearance: .4 mm
  2. - Track Width: .3 mm
  3. - Via Size: 1.2 mm
  4. - Via Hole: .8 mm

Traces

1. Arrange and connect components according to schematic design.

2. Before exporting the board check that everything is correct through the "Design Rules checker":

3. Some of the Errors & Warnings are because I haven't drawn the outline of the board and not attached traces for the touch pads.

4. Export board to SVG file.


Customize board

1. Open SVG file using Adobe Illustrator to invert colors for mods.

2. Black: removes // White: keeps

3. Export "Traces" and "Outline" seperatly as PNG file with 1000 dpi quality each.


Modsproject parameters

1. Open modsproject.org / right click anywhere / select programms / look for SRM-20 milling / select "mill 2D PCB".

2. Upload the Tracing file that was customized.

3. Select from the box below the option mil traces (1/64), we begin with the smallest bit to trace our design.

4. On the "Roland SRM-20 milling machine" box we change the following settings according to the 1/64 bit:

  1. - Speed: 3 mm/s
  2. - Origin: x,y,z = 0
  3. - Jog height: 5 mm (elevation of the bit each time it moves)
  4. - Home (z): keet high just for safety of the bit

5. On the "mill raster 2D" box, change the offset number to 4 as a default and safety tracing. This number could vary from 3 or 4.

6. Press "Calculate" to generate a preview and automatic download of the machine's tracing path. See preview (blue lines).

7. Upload first the Outline png file.

8. Select from the box below the option mil outline (1/32), we continue with the bigger bit to do the final cut of the board.

9. On the "Roland SRM-20 milling machine" box we change the following settings according to the 1/32 bit:

  1. - Speed: .5 mm/s (we need to lower the speed to avoid pushing the bit and breaking it)

10. Press "Calculate" to generate the preview.


Roland SRM-20 milling machine

Setting PBC board & milling bits

1. [First image - left] Grab PCB and apply double side tape on the non-copper face. Leave extra space for peeling the side and not affect the base leveling.

2. [Second image - left] Open software / Set XY and Z using up/down/right/left keys until it's leveled.

3. [Third image - right] Change bit to 1/64 since we are starting with the tracing file / Set Z carefully dropping the bit so it touches the board.

***IMPORTANT: Make a spindle test to ensure the bit is leveled and avoid missed cuts.

4. On the software, select "Cut" and add the tracing file / press "Output" to start.

Components + Soldering

  1. - RGB LED: (1)
  2. - Resistor 1K: (2) for Red and Green light
  3. - Resistor 499: (1) for Blue light
  4. - Socket: Horizontal 5 pin (1)

Arduino set up

Basic RGB blink

1. Overwrite the blink example from Arduino by substituting the pins 5, 8 and 9.

Basic Code

void setup() {
        // initialize digital pin LED_BUILTIN as an output.
        pinMode(5, OUTPUT);
        pinMode(8, OUTPUT);
        pinMode(9, OUTPUT);
      }
      
      // the loop function runs over and over again forever
      void loop() {
        digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(5, HIGH);  // turn the LED off by making the voltage LOW
                                //delay(1000);                      // wait for a second
        digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage level)
        digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(5, HIGH);  // turn the LED off by making the voltage LOW
        digitalWrite(8, HIGH);  // turn the LED off by making the voltage LOW
        //delay(1000);                      // wait for a second
        digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(8, HIGH);  // turn the LED off by making the voltage LOW
                                //delay(1000);                      // wait for a second
        digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)
        digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(8, HIGH);  // turn the LED off by making the voltage LOW
        digitalWrite(9, HIGH);  // turn the LED off by making the voltage LOW
        //delay(1000);                      // wait for a second
        digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(9, HIGH);  // turn the LED off by making the voltage LOW
        //delay(1000);                      // wait for a second
        digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage level)
        digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage level)
        delay(1000);            // wait for a second
        digitalWrite(9, HIGH);  // turn the LED off by making the voltage LOW
        digitalWrite(5, HIGH);  // turn the LED off by making the voltage LOW
        //delay(1000);                      // wait for a second
      }
      

Resources

SAMDino from Adrián Torres.

KiCAD

Modsproject

Josep Martí // Fab Lab Barcelona lead instructor

Adai Suri // Fab Lab Barcelona instructor

Files

Download the KiCAD ZIP package here.