Tim's Mini Plotter 2 With Single PCB
by Palingenesis in Circuits > Microcontrollers
21251 Views, 181 Favorites, 0 Comments
Tim's Mini Plotter 2 With Single PCB
The video is of the original Mini Plotter 2 to show how it works.
Story
This is a PCB Version of mini plotter I did quit a while ago, my original mini plotter I made of standard modules I bought and a home made PCB.
Details of the original can be found at my Blog.
Tim's Mini Plotter 2 (tims-mini-plotter2.blogspot.com)
I go into more detail on how I compressed files to fit on the memory in my blog.
do a great offer in prototyping PCBs, so I decided to make a version based around a single PCB. This is the same as the original except for the electronics, it has been made slightly longer to accommodate a single PCB.
My Brief
For this project, I wanted to make a compact portable plotter using 2 motors from CD/DVD Drives. I wanted to use the cheap L298 drivers. I wanted to give it some memory where it can store some plots, and have a menu system to set some basic settings and be able to chose plots stored in memory.
What I use
I use FreeCAD to design my 3D Prints, and KiCAD EDA to design my PCB. Both these programs can integrate with each other. They are open source and I recommend them. KiCAD EDA also has a plugin from that makes it simple to order PCBs.
There are some Live Streams I did when making this.
Treat my live streams like you would a reference book, click through it to find bit you are interested in.
Tim Live Part 1 of Mini Plotter (youtube.com)
Tim Live Part 2 of Mini Plotter (youtube.com)
Tim Live Part 3 of Mini Plotter (youtube.com)
I also did a follow up video.
Tim's Mini Plotter 2 [Live stream follow up] (youtube.com) (I hope you find this one entertaining)
I also have a GitHub Page for this project.
Palingenesis/Mini_Plotter_2_Single_PCB: A Portable Mini Plotter (github.com)
Note!
Programming the memory may look a little complex.
I have tried to make it flexible so that you will be able to load your own Plots into the memory.
My blog goes into more detail about saving memory space.
I hope the videos help.
Supplies
PCB
As this version is based around a PCB I had made at
I have done a Shared project at There is all the Gerber Files and a BOM there.
Tim's Mini Plotter 2 - Share Project - PCBWay
Additional Components
In addition to the PCB the are components listed here:
An Arduino NANO.
2 Stepper Motors.
An OLED.
A Servo SG90.
2 L293 Drivers.
Some 3mm polished Linear Rod.
A small spring.
Some M1.7x6mm self tap flat nose screws.
3D printed parts.
Dupont Connectors.
Tools
3D Printer.
USBasp Programmer. (See Updating a USBasp Chinese Clone Using an Arduino Uno : 3 Steps - Instructables)
A hot plate, (Tim's Hot Plate : 36 Steps (with Pictures) - Instructables)
Software
There is also some Software that I wrote required.
3D Prints
STL files for 3D printing are attached.
The PCB
I know I have mentioned a lot, but that's where I had the PCB Made.
I use KiCAD EDA to design my PCB, and make it very easy to order a PCB.
Just one click on there KiCAD plugin button and all the hard work is done for you.
Your order is placed on there web site and all you have to do is enter your address info and pay.
For you to get this PCB you can go to my Shared Project page.
- Chose your option.
- Add to cart.
For a BOM you can download form my Shared Project page or my GitHub.
The parts I have listed above are the Parts not directly connected to the PCB.
I did a video stream of me assembling my PCB. Tim Live Part 1 of Mini Plotter (youtube.com)
Stepper Motors
Info
The stepper motors I am using for this project are motors I repurposed from some CD/DVD drives.
The dimensions are approximate, I have put holes to suit what I have shown.
Care should be taken when soldering new cables to these motors, it is very easy to melt the coil bobbins.
The only data I could find for these type of motors was from a data sheet for a PL15S-020. (I will assume other makes are similar)
I soldered my own cables to the stepper motors.
If you get stepper motors with ribbons attached, I recommend just cutting the excess of.
It is very easy to melt the pin off the bobbins of this type of stepper motor.
To connect these to the PCB, I have a four way DuPont female connector.
The cable I use is 4 way Servo cable.
OLED
The OLED needs to be as shown.
The PCB has been designed for this one to fit.
Pin order viewed from the top: GND, VCC, SCL, SDA.
Size: 0.9" (inch).
Resolution: 128 x 64.
Driver: SSD1306.
Arduino Code
As mentioned all my files are available on GitHub.
Again, though I ask, one of the files are not supported here.
The code for the Arduino are a HEX and an EEP file.
These needs to be uploaded using AVRDUDE.
This is instruction for backing up and restoring data on an Arduino NANO. aka ATMega328p Using AVRDUDE in the windows terminal.
To upload the files an USBasp tool is required.
See my Instructable for upgrading one to know more about these.
Updating a USBasp Chinese Clone Using an Arduino Uno : 3 Steps - Instructables
Replace "Backup" with the name of the corresponding name of my files for this project.
You will not need to backup, I have included it just so you know how to do it.
My files are:
First thing is know where your copy of AVRDUDE is installed on your computer.
I am using the copy Arduino IDE uses and is installed on my E: Drive.
If yours is in the default on C:, you will probably only need to change E: for C:
There is the location for AVRDUDE.EXE "E:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude"
There is the location avrdude.config "E:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf"
The files created/used will be in the location your are in in the windows terminal.
You must be in the location the files are or you want them to be.
The file names used here in the example are:
backup_flash.hex
backup_eeprom.eep
If you are backing up a specific device, I suggest renaming them to something relevant.
So to upload my files you replace the names with the name of my files above.
Back up HEX and EEPROM (ATMega328p) with USBasp
Restore HEX and EEPROM (ATMega328p) with USBasp
Memory
You may just want to watch the video :)
I have use two 24C256 I2C Memory Chips, there is room for three.
You will find all software on my GitHub to program the memory.
One of the videos I did goes through the process of programming the Memory. Tim Live Part 3 of Mini Plotter
No need to bother with the first 18 minutes.
My blog goes into a lot more of the details on how all this works. Tim's Mini Plotter 2: Adding Memory to Arduino NANO and compressing G-Code (tims-mini-plotter2.blogspot.com)
Tim's EEPROM Writer
Note!
I have not made the program idiot proof, that is: Do the wrong things and it may crash.
After all, I originally just wrote it for me.
Also window may give warnings when you install it. (I used Microsoft Visual Studio Community Edition to write it and I haven't signed it)
As with all the Applications I write It is all about trust.
To use this:
You need an Arduino (any type) plugged into you computer via a USB.
The Arduino must have Tims_Arduino_Memory_Writer_Firm.ino Installed.
The EEPROM needs to be connected to the Arduino.
First we need to connect to the Arduino.
In the Coms section, choose the correct COM Port the Arduino is connected to.
Set the communication speed to 115200.
Click the connect button. (if it connects, the status will be written green)
Note! Only 1 device can be connected to a COM Port at a time, make sure your Arduino IDE Serial Monitor is not connected.
The First Memory Chip (Mem 1) [Menu Text]
Once connected, "Browse" for the file: Memory_Words.txt
To send this file, the Pre-set "Send Words" must be selected.
This is a pre-set, you will notice that the settings for "Start Address" and "Page Length" Have been set, and cannot be changed.
This is so things happen according to the rules I have talk about on my blog.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
After conformation, click the "Send" button.
Where it currently shows Done, data being sent should appear.
When all is done, "Done" should be displayed again.
After this first part, the Arduino NANO with be able to use the data to create the menu.
The First Memory Chip (Mem 1) [Plot Data]
On my Git there are several G-Code files.
I would list them here but the files have my extension ".tgc" (Tim's G Code)
I have given them my extension because they are a simple form of G-Code.
- Cube 001 Cube.tgc
- Snowflake 002 Snowflake.tgc
- Wolf 003 Wolf Howling.tgc
- Links 004 Links.tgc
- Witch 005 Witch on a Stick.tgc
- Unicorn 006 Unicorn.tgc
- Butterfly 007 Butterfly.tgc
- Spider 008 Spider.tgc
- Triangles 009 Triangles Rotating.tgc
- Skull 010 Skull.tgc
- Tim 011 Tim Logo.tgc
- Alien 012 Alien.tgc
- Agent 013 Agent.tgc
- 5 P Star 014 5p Star.tgc
- 9 P Star 015 9p Star.tgc
- 18 P Star 016 18p Star.tgc
- Reaper 017 Reaper.tgc
- Octopus 018 Octopus.tgc
- Corner 1 019 Corner_1.tgc
- Corner 2 020 Corner_2.tgc
- Corner 3 021 Corner_3.tgc
- Corner 4 022 Corner_4.tgc
- Inst Robot 023 Inst_Robot.tgc
I have numbered/listed them all so that we are working on the same page so to speak.
Upload them in this order.
I will be linking a Text file with the notes made from saving these plot files. (Similar to what we did with the "Words" and "Phrases") (I saved them in this order)
Once connected, "Browse" for the first plot file.
To send a plot file, the Pre-set "Compress Code" must be selected.
This is a pre-set, you will notice that the settings for "Page Length" has been set, and cannot be changed, but "Start Address" this time needs setting to 3000. (3000 is the address where Plot files start on EEPROM 1)
I have left "Start Address" changeable so that more plot files can be added at a later date.
This again is; so things happen according to the rules I have talked about on my blog.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
It is important that the Arduino is told where to start saving data, before sending a file, otherwise other data on the EEPROM could get corrupted.
After conformation, click the "Send" button.
Where it currently shows Done, data being compressed should appear.
When all is done, "Done" should be displayed again.
This time the data being sent is shown underneath where it currently show done, it is represented by three characters.
When done sending, to the right of "Start Address" and above "Send Settings" button, There are two numbers:
The lower number is the number of characters sent. (How long the plot is)
The upper number is the next address to use to save a plot file.
Before we continue we need to make a new text file to save notes on what we want to name the plot, the address where it starts, and how long the plot is.
I have done a Plot_Names.txt file.
This file is made as you upload you plots to the EEPROM. (You create it manually)
You will see that each line of plot file has an extra piece of data (1). This is EEPROM number.
I have mentioned my Mini Plotter has three EEPROM's. (so my program expects this rule as well)
So the rules for the Plot_Names text file is as follows:
Each plot has it's information on one line.
Each piece of information separated by a comma.
First, the Name we give it. (Not more than 10 characters and does not contain a comma)
Next, the EEPROM number. (The above plots will all fit on EEPROM 1)
Next, the start address. (3000 to 31999 for EEPROM 1)
Lastly, the length of the plot file.
To continue saving:
Make sure "Compress Code" checkbox is still ticked.
"Browse" for the next plot file.
Enter the address where to start saving the plot file. (To make it easy to enter the next address, you can double click the upper number above the "Send Settings" button)
Once the address has been entered, click the "Send Settings" button.
After conformation that the settings have been set in the "Feed Back" window, click "Send".
When the plot is saved. Remember to make notes of all the names, start addresses and plot lengths.
The First Memory Chip (Mem 1) [Number of Plots]
After uploading all the plots to be saved. We need to let the menu system on my Mini Plotter know how many plots to look for.
To send the number of plots, the Pre-set "Number of Plots" must be selected.
This is a pre-set, you will notice that the settings for "Start Address" and "Page Length" Have been set, and cannot be changed.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
The number of plots can be entered in the "Number Of Plots" box. There is a rule here also, the number must +1, one mor than you uploaded.
Click the "Send Number Of Plots" button to set the number of plots.
As I have only allocated enough room for 166 plot names, (one of the rules in my blog) 1 byte can hold this.
The First Memory Chip (Mem 1) [Plot Names Text]
As you was uploading the Plot Data in Step 7, you should have been creating a Plot_Names.txt file.
It should look like the one shown.
This needs to be uploaded so that the names can be seen in the Plotter menu.
Once connected, "Browse" for the file: Plot_Names.txt
To send this file, the Pre-Set "Send Plot Names +" must be selected.
On selecting this pre-set, you will notice that the settings for "Start Address" and "Page Length" Have been set, and cannot be changed.
This is so things happen according to the rules I have talked about in my blog.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
After conformation, click the "Send" button.
Where it currently shows Done, data being sent should appear.
When all is done, "Done" should be displayed again.
Text Characters [Memory 3]
My Blog ends at this point, but a some time later after writing it I added Text Characters to my Plotter.
This is done in the same way as Plot Data and Plot Names.
This time though they are saved om Memory 3.
I have grouped these file into categories.
This is the order to upload them to the EEPROM 3.
There is a lot, so it will take time.
Be carful not loose track of the start address of each.
Once connected, as before "Browse" for the first plot file.
To send a plot file, the Pre-set "Compress Code" must be selected.
This is a pre-set, you will notice that the settings for "Page Length" has been set, and cannot be changed, but "Start Address" this time needs setting to 1000. (1000 is the address where Character files start on EEPROM 3)
I have left "Start Address" changeable so that more character files can be added.
This again is; so things happen according to the rules I have talked about on my blog.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
It is important that the Arduino is told where to start saving data, before sending a file, otherwise other data on the EEPROM could get corrupted.
After conformation, click the "Send" button.
Where it currently shows Done, data being compressed should appear.
When all is done, "Done" should be displayed again.
This time the data being sent is shown underneath where it currently show done, it is represented by three characters.
When done sending, to the right of "Start Address" and above "Send Settings" button, There are two numbers:
The lower number is the number of characters sent. (How long the plot is)
The upper number is the next address to use to save a plot file.
Before we continue we need to make a new text file to save notes on what we want to name the plot, the address where it starts, and how long the plot is.
I have done a Plot_Charectors.txt file.
This file is made as you upload you plots to the EEPROM. (You create it manually)
You will see that each line of plot file has an extra piece of data (3). This is EEPROM number.
I have mentioned my Mini Plotter has three EEPROM's. (so my program expects this rule as well)
So the rules for the Plot_Charectors.txt text file is as follows:
Each plot character has it's information on one line.
Each piece of information separated by a comma.
First, the Name we give it. I have used the ASCII Character number for the names (Not more than 10 characters and does not contain a comma)
Next, the EEPROM number. (The above character plots will all fit on EEPROM 3)
Next, the start address. (1000 to 31999 for EEPROM 3)
Lastly, the length of the plot file.
To continue saving:
Make sure "Compress Code" checkbox is still ticked.
"Browse" for the next plot file.
Enter the address where to start saving the plot file. (To make it easy to enter the next address, you can double click the upper number above the "Send Settings" button)
Once the address has been entered, click the "Send Settings" button.
After conformation that the settings have been set in the "Feed Back" window, click "Send".
When the plot is saved. Remember to make notes of all the names, start addresses and plot lengths.
Text Characters [Plot Characters Text]
As you was uploading the Plot Data in Step 10, you should have been creating a Plot_Charectors.txt file.
It should look like the one shown.
This needs to be uploaded so that the names can be seen in the Plotter menu.
Once connected, "Browse" for the file: Plot_Charectors.txt
To send this file, the Pre-Set "Send Plot Characters" must be selected.
On selecting this pre-set, you will notice that the settings for "Start Address" and "Page Length" Have been set, and cannot be changed.
This is so things happen according to the rules I have talked about in my blog.
Now click "Send Settings" button. when the settings on the Arduino have been set, a conformation should be shown in the "Feed Back" window.
After conformation, click the "Send" button.
Where it currently shows Done, data being sent should appear.
When all is done, "Done" should be displayed again.
Plastic Parts
There is a special orientation for some of the parts to print correctly.
I have shown in the image which way I printed the parts.
I did not print all the parts at the same time. The image is just to show the orientation.
All parts are made of PLA.
Assembly [Base]
Attach Stepper Motor to Base.stl using 2 screws.
I added a sketch to show where the Screw Shaft should be positioned.
There are many stepper motors to chose from, hopefully you can get one that is close to the correct size.
It is important that the foot that sits on the Screw Shaft is a good fit.
Attach PCB using 4 screws.
Assembly [Y Axis Stepper Motor]
Attach Stepper Motor to Part_Y using 2 screws.
I added a sketch to show where the Screw Shaft should be positioned.
There are many stepper motors to chose from, hopefully you can get one that is close to the correct size.
It is important that the foot that sits on the Screw Shaft is a good fit.
Assembly [Servo]
Attach the Servo to Part_X.stl using 2 screws.
Check the image for orientation.
Set the Servo to it's central position to fit the Horn. (use screw that came with Servo)
The horn I used was a four arm type.
The horn will need trimming, see image.
Assembly [Tool Holder]
Attach the Tool_Holder.stl to Part_Z.stl using 4 screws.
Check the image for orientation.
Fit the Holding_Screw.stl
The Tool_Holder.stl has two psitions for the Holding_Screw.stl
Top is for holding a small laser.
Bottom it for holding a pen.
Assembly [Z Axis]
Before fitting the Linear Rod, make sure that the Linear rod slides freely and smoothly through Part_Z.stl
Fit Part_Z.stl over the Horn of the Servo.
Align a small Spring above the Part_Z.stl
Slide a 3mm linear rod through the top of Part_X.stl and the other parts.
Then secure the Linear Rod in place with a screw.
Notes
Linear Rod is a mirror polished type, very smooth.
This rod is 71mm long.
The spring is a week one.
Made from wire no more than 0.6mm diameter.
The diameter should be a slack fit over the Linear Rod.
The length is approximately 25mm.
The spring needs to be just strong enough to hold the pen against the paper.
Assembly [Y Axis]
Before fitting the Linear Rod, make sure that the Linear rod slides freely and smoothly through Part_X.stl
Hold Part_X.stl in position.
Slide a 3mm linear rod through the end of Part_Y.stl and through Part_X.stl .
Then secure the Linear Rod in place with a screw.
Notes
Linear Rod is a mirror polished type, very smooth.
This rod is 96mm long.
Assembly [X Axis]
Before fitting the Linear Rod, make sure that the Linear rod slides freely and smoothly through Part_Y.stl
Hold Part_Y.stl in position.
Slide a 3mm linear rod through the end of Base.stl and through Part_Y.stl .
Then secure the Linear Rod in place with a screw.
Notes
Linear Rod is a mirror polished type, very smooth.
This rod is 97mm long.
Assembly [Side Support]
Fit the Side_Slide.stl to the side of the Base.stl using 3 screws.
Assembly [Control Knob]
Fit the Knob.stl to the Rotary Encoder Switch.
This knob is designed for the type of Rotary Encoder Switch that has Star Groves like the one shown in the image.
Assembly [OLED Support]
I have made a support OLED_Support.stl
Attach as shown using 2 screws.
There is a correct orientation, so that it does not hit the memory chips.
The OLED has Dupont Pin Header fitted, so that it just plugs into a Dupont female header on the PCB.
This is to make it easy to access the memory modules.
Chips
Fit the components to the PCB.
I have tried to mark all connections on the PCB.
Be sure to get the Servo connected the correct way.
There is a 2 pin header for 5 volts auxiliary tool (laser) this can be selected in the menu.
I added an extra I2C connection, Just In Case.
The Stepper Motor connections.
Pins 1 and 2 are coil A.
Pins 3 and 4 are coil B.
If the Stepper Motors Move in the wrong direction, you may need to turn the connections.
Power
This circuit is wired to Limit Current to the Stepper Motors.
Voltage will give speed.
I run mine at 10 Volts.
The Linear regulator on the Arduino NANO is setting the max voltage you can use.
My NANO has a AMS1117 5.0 Linear Regulator, this has a limit of <12v.
Happy Plotting
Although the Plot size is limited to 40mm x 40mm.
Through creation of the right type of pattern larger things can be drawn.
Your not limited to the Plots I have created, I hope that was clear.
I do hope I explained this in a way you can reproduce it.
I have done some videos to try and help, Defiantly not a pro. at making video though. haha.
There is also my original Blog that goes into detail about coding rules I used to achieve the reduced memory space.