Monday, August 15, 2011

Redpark Serial Cable Electrical Characteristics

I'm currently doing some contract work that involves developing hardware to plug into an iPod device.  Of course, we're inevitably having problems getting the MFi license needed to talk directly to the iPod, so for the short term, We need a different solution.

We decided to develop the hardware to talk over RS-232, which can be fed into an iPod using the Redpark Serial Adapter.  This is a pretty neat little device; selectable speeds up to 57.6k baud (a little slow, but fine for telemetry), comes with a whole SDK to easily integrate into your app, and comes with a loopback test dongle.

Of course, having our hardware talk over RS-232 instead of straight TTL serial has the disadvantage that RS-232 has no provisions for power.  Batteries were a no-go, but we thought it would be possible to maybe "harvest" the needed power for our 3.3V electronics off of the RS-232 data lines coming from the iPod.  This is risky, since many RS-232 adapters cut corners and take liberal interpretations of what +5-15V actually means, so having this vampire power supply work depends on really how well this Redpark cable implements the standard.

Turns out, they implement it quite well!
Scope image of a mark-to-space edge on the RTS line.  2V / 1ms per div. Don't you love my 70's-tastic Tek 468?
 An RTS edge again, but at 2V / 0.2μs per div to check the slew rate.
9600 baud loopback test. 2V / 1ms per div.

Looking at those images, and doing some tests with my volt meter, the Redpark puts out +6V open, 30mA dead-short, and -5.6V open, -22mA dead-short.  That's a lot of power!  I'm going to be able to run my electronics off the RTS line no problem.  The cable also appears to implement all eight data lines, which can also be rare in cheap adapters.  They even meet the slew rate spec of <30V/μs, with a slew rate of only 7.5V/μs.

So long story short, Redpark didn't cut any corners here; The signals are all implemented according to spec.  The iPod connector does feel a little cheapy light, and I'm a little disappointed that their demo app is just a loop-back and signalling line test, and not something at least remotely useful like a little hyperterminal app, but the BB-9 connector feels solid, and I'm certainly not longer apprehensive about building our project on this product.

Saturday, August 13, 2011

Haul from the Electronics Flea Market

During the summer, every second Saturday is the Electronics Flea Market at De Anza in Cupertino, CA.  My parents happen to live about a mile from there, so while I'm visiting, I always make sure to partake in this nerd feeding frenzy of a morning and try and stock up on some interesting or useful hardware for this year's worth of projects.
I did fairly well this month.  I picked up a 4x20 backlit alphanumeric display (because I really need more displays) ($5), a Motorola pager ($1), a screen protector for my new iPod ($3), a 2GB CF card for my camera ($10), since trying to trick my camera into using the last CF card I had was a pain in the ass, and lastly, I picked up an Acute Technologies Thincast 5000 thin client ($5).  This is a most decent haul, if I say so.

The thin client is going to be an interesting project.  It seems to have some sort of Windows CE image on it that doesn't work, but you can force it to PXE boot off the network by pressing F1.
Even though it's 10 years old, it has every connector you could want from a computer.
The BIOS seems to be locked down so I can't reconfigure it, so I may very well end up burning a new EPROM for it somehow once I find a good application.
The specs are a little slim at a 300MHz Geode, 64MB of RAM, and an 8MB flash drive, but that's certainly plenty for a thin client, or even just a text terminal.

Moving on to the pager, I picked it up thinking it might be possible to tap into the modem on it to decode all the pager traffic in the area.  I was not disappointed.  It took some digging around online for the datasheet to the FM IF detector, but once that was found, the demodulated FSK signal popped right up on my scope.  The next step is figuring out how it's encoded, and hook it up to an AVR and have it somehow display the traffic.  I think another prerequisite for this project will be getting my Logic Shrimp working; It might come in handy trying to trace out these 1Hz data bursts.

De Anza is having some construction, so parking was a little nightmarish, and I'm very glad I got there as early as I did...

Did anyone else go?  You find something awesome?  You want to come next month on September 10th?  Hit it up in the comments.

Thursday, August 4, 2011

Laser Cutting Designs from Inventor

