USB To DB25 Adapter Uses GRBL For Parallel Port CNC Communication

With the continuing manufacture of new computers, there is a clear and obvious trend of the parallel port becoming less and less common. For our younger readers; the parallel port is an interface standard used for bi-directional communication between a computer and a variety of peripherals. The parallel port’s demise is partially due to the invention of the USB standard.

If tinkering with CNC Machines is one of your hobbies then you are familiar with the parallel port interface being fairly popular for CNC control board connections. So what do you do if your new fancy computer doesn’t have a parallel port but you still want to run your CNC Machine? Well, you are certainly not stuck as [Bray] has come up with a USB to Parallel Port Adapter solution specifically for CNC use.

A cheap off-the-shelf USB to DB25 adapter may look like a good idea at first glance but they won’t work for a CNC application. [Bray’s] adapter is Arduino-based and runs GRBL. The GRBL code is responsible for taking the g-code commands sent from the computer, storing them in a buffer until they are ready to be converted to step and direction signals and sent to the CNC controller by way of the parallel port DB25 connector. This is a great solution for people needing to control a CNC Machine but do not have a parallel port available.

[Bray] is using a Raspberry Pi running GRBLweb to control his adapter board. However, there are other programs you can use to communicate with GRBL such as Universal G-Code Sender and GRBL Controller.

The board has been created in Eagle PCB Software and milled out using [Bray’s] CNC Router. The design is single-sided which is great for home-brew PCBs. He’s even made a daughter board for Start, Hold and Reset input buttons. As all great DIYers, [Bray] has made his board and schematic files available for others to download.

