Colors

One of my PCOMP students wants to randomly select a set of RGB values from a predetermined list. It’s the sort of things where I know the concept is easy but the execution is a bit more difficult only because I’ve done it in other languages/environments, but not in an Arduino sketch.

The nice thing about programming is that once you know how to do something using one language, the concepts transfer over to other languages, and it becomes mostly a matter of figuring out the syntax and method to make it all work.

Here’s an example sketch that allows you to have a list (array) of RGB values and then randomly select one and return it, split the r, g, b into their own integer variables, and then print them to the serial monitor. (The final version will use analogWrite to control RGB LEDs.)

// RandomColor.ino

void setup() {
  Serial.begin(9600);
  randomSeed(analogRead(A0));
}

void loop() {
  char* rgb = returnColors();
  int r, g, b;
  if (sscanf(rgb, "%d,%d,%d", &r, &g, &b) == 3) {
    Serial.print(r);
    Serial.print(", ");
    Serial.print(g);
    Serial.print(", ");
    Serial.println(b);
  }
  delay(500);
}

char* returnColors() {
  char* myColors[6];
  myColors[0] = "128,0,0";
  myColors[1] = "0,128,0";
  myColors[2] = "0,0,128";
  myColors[3] = "255,0,0";
  myColors[4] = "0,255,0";
  myColors[5] = "0,0,255";
  int colorIndex = random(0,6);
  char* result = myColors[colorIndex];
  return (result);
}

Obviously the list can be much larger than just six elements, but this is example code to be expanded upon.

Teensy BOB 1.4

The folks at Seeed Studio got in touch with me about their Fusion PCB Service and asked if I wanted to try it out. I’ve ordered stuff from Seeed Studio over the last five years or so, and I’ve never been disappointed with their products, and since they offered a coupon to save on an order, I decided to give it a try.

PCB Options

My previous PCB was the Teensy LC BOB v1.3. I ended up making a very small revision and released v1.4, which is the board I used for this Fusion PCB order. I’ve ordered these from OSH Park and they turned out good, so I wanted to compare ordering from Seeed Studio.

I should mention that I am not an Electrical Engineer, but a maker & hacker who learns things by trial and error. I’ve managed to get lucky with the PCBs I’ve ordered and part of that success has probably been due to the sensible defaults that OSH Park uses. By comparison, when uploading my Gerber files to the Fusion PCB service, I was a little overwhelmed. (See image above.) The choices… so many choices! While I didn’t know exactly what every option was, it was easy to choose them and see how it affected the price. Many options caused the price to go up by 2 or 3 or 10 times the amount. This made it easy to decide what not to choose. The one choice that is nice are the colors. OSH Park boards are purple, but you can get Fusion boards in green, red, yellow, blue, white, or black, which is great.

The one tricky form value you need to deal with is Dimensions. By default it is set to 70mm by 70mm, which comes out to $9.90 for 10 PCBs (though they seem to be changing that to 100mm by 100mm for $9.90, slightly better pricing.) You need to input the dimensions of your PCB as they are not detected by the Gerber files you upload. It’s a bit confusing… I guess for small PCBs you can panelize them. I should learn how to do that as it seems you can save money / get more PCBs by doing it.

The $9.90 is the base price for 10 PCBs, but adding more PCBs affects the total cost, but not by much for small boards. I could get 100 of my ATtinyNoisy boards for $18.32. That’s 10 times the number of boards for just twice the price! For the Teensy LC BOB v1.4 it’s $9.90 for 10 and $49.69 for 100. Economies of scale, yo.

Gerber View

One of the things that was missing when I ordered by PCBs was the preview of the board when I uploaded it. Well, either I missed it, or it’s a new feature that was recently added. Here’s what the Gerber preview looks like for my PCB in Fusion.

Teensy BOB 1.4

Teensy BOB 1.4

The boards turned out great. They look amazingly well done, and checking the 20 boards I received they all looked identical.

