Introduction: DIY Multi-Purpose Robot Base and Motor Shield
Hello everyone, recently I started working on a robotics projects using Arduino. But I didn't have a proper base to work on, the end result didn't look great and only thing I could see is all my components entangled in wires. Trouble shooting any error used to take like forever and wiring things again and again was sometimes frustrating. So I decided to make a multipurpose robot along with a motor driver on which I could attach my other components easily without creating any mess and assemble and dismantle it easily for any modifications.
If you are a beginner and want to get started with robotics or even when you are planning to prototype a bigger robot project first on a small scale, a prototyping base always comes in handy.
This instructable covers the entire process of preparing your acrylic base, adding motors, wheels and also make a DIY motor shield by fabricating a double sided PCB at home. At the end there will be a basic project to check whether everything is done correctly and give a rough idea about what you can do with your robot. After the build, you can then try some of the very basic robots such as these:
- Simple Remote controlled robot (wired)
- Line following robot
- Obstacle avoiding robot
- Bluetooth Controlled robot
- Wireless remote controlled robot (using RF transmitter and receiver / IR remote)
This is my first instructable so forgive me for any mistakes and constructive criticism is welcome.
Step 1: Gather Your Tools and Materials
Since it is a two part build 1. The chassis and 2. Motor shield the list of the tools and parts is divided into two sections respectively.
For chassis :
- Access to a laser cutter (you can look for one in a maker space nearby or search online for local laser cutting service providers)
- Screw driver
- Wire cutter
- Soldering iron + wire
- 3mm acrylic sheet (any color of your choice)
- Geared motors (100 to 200 rpm) x 2
- Wheels x 2
- Caster wheel x1
- M3 x 10 mm nuts and bolts x 20 (or more if lose some)
- 6 cell AA battery holder x 1 (no need if using 12v battery or li-po pack)
- Servo motor x 1(optional)
- M2 x 25mm nuts and bolts x (for fixing motors)
- Toggle switch x 1
- Insulated wire (for connections)
For Motor Shield :
- Soldering iron + wire
- Mini drill or hand drill
- Rubber hand gloves
- Metal Scrub
- A small plastic container
- Multi-meter (for testing)
- Permanent marker
Chemicals required :
- FeCl3 powder OR Solution
- Acetone or Thinner (can also use nail paint remover)
- Double sided copper clad board
- Glossy paper or photo paper
- 16 pin IC socket x 2
- 14 pin IC socket x 2
- L293D Motor Driver IC x 2
- 74HC04 NOT Gate IC x1
- Electrolytic capacitors : 100uf, 10uf, 47uf (each X 1)
- 0.1uf ceramic capacitor x 2
- 7805 voltage regulator IC x 1
- Female header strip long pin X 1
- Female header strip short pin x1
- Male header strip X 1
- Screw Terminal Blocks (2 pin 3.5mm spacing) x 6
- LED x 1
- Resistor (220ohm to 330ohm any will do) x 1
Step 2: The Chassis
In order to mount the motors, wheels, sensors etc. for our robot we need a chassis which will hold all things in place and will be the main body of the robot. Instead of buying one, I decided to make one myself on which one can easily mount the required parts and modify it whenever required. I went with acrylic to give it a professional look.
Before actually drawing the chassis on the computer I used pen and paper and drew a rough sketch with all the measurements and dimensions. It was for the first time I was working with acrylic so, I was a bit confused about the parameters and the designing, but after a few tries and referring the Instructable posted by "oomlout", it was not a difficult task any more.
The final design was made in Inkscape and sent for laser cutting.
Now, what you need to do is download the files and export it in the format asked by the service provider and get it laser cut. The ''.svg " file is for Inkscape and ".cdr" for Corel draw.
Download link for InkScape : https://inkscape.org/en/
To download files : https://www.thingiverse.com/thing:2544002
Step 3: Let's Start the Assembly
Gather your laser cut parts and the above mentioned tools and materials.
Step 4: First Prepare Your Motors
To make the robot move we need some kind of actuators. We will use geared DC motors as the actuators.
Solder wires of two different colours (each with approx length of 5 to 6 inches) to the motors. To check the polarity connect the wires to a battery and check the spin. If the motors spin in opposite directions swap the wires.
Step 5: Time to 'nut' and 'bolt' Everything
Start by fixing the side plates to the bottom base plate by placing them in the slots.Place a nut in the T-Slot and insert bolt from the hole in the bottom plate and fasten it using a screw driver. Make sure not to fasten too tight or else you may end up breaking the acrylic. Check for the orientation of the plates (motor side down as shown ).
- Then fix the motors, caster wheel, front plate, battery holder and finally the top plate.
- If you want to place a big servo motor you can directly screw it in the given slot or for mounting a micro servo first attach the plate for servo and then the servo motor.
- Attach the wheels to the motors
- Connect the switch with the battery pack as shown and screw it in place.
- Finally screw in your arduino/ arduino mega OR Raspberry pi
And you are done !!
Step 6: The Motor Shield/ the Motor Driver Circuit
The motors are the actuators of the robot which demand more power to operate which our microcontroller cannot provide, so hooking then up directly to it will surely fry it. In order to provide power to the motors and control its direction and speed we need a H-Bridge. What is a H-Bridge and how it works? I think this video will answer your question : Video (The video is not mine)
If you believe on doing everything yourself, then you may also consider making the motor driver circuit on your own instead of buying a ready made one. Since, I'm using Arduino board I decided to make motor shield instead of a breakout board.
Advantage of a shield over breakout board is that it easily plugs on the top of you Arduino board, which saves some space and wiring things to it becomes easy and less mess is created.
I made a double sided PCB(Printed Circuit Board) for making the shield, since single layer of the PCB was not enough to make all the connections. I used the 'Toner transfer' method to make the PCB.
If you don't know how to make a PCB, then don't worry I'll be covering all the steps on how to make one.
Step 7: Making Your Circuit Board Design
Before you make your own custom PCB board you need to design your PCB layout. You can design the layout by using a decent PCB designing software. For me the following are the best PCB designing software.
For making the motor shield you just need to download the files in the following steps and follow the instructions.
Step 8: Printing Your PCB Layout
Since we are making double sided PCB we will need two layers 1. Top layer 2.Bottom layer.
Download the pdf files and print them separately on any Glossy paper (magazine paper will also do), using a Laser Printer.
Inkjet Printers wouldn't work since its ink is soluble with water so it won't transfer its ink on the PCB board.
- Set your printer to a high resolution before print
- Select the actual size option before printing
Why to we need paper and ink to make a pcb??
As mentioned earlier, the method used for the build is called toner transfer.
How it works:
- First you take the print of your board layout on a glossy paper using a laser printer.
- The toner used in the printer is nothing but plastic, which melts and sticks to your paper.
- Now, you transfer the toner on your copper clad board using iron i.e. you melt the toner again and it sticks to the copper.
- The ink serves as the protective layer to cover the copper part that shouldn't be etched.
- Since the etching solution only works with metal and not with ink, you transfer ink to the copper side of the PCB be so that a certain pattern on your PCB board gets etched and the inked part doesn't.
Step 9: Cut and Clean Your Copper Clad
- Take your printed circuit and mark points on the board to draw lines and get it cut. For cutting you can use a Dremel or Hacksaw.
- After cutting, clean the board using some soap and a metal scrubber until the board looks nice and shinny.
Cleaning the board removes the oxide layer,dirt and grease on it and exposes fresh layer of copper on which the toner can stick firmly.
Step 10: Transferring Toner to the Board
- Take any layer ( bottom or top mirror) of the print and place it on the copper clad with printed side facing down.
- Align the board and the print. Use a laundry iron to iron your printed PCB layout to your board.
- Ironing the printed layout transfers the ink from the paper to the PCB board.
- Set your iron to the highest temperature(for thick paper) or to medium
- To supply constant heat place the iron on the board and apply some pressure on it for about 1 to 2 minutes.
- Gently move the iron on the paper for about 2-3 minutes.
- Make sure that proper heat is applied at corners and sides
The whole process should take around 5 - 6 minutes (can be more or less depending on the thickness of paper and temperature).
Step 11: Removing the Paper of the Board
After the heat treatment soak the board in container with some tap water for about 5-7 minutes.Be sure to wait until the paper on the board becomes soggy, then rub it gently so the ink wont get removed while you rub the paper off the board.
Step 12: The Second Layer
Now it's time to make the second layer. Since it is a double sided PCB the top layer and the bottom layer should be aligned perfectly or else the results would be undesirable. To connect the two layers vias will be used.
PCB manufacturers have machines which can precisely align the two layers. But how do we do such precise job at home? So I came up with a trick which can solve this problem. To align the two layers follow these steps:
- Drill holes at corners of your PCB using the first layer as reference.
- Take the print of the second layer and make holes in the same location as done for the previous layer.
- Align the board and the print such that light passes through all the holes.
- Tape the sides using some masking tape and do the same heat treatment.Soak the board in water and remove the paper
Step 13: Fixing the Tracks
Sometimes the toner doesn't get transferred properly to the board, which leads to some incomplete connections.
To fix this problem, take a pointed permanent marker and draw the incomplete tracks.
Step 14: Etching the Board
There are different variety of etching solution but the most common is Ferric Chloride. You can get it in powdered form or as solution.
For making the solution:
- Take a plastic container with some water. (about 1.5 cup ).
- Add 2-3 table spoon of FeCl3 to it and stir well. ( always add acid to water with gentle stirring )
While working with chemicals make sure to wear gloves and be in a well ventilated area.
Place the board in the solution for about 20 - 30 minutes. After for about 20 - 30 minutes remove it from the container, leaving it for a long time will etch the ink protected area so please remove it when it's done.
Rinse the board with water after etching.
Step 15: Remove the Toner
For removing the toner you can use acetone or thinner (nail-paint remover will also do). Take a peace of cotton or damp cloth and soak it well with thinner/acetone. Rub the toner off and clean the board with water.
And you have your home brew "Double Sided PCB".
Step 16: Drilling the Holes
Drill the holes using a mini vertical drill or a hand drill.
Use 1 mm drill bit for drilling holes for screw terminals and voltage regulator and 0.8 mm bit for other holes
Clean the dust after drilling.
Step 17: It's Time for Soldering
Before soldering make sure to keep a print of the layout with you for reference and to know the placement of parts. Start by soldering the vias by passing a wire through the holes and solder on both sides, cut the excess wire. Before soldering rest of the components use a multi-meter and check the continuity of the tracks of top and bottom layer and also check for any shorts after soldering.`
Solder rest of the parts. Make sure to check the polarity and placement of the components.
Step 18: Check the Circuit
Before placing the ICs in their sockets and powering up the circuit, make sure that there are no shorts and check the voltage at the respective pins. If everything is fine, place the ICs and power the circuit.
Step 19: Installing and Testing the Motor Driver
The shield will fit snugly on top of your Arduino board and the circuit is checked, so powering it will be a no problem.
Before testing lets look at the structure and features of the motor shield.
Structure and features :
- Uses two L293D H-bridge IC to control four motor.
- A 74HC04 inverter IC to reduce the number of pins used to control the h-bridges.
- A separate +5V and GND rail.
- Pins for mounting 4 servo motors with separate power rail
- Switch to reset the board
- Number of digital pins left even after controlling 4 motors: 6 (2 of them as PWM)
Testing the circuit :
Connect two motors to the screw terminal output M1 & M2, connect the power jumper and power the circuit using a DC supply 9-12V ( refer the diagram for polarity and connections). After uploading the TEST sketch to the arduino board, plug the motor shield and turn on the power supply.
For testing the second motor driver connect the motors to M3 & M4 and replace the pin numbers with these in the code
- LeftEN= 3
- LeftPin =2
- RightEN = 5
- RightPin = 6
Step 20: Let's Make It Move
It's time to bring your robot to life!!
Now you have a robot with all the necessary components installed, let's make a simple project using it to get an idea how quick you can prototype anything in a couple of minutes without any hassle and mess.
An Obstacle avoiding robot will be the best to start with. So let's make it.
- HC -SR04 Ultrasonic sensor
- Micro servo motor (if not installed)
- Some wires
- Connect the Vcc and GND pin of sensor to +5V and GND respectively
- Connect Trigger pin to A1 and Echo pin to A2 on arduino
- Place the J5 jumper on the shield and connect the servo to pin 10 on the servo rail (refer diagram)
- Mount the sensor on the servo
Upload the given below sketch to your arduino board and watch your robot avoiding obstacles.
So you made a simple autonomous robot in a couple of minutes.
Step 21: The End
Enjoy playing with your robot and make fun projects with it. There are variety of sensors and development boards available which are easy to use and understand, make use of them to make it move in the way you want.
And if you're new to robotics, I'll recommend you to try some basic projects given in the introduction part.
That's it for this Instructable. I hope you found it interesting.
If you have any doubts/queries regarding the build feel free to ask. Thanks for watching :)
We have a be nice policy.
Please be positive and constructive.