Archive for May, 2011

Tutorial: PCB Design T-Shirt

I recently had the idea of printing a PCB design on a t-shirt. Since I don’t do my own silkscreening, I just wanted to upload my EAGLE PCB design to a custom t-shirt provider and have them do the hard part. In this post I’ll show you how you can do the same for your favorite board design. Mine turned out great!

Photo by Paul Sobczak


 

First, I exported my board design from EAGLE by choosing File -> Export, then picking Image from the next menu. You want your image to be high resolution, so increase the DPI value to at least 400 to give you a large image. Choose a file location for your large PNG file.

In Eagle, choose File -> Export, then choose Image


 

I then used Custom Ink to have the t-shirt made. I chose a black short sleeve Hanes Beefy-T. The shirt design tool makes it easy to upload an artwork image. After uploading, it asks you to choose the colors that are in the image. My standard Eagle board image has red, blue, white, green, and yellow. The colors you choose don’t have to exactly match your image — it’s just for accurate pricing.

Choose colors included in your image.


 

Then I resized the image so that it filled the front of the shirt. I also made sure to select the checkbox that says “keep the white in my image”.

Resize and position your PCB design


 

Next, get a quote and order a shirt. Mine only cost $24.75 and shipping was free in the U.S. I thought this was a great price and was really happy with the result!


Published by Michael, on May 21st, 2011 at 1:40 pm. Filed under: Art,Level 1. | 1 Comment |

Driving Multiple Digit Shields from One Arduino

Difficulty Level = 2 [What’s this?]

The Digit Shield is a very easy-to-use Arduino shield that provides a digital readout for your Arduino projects. Some example projects are here.

One of my customers asked me about driving multiple Digit Shields from one Arduino. I had never thought of that, but the customer had the idea of using a single Arduino to display the X,Y,Z positions of a CNC router. I thought this was an intriguing idea, and with a little bit of experimentation and modification to the Digit Shield library, I was able to very easily accomplish this.

Driving multiple Digit Shields with one Arduino


 

When a Digit Shield is on top of an Arduino, the pins used to control the shield are 2, 3, 4, and 5. In the picture above, this shield is displaying value “60.08”. If we connect another shield, we obviously have to use different Arduino pins to drive it. The second shield in the picture above (the one displaying “59”) is connected to Arduino pins 6, 7, 8, and 9. Of course, the wires still connect to pins 2, 3, 4, and 5 on the shield itself.

The 3rd shield in the picture displaying “1800” has its pins 2, 3, 4, and 5 connected to Arduino pins A3, A2, A1, and A0 respectively. In the code, analog pins are used as digital pins by referring to them as 17, 16, 15, and 14.

What about the code? I added a constructor for DigitShieldClass to the library so you can create new objects to represent the additional shields. The shield on the Arduino is still referenced as “DigitShield”, but the additional ones are referenced as “digitShield2” and “digitShield3”. Here’s how the shields are declared and initialized.

// Create a second Digit Shield connected to Arduino pins 6,7,8,9                            
// Connected to pins 2,3,4,5 on the shield, respectively.                                    
DigitShieldClass digitShield2(6, 7, 8, 9);

// Create a third Digit Shield connected to Arduino pins 17,16,15,14 (A3,A2,A1,A0)           
// Connected to pins 2,3,4,5 on the shield, respectively.                                    
DigitShieldClass digitShield3(17, 16, 15, 14);

void setup() {
  // The static variable DigitShield refers to the default                                   
  // Digit Shield that is directly on top of the Arduino                                     
  DigitShield.begin();
  DigitShield.setPrecision(2);

  // Initialize the other two shields                                                        
  digitShield2.begin();
  digitShield3.begin();

  // set all values to 0
  DigitShield.setValue(0);
  digitShield2.setValue(0);
  digitShield3.setValue(0);
}

The full code example is called “MultiShieldExample” and is included in the Digit Shield library.

Also note that I’m providing power to the off-Arduino shields with a 7805 voltage regulator. The Arduino’s voltage regulator can deliver quite a bit of power, but it got rather warm when driving all these LEDs. So, in the picture above, there’s a 7805 which provides 5V to the 5V pins on the off-Arduino shields. Also make sure you connect all the grounds together.