I actually placed two orders, for the first one I chose the fast shipping option, and the boards were completed within just a few days and shipped from Shenzhen, China to Milwaukee, Wisconsin in two days. Wow. That was for DHL shipping at about $20. Not bad at all.

The second order I chose the cheap shipping option, which was just $10. The boards were completed on November 18th (two days more than the first order) and were shipped, but as of December 4th (16 days later) I still have not received them. They were sent via Singapore Post and should be delivered to Rosemead, California, and then transferred to the USPS for delivery to me. I’m hoping they show up soon.

Teensy BOB 1.4

In summary, I was extremely pleased with the quality of the PCBs I got from the Fusion PCB Service from Seeed Studios. There are a lot of nice options when ordering, and volume pricing can make a lot of boards really cheap. The shipping costs and options are something to consider. With OSH Park the free shipping is nice, but of course you do end up waiting a while for the boards to be produced. OSH Park does have something called ‘Super Swift Service’ which adds $89 to your total. Oh, Fusion also has an “expedited” service that makes your boards in 24 hours, and that’s a $199 charge.

If I get to the point where I need a lot of PCBs for a project, or plan to sell them, Fusion would definitely make sense. If that’s what you need (perhaps for a Learn to Solder kit?) give Fusion a try.

ATtinyNoisy

I needed some small boards to put an ATtiny85 on, so I drew up a simple board in Fritzing and had them made up at OSH Park.

ATtinyNoisy

Here’s the breadboard view in Fritzing. Whenever I need “holes” I just use screw terminals. I’m sure there’s another/better way, but I’ve not found it yet, so I keep doing it this way.

ATtinyNoisy

Once the breadboard view is done, I go to the PCB view and move things around, make all the connections, and then export the files in Gerber format. Once you have a folder of Gerber files, you can ZIP it up and then upload to OSH Park for fabrication. (I covered this process in a previous post.)

MCN Gerber Viewer

I did find this Mac OS X application called MCN Gerber Viewer which allows you to view Gerber files. It allows you to view the different “layers” and turn them on and off to check your board before fabrication. OSH Park shows you what your board will look like when you upload it, so you can easily check for issues, but MCN Gerber Viewer is still handy to have around to check files before you upload them.

You can download ATtinyNoisy, which includes the Fritzing file and the Gerber files, or just order it from OSH Park.

A New Light

I recently acquired this lighted sign that was made by Buchler Instruments. (It’s probably 30 years old since Labconco acquired Buchler Instruments in 1989.) I decided to tear it apart and replace the non-functional insides with an LED strip. I’ll also be adding some vinyl to the front plate, but I’ll save that for Part II of this project.

Here’s some of the tear-down process, in photos.

A New Light

The front plate sort of press-fits into place. It seems like it should slide in from the side, but it wouldn’t budge, so I was able to pull & pry it out the front.

A New Light

After the bulbs were removed, the back reflector came out. I mean, it came out with a lot of pulling and a bit of bending. You can see that this thing is a bit worn and dirty. Looks like it may have gotten wet or had some chemicals seep into it (or out of it.)

A New Light

Plenty of rust, dirt, and corrosion. This is a not a transformer I’d trust to use in the future. Luckily I’ll just need a 5 volt power supply.

A New Light

More nasty stuff. The contacts for the bulbs didn’t look bad, but there was enough crud elsewhere.

A New Light

Everything out! The wires were brittle, and falling apart. The hardware was rusted, and overall just a mess. Still, it was nice to see the construction of this thing, and admire some parts of it.

If I don’t use the existing reflector plate I’ll just make a new one. I could probably make one using foamcore since heat won’t really be an issue with the LEDs.

A New Light

That crackle finish is beautiful. Luckily the outside is in much better shape than the inside. Just a little bit of rust on the back, but nothing that will be noticeable.

ART

“Sometimes we don’t understand the significance of something until we create it.”

« Older Entries |

support:



photos:


buy the button:

Buy The Button