Introduction: Almost Entirely 3D-printed Pen Plotter
Recently I got really interested in CNC machines, those are unfortunately expensive and advanced so I wanted to explore the subject in a simpler and cheaper way. So I designed this BBC Micro:bit controlled, almost entirely 3D-printed drawing machine. It works almost like an etch-a-sketch but drawing with a pen on real paper. I really wanted to create something with cheap and easily accesible materials and easy to learn software to make this available to so many people as possible.
The motion of the lead screws is controlled by 2 micro servo motors, the user input is via a joystick and the brain of the organisation is the Micro:bit which is programmed using the code blocks editor.
This is the first time I use a Micro:bit and I chose that microcontroller because I wanted this project to be beginner friendly, which the micro:bit very much made sure of. Programming using code blocks was also SUPER simple once you get the hang of which blocks you want to use.
So let's get to makin it!
Supplies
You will need:
- BBC Micro:bit microcontroller (Link here)
- Micro:bit breakout board (like this one)
- Jumper wires (female-female, male-male and male-female)
- 2 microservo motors (like these) (link is updated to the correct servos)
- Servo motor to lego axle attachment (Like this one)
- 2 axis joystick module (like this)
- Breadboard
- 3D printed parts
- Power drill
- 8mm drill bit
- 5mm drill bit
- Screwdrivers
- Screws ( 8x 10mm by 3.5mm wood screw, 4x 17mm by 3mm wood screw and 8x 20mm M2 screws with nuts)
- (optional) 4x 8mm M3 nylon spacers
- Metal rods (I used 4x 220mm by 8mm aluminum rods)
- MDF base plate (at least 300mm by 300mm)
You will need 2 of some 3D-printed parts, these are:
footer2
worm_gear_2
worm_gear_axle_rod
Attachments
Step 1: Slice and Print Parts
I sliced all the parts using Prusaslicer. My settings were 10% infill with a 0.4mm nozzle. I printed using my Prusa i3mk2.5 and AddNorth E-PLA. Make sure to print the sliders standing up, otherwise they wont slide as good on the rods.
Step 2: Assemble
I printed out a 1:1 copy of the baseplate drawing and marked where the footers should be fastened to the baseplate and marked the positions (attached below). I then placed the sliders on the rods and the carriages on the lead screws. I then pushed the rods into the designated holes in the footers and then inserted the end of the lead screw (You may need to bore up these holes beforehand with the mentioned 8mm drill bit and the 5mm drill bit).
I then attached the footers to the base plate and then mounted the motors.
I got a bit caught up in the moment when I assembled everything so forgive me for not taking enough photos.
I will attach a model of the entire machine so you can hopefully use that for reference on how everything should be connected.
The joystick platform is optional but if you want to use it, mount the joystick with the spacers and then screw it to the baseboard at desired position.
Step 3: Program the Micro:bit
There are great tutorials on youtube on how to get started with the Micro:bit, I recommend you watch some of these first to get a feel for how the code blocks work. This one from Sparkfun is way better at explaining how to get started with the Micro:bit than I could ever be, I suggest you watch it if you are new to the Micro:bit.
https://www.youtube.com/watch?v=kaNtg1HGXbY
When you are a bit comfortable, this is how you program the drawing machine:
Go to https://makecode.microbit.org/# and start a new project using the code blocks editor.
In the forever block, place 2 servo write pin blocks. I used Pin8 and Pin12 as my OUT pins (these will run the motors).
In the part of the block where you put the write value, place a map block.
The map block will take a range of numbers and map it to another range, in this case we will read the analog values from Pin1 and Pin2 and the values will shift from 0 to 1023 (the joystick all the way to one direction and all the way to the other direction) with varying joystick:ing resulting in values inbetween.
So place read analog pin blocks in the input section of the map block and select the pins Pin1 and Pin2 as shown in the picture.
The map block will output (to the write block) the corresponding value in the range 0 to 180 (the motor spinning full speed in one direction to full speed in the other direction).
This is really all there is to it, simple right?
When you are done, you want to upload the code to the micro:bit. Click the download button down to the left of the screen. Connect your micro:bit to your computer using the micro USB cable and the go the file explorer. In the downloads folder, you will have the code file, simply drag and drop it to the micro:bit which will appear as a device in the explorer.
Now the code will be ready to run everytime you power up the micro:bit, which you can do using the same micro USB cable.
Step 4: Connect Everything
Reality is often disappointing, as Thanos said. My wiring was a little bit hard to follow so took a photo of each component and made this schematic, I hope it is clear how everything is wired, my bad if it is not.
Connect one of GND (0V) of the micro:bit to one of the - rows of the breadboard and the other GND to the other -row of the breadboard.
Connect the 3V of the micro:bit to one of the + rows of the breadboard.
Connect the GND pin of the joystick to one of the - rows of the breadboard. Connect the +5V of the joystick to the + row of the breadboard which has the 3V from the micro:bit connected. Connect the VRX pin of the joystick to Pin2 of the micro:bit and connect the VRY of the joystick to Pin1 of the micro:bit.
Connect the GND (brown wire) of one of the servo motors to one of the - rows of the breadboard. Connect the +V wire of the motor (red wire) to the +row of the breadboard which is connected to the micro:bit. Connect the signal wire (Orange wire) to Pin8 of the micro:bit.
Connect the other motors GND (brown wire) to the OTHER -row of the breadboard. Connect the +V wire (red wire) to the +row of the breadboard which has 3V from the micro:bit. Connect the signal wire (Orange wire) to Pin12 of the micro:bit.
The breakout board comes with 2 rows of 2 pins with Ground (GND or 0V). Make sure to connect the GND ends of the servo wires to DIFFERENT rows of 0V, I'm not skilled enough in the field of electronicws to explain why but I had some problems with interference if I had the wires connected to the same row. Maybe someone can explain this to me in a comment?
The only reason for the breadboard is because we need 3 wires with 3V, if you want to you can just connect 1 wire to 3V and split it to 3, to get rid of the breadboard.
Hook up the power to the micro:bit and you are done!
Step 5: Attach Pen and Draw Something!
The pen holder with the outside threads is conical on the inside so slide it over a pen which will fit and screw it into the opposite pen holder until the pen touches the paper. I added the possibility to fasten the inner pen holder with a screw through the outer holder but it turned out the pen stayed safe in anyways.
Now the only thing stopping you is your creativity! (and perhaps time, the drawing machine is a bit slow...)
Draw something pretty and post the result in the comments. Happy making!