Published by Michael, on May 21st, 2011 at 10:09 am. Filed under: Arduino,Level 2. | 2 Comments |

Overlay GPS Data on Video

Difficulty Level = 7 [What’s this?]

Several people in the FPV RC world (that’s First Person View Remote Control for the uninitiated) have contacted me about the possibility of using a Video Experimenter shield as an OSD solution (on screen display). People who fly RC planes and helicopters are increasingly using on-board video cameras to provide a first-person view of the flight, and they like to overlay GPS data onto the video image. Flying radio controlled drones has become a huge hobby (just look how big the DIYDrones and RCGroups communities are!).

I don’t have any RC vehicles, so I’m really on the outside looking in, but I thought I’d experiment to see how useful a Video Experimenter might be in overlaying data onto a video feed. I wrote a simple Arduino program that reads GPS data from the Arduino’s serial RX pin and overlays a heads-up display onto the video input. I think it turned out pretty nice:

Using a Video Experimenter as an OSD


 

All relevant info is displayed: current latitude/longitude, compass heading, speed (left), altitude (right), and distance home (meters) in the lower right. There’s also a home arrow in the center of the screen pointing toward the hard-coded home location. Note that the ground elevation is also hard coded in the Arduino program so we can calculate altitude.

Circuit Setup

I think there are two ways that a FPV solution could use this approach. If the vehicle is transmitting video and also transmitting GPS telemetry via an XBee radio, then the GPS data can be overlayed onto the video at the ground station. I had to configure the XBee radios to use the same baud rate as my GPS (4800bps).

Circuit for GPS overlay ground station


 

OR the Arduino and Video Experimenter shield could be onboard the vehicle itself. This way the GPS data is overlayed onto the video before the video is transmitted. In this case, the GPS module is connected directly to the Arduino RX pin, and there’s no XBee radios involved. An Arduino+Video Experimenter shield weigh 2 ounces or 57 grams (I knew you were going to ask that).

I need to be clear that this overlay software can’t run on your ArduPilot hardware. Processing video in an Arduino environment requires nearly all of the ATmega’s SRAM, so there’s no way that this is going to run on the same hardware as your autopilot code.

Again, I’m not in the FPV RC community and don’t have a plane, so I’m not entirely sure how feasible all this is. But a number of RC hobbyists have asked about the Video Experimenter and were enthusiastic about the possibilities. Comments are very welcome!

GPS Configuration

My EM-406 GPS module is configured to only output RMC and GGA sentences, and they are output once per second, so the display only updates at that frequency. It was important to limit the output to only the RMC and GGA sentences, because when using the Arduino video library (TVout), serial communication is accomplished by polling, and it can’t handle data too quickly. To limit the output to RMC and GGA sentences, I wrote these commands to the GPS RX line, with each line followed by a CR and LF character. The Arduino serial terminal works fine for this. Don’t write the comments, of course.

# enable RMC, output 1Hz:
$PSRF103,04,00,01,01*21

# enable GGA, output 1Hz:
$PSRF103,00,00,01,01*25

#disable GLL
$PSRF103,01,00,00,01*25

#disable GSA
$PSRF103,02,00,00,01*26

#disable GSV
$PSRF103,03,00,00,01*27

#desiable VTG
$PSRF103,05,00,00,01*21

If you have a MediaTek GPS module, I believe the correct command to disable all sentences except for RMC and GGA would be this:

$PGCMD,16,1,0,0,0,1*6A

I don’t know how fast of a data feed that the Arduino overlay code can handle, so some experimentation would be in order.

Download

Download the Arduino code OverlayGPS.zip. The awesome TinyGPS library is also required, so install it in your Arduino libraries folder. You also must use the enhanced version of the TVout library that is required by the Video Experimenter.


Published by Michael, on May 20th, 2011 at 1:07 pm. Filed under: Arduino,GPS,Level 7,Video,XBee. | 9 Comments |