Project in progress
CNC Plotter

CNC Plotter © CC BY-NC-SA

Mobile-controlled CNC plotter.

  • 12,697 views
  • 4 comments
  • 32 respects

Components and supplies

About this project

Type Any Text Of Maximum (5) Letters And The Plotter Will Write It For You.


Code

CNC Writing Code C/C++
It Writes any Word Of (5) Letters
FUTURE WORK :
-Control It by Voice
#define CUSTOM_SETTINGS
#define INCLUDE_KEYBOARD_SHIELD
#define INCLUDE_LCD_SHIELD

#include <OneSheeld.h>
#include <Servo.h>
#include<AFMotor.h>

AF_Stepper motorx(200, 1);
AF_Stepper motory(200, 2);

Servo myservo;

char dataArray[6];
int counter = 0;
int flag =0;
void setup() {
  // put your setup code here, to run once:
  OneSheeld.begin();
  motorx.setSpeed(40);
  motory.setSpeed(40);
  myservo.attach(9);
  AsciiKeyboard.setOnButtonChange(&myFunction);

}

void loop() {
  // put your main code here, to run repeatedly:

}


void myFunction(char data)
{
  dataArray[counter] = data;
  counter ++ ;

  if(counter == 5)
  {
    counter = 0;
    for (int i=0;i<5;i++)
    {
    switch (dataArray[flag]) {
    case 'A':
       Aletter();
      break;
    case 'B':
      Bletter();
      break;
    case 'C':
      Cletter();
      break;  
     case 'D':
      Dletter();
      break;
    case 'E':
      Eletter();
      break;
     case 'F':
      Fletter();
      break;
     case 'G':
      Gletter();
      break;
     case 'H':
      Hletter();
      break;
     case 'I':
      Iletter();
      break;
     case 'J':
      Jletter();
      break;
     case 'K':
      Kletter();
      break; 
     case 'L':
      Lletter();
      break;
     case 'M':
      Mletter();
      break;
     case 'N':
      Nletter();
      break;
     case 'O':
      Oletter();
      break;
     case 'P':
      Pletter();
      break;
     case 'Q':
      Qletter();
      break;
     case 'R':
      Rletter();
      break;
     case 'S':
      Sletter();
      break;
     case 'T':
      Tletter();
      break;
     case 'U':
      Uletter();
      break;
     case 'V':
      Vletter();
      break;
     case 'W':
      Wletter();
      break;
     case 'X':
      Xletter();
      break;
     case 'Y':
      Yletter();
      break;
     case 'Z':
      Zletter();
      break;
    
    }
    flag++ ; 
  }
  }
}


void Zletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  motory.step(300, BACKWARD, INTERLEAVE);
  for (int i =0;i<380;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, FORWARD, INTERLEAVE);  
  } 
  motorx.step(120, FORWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE); 
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE); 
}


void Oletter()
{
  myservo.write(20);
  motory.step(130, BACKWARD, INTERLEAVE); //space
  motorx.step(400, FORWARD, INTERLEAVE);

  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(300, FORWARD, INTERLEAVE);// O letter
  
  myservo.write(20);
  motory.step(300, BACKWARD, INTERLEAVE); 
  motorx.step(500, BACKWARD, INTERLEAVE);
}


void Nletter()
{

  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);
  
  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE);
  for (int i =0;i<350;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  motorx.step(400, BACKWARD, INTERLEAVE); // N letter
}


void Eletter()
{
  myservo.write(20);
  motory.step(400, BACKWARD, INTERLEAVE); //space


  myservo.write(53);
  motory.step(300, FORWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE);

  myservo.write(20);
  motory.step(300, FORWARD, INTERLEAVE);
  motorx.step(250, BACKWARD, INTERLEAVE);

  myservo.write(53);
  motory.step(220, BACKWARD, INTERLEAVE);// E letter
  
  myservo.write(20);
  motory.step(80, BACKWARD, INTERLEAVE);
  motorx.step(250, BACKWARD, INTERLEAVE);
}

void Lletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE);
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);

}

void Aletter()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);
  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE);
 
  motory.step(300, BACKWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
 
  myservo.write(20);
  motory.step(300, FORWARD, INTERLEAVE);
  motorx.step(200, BACKWARD, INTERLEAVE);
 
  myservo.write(53);
  motory.step(300, BACKWARD, INTERLEAVE);
 
  myservo.write(20);
  motorx.step(300, BACKWARD, INTERLEAVE);
}

