Let’s Get Stated with the DRO Project

Sunday, January 15, 2012
First of all, after sleeping on the design for a few nights I decided to break the project into two stages. The first stage will be to make a functional DRO with basic DRO functionality. The second stage will be the stepper control and CNC functionality. The main reason is that the DRO will be useful by itself, and I think doing a proper G-code interpreter and stepper controller will take some time. As an added benefit, this makes for a smaller initial money outlay.
I’m using STM32VLDiscovery board for the project, as I’ve already mentioned in the previous post, so initially the project will include the following hardware:
  • STM32VL Discovery board
  • Grizzly Digital Scales (3 pieces)
  • 7-segment LED displays. 0.56”, common cathode (18 pieces)
  • MAX7221 LED drivers (3 pieces)
  • Push buttons (3 pieces)
  • 4x4 key keypad
  • 16x2 character LCD display
In addition we will need some sort of enclosure, wires, 5V wall power supply (to power the board), connectors, proto board (possibly more than one) and hardware. With careful shopping all this should cost under $200.
NOTE: the keypad and 16x2 LCD are optional, and I will provide the code for a basic DRO version that has just the readout and the zero-out buttons.
Here is what I have in mind for the design:
Grizzly scales work at 3V DC. LED drivers and LCD (and presumably the stepper drivers), on the other hand, will require 5V. Luckily the Discovery board provides a pass-through 5V from its USB port, in addition to the regulate 3.3V. The good news is that a used 5V phone charger can be had for a song and will make a good power supply for the DRO. Simply look for a charge with mini-USB connector at your local flea market (Goodwill, etc.) For the long term a reader suggested that I use a stadndard ATX computer power supply, which provides 12V, 5V and 3.3V rails, so if you're planning to do the whole things, getting one now won't hurt.
Also, let's keep in mind that MAX7221 won’t work with 3.3 V inputs, but there are easy workarounds. STM32’s ports are 5V-tolerant, and I’m fairly sure that with pull-up resistors it will work just fine. In the worst case we can use a buffer or a bus driver IC, or even a few transistors.
The firmware will consist of the following logical modules:
  • Scales reader that will read the position from the scales
  • LED driver that will display the readout to the 7-segment LEDs by sending data to MAX7221’s over SPI.
  • LCD driver that will display the text on the 16x2 text LCD.
  • Keypad reader that will read user input
  • Main DRO module that will provide high-level functionality
The DRO module will run a “super loop” scanning user input, taking commands and sending text to the LCD. Scale reading and LED updates will be driver by a timer interrupt. This dual will ensure that the scales will be read and position displayed even when the user is entering data etc.
The pars are on order (LCD, 7-segment LEDs and the keypad), and while I’m waiting I’ll start writing the software and testing individual modules. Most of the initial debugging can be done with the stuff I already have, so I will probably cobble together some sort of “proof of concept” in a day or two and start posting detailed instructions and code for each module.


  1. Hello,
    Did have any code examples reading scales?

  2. Daniel,
    Please look here: http://www.yuriystoys.com/2012/01/reading-gtizzly-igaging-scales-with.html
    At the bottom of the post there is an Arduino sketch.

    Thank you