Cutting thin sleeves at circlesaw using step motors and Arduino to move fence

Steadily under construction.


Cutting thin sleeves on a circlesaw MAY be dangerous doing it the wrong way :Link1

Here’s a good handling to minimize danger:Link2

Problem solved :slight_smile: …if You like puzzle with motors,programming, uC, its not :slight_smile:


To make a jig that moves a saw fence a distance (input from a keypad) each time you press a button showing input distance on a display

This way, You won’t be dependant of a single point contact with object to be cut and the sawblade.
You will (hopefully) get an accurate movement of fence movement without need of new measurements every time You need to change width of the object. (piece of wood).

You will also get a larger area to glide the object to,entering the sawblade (not a single point as You get from i.e. a featherboard.




All red wirestubs from each module ends up at breadboard + line.
All black wirestubs from each module ends up at breadboard – line


#include <AccelStepper.h>
#include <MultiStepper.h>
#include <Keypad.h>
#include <Wire.h>
#include <Stepper.h>
#include <utility/Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

#define STEPS 100
// define display instance
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// define step motor instances and driver pins
// AccelStepper stepperx(AccelStepper::DRIVER, 12, 13);
Stepper stepper(STEPS, 10, 11, 12, 13);

// define variables for motordriver
byte sXpin_s=12;  // stepmotor x-retning stepp
byte sXpin_d=13;  // stepmotor x-retning direction

// define keypad variables
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

// define switches/buttons variables
boolean nodstop = false;
boolean motorstart= false;

int number=0; // distance, as integer, to move fence
String inpnumber=""; //numbers,as characters, input from 3x4 keypad
String dummy="";
int numberlength=0;
char key;
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  keypad.addEventListener(keypadEvent); // Add an event listener for this keypad
  pinMode(9,INPUT); // input true, start moving fence
  pinMode(sXpin_s, OUTPUT);
  pinMode(sXpin_d, OUTPUT);


  lcd.begin(16, 2);
  lcd.print("Avstand i mm ?");



void loop()
 key = keypad.getKey();
                    lcd.print("motor running");
    // lcd.print(number);         
}  // end loop function

// events

void keypadEvent(KeypadEvent key)
    switch (keypad.getState()){
    case RELEASED:
        if(key=='#' && number<401)
        if(key == '#' && number>400)
        lcd.print("Nummer > 400");                              
        // write to lcd display :number must be less than 401 mm
        // blink tekst twice
        // write number to display, blink twice

        if(key == '*')
   case PRESSED:
    if (key== '1' || key=='2' || key=='2'|| key=='3'|| key=='4'|| key=='5'|| key=='6'|| key=='7'|| key=='8'|| key=='9'|| key=='0')
          lcd.print(" mm");


   case HOLD:
               {// move fence back to startposition

TESTING OUT MODULES with function snippets:



1 pcs Arduino uC. i.e.: Arduino Uno uC
1 pcs LCD display. i.e.: LCD display
1 pcs I2C shield i.e.: I2C shield
1 pcs 3x4 Keypad i.e: 3x4 keypad
1 pcs stepmotor driver i.e.: Stepmotor driver breakout board
2 pcs NEMA-17 type stepmotor i.e.: NEMA-17 Stepmotor
X pcs signalwires i.e.: Signal wires
i.e.: Signal wires
1 pcs breadboard i.e.: Breadboard
1 pcs communication cable i.e.: USB cable A-B
1 Pcs 12vdc powersupply (for motordriver) i.e.: I=3Ampere

All others: