This web site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more.

Electronics for CNC apparates

Last update: 31/07/2015

This article regards a simple (and cheap) ruler for CNC machines (or any other robotic appliance) based on a Microchip 16F887 pic. It captures, from a parallel port, the same step-dir signals to be sent to the cnc interface. There are no particular reasons about the choice of such pic but we have to consider that the 16F887 is cheaper than the 'old' 16F877, it is fast enough and has pins and internal functions necessary to satisfy all our needs.


The project is really simple and cheap. We have used a couple of led to display the signs + (green) - (red), saving the use of a further 7 digs segment display. The value is shown on a 4 digs 7 segment display and the range is +/-999.9 mm.

righello per CNC Righello


Schematics and boards files (naturally available and downloadable from the repository) have been divided into two parts. The first part regards the logic of the project while the second regards the display, vertically mounted. Both are single side pcbs. A few jumpers are needed.

It is important to pay a look to the schematics:

Righello CNC

The display is quite traditional. A four digits - 7 segments - 0.56 inches, common cathode display and four 2sc1815 (or any other NPN small signal transistor) have been used.

Using a common anode display schematic must be modified accordingly and transistor changed (pnp).

Resistor values are not critical. R1-R8 180-330 ohms (according to the display), 330ohms for the two leds. 1k or more for the others connected to the transistor's base.

- input is triggered by a 74ls14. Pulses are counted on falling edges

- input must be connected to the parallel port (step, dir, gnd) signals

- pin RA5 select the motor (200 steps/turn). If a 400 steps/turn motor is used the pin RA5 must be connected to the ground and the resistor R14 removed

- RC0 and RC1 pins select the cnc interface (1/2-1/4-1/8-1/16)

- RC2 and RC3 pins select the pitch of the screw (1-2-4-5 mm). Sorry, no imperial meausures

- the crystal is 20Mhz

- all resistors are 10K (5mm)
righello cnc 16f887

righello con 16F887





Diritti riservati 2008-2015. Tutti i marchi riportati sono detenuti dai legittimi proprietari. Tutto il materiale e` liberamente utilizzabile ma non per scopi commerciali. Non si assume alcuna responsabilita` sul materiale pubblicato per eventuali danni diretti o indiretti che possano derivare dall`utilizzo di schemi, progetti o altro materiale presente nel sito. Inviare una mail a: (contenuti) (webserver) per domande e/o suggerimenti.