PCBWay PCB Prototyping review (aka how I made an LED word clock)

A while ago my mom saw a clock where the time was shown using only words instead of numbers:

The bright letters say “It is twenty five past one” in Spanish.

If you speak spanish, you can see that there are letters spelling every possible combination of times. You could show any time of day provided you light the correct LED combination (well, technically not every possible combination is available as the time is rounded up to intervals of 5 minutes, so 10:57 would be displayed as “five to eleven”).

Disclaimer: I’ve been approached by the people at PCBWay to review their PCB Prototyping product. They gave me a coupon to try the service out for free in exchange for a review. So this is not a sponsored ad or anything like that. They never prompted me to say anything in particular; these are my own words.

My mom looked for a clock like this and quickly found that they ran for over $200, which is insane! I told her that I could make one for under $20 and thus the journey began.

Arduino Prototype

The first thing I needed was an LED matrix which I made by soldering some addressable LED “pixels” I found on Amazon:

Front side of LEDs. There are TINY!
Each LED has six solder pads: 5V, GND, and DATA (both inputs and outputs)

I cut a small plywood square from a scrap piece that I had, drilled and countersunk some holes. Then I hot-glued all the LEDs in place and pre-tinned each solder pad. Then soldering began. This took A LOT of time!

Pre-tinned solder pads.
All LEDs glued up.
Cutting the wires.
Soldering the 5V line.
Not pretty, but functional.
Running a simple Arduino program to check that all LEDs are wired properly.

After making sure all LEDs were working, I made a test sheet in illustrator with the letters in places, and cut it in the vinyl cutter using some thick cardstock. Remember, this is just the beta version. The final version will have a way nicer look!

Illustrator template. Reversed so that when I cut the vinyl it looks right when I apply it.
Card stock template.
Card stock close-up. Awful looking, I know (remember this is just a beta)!
The black vinyl sheet as it came out of the vinyl cutter.

After cutting the black vinyl template, I applied it over a piece of acrylic, and added a white sheet of paper behind it to act as a diffuser. Then, I went into the shop and made a quick and dirty frame for the whole assembly. It looks like this:

Since I didn’t have any buttons at hand, I decided to use capacitive touch buttons instead using some bolts. They look like this:

The bolts that act as capacitive touch buttons. From left to right: hours, minutes, colour.
Capacitive touch bolts from the back side.
An Arduino Mega with an external RTC (Real Time Clock) that “remembers” the time when the Arduino is powered off.

But let’s be honest. The prototype circuit looks pretty awful. We can do better! Let’s make a PCB!

The PCB

The cool think about this PCB is that it doesn’t really DO anything. It’s just a bunch of connectors taking signals from here to there. Other than a pretty sizable capacitor to prevent the Arduino from rebooting if I set all the LEDs to white (too much power), the whole thing is pretty straight forward:

The schematic.
The routed board.

I went to the PCBWay website and I uploaded my board to their platform. There are a lot of options to chose but set everything to the default, except that I chose the white colour for the PCBs. The 80s called and they want their green coloured PCBs back!

A cool thing they do is that if you choose a white solder mask, they automatically change the silk screen to black just so that your silk screen doesn’t get lost in the background.

I did have some trouble entering my shipping address in Canada because their system was confusing city and province names, but that seems to be fixed now.

After uploading, their system sets the order on hold until approval (which took less than 24 hours). And after that, the order changed status pretty fast and I could see what they were actually doing. This can be seen in their order status page:

The order goes through different manufacturing stages.

3 days after the last status change I had the PCBs in my hand and they looked spiffy! I love white PCBs!

All the solder pads looked great and all the boards that I assembled worked perfectly. Here are a couple of shots of one of the assembled boards. Note that I soldered the capacitor sideways so that it fit in the particular tight enclosure I was working with.

Assembled PCB, top view.
Assembled PCB side view.

Did you spot the boo-boo? :) Here’s a close-up:

Mistakes happen!

Yes. I screwed up! I usually use the Eagle auto-router and just go with what it gives me. This time I routed the whole board by hand. Doing it this way makes for a much cleaner board and I learned a lot… but… I got so caught trying to make the board look nice that I accidentally swapped the 5V and GND pads! Oh, well…

I’m super happy with the PCBWay service. There were no complications, no delays, and everything worked exactly as I expected. The quality of the silk screen in particular is the best that I’ve seen so far. On other PCB services that I used sometimes the silk screen chips off (in minuscule bits) but this one is perfect all the way.

Conclusion

I love Arduino, but hate breadboards. Everything is so flimsy and when you eventually want to take the prototype to vero board or any of the more permanent alternatives, it takes forever to do so and it’s an incredibly error prone process. Making a PCB leaves everything clean and repeatable. The next time your friend comes to your house you can snap one of these PCB shields on top of an Arduino, load up the software and you are ready to go!

How to program a Dorkboard with an FTDI breakout