void Bletter ()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(200, BACKWARD, INTERLEAVE);
  motory.step(200, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(300, BACKWARD, INTERLEAVE); //space
}

void Cletter ()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
   myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(100, BACKWARD, INTERLEAVE);
  
  myservo.write(20);
  motory.step(200, FORWARD, INTERLEAVE);
  motorx.step(400, BACKWARD, INTERLEAVE);
  
  myservo.write(53);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(100, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(100, BACKWARD, INTERLEAVE); 
}

void Dletter ()
{
   myservo.write(20);
  motory.step(300, BACKWARD, INTERLEAVE); //space
  
   myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(200, FORWARD, INTERLEAVE);
  motorx.step(200, BACKWARD, INTERLEAVE);
  motory.step(200, BACKWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(300, BACKWARD, INTERLEAVE);  
}

void Fletter()
{
  myservo.write(20);
  motory.step(400, BACKWARD, INTERLEAVE); //space


  myservo.write(53);
  motory.step(300, FORWARD, INTERLEAVE);
  delay(200);
  motorx.step(500, FORWARD, INTERLEAVE);
  delay(200);
  

  myservo.write(20);
  motorx.step(200, BACKWARD, INTERLEAVE);

  myservo.write(53);
  motory.step(250, BACKWARD, INTERLEAVE);// E letter
  
}

void Gletter ()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
   myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(100, BACKWARD, INTERLEAVE);
  motory.step(50, FORWARD, INTERLEAVE);
  motory.step(100, BACKWARD, INTERLEAVE);
  motory.step(50, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motory.step(200, FORWARD, INTERLEAVE);
  motorx.step(400, BACKWARD, INTERLEAVE);
  
  myservo.write(53);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(100, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(100, BACKWARD, INTERLEAVE);
}

void Hletter()
{
    myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);  
  
  myservo.write(20);
  motorx.step(250, BACKWARD, INTERLEAVE);
 
  myservo.write(53);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(250, FORWARD, INTERLEAVE); 
  motorx.step(500, BACKWARD, INTERLEAVE);    
}

void Iletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
   
   myservo.write(53);
  motory.step(200, BACKWARD, INTERLEAVE);
  motory.step(100, FORWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(100, FORWARD, INTERLEAVE);
  motory.step(200, BACKWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
}

void Jletter()
{
  myservo.write(20);
  motory.step(200, BACKWARD, INTERLEAVE); //space 
  
   myservo.write(53);
  motory.step(200, BACKWARD, INTERLEAVE);
  motory.step(100, FORWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(200, FORWARD, INTERLEAVE);
  motorx.step(100, BACKWARD, INTERLEAVE);
  
  myservo.write(20);
  motory.step(300, BACKWARD, INTERLEAVE);
  motorx.step(400, BACKWARD, INTERLEAVE);
}

void Kletter()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space 
  
   myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE); 
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(250, BACKWARD, INTERLEAVE);
  
  myservo.write(53);
  for (int i =0;i<250;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, FORWARD, INTERLEAVE);  
  }
 
 for (int i =0;i<250;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }  
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);  
}

