New Version of VirtualBox

February 24th, 2008 by wd5gnr

VirtualBox is a great virtualization program similar to VMWare or VirtualPC except it is open source (and recently acquired by Sun, by the way). What’s cool about VirtualBox is that it has “additions” for the guest OS that really makes cursor and video management work well. For example, right now I have Kubuntu (the KDE version of Ubuntu) running on my right hand screen (full screen) watching a Youtube video. On the left I have my Windows host operating system. I can move the mouse between screens as though it was just one single computer (although I wish they’d integrate the Alt+Tab key combo — when you Alt+tab into Linux you get “stuck” until you use the mouse.

Youtube is sort of my standard test for virtualization. It won’t be as good as watching it on the host OS, but playing a flash video in a browser is a pretty good stress test for the audio and video virtualization. The new VirtualBox does just fine — even full screen works pretty good. Of course, VirtualBox also supports USB and serial device virtualizaton which is key for a lot of what I do. On the other hand, VirtualBox lacks some 64 bit support and doesn’t make good use of my multiprocessors (would love to dedicate one CPU to Linux).

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Serial port via Internet

February 24th, 2008 by wd5gnr

Com0Com setup screenHave you ever had a serial device you wanted to use over the Internet? Turns out its easy to do with com0com. This open source program lets you create a virtual serial port pair. You can use the pair to connect two programs that “think” they are both talking to a remote program over a serial port. You can also tunnel the end point over the network to a remote machine’s serial port. In addition, there are tools to let you do things like share a single serial port with multiple programs. This might be useful, for example, if you want to use a single RS232 GPS with several programs that expect direct connection to the GPS. It would also be useful for monitoring a serial connection.

This article explains how to use my favorite GP3 over the internet. The software running the GP3 runs on one computer and the GP3 is connected to a remote computer across the LAN or around the world.

Although the article uses a GP3, almost anything with a serial port could use the same technique. After all, the GP3 has no idea it might be connected remotely. This tool could “hack” a lot of RS232 devices and transform them into network devices.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

GP-3 Board on Sale

February 23rd, 2008 by wd5gnr

GP3

The GP-3 is a powerful board that you can use with or without a PC to do many physical computing tasks. I’ve talked about this board several times in this blog including this robot and this Visual Basic tutorial.

The boards are currently on sale. This is a great chance to pick up one or more for your next project.

The original purpose for this board was to act as an I/O device for a host computer (typically a PC). An efficient serial protocol (you can use a USB adapter) allows you to read analog voltages (5 channels of 10 bit A/D), output PWM, create and read pulses accurately, and control 8 bits of digital I/O. Library support is available for nearly any language. There are ActiveX and DLL libraries that you can use from C#, C++, Visual Basic, and many other Windows languages (for example, there’s a demo that uses the board with Microsoft Excel). There’s also a generic C library that works with Linux and most other platforms too.

With the free GP3EZ software, you can do many tasks (like the robot example above) using no programming at all. Better still once you have a script built using GP3EZ’s easy-to-use interface, you can “compile” the script down to the board and it will run without the PC until you reprogram it. In fact, things like timing become more accurate after you compile since the PC is notoriously bad at keeping time on small scales.

These boards aren’t on sale often, so pick one up while they are. Once you have simple I/O on your PC, you’d be surprised how handy it is. And since the GP3EZ scripts can run without a PC, using just one somewhere to replace a PC in a control application will save a bundle.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Under Construction

February 20th, 2008 by wd5gnr

I decided to switch to WordPress (which is really great, by the way). But that means some things are going to be broken for a bit. Worst case you can try http://wd5gnr-temp.blogspot.com if you want to see the original version of something for a while.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Is it Basic or is it C? Its SEABASS

February 18th, 2008 by wd5gnr

Personally, I like to program in C. Luckily, there is pretty good C language support for most modern microprocessors. However, if you don’t know C, its a pretty steep learning curve. Sometimes you just want to bang something out quick.

If your processor wants you to use C but you want to use Basic, you might try Seabass. Seabass is a BASIC compiler that outputs C code. So anywhere you can compile a C program (even on Linux or Windows) you can write BASIC programs. Even better, Seabass integrates with existing C libraries and you can even embed C code in your program.

The link shows an entire article about using Seabass to produce some Morse code on an Atmel AVR and a PIC. Here’s the first part of the AVR program:

include "avrio.bh"       ` get I/O routines
cinclude "app4delay.h"   ` get delay routines (from C)
#link "app4delay.c"      ` include C library

` Define a string typedef
type string char *

` Speed of a dot in milliseconds
Const speed=200

The first line includes a basic header file (by convention, these files have a .bh extension). This is a SeaBass file (included on the CDROM) that provides some common I/O routines for the APP-IV (the target board). This line allows us to use things like HIGH and LOW to affect the I/O pins.

The second line includes a C file, not a SeaBass file. This file is one that the APP-IV kit supplies and provides an easy way to write delays. Notice the line just under this tells the compiler where to find the associated C file. If you are manually compiling SeaBass’ output, this isn’t necessary, but if SeaBass controls the build process, this will allow it to automatically bring in the correct C code that your program needs.

Type names in SeaBass have to be a single word. However, many C types use multiple words (or even symbols). For example, if you want to deal with a string, in C you use a character pointer represented by “char *”. The SeaBass DefType statement allows you to make a SeaBass type that represents a complex C type:

` Define a string typedef
type string char *

The final part of the initial part of the program sets a constant using Const. In this case, the speed value is set to 200 (this will be the number of milliseconds to delay for a dot).

Now it is very simple to understand the main code:

` Main program
function main() as int
dim text as string
dim i
text="-.-. --.-"   ` message to send
` Set LED to output
OUTPUT(B,0)

The first two lines in the function define variables (notice one of them is a string).

Here’s the main loop:

` Main code
top: for i=0 to strlen(text)-1
` walk through text
     if text[i]=’.’ then
	dot()
     end if
     if text[i]=’-’ then
	dash()
     end if
    if text[i]=’ ‘ then
      space()
    end if
 next

Notice that the program uses the C library call strlen to find the length of the string. Of course, you could write a version of strlen in SeaBass, but since the C compiler already has this function, why not use it?

You can read the whole article or look at an example with an LCD library. You can also play with a demo of Seabass online.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Homemade hot air pencil

February 16th, 2008 by wd5gnr

Homemade hot air pencilI’ve been lucky enough to own two hot air stations. An Edsyn Atmoscope which I loved to use but had some limitations on larger parts and a Aoyue hot air station which is more flexible, but not the build quality of the Edsyn.

However, because I like to tinker I’ve also tried a few home-grown solutions. Most of these center on an aquarium pump for air and steel wool for a heat exchanger. I haven’t had good luck with these — maybe because I don’t have the right components or maybe because I’m “spoiled” with real tools.

The truth is, the best “cheap” results I’ve had have been with an $20 embossing gun I got on sale for $10 at Hobby Lobby. If you are handy enough with metal working to get it to accept they cheap Aoyue tips, I think it would be good enough for just about everything and they are cheap enough to replace if you burn one up.

Here’s a homebrew station that looks promising though. It uses part of an old hair dryer and a soda bottle for the air source. I haven’t tried it, but surely it would produce more air flow than what I’ve done in the past.

Another idea is to hack up a “heat gun”. Here’s at least one (plenty of other homebrew SMD irons on the same site).

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Interesting Video Camera Project

February 13th, 2008 by wd5gnr

Take a look at this video from MIT. The brush itself seems almost trivial. It looks like a “web cam” with a brush around it. What isn’t trivial is the big touch sensitive screen!

Very cool idea though. I wonder how you could adapt it to something pen sized on a standard LCD monitor. Come to think of it, I wonder if a regular light pen would work with an LCD since there really isn’t any “raster” as we know it — is there?

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

Read Quadrature Inputs Easily

February 6th, 2008 by wd5gnr

Lots of mechanical devices (like mice and shaft encoders) output quadrature signals. This is just a fancy way of saying that you have two signals and whichever one comes on “first” means something. So in the picture, you can see a mouse encoder wheel moving on a single axis counter clock wise. If it were moving clockwise channel 1 would come on before channel 2.

This is a natural byproduct of how the optical encoder wheels work. They are offset a little from each other, so the slots in the wheels are aligned about like the pulses in the oscilloscope trace shown.

The PAK-VII’s primary purpose is to measure pulse widths, but with very little effort it can also measure quadrature inputs. Want to know more? Read this article.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

3D PDFs

February 6th, 2008 by wd5gnr

If you have PDF documents you want to present on the Web, check out Issuu (pronounced Issue). For example, above is the GP3 manual PDF hosted on issuu. Click on it to open the viewer.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

An Easy Robot

February 3rd, 2008 by wd5gnr


This little robot is made with two perf boards from Radio Shack (one of them cut into two for the sides). This board is easy to work with because it has a grid of holes. It is very easy to make nice straight cuts (or even just score and snap). It is also perfect for drilling exact holes. Basswood and polyurethane glue holds it all together (along with a few screws).

The drive consists of two Futuba RC servos modified for continuous rotation and a caster wheel from Home Depot in the rear. The tires are 2.25″ RC aircraft tires.

A 4xAA holder under the top deck powers the motors. The 9V battery on the top is just for the electronics.

The electronics is the GP3 board which has been programmed by the GP3EZ software so programming the robot is simple point and click.

The sensor is a Panasonic IR sensor tuned for about 38kHz. The IR LED is pulsed through a 2N2222 with the GP3’s PWM at 32kHz which is close enough that it works. A piece of antistatic foam pushed into a pin header blocks the sensor from seeing the LED directly. When something is in front of the bot, it sees the IR bounce off of it. It would be easy to add more LEDs (for example, two on the corners). The sensors could be paralleled or just connected to more I/O pins.

Here’s the software (dumped out to HTML by GP3EZ; the real software is all constructed using GP3EZ’s point and click interface):

Step # Tag Condition Action Next Notes
1 Start Always LED Off
PWM: 200 freq=32766
  Start IR and reset LED (for when we finish turning)
2 MainLoop Input: XXXXXXX0 LED On object Check IR sensor
3   Always Pulse: pin 7 2000   Drive forward
4   Always Pulse: pin 6 1000   Drive forward
5   After 20 ms   MainLoop Servo delay (20ms)
6 object Always   back (set bookmark) We detected something, so back up a little.
7 turn Always Set Loop A to 20   Start turning (just under 1/2 second)
8 turn0 Always Pulse: pin 7 2000   pulse motors the same way
9   Always Pulse: pin 6 2000   Inserted step
10   After 20 ms   turn0 (Loop A) Pause and loop for 2 seconds
11   Input: XXXXXXX1   Start If sensor shows clear (high) then go back to forward motion
12   Always   turn Sensor wasn’t clear so do some more turns
13 back Always Set Loop A to 100   Back up for about 2 seconds
14 back0 Always Pulse: pin 7 1000   Turn motors in reverse
15   Always Pulse: pin 6 2000    
16   After 20 ms   back0 (Loop A) Delay and loop
17   Always   {last bookmark} Go back to caller

The table is easy to understand. The step number should be obvious. The “Tag” is a label that names a particular step so you can refer to it later. Each step has 3 major parts:

  1. Condition - This must be true for the step to execute. Many of the steps are marked “always” and some are marked “After xxx milliseconds”. These will always execute, of course. Note the lines that work with the IR sensor, however. They only execute when a specific condition is true.
  2. Action - When the condition occurs, this is what will happen. The GP3EZ can output digital values, PWM, pulses, and do a variety of other tasks as part of the action. If you are connected to a PC (the robot isn’t) you can write data to a file or execute external commands.
  3. Next - When a step executes, this column tells the program where to go next (which is usually the next step).

The note field is just a comment and is ignored by GP3EZ.

Note that the GP3EZ supports looping and subroutines. For example, at the “object” tag, there is a transfer (in the next field) to the tab “back”. The notation says that a “bookmark” is set. If you find the back label, you’ll see it does several steps and then goes to the “last bookmark.” This is nothing more than a subroutine call and return. You can see examples of looping in the object and back routines which generate a specific number of motor pulses.

Add This! BlogLines del.icio.us Digg Diigo DZone Facebook Google Google Reader Yahoo! MyWeb Netscape Netvouz reddit SlashDot Sphere StumbleUpon Technorati

« Previous Entries Next Entries »