I’ve been playing with my Arduino long enough to realize that it is much cheaper to maker my own breadboard Arduino and transfer that into either a PCB or Veroboard than to actually buy a full Arduino for every little thing I make.

In order to program my breadboard Arduino I’m using Sparkfun’s FTDI Basic Breakout. I think this is the easiest way to program (and re-program) a breadboard Arduino; just stick some 6-pin headers, hook them up, and you’re good to go.

Now I’ve recently acquired a few Dorkboards. These are a very minimalistic PCB version of an Arduino (fully compatible since they use the same chip) and are also very quick to assemble. I’m using these as a starter for my projects now. The only problem is that whoever designed them thought it would work better for them to have a 5-pin connector instead of a 6-pin one. This means that in order to program them the same way you do an Arduino you need to convert this into a 6-pin connector. This is easy enough to do and there are two ways that I can show you. Both are conceptually the same and pretty much consist of creating some sort of connector using the following schematics:

Dorkboard to FTDI connector

Option 1: Custom cable

You can easily create a custom cable by taking 5 pieces of solid core wire and soldering them. The resulting cable will look like this (if done poorly like I did):

Dorkboard adapter cable

In this picture you can see that I’ve included the FTDI adapter on the left.

Option 2: Custom PCB

I’ve made this little PCB board (download link below) that you can use over and over that will resist wear and tear much better than the cable above.

Dorkboard to FTDI PCB adapter

Download the Eagle Schematics and Board files.

As you can see this is just a tiny little board but serves its purpose. In this case I’ve soldered male headers to both ends but that will depend on what you’ve soldered to your Dorkboard. In my case I didn’t have pre-bent headers so I bent them with pliers, that’s why they look a little crooked, but the connection is quite snug. Since the Dorkboard connector is on the edge of the board you can even connect straight headers and it will work too but I prefer mine bent. The best part is that you can get three of these boards made for only $2.50 at OSHPark.com (that includes shipping too!) so that you can make a male version, a female version, and still have a spare.

Once this adapter is in place, programming the Dorkboard is done exactly the same way as the Arduino!

 

Calibrator: An Arduino library to calibrate sensors hooked to analog inputs

Once you get past your first few projects with the Arduino, you soon realize that the calibration method they show on their webpage is just a sample and cannot be used with many sensors without polluting your code with a ton of variables.

So, here it is. My own take on sensor calibration library. You can download the source code and a more detailed explanation on the github Calibrator page.

This is how you use it:

#include <Calibrator.h>

Calibrator calibrator;

int sensorPin = A0; // The sensor we want to calibrate
int ledPin = 13;    // Will indicate when calibration is going on

void setup()
{
    pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin, HIGH); // Turn LED on
    Serial.begin(9600);

    // Reset the calibrator. You only need to call reset() if you restart calibration again but
    // if calibration is only run once like in this example is not needed. It doesn't hurt to 
    // call it here though. 
    calibrator.reset();

    // Run calibration automatically during the first 
    // five seconds (or 5000 milliseconds) your code runs.
    // It is important that during calibration you "exercise" your sensors to measure both 
    // ends of their range.
    while (millis() < 5000) {
        calibrator.setValue(analogRead(sensorPin));
    }
    digitalWrite(ledPin, LOW); // Turn LED off
}

void loop()
{
    // In your code analogRead(sensorPin) will give you the uncalibrated value
    // and calibrator.getValue(analogRead(sensorPin)) will give you the calibrated value 

    Serial.print("Sensor value: ");
    Serial.print(analogRead(sensorPin));
    Serial.print(" , Calibrator value: ");
    Serial.println(calibrator.getValue(analogRead(sensorPin)));
}

 

8 RGB LED Controller

UPDATE: I’ve now made a custom PCB out of this.

This is my first experiment with Arduino. Like most people starting out with Arduino, I wanted to make stuff blink! So after finishing up the Arduino Starter Project Book I started hooking up LEDs to my Uno’s outputs. I very quickly ran out of outputs and a quick search through the Arduino Forum led me to the wonders of shift registers. These are basically serial to parallel ICs that allow you to just use three pins on the Arduino to control eight outputs. You can daisy chain them like I did and if you do, you can control many more outputs yet still using three pins to control them. I few days later, my SparkFun order had arrived and it was time to test my spanking new 74HC595N set.

Ingredients:

  • 3 x 74HC595N shift registers.
  • 8 x RGB LEDs, diffused.
  • 8 x 200Ω resistors
  • Lots of jumper cables
  • 1 x Solderable PC Breadboard.

After some trial and error, I arrived at this. The gray cables are telephone cables that connect the controller to the LEDs.

8 RGB LED Controller prototype

Yikes, that looks ugly. I soon realized that I shouldn’t have soldered the LED cables to the board as it makes it very impractical to repair any LEDs or reuse parts. Even though it looks flimsy, so far it’s still in one piece.

I’ve put together a video that shows some of the build process and also the whole thing put together and working. At the end of the video you can see the presets that come with Elco Jacobs’ awesome ShiftPWM library which is what I used to control the LEDs.