WEEK 12
OUTPUT DEVICES

ASSIGNMENT DETAILS:add an output device to a microcontroller board you've designed, and program it to do something.

This was a bit of a weird week in that I made many similar mistakes in my assignment which pushed me a bit behind schedule. I am still planning to return to this week as I complete my final project as the two are related.



BOARD #1

My first attempt was to start re-drawing Neil's example but adding extra pads for future use with NeoPixels. I wanted to understand the relationship between the components by re-drawing it in Eagle before designing a custom board.


I was able to visit a local Fab Lab and had a chance to use their Roland MDX 50. I appreciated that you can home your z-axis with a homing sensor/puck anywhere on the plate. I definitely did not have the depth issues I have been experiencing with the Carvey.



---> Hello Frankenboard!!

The following board is an example of what happens when you rush a process. Although I managed to salvage the board, the end result is a Frankenstein-like creation with several errors. This seems to be a common thread in my learning. I need to change a part and I end up with some monstrosity. I am sharing it with the world as opposed to tucking it away. I learned that these RGB LED's are a pain to solder and very easy to orient the wrong way. The part number for this specific LED is:

---> CLV1A-FKB-CK1N1G1BB7R4S3CT-ND

Like many components, the notch or the line usually identify cathode, or anode. For this LED it is R.


It is important to note that I was following the schematic and the layout of the part. If you look at the Eagle board above you will see that I matched the labeling. However, this LED is not the same. R is in where B is supposed to be.


I started by reorganizing the resistors to match the new orientation.


Traces were burning out on me. This board was cut with FR4 pcb material. We were careful with it and it was milled in the machine enclosure. It seemed that the traces burnt off more easily. Anyways, I had to get creative to find a solution to fix this problem so I started using wire and jumpers. I would suggest NOT to use braided copper wire. It is harder to work with and can get messy. There is always the chance that some strands of copper will stray away and create shorts.


Tthe 1206 SMD 0 ohm jumpers were not going to work. I soldered wires to the bottom of the LED thinking this would make it easier.


Wow! Look at this beuty! Enough said. But... it passed continuity tests.


Next I needed to program the board. I was more curious than anything to see if this thing would work. I attached my FabISP and loaded a sample code from Adafruit found HERE and then using the Arduino IDE I successfully uploaded the sketch using Sketch / Upload Using Programmer. I had to adjust the pins to match the ATTiny45 and I also had to add back the line #define COMMON_ANODE because the RGB LED I was using had a common anode and not a common cathode.

/*Modified from 
Adafruit Arduino - Lesson 3. RGB LED
*/

int redPin = 2;
int bluePin = 1;
int greenPin = 0;

#define COMMON_ANODE

void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
}

void loop()
{
  setColor(0, 0, 255);  // blue
  delay(1000);
  setColor(255, 255, 255);  // white
  delay(1000);
  setColor(255, 0, 0);  // red
  delay(1000);
  setColor(0, 0, 255);  // blue
  delay(1000);
  setColor(80, 0, 80);  // purple
  delay(1000);
  setColor(255, 255, 0);  // yellow
  delay(1000);  
}

void setColor(int red, int green, int blue)
{
  #ifdef COMMON_ANODE
    red = 255 - red;
    green = 255 - green;
    blue = 255 - blue;
  #endif
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

The code seemed to work although it did not pass the smoke test. I started to smell burning.

>


---> failed smoke test

After all this work, when I plugged the board in with an external source there was smoke. Upon review, my voltage regulator was designed on the wrong side of the power input. This means unregulated power was going through the board. I have been pretty lucky in Fab Academy with my boards but today was not my day.




BOARD #2

I decided I would design and build a new board. This time I moved the LED to the front of the board.


I had it up and running but there was something clearly wrong. It also started getting hot. In the end it was not the regulator. There was a short under one of the resistors. I also broke off the external power supply but I could still test the board without an external supply.

Lastly, I realized why I had been having so many issues with the LED. I am using an older version of the part. There is a newer part in the Fab Library that I somehow missed.



BOARD #3

I decided yet again that I would make another board. Although this one is not yet finished. First order of business was to add the new version of the LED. The labels were now right and the pads much bigger.


I updated my board design and got it ready for milling.


As per usual. I had to divide the scale png that comes from Eagle before loaded it into Easel.

When in Easel, I checked to make sure that all the traces were properly separated.

Now that I have had some time with Carvey I have learned a few tricks and the best settings for a good PCB milling experience. For whatever reason, I could never get the right depth. No matter my settings, it would seem to do a minimum depth of .5 mm and I needed something more like .2mm. My trick has been to actually shim the smart clamp with a couple pieces of paper. It seems crazy but it works. I then use the following settings:

---> layer depth - 0.002in (Easel works better in imperial for anything under .5 mm).
---> Cut settings - 0.002in Depth Per Pass


A new board is formed with the proper parts in the Eagle file. It was much easier to solder with the big pads.


Finally! Working nicely. Here are a couple samples. I used the Arduino again.



NEOPIXEL

As I working with LED's is part of my final project. I thought I should try making another board based on the hello board but with an output to Neopixels. Doing this is very simple. It just requires a pin for data, VCC, and GND.


Here are the Neopixels running the NeoPixel example in Arduino. This was just a quick test to keep me motivated. I still need to load Logo on this board and get that to work.