53 thoughts on “USB To DB25 Adapter Uses GRBL For Parallel Port CNC Communication

  1. I had a chuckle when I read “For our younger readers” and then I saw the open frame D25 connector. I haven’t seen one of those for about 30+ years lol.

    Strictly speaking this is a TTL serial to parallel converter as it uses an off the shelf USB to TTL serial adapter.

    In any case it’s a great solution to the problem. I only have one PC left now that has a parallel port (and even a floppy).

  2. For the unfortunately CNCless… why won’t a standard USB parallel port dongle work? Is this one of those “parallel port” applications that uses it as GPIOs, like for ROM programming on-the-cheap, rather than for traditional IEEE-1284 communication?

    …wish I had a CNC machine… a challenge to the HaD CNCers out there: I have $50/mo disposable income. Can anyone design a practical 3-axis CNC machine that fits into that one month’s budget? (I doubt it.) Needs to work with thin metal and with plastic. (Think Radio Shack project boxes — 1/16″ aluminum and ~1/8″ ABS plastic.) I’ll let go of woodcutting ability for now… although if that could be added for another month’s budget, later on, I’d sure be a happy fella…

      1. Thin metal and thin plastic. Wood for me starts at quarter inch birch ply and gets worse (thicker but softwood) from there…

        Would be awesome if I could cut 1/16″ steel from an old PC power supply (specifically, from a thoroughly deceased Compaq Deskpro… 1st gen 1984…) but I don’t expect that for $50!

        Let’s say working size of 11″ square, I’ve got a couple dead printers I can scavenge for parts, but they’re standard letter size, so that puts limits on precision rod size ;)

        1. There are lots of projects around here where people have used scrap to make CNC routers and stuff. Seems like most of the cost is in the materials for frames and electronics, but I have seen frames and carriages made from plywood and you might find cheap electronics at some 3d printer site. They just strap a cheap dremel to them, seem functional enough.

        2. I’ve built my way up through a series of machines, and anything Dremel-based is, IMHO, a waste of money for anything other than engraving. It’s very hard to get rigidity with cheap components, and that makes cutting anything besides balsa a nightmare. At the low end of the price scale these days you will get more utility from a 3D printer most likely. If you work in a lab or mfg facility you might be able to salvage something together, but you have to have access and know what to salvage because a lot of what gets thrown out is junk. I learned that by wasting hundreds of dollars on stuff. Otherwise $50 is impossible. $500 would give you some options.

          1. This is SO true. I normally don’t bother replying, but building and improving a cheap CNC machine has been my project for the past couple years. “Cheap” is relative, of course; it started out cheap in absolute terms, now I’m just going for cheap compared to what an equivalent commercial offering would be.

            Basically, you NEED good linear bearings ($50+/axis), a decent spindle ($100+, definitely NOT a dremel-type tool), and stepper drivers ($30+/axis)*. Steppers are another $30+/axis. You’ll also need a power supply, maybe $40.

            So call it $500 to do it mostly right. If you cut corners on any of these parts, you WILL be replacing them down the line. I know firsthand- I’ve tried to do everything cheap on my build, and have replaced just about everything in the process. With a bunch of headaches along the way. You COULD start with solid mechanical parts, then put a dremel on there until you can afford a decent spindle; just know that you WILL want to replace it.

            I’d really recommend a BeagleBone Black (it has a hardware realtime unit, which is wonderful) with LinuxCNC for control, though you can get by with an old PC running LinuxCNC.

            You can probably use an old PC power supply for a while, but at 12V you won’t be stepping very fast.

            Oh, and if don’t have access to a metal lathe and drill press, you’re probably in for a bad time. A table saw helps a ton as well. An existing mill would make life much easier as well. The mill or table saw is basically required to make all the square corners you’ll need- and that’s something that you REALLY shouldn’t *ahem* cut corners on.

            The lathe is something I didn’t anticipate needing, but used ALL the time- turning down leadscrews, making bearing holders, and a bunch of other stuff.

            If you want to see all the crap that can (and will) come up, take a look at my build (click my name above).

            TL;DR: $500, a metal lathe, a drill press, and a table saw should get you going. Anything less and you’re probably in for poor performance in some regard, replacing parts down the line, and just a headache in general.

            *Do NOT get one of the cheap 3-axis Chinese boards for ~$40. It will just bring you a headache (awful performance, awful documentation). And possibly explode on you, like one did to me.

          2. I’m looking for super duper cheap. I want something I can use to muck up Radio Shack project boxes. Anything beyond that (for the initial investment) is total bonus material, as far as I’m concerned. I don’t mind maintenance intensive stuff as long as maintenance is a couple dollars every two or three months.

            I have printers and scanners I can scavenge parts from. I’d rather not use a Dremel as I’ve only got the one… so I’m at a loss there.

            For building tools I’ve got (sigh) mostly hand tools. I have a power drill and the dremel and that’s about where it ends. But I’ve got plenty of ingenuity!

            What about driving eg regular ol’ threaded rod, with a carriage (holding the tool) on nuts…? I’d use regular gearmotors and rotary encoders to keep costs down. (I have some dead ball mice that will help nicely there, I think.) Lots of grease and I should be OK, I’d think. I’ve a spare electric drill that I could use to hold the bits, maybe… moving the Z axis would be a little tricky tho. Too heavy for a desktop CD drive tray mech… maybe two of them in concert?

            Keep in mind that I need precision on the order of a fiftieth of an inch at the most ridiculously high. I don’t need five digits of tolerance! I tend to draw stuff out by hand… I can’t 3D model for beans, but I’ve a friend who can take my graph paper scribbles and turn them into G-code…

          3. Build something from junk.

            Threaded rod is fine, MDF is fine, steppers from an old laser is fine, one of those cheap eBay $50 drivers is fine (don’t go over 24v).

            The point is by building something you get to know how it all woks, and remember it’s not just hardware. You need software to design the parts (2D, then 3D) and to drive the machine. That’s a learning curve all by itself, and is doesn’t matter if the CNC itself is junk.

            People spend so long worrying about which ball screws and other esoteric crap to buy they never get anywhere.

            Not all processes require high speed or accuracy, your junker might still be useful afterward. Put it this way, it’ll probably be able to do thing better than you can by hand; at least if won’t get bored & stop halfway through. I’ve got one machine that does nothing but polish patterns into metal, don’t need micron accuracy for that.

          4. Well, if you REALLY want just something rough (and my experience is that you’ll want more features, rigidity, and precision sooner as opposed to later, hence my suggestion to “do it ‘right’ the first time”), you can probably even use drawer slides for your “rails”- They’re pretty cheap and linear-ish. They DO have terrible tolerances, but they’ll work for rather rough work. I suspect rails you take out of small printers are really thin, and thus not much better, at least not for rigidity. If you have them and bearings to match, you might as well at least try them, I guess.

            If you rip steppers out of a printer, you can probably use them, though you’ll likely be moving things insanely slowly. I’d still recommend getting some SLIGHTLY beefier steppers; SparkFun has some in the $15-$20 range that will possibly save you from going completely crazy. Note that it’s not just insane times to mill things- plastic (like project boxes) melts if you don’t feed fast enough.

            Regular gear motors with rotary encoders should work in principle. I don’t know how easy that is to set up with, for example, LinuxCNC.

            For stepper drivers, you can get some pretty cheaply from Pololu: http://www.pololu.com/category/120/stepper-motor-drivers. If you’ve got electronics experience (or are in for a learning curve), I’d say that + an Arduino running GRBL might work. Or you can look at some of the 3D printer control boards- they should work for your purposes; no idea how cheap they are.

            I’m really against those Chinese boards after my bad experience. It really did run the motors poorly, and really did blow up eventually.

            I’ll agree with Tony that you can use regular old threaded rod for leadscrews- 1/4-20 is cheap and easy to find. You can even just drill and tap a hole in a piece of scrap metal for a leadnut. That works reasonably well (I’ve done it before).

            You CAN use your dremel as the spindle, even if you don’t want to use it permanently- just make it removable. I used to hold one onto the Z axis with a chunk of PVC and a hose clamp: https://sites.google.com/site/dbtayl/cnc-mill/pictures

            Since you’ll need to connect your leadscrews to your motors somehow, I’d suggest hose clamps and plastic tubing- cheap, and it works surprisingly well. And then you don’t really need to worry about alignment issues (or machining the ends of your screws, since you don’t have a lathe).

            If you’ve only got hand tools, the other problem will be making the parts with right angles… You can probably do OK enough with a T-square, especially if you’re not looking for ultra precision.

            Anyway, I’m just going to re-iterate: If you buy ANYTHING for this, think about whether you’ll want it better in the future, and then whether it’s worth just buying higher precision/quality/whatever to start with. Maybe you really don’t care, but I sure wish I had known that you really do need higher-cost parts to get those tight tolerances.

          5. Doing it right the first time is fine if you know what you’re doing – and most people don’t.

            You don’t learn to drive in an F1 racing car.

            And after you learn to drive, you might decide you prefer bikes.

            Once you have a machine and have actually used it, the questions you ask will be different, that’s what experience does for you. You haven’t asked about feed rates, tool offsets, zeroing, constant velocity, contouring and so on – that’s far more important than debating threaded rod vs belts vs ball screws. (And note none of those questions are about the actual machine.)

        3. Honestly, for what you’re doing, if you’ve got a steady hand and want to go cheap I’d take a different approach. Place the cutting motor (dremel if you must, but there is a lot of flex so be forewarned) in a fixed XY configuration. Adjustable Z would be useful for sake of your materials thickness but you don’t necessarily need that. Make the platform what moves… a gliding XY platform would be much easier to build, wouldn’t require as high of a degree of precision, etc… Add a tensioning belt on both axis to provide some adjustable drag if you wish. Move the platform by hand. If you don’t want adjustable Z on the cutting part, you’ll have to include it on the platform part. Youe call.

          This approach would mean that you’d have to mark out the cuts you wanted on your materials ahead of time, but then cutting would be as simple as moving the platform manually to guide the material under the cutting head as you desired. Add an adjustable speed pedal/potentiometer to the cutter if you wish. You’d have a much higher level of control for the minimal tolerances you seek, you could nibble out additional bits if you wished to change your design as you were cutting it, etc… and all the machine control would be being done with your personal CPU (cranial processing unit) as opposed to so much futzing with machine control.

          This obviously won’t work where folks are looking for 3+ zeros of precision, but you’ve said that’s not your goal, so why complicate things? Make the moveable platform from printer guide-rods or from any of the extruded rail products available out there… small wheels with good bearing sets are fairly inexpensive.

          This approach also would allow you to expand the platform size as needed so long as you could clear the mounting post/arm that the cutting head would be hanging from.

    1. A USB to parallel adapter doesn’t keep the timings necessary to control a CNC properly.
      Think of trying to drive a car, but there is a random time delay between what you do and what the car does.

        1. My cnc setup (linuxcnc) running on a 3 year old dell with a parallel port claims it has 10 microsecond timing, on four axes simultaneously. So, yes, lag, but also that there needs to be a separate brain that can drive many signals in parallel with extremely precise timing.
          With all that said, a pci-e parallel card also seems to do a pretty good job. I know that a pci parallel card does, because I’ve used one.
          However, a place where this would be thoroughly useful is a laptop. Even ones with parallel ports are dodgy because the power-save functionality is really difficult to shut off and a single blip in timing from a bios-level power save action can trash a part. However, with a buffer, suddenly you can use old laptops as cnc controllers.

          1. Also most laptop ports are 3.3v rather than the usual 5v on PCs, so you need level shifters in the middle.

            Most people have break-out boards that do that, but it’s one extra (minor) hassle.

        2. they call it “latency”
          usb port’s realtime performance is pretty awful; there has been effort to change that (rt-usb), but have not heard of any useable results;
          lpt port really is disappearing, pci is still here (there are lots of cheap pci cards that add lpt port).
          those that are familiar with cnc machines might have heard about LinuxCNC; those that are familiar with LinuxCNC most probably have heard about different fpga boards that not only expand computer’s capailities in terms of i/o pins, pwm or step/dir signal generation, encoder pulse counting etc, but also allow to use pc without lpt port
          so I would say that this usb-to-lpt bridge not only does not really solve the problem, but introduces new one – the previous cnc controller software will not work and it seems to me that the new cnc controller is capable of driving only the very basic 3 axis machine, where only limit/home switches are connected to i/o pins, you can forget about automatic tool changes and whatever else additional mods specific to particular machine.

    2. long story short… Not really…
      You can either spend several months saving your $50 a month and buying a product, or spend $50 a month for a few months on parts. for many months.
      Nothing that could do anything useful will come along for just $50 with working CNC that doesn’t need hundreds more spent on it. (or a bunch of more advanced tools in order to fix it.) or that isn’t just really bad at doing anything or very limited for materials.

    1. thats not compareable. The hacky one gets gcode from one side, and outputs step signals over parallel port on the other side, with realtime accuracy.
      For a normal usb to parallel, you would need a linux with realtime extension and linuxcnc to drive it, and still would fail, as the usb destroys the realtime stuff.

  3. Whilst I appreciate the work, it’s still cheaper and easier to find an old Dell. They tend to have a parallel port (even now some do). Something secondhand that came with XP installed is perfect for either Mach3 or Linux CNC and probably cheaper than the Raspberry Pi he used for this.

    I must admit I was surprised that considering how much faster USB is compared to a creaky old parallel port, it is totally unsuited to anything timing critical.

  4. Don’t have a CNC myself (neighbours wouldn’t appreciate it!), but I think a more sane solution is simply to rip out the parallel port connector mess from the motor controller and install this sort of “dongle” inside. Then connect to the PC using a regular USB cable. Much better signal integrity and less thick and nasty cable to deal with.

    BTW, why the heck are *new* CNC machines (e.g. the popular Chinese CNC3020/3040) still made with parallel port interfaces in this day and age?! Sure, it is cheaper, but compared to the cost of the machine a microcontroller interpreting g-code on board cannot be THAT expensive? I don’t recall ever seeing a 3D printer using a centronics port.

    1. It’s “CNC + driver + PC” vs “CNC + PC” – you save $50 leaving out the driver. Put a cracked version of Mach3 on a CD and toss in a $2 parallel cable.

      You can pick up external drivers easily enough if you want to go the USB route.

      There’s no reason why 3D printers couldn’t do the same, but they all suffer from NIH (not invented here) for some reason. G-code, wazzat?

  5. Leaving aside the mini-ITX boards which do still have a parallel port (like the Gigi-byte E350 series and one or two surviving Intel boards), this project looks like a great way of addressing the real-time timing problems inherent in the USB ports. Will there be a version for the Arduino (which is better at real-time operations than the Pi)?

    1. raspberry has its gpio pins and might look usable for cnc at first point, but then it has only arm cpu, which is not powerful enough to drive full Linux system at reasonable realtime performance. maybe a version of marlin firmware might be adapted.
      beaglebone black is another story – it has pru (programmable realtime unit), which makes it very useful for cnc applications out-of-the-box

        1. You can get over 100khz out of a parallel port these days.

          Mach3 offers speeds from 25-100khz with minimal latency (drop speed until you get numbers you like).

          Welcome to this century, have a nice stay.

  6. This has always be done and looks like a copy from the c’t Hacks magazine ‘c’t Hardware Hacks 1/2013’! In this magazine a selfmade cnc mashine is shown with a similar connector board to link lowcost chinese controllerboards with the pc via a grbl (arduino micro) board!
    Copy! Copy! Copy!
    Michael

    1. Hi Erik,
      this project is not just an USB to LPT converter. In this project the goal is to control the CNC with an interface which handles grbl code. So you send via a virtual serial interface the original grbl commands and the interface does the moving of the cnc parts.

      (Rich uses a 128 Atmel chip. The open source grbl solution needs a 328 chip because of the limited storage of the 168 Atmel. So i don’t believe that Rich’s solution uses the complete grbl command vocabulary.)
      Michael

        1. Most pci-e cards with printer ports output 3.3 volts. I work with microscopes which often use parallel ports to create 5 volt TTL pulses. I have tried several of these types of cards including the two you linked and they don’t put out the required voltage or current to drive TTL logic without additional hardware. Since the point of using TTL in these systems is to avoid developing our own hardware these boards are simply not a solution.

          1. Most breakout boards for CNC include logic level shifters.

            I haven’t seen one that does 25-25 pins for a while, they’re all 25 pin to screw terminals. Making your own out wiring a port to the them isn’t that hard.

  7. I think using the parallel port to do cnc control isn’t the best way to do this anymore.
    Sending gcode to a controller and using it to run the steppers is a much better option. On the low end you could have grbl running on a Leonardo (Arduino, I know, I know) that could easily hand all the basic geometries for a 3 axis CNC machine. Use a MEGA running RAMPS for a very respectable midrange controller and for a higher end have a multiprocessor running LinuxCNC. The parallel port was never meant for realtime control, it was just used that way.

  8. i know parallel ports are dying fast buuut…
    are IDE (drive) connectors on mobo still kicking around?
    on systems i see without LPT i often still see IDE port,

    IDE makes for a nice lag-free 16 bit port with two or four addresses? no?
    … just need a latch chip or two (8bit ea) and disable IDE-device-driver

  9. A simple Arduino DB25 shield would have worked. Found a few with a quick search. Even found one that was connected to an Arduino nano. For the real cheap, Arduino breakout board and solder a DB25 cable to it. This is nice for a DIY project to learn a few things about making boards and such.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.