void Mletter()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);
  
  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE);
  
  for (int i =0;i<200;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  for (int i =0;i<200;i++)
  {
    motorx.step(1, BACKWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  motorx.step(500, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);  
}

void Pletter()
{
   myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);  
  
  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE); 
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(300, FORWARD, INTERLEAVE);  
  motory.step(200, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(300, BACKWARD, INTERLEAVE);
}

void Qletter()
{
  myservo.write(20);
  motory.step(130, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);

  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(300, FORWARD, INTERLEAVE);
  motory.step(280, BACKWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(50, BACKWARD, INTERLEAVE);
  
  myservo.write(53);
  for(int i=0;i<130;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  myservo.write(20);
   motory.step(80, FORWARD, INTERLEAVE);
   motorx.step(580, BACKWARD, INTERLEAVE); 
}

void Rletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  motorx.step(500, FORWARD, INTERLEAVE);  
  
  myservo.write(53);
  motorx.step(500, BACKWARD, INTERLEAVE); 
  motory.step(200, BACKWARD, INTERLEAVE);
  motorx.step(300, FORWARD, INTERLEAVE);  
  motory.step(200, FORWARD, INTERLEAVE);
  
  for(int i=0;i<200;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  
}

void Sletter()
{
  myservo.write(20);
  motory.step(500, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  motory.step(400, FORWARD, INTERLEAVE);
  motorx.step(250, FORWARD, INTERLEAVE);
  motory.step(400, BACKWARD, INTERLEAVE);
  motorx.step(250, FORWARD, INTERLEAVE);
  motory.step(400, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(400, BACKWARD, INTERLEAVE); 
}

void Tletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
   
   myservo.write(53);
  motory.step(300, BACKWARD, INTERLEAVE);
  motory.step(150, FORWARD, INTERLEAVE);
  motorx.step(500, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(150, BACKWARD, INTERLEAVE);  
}

void Uletter()
{
  myservo.write(20);
  motory.step(130, BACKWARD, INTERLEAVE); //space

  myservo.write(53);
  motorx.step(500, FORWARD, INTERLEAVE);
  motory.step(300, BACKWARD, INTERLEAVE);
  motorx.step(500, BACKWARD, INTERLEAVE);
  
}

void Vletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  for(int i=0;i<500;i++)
  {
    motorx.step(3, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  for(int i=0;i<500;i++)
  {
    motorx.step(3, BACKWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
}

void Wletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  for(int i=0;i<500;i++)
  {
    motorx.step(5, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  for(int i=0;i<100;i++)
  {
    motorx.step(5, BACKWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
   for(int i=0;i<100;i++)
  {
    motorx.step(5, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
   for(int i=0;i<500;i++)
  {
    motorx.step(5, BACKWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
}

void Xletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
   for(int i=0;i<500;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, BACKWARD, INTERLEAVE);  
  }
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);

   myservo.write(53);
   for(int i=0;i<500;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(1, FORWARD, INTERLEAVE);  
  }
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(500, BACKWARD, INTERLEAVE);  
}

void Yletter()
{
  myservo.write(20);
  motory.step(100, BACKWARD, INTERLEAVE); //space
  
  myservo.write(53);
  for(int i=0;i<150;i++)
  {
    motorx.step(1, FORWARD, INTERLEAVE);
    motory.step(3, BACKWARD, INTERLEAVE);  
  }
  for(int i=0;i<150;i++)
  {
    motorx.step(1, BACKWARD, INTERLEAVE);
    motory.step(3, BACKWARD, INTERLEAVE);  
  }
  
  myservo.write(20);
  motorx.step(150, FORWARD, INTERLEAVE);
  motory.step(450, FORWARD, INTERLEAVE); 
  
  myservo.write(53);
  motorx.step(350, FORWARD, INTERLEAVE);
  
  myservo.write(20);
  motorx.step(500, BACKWARD, INTERLEAVE);
  motory.step(450, BACKWARD, INTERLEAVE);
  
}

Custom parts and enclosures

CNC Plotter Design
Manufacturing.rar

Schematics

Circuit Schematic
final_shield.fzz

Comments

Submitted to Contest

Mini Soldering Iron + Grove - Starter Kit for Arduino + 20% discount voucher from Seeed Studio + 1Sheeld T-shirt + Hackster T-shirt

Smartphone Hacks Challenge

Team members

14951 849099038448642 4902895189815101221 n
Fakhr El-deen Gamal
  • 2 projects
  • 19 followers
15644448 10210809919111400 741345276 n wvupgxkkli
Mohamed Sami
  • 1 project
  • 5 followers

Additional contributors

Published on

October 6, 2015

Members who respect this project

AmrousyGithub profile pic tsfwg3xzqnMerlin arch 4fnrmpnf6jDefault3cw3cmfvDefaultDefaultDefault

and 24 others

See similar projects
you might like

Similar projects you might like

Arduino CNC Pen Plotter

Project in progress by Niko123

  • 4,346 views
  • 2 comments
  • 17 respects

Arduino Based Mini CNC 2D Plotter

Project showcase by Mrinnovative

  • 75,700 views
  • 13 comments
  • 187 respects

How to make mini CNC 2D plotter using scrap DVD drive, L293D

Project tutorial by Sandeep Sharma

  • 33,064 views
  • 21 comments
  • 77 respects

CNC Flatbed Pen Plotter

Project in progress by Rodion Borisov

  • 8,612 views
  • 3 comments
  • 18 respects

Mini Arduino CNC

Project tutorial by Zain Shahwar

  • 71,230 views
  • 8 comments
  • 99 respects

PENXZYL 3.0 :: Arduino Brush Plotter :: CNC

Project showcase by Guiye Perez Bongiovanni

  • 7,736 views
  • 6 comments
  • 30 respects
Add projectSign up / Login