Introduction: How to Make a Mobile Phone and Computer Controlled 3D Printed Robot With Arduino - IoBot.
If you are looking for a way to control an Arduino based devices, this instruction will show you how to do it by building simple robot.
The IoBot can be controlled by mobile and computer application via LAN or USB Cable. The application runs on Android, Mac OS and Windows, it is available for download on IoBot’s website.
All the plastic parts are 3D printed, Arduino is the brain and the control application is written in Python / Kivy.
Knowledge of programming languages is not required but I have provided links through which you can find more detailed information about them. It might be helpful for someone who would like to modify the code and customise application or Arduino sketch.
Selection of low cost and easily available parts was a priority for me when designing this robot. Cost of all electronic parts, bolts and wires should be around £45 based on Ebay UK prices. If you do not have a 3D printer, there is option to print plastic parts with 3D HUBS, prices starts from £19 in my region.
Now we can go to step 1 and prepare all the tools and components for the project.
Step 1: Materials and Tools
Electronic Parts:
- 1x Arduino Uno R3 Microcontroller Board
- 1x Ethernet Shield WIZnet w5100 for Arduino
- 4x TowerPro SG90 Micro Servo
- 2x 5mm Round LED Light Emitting Diode
- 2x 220ohm Resistor 0.25W
Arduino UNO Board:
In addition to original Arduino UNO, there are a lot of mods on the market. Depending on your budget and your preferences, select appropriate board for you. If this is not the original Arduino UNO, make sure that it is 100% compatible clone. I advise you do NOT buy counterfeit.
Here you can learn more about how to recognise counterfeit item.
Ethernet Shield:
WIZnet W5100 based ethernet shield for Arduino - this is the most popular type of shield at the moment. It uses the standard Arduino Ethernet Library and is widely available. Some versions may differ a little from each other but each based on the chip W5100 should work well.
SG90 Servo’s:
The cheapest and most popular servo I know. In the set you will get also a few screws and Servo Arms which will be needed later in this project.
LEDs and resistors:
Widely available resistors and standard LEDs with a diameter of 5 mm. Of course you can use different colours of LEDs.
Tools:
- 1x Philips Screwdriver PH1
- 1x Slotted Screwdriver Size 2 up to 3mm
- 1x Spanner Size 4mm
- 1x Allen Key Size 1.5mm
- 1x Wire Stripper
- 1x Wire Cutter
- 1x Lighter
Other parts:
- 4x AA Batteries
- 1x Battery Pack 4x AA
- 1x 6F22 9V Battery
- 1x 6F22 Battery Snap with 2.5mm Power Plug
- 1x Half-Size Solderless Breadboard
- 14x Dupont Jumper Wire Male Connector 10cm Length
- 7x Dupont Jumper Wire Male Connector 20cm Length
- 4x Dupont Jumper Wire Male Connector 30cm Length
- 2x 1/0.6mm Solid Wire 20cm Length
- 4x 3mm Heat Shrink Cable Sleeve 2cm Length
- 12x M2 Allen Bolt 10mm Length
- 4x No 2 Self Taping Pozi Screw 6mm Length
- 12x M2 Nut
- 12x Stainless Stell M2 Washer
- 4x Nylon M2 Washer
- 1x USB A to B Cable
- 1x Ethernet RJ45 Cable
Optional:
- 4x 3 Way Single Row Pin Header Connector 2.54mm Pitch, 17mm Pin Length
- 1x 2 Way Single Row Pin Header Connector 2.54mm Pitch, 17mm Pin Length
- 1x Roll of Insulation Tape
- 3x Cable Tie 71mm Length
List of optionals covers things that it is good to have but are not necessary to run the job. 'Single Row Pin Header Connector 2.54mm Pitch, 17mm Pin Length' can be used instead 'Dupont Jumper Wire Male Connector 10cm Length'. Insulating tape and cable ties are useful for fixing cables.
3D printed parts:
- 1x Right Arm
- 1x Left Arm
- 1x Head
- 1x Upper Back Body
- 1x Bottom Back Body
- 1x Front Body
- 1x IoBot Base
- 1x Base for Arduino with Breadboard
A few years ago to build such a project, it caused a lot of problems, there was no easy way for the implementation of housing and other plastics.
Fortunately, it's already a history because there are 3D printers that filled the gap in design process. Now you can print all items you need. If you don't have a 3D printer, just click on the button “Print With 3D HUBS” and check the nearest available 3D printers in your area.
I recommend to print the parts using the PLA filament, which is easier to use and Environmentally-Friendly.
Use a medium printing resolution, 0.25mm layer height is good enough for this project. Some parts need a small support, but all of that is already contained within the STL file and you can print these parts just like every other. Later, just brake out bottom support as shown by photos in step 3.
Attachments
Step 2: Preparation
Installing Arduino IDE:
If you have not previously used the Arduino, you need to first install the Arduino Software. Here you will find step-by-step instructions for setting up the Arduino software and connecting it to an Arduino depending on your Operating System.
Installing External Library:
Arduino IDE has a Standard Servo Library but IoBot needs more advanced version which allows you to control the speed of movement. For this purpose, we will use an external library VarSpeedServo:
Download and Install IoBot Application:
Download application from IoBot website. Choose the version appropriate for your operating system. At the moment there are versions for Windows, Mac OS and Android.
Run the downloaded Setup file, then:
- Mac OS: copy the IoBot file to the directory Applications. Run applications with Launchpad
- Windows: follow the steps in the installer.
- Android: follow the steps in the installer.
Safety:
Choking Hazard:
Parts used in this project are small and should be kept out of the reach of children under age of 3, because the parts or their pieces may present a chocking hazard to small children.
Caution:
The IoBot is an educational project, not a toy. It is not intended for children under 13 years old.
Step 3: Assembly
Base:
- Remove the support under the bottom of the 'IoBot Base' using a 'Slotted Screwdriver'.
- Assemble 'IoBot Base' with 'Base for Arduino with Breadboard' using 'M2 Allen Bolt 10mm Length', 'M2 Nut' and 'Stainless Stell M2 Washer'. Tide using 'Allen Key Size 1.5mm'
- Remove protective paper from the sticker on the bottom of the 'Breadboard'.
- Attach a breadboard to the central part of the base.
- Screw the 'Arduino Uno Board' using 'No 2 Self Taping Pozi Screw 6mm Length' and 'Nylon M2 Washer'.
- Plug 'Ethernet Shield' on top of the 'Arduino Board'.
Robot:
- Remove the support from the underside of the 'Head'.
- Connect 'Front Body' with 'Bottom Back Body' using 'M2 Allen Bolt 10mm Length', 'M2 Nut' and 'Stainless Stell M2 Washer'.
- Screw the 'Upper Back Body' with 'Front Body' at the same time while mounting the 'Right Arm' and 'Left Arm SG90 Servo'.
- Insert 'Servo Arms' to printed blocks: 'Head', 'Arms' and 'IoBot Base'.
- Using 'No 2 Self Taping Screw 7mm Length' (Included with SG90), screw lightly 'Arms', 'Head' and 'IoBot Base'. Later in step 5 you will need to set them in the right position.
Step 4: Wiring
Wiring Arduino Uno with breadboard:
First, follow the connection on the 'Breadboard' using '1/0.6 mm Solid Wire' in two colours and put in the right place 2x '220ohm Resistors'.
The colours of wires do not have importance for functioning of the circuit but it is good to adopt the principle that BLACK always means GND and RED is VCC. In this project, the BLACK wire is replaced in some places with BROWN because my 'SG90 Servos' have the brown GND wire.
- Cut pieces of 'Solid Wire' leaving ~7mm on each side, so you can fold them and place in the breadboard.
- Remove the insulation from the wire ends (~7 mm), fold and place the wires in the 'Breadboard' according to the schema.
- Mount the '220ohm Resistors' in the 'Breadboard'
LEDs:
- Cut off connectors from one side of the 'Dupont Jumper Wire Male Connector 30cm Length'
- Remove approximately 15-20mm of insulation from the wires
- Wrap the wires around LED's terminals. Be careful, LEDs are polarity sensitive, this means that wires must be connected to the correct LEDs electrode +/-. In our case, connect the brown wire to the cathode (negative-, shorter LED's wire) and the red to the anode (positive +, longer LED's wire)
- If you have a soldering iron, solder these connections. If not, make sure that the connections are strong enough. The head of the robot rotates quite rapidly and the wires may slide if they will not be protected.
- Tighten the 'Heat Shrink Sleeves' using the lighter. Keep an appropriate distance from the fire, heated too strongly may catch fire. NOTE: This work should be done by adult person!
Connect the Robot:
- Connect 'Dupont Jumper Wire Male Connector 10cm Length' to each 'SG90 Servo'
- Secure this connection with insulation tape so that the connectors cannot disconnect during movements of the robot.
You can use '3 Way Single Row Pin Header Connector 2.54mm Pitch, 17mm Pin Length' instead of 'Dupont Jumper Wire Male Connector 10cm Length'. I think, this is better solution but I did it with 'Jumper Wires', because they are easily accessible and everyone who plays with Arduino will probably find them in a drawer.
- Place the LEDs in the eye's holes of the robot head and connect their wires
- Connect "SG90 servo's" wires
- Mount the wires in a way so they cannot block movement of the robot, you can fasten them with the 'Cable Tie' or 'Insulation Tape'
Now you should have finished the IoBot. The last photo shows the connection to the power supply and LAN. But before you connect it, you must upload the Arduino sketch and perform a brief calibration.
Step 5: Uploading Sketch and Robot Calibration
Sketch Configuration:
Before uploading the sketch to the Arduino, make sure that the IP Address, Gateway Address and Subnet Mask in the sketch match to your LAN. In most cases you will not need to change anything. However, if your router has an IP address different than the 192.168.1.1 or IP 192.168.1.177 is occupied by another device, you should adjust appropriate settings in the sketch.
Upload sketch to Arduino Board:
Upload the sketch of IoBot to Arduino as described in Getting Started with Arduino
If everything went successfully, after opening Serial Monitor, you should see the message:
initialize: succes Server address: 192.168.1.177
or other IP address, if you did change the sketch.
NOTE: Check the 'Baud rate' in the lower-right corner of 'Arduino Serial monitor', it should be set to 115200, if there is different rate, change it.
Calibration:
Connect '4 x AA Battery Pack' (servo motors power) to the 'Breadboard'. 'Arduino Board' should be powered from '6F22 9V Battery' or 'USB Cable'. All servos should now set to position "0". It is the head and body in the middle position and arms should be facing down. If any of them is not in such a position, unscrew it and set in the correct position.
Application Settings:
LAN Mode:
When you first start the application, it is set to work in LAN mode and IP address is set to 192.168.1.177
If you did set a different address in Arduino sketch, change it also in application's settings panel by clicking in the application's toolbar and later on the IP Address.
USB Serial Mode:
If you are running application on your computer, you can also control the robot via 'USB Cable'. In order to do it, switch 'Connection Method' in application's settings panel to the 'Serial' and then select name of the port of your Arduino by clicking on 'Serial Port' button.
Close settings panel, connect the robot by clicking 'Connect' button in the upper-right corner of application window.
All done, you can now play with your IoBot!
Step 6: Future Ideas
Control Other Devices:
You can control other Arduino or Raspberry Pi projects using IoBot application. You can, for example, use application's sliders to control brightness of a LED or speed of motor. You can use the buttons to turn on and off the LED or motor. Labels of the buttons can be changed in the source code of the application. But for now, I'm not going to tell you how to do it. I will let you find a solution yourself.
Download IoBot's source codes from GitHub.
IoBot is speaking in LAPP 'language'.
When you control the robot over a LAN, you can view LAPP messages on Arduino Serial Monitor, just connect the robot with your computer using USB Cable. Check out what messages are send to the robot by pressing each application button, and by moving each slider. You can use these data to control your own project with IoBot application. These messages, as well as ranges of sliders, can be changed in the source code of the application.
Learn IoBot New Tricks:
You can change the tricks of IoBot by changing the code in section >>> TRICKS <<< of Arduino sketch. Here you can find reference of VarSpeedServo functions and write your own tricks.
Remember:
The only limit is your imagination! :)
Step 7: Credits
Thank you to the Contributors:
- Malgorzata Wojcik - 3D printable parts design.
- Dawid Szewczuk - IoBot’s web development and help with making this Instructable.
And the teams of:
- Arduino - IoBot is built on hardware and software designed by Arduino.
- Blender - 3D printable parts has been designed using Blender software.
- Ciseco - IoBot is speaking LLAP, which is designed by Ciseco.
- Fritzing - Schematics has been designed with Fritzing software.
- Kivy - IoBot application is written in Kivy
- OpenSCAD - 3D printable parts has been designed with OpenSCAD software.
- Python - IoBot application is written in Python.