This is a guide showing the work flow I've been using to get parts out of Autodesk Inventor 2011 and into the vector format needed to send to a laser cutter.  I've been using this quite a bit this summer for my internship, since the company happens to have a laser cutter in their shop.

First thing first, you need to design all of your parts in Inventor, or whatever 3D CAD program you happen to be using.  Designing for laser cutting is relatively easy; A single sketch, extrude for the material thickness, assemble.  You do want to consider the implications of having sharp corners being cut out of acrylic, or whatever material you're using.  Sharp corners will make it more vulnerable to cracking.
Here is the completed assembly for what I'm working on, to make sure everything fits together virtually, since bits are cheaper than acrylic.
Once the 3D design is done, drop each part into its own 2D drawing.  I opted to actually dimension and tolerance everything, but all you really need is the base view.
 Autodesk developed the drawing exchange format back in the 80's, which allows us to be able to export these .idw drawings to something Inkscape can open, namely the .dxf format.  Inventor is a little screwy, because it has several different types of saving, with subtle differences.  You can't "save as" a .dxf file, but can only "save copy as" a .dxf file, so make sure you select the correct menu option.
When saving as a .dxf file, make sure to go into the options menu and select "model geometry only," since otherwise the laser cutter will start cutting out all of our dimension and reference lines, which isn't really what we want.

Now you should have .dxf files for each part.  Next is to open them with a vector image editor (the de facto free one being Inkscape), and convert your parts into the .svg and/or .pdf files your laser cutter or laser cutting service expect.
When you try to open the .dxf files in Inkscape, it will ask you what scaling factor to use.  This is because Inkscape by default expects the .dxf files to be in millimeters, but of course, Inventor saves it into whatever units you happened to be using, so since I'm a mechanical engineer working in the US, I need to convert it from inches, so enter a manual scale factor of 25.4 (mm/inch), otherwise your parts will end up the WRONG size.
You should end up with something like this, with all of the views from your drawing now sitting somewhere in Inkscape.  Obviously, you only need the top-down one, so click-drag-delete the side view, and select the main view and move it back to the origin.
At this point, you also want to set up the document properties correctly for your laser cutter or service.  (Many services will provide vector templates for you to work from.) My Laser cutter happens to have a 16"x12" bed, so in the document properties (File > Document Properties...) (Shift-Ctrl-D) change the default units to inches, and the document size units to inches, and type in the appropriate geometry. Also consider that you can add some grids in the grids tab, which is kind of handy some times, but can get a little annoying when parts start trying to snap to it instead of go where you want it.
Now with the outline selected, open the Fill and Stroke dialog (Object > Fill and Stroke...) (Shift-Ctrl-F), and set the stroke width to 0.001".  This is because some laser cutters will decide between vector cutting the line and rasterizing it (shading) based on how thick the line is, so the default thickness will end you with all of your parts merely shaded on the sheet, not actually cut out of it.

Now all that's left is changing the stroke color to the correct one for cutting.  This is because laser cutters will have several different power settings, for say cutting, engraving, deep engraving, raster, etc, and will distinguish between which modes you want to use by the color of the lines.  My cutter uses red (#FF0000) for cutting, but others will use black (#000000) or blue (#0000FF), so make sure to read the documentation and check your settings.  Select all of your lines, and right click the correct color at the bottom of the Inkscape window and select "Set stroke"  This should now have you with vector files you can send off to be cut out.

Now, in addition to the basic outline from your 3D CAD program, you can also quite easily add notes on the material using the text tools, or pretty much everything, in Inkscape.  Just make sure you remember to set the stroke of the text to 0.001" so it doesn't end up just rasterized, and turn off the fill if you don't want to pay for several minutes worth of laser time to shade in your letters (not that I totally made that mistake and turned a 45 second cut into 6 minutes).

And as always, print everything out on paper or cardstock beforehand, to save you the expense of noticing something obvious in $5/sq ft material.

Finally, consider the implications of that the laser will burn off about 10 thou of material where it cuts.  For most applications, this isn't a big deal, but if you're trying to get some tight-tolerance fits, you'll need to move the cut vectors out about ~5 thou to actually get what you drew.
 All being said and done, three hours later and $15 in material, and that which I imagined, becomes reality.  I hope you find this all useful.