Arduino DRO Serial Protocol Considerations

Thursday, September 27, 2012

Last time I posted the schematic and firmware code for the Arduino DRO, for reading the iGaging scales. The plan is that the Arduino will read the positions and send it over UART to the app running on Android tablet via an inexpensive Bluetooth module. The nice part of using a serial-to-bluetooth adapter is that it's completely Plug-and-Play, so the hardware layer isn't too complicated. On the Arduino side we simply connected the Rx and Tx to the Tx and Rx on the Bluetooth board respectively, and provided power via Vdd and Ground. On the Android side all you need to do is to pair with the device. These Bluetooth modules use the so-called SPP (Serial Port Profile), also known as RFCOMM. When the controller is paired with the tablet it will behave like a regular serial port.

Arduino Wireless Digital Readout (DRO)

Sunday, September 23, 2012
Android Digital Readout Application
Application screenshot taken from Nexus 7

Recently I started working on a new version of my DIY digital readout project to that uses an Arduino DRO controller and an Android tablet. The DRO I'm building for my milling machine uses three inexpensive iGaging scales. (The whole set for my Hardbor Freight Mini Mill set me back less than $100 on amazon, in fact.) Since the bulk of the functionality is handled in the digital readout application, the controller design becomes much simpler, requiring only a few extra components. The parts list

In reality I've been toying with the software-based design for some time, and even wrote a basic desktop application on my computer. I scraped the idea of Windows application because without a touch screen the unit would be too cumbersome. When my Nexus 7 arrived in late July, it only made sense to use it for the DRO display unit. I've done some Android programming before, so it didn't take too long to get a basic app up and running. The app in the screenshot is a crude proof of concept, but I should be able to post a working version in a week or two.
As I mentioned before, my unit uses three iGaging scales and a controller based on Arduino UNO board to read them, as shown in the schematic below.

DIY DRO with Arduino and Android

Friday, September 21, 2012
Google Nexus 7 Running an Early Version of DRO Application

UPDATE October 2022: Since the time of the original posting, I've developed a few new designs that perform much better, work with more scale types and read the scales more reliably. The latest version uses an ESP32 wireless module. You can find the circuit diagram and instructions on the ESP32-Based DIY Digital Readout. Other designs that use MSP430 LaunchPad development board can be found in the Do-it-Yourself DRO Build Instructions

Having a full-featured DRO on a milling machine or a lathe would, no doubt, be very convenient. Unfortunately the cost of commercial units is very high, so the only way I could afford one would be to go the do-it-yourself route. My initial plan was to build a tradition digital readout unit using six 7-segment LED displays per axis and an ARM microcontroller (STM32VL Discovery Board). To build the first prototype I used the free version of Atollic Studio. Even though it was "crippled", compared to the full version, at least there was no code size limits. Well, as of the last version, Atollic added a code size limit so I decided to scrap the idea of an ARM-based DRO. Instead the DRO would consist of an Arduino-based scale driver and an inexpensive Android tabled as a readout display.

Arduino On a Beadboard - Uploading Your Sketches

Wednesday, February 22, 2012

A few days ago I posted some intructions on how to use a standalone Atmega328 (or Atmega168) on a breadboard. This approach offer a good cost reduction for Arduino-based hobby projects by reusing the USB-to-TTL circuit between the projects. The cost saving can be close to $20, but there is a small tradeoff in convenience. Instead of the customary "plug in the USB cable and click 'Upload' ", we will need to hook-up a few wires; nothing too bad, though. Let's look at two different approaches: using FTDI adapter and an existing Arduino board.

Building Arduino on a Breadboard

Sunday, February 19, 2012
Arduino on a Breadboard

In the previous post I showed threeways to reduce the cost of an embedded Arduino-based project: using one of the Arduino Pro variants, using a preloaded Atmega MCU and burning the bootloader yourself into  a blank Atmega MCU. For the first option, a “Pro” board with a Sparkfun's FTDI adapter all you need to do is to plug the board in (making sure that GND pin on the board matches that of the adapter) and you're good to go. The only drawback is the price tag of $20. The last option is the cheapest, but requires an AVR in-system programmed, and if you have an AVR ISP, chances are you don't need me to explain how to use it. The “Goldilocks” approach is to purchase the chips preloaded with Arduino bootloader. This approach provides a good balance between beginner-friendliness and cost. This is the option I will be using in my open source projects. In this post I will show you how to build a basic Arduino circuit on the breadboard.

Three Easy Ways to Reduce Arduino Project Cost


Arduino Pro Mini, Atmega 328 with Arduino Ominiloader Uno and a blank Atmega328P  

In response to the reader feedback I'm going to use Arduino for the DIY DRO Project and the stepper motor driven power feed. Arduino makes a great choice for beginners, in large part due to the standardized form factor and self-contained hardware. The flip side is that the boards cost between $35 and $70. “Wasting” a full-blown board for each little project gets expensive quickly. Every “mainstream” Arduino board comes with a USB-to-TTL adapter on-board that adds about $15-$20 to the board price. Having the adapter is convenient for prototyping, but in a “deeply embedded” projects this is a waste of money. Once you buy your first Arduino board or an “FTDI” adapter, the USB circuitry can be omitted. There are many ways to implement a minimalistic Arduino controller, but the most common ones are:

DIY Digital Readout Project Update - Display Boards Are Here

Wednesday, February 15, 2012
Ten brand-spanking-new LED display PCBs
for the DRO project

A week or so ago I finished laying out the LED display PCB for my DRO project. I built one unit some weeks ago using a prototyping board, but when a friend asked me to built one for her husband, I decided to bite the bullet and make a proper circuit board. This is by no means necessary, but wiring three MAX7221 on a prototyping board isn't my favorite pass time. Additionally, by using surface mount parts I was able to squeeze 24 digits (three rows of eight digits) and six tactile switches into a 5.75” x 3” board, whereas the initial prototype took 7”x5” prototype board for 18 digits (6x3) and no buttons.

Tramming Harbor Freight/Grizzly Mini Mill Column and Head

Saturday, February 4, 2012

Yesterday I installed the "Large Table Assembly" and the "Air Spring Kit" from LittleMachineShop.com, so today was the time to tram the column and the head. I've seen some people tramming the column by attaching a dial indicator to the quill and adjusting the column unti the reading on both end of the table are equal. There is one huge flaw with this method: it doesn't tram the column, it trams the spindle. If you look carefully, the head is composed of two castings. The part that holds the bearings and the spindle is held by grou long bolts, and, you guessed it, is not always parallel to the dovetails. A tell-tale sign that your mill has this problem is when you jobber drill bits miss the spot that you started with the started drill bit. Essentially the head is perpendicular to the table but the column being at the angle offsets the head in the X axis as you move it up and down.

Alignment Problems with Large Table Assembly

While tramming the head on my mini mill (after installing the larger table), I came across an unexpected snag. I attached the dial test indicator to the spindle with a quill-style holder and prepared to zero it out on the right side of the table, but I noticed that swinging it across the table changed the reading. In fact, after zeroing the indicator on the front of the table, the probe didn't touch the surface on the back. Checking the column with a square showed a 1/8" runout over 6". Apparently something went terribly wrong, so I started troubleshooting. I took the column off the table, cleaned the surface, ran a file across the edge to make sure there were no burrs.