My project is a robodog that can be remotely directed using a mobile application using a microcontroller (Arduino UNO) and a Bluetooth module that enables the communication between the arduino and the mobile application. .
In my CAD process I used Fusion 360 software tool.
The body Consists of 5 main parts: Front, Base, Side, Front leg and Back legs. Each one of them is doubled to form the whole design
For the side part, I used 4 circles 2 to form the outer shape and another 2 to form the curve that links between them
for the base, I used a rectangular shape and then started to form the tabs and slots in it respectively.. And the same was applied to the front part.
for the legs I used each of the "Conic curve" tool and the "Circle" to draw it.
After that I extruded the parts
Fully defining the sketches
Then I started to mount the different components I am going to use like the motor and the arduino uno board.
Assembling the parts on Fusion
I wanted the project to be fabricated from the wood material, so I needed the laser cutter machine for wood cutting.
The laser cutter that we have in the maker space is from the "Morn" type and the material used was a 3 mm plywood.
Laser Cutter Machine
Adjusting power and speed settings on LaserWork before downloading it to the machine
Directly after Cutting
Assembling all part to check that all the slots and tabs are aligned together
While the laser wood cutting.
The electronic circuit consists of:
1- Battery 10000 mAh
2- DC jack with on-off switch
3- Bluetooth Module
3- Gear Motors ×4
4- Motor Driver ×1
5-Arduino UNO Board
6- Jumper Wires (Male -Male, Male -Female)
7- Bread Board
8- DC jack with on-off switch
Gear Motor
Bluetooth Module
Motor driver
Jumper wires
Arduino UNO Board
The components were wired as follows:-
PIN 0 (RX)--> TX pin of the Bluetooth Module
PIN 1 (TX)--> RX pin of the Bluetooth Module
PIN 7 (Digital pin)--> right pin of I/P side 1 of the driver
PIN 8 (Digital pin) -->left pin of I/P side 1 of the driver
PIN 12 (Digital pin) -->right pin of side I/P 2 of the driver
PIN 13 (Digital pin) -->left pin of side I/P 2 of the driver
Vin pin--> 12 V pin of the driver
5 V pin--> Power Pin of the Bluetooth Module
GND pin--> Connected with the ground of the Bluetooth Module and the driver (in order to have a common ground)
Right side of the enclosure: Right pin of each of Motor 1 and Motor 2 --> Right O/P pin of side 1 of the driver
Right side of the enclosure: Left pin of each of Motor 1 and Motor 2 --> Left O/P pin of side 1 of the driver
Left side of the enclosure: Right pin of each of Motor 1 and Motor 2 --> Right O/P pin of side 2 of the driver
Left side of the enclosure: Left pin of each of Motor 1 and Motor 2 --> Left O/P pin of side 2 of the driver
The project consists of one input which is the mobile application commands that are sent through the Bluetooth module and then it preforms a smart action which is the motion in different directions according to the instruction as it is programmed. The arduino acts as the brain of the whole project as it has the microcontroller.
The 2 wheels of the left side are taking the same inputs as they are wired to the same O/P pins of one of the sides of the driver and the same is applied to the other 2 wheels on the right side respectively, as they are wired to the O/P pins of the other side of the driver.
The project power source is a LiPO battery of 10000 mAh.
As my project consists of 4 motors, 1 driver, bluetooth module and a driver, each of these components are powered by about 5 v and for the driver it needs from 5 to 9 v to operate, so we used the battery to power the arduino, the arduino itself has a voltage regulator so it will be powered by the voltage needed and from the Vin pin the same voltage entered from the battery outgoes an =d that is exactly what we need for the driver so we will connect the 12 v pin of the driver to it. And finally the bluetooth module operates with 5v so we will connect it to the 5v pin in the arduino uno board.
For programming, I used "ARDUINO" IDE. I also have used "Arduino BlueControl" mobile application for controlling robodog remotely.
I used the arrows interface were:
Upper arrow--> sends 'U'
Down arrow --> sends 'D'
Right arrow-> sends 'R'
Left arrow--> sends 'L'
First, I started by defining the pins I am going to wire in the arduino, which are 13, 12, 8 and 7 and gave for each pin a name for more readability of the code.
Then I defined a global variable which is "directions" and gave it the a data type "char" as it is going to store letters.
After that, I started to create some functions that I will call them inside the void loop.
The first function was the turn off function that is responsible for the stopping of the motion.
Then for each direction I started to create a function
For the front function I gave for one of the pins high voltage and the other low voltage so that motion occurs, I selected which of the pins should take the high and the other low according to the wiring and the adjusting of the wheels in the enclosure respectivily . The same was done in the back function but by reversing the high and low commands so that the wheel will rotate in the opposite directions.
For the Right direction function I stopped the motion of the 2 wheels on the right side of the enclosure and allowed the left side wheels only to move. And for the left direction I reversed the command were the left is stopped and the right is moving. The moving command is done by giving the one of the pins high and the other low while the stopping command is done by giving the 2 pins low.
And the last function is the motion function, inside it I started first by reading the value coming from the mobile application through the bluetooth module and saving this value inside the variable "directions" that we created in a previous step, then by checking this value using the if condition, we are expecting to receive sny of 4 characters (U, D, L, R), for each of them we will call one of the functions we once created to move the robodog in a certain direction where:
U -> front direction movement
D -> Back direction movement
R-> Right direction movement
L-> Left direction movement
And if nothing of this values is received, it will call the function turnoff to stop the motion.
Then inside the void setup, we start to set the mode of each pin using pinMode, here all the pins (13, 12, 8, 7) are output pins. Also using Serial.begin we intialise the communication between the arduino and the bluetooth module.
inside the void loop we called the the motion function as long as there is an input coming from the bluetooth.
For the components testing, I first stared to check the H bridge (driver) and the motors using test codes as:
#define IN1 13
#define IN2 12
#define IN3 8
#define IN4 7
#define EN1 9
#define EN2 10
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(EN1, OUTPUT);
pinMode(EN2, OUTPUT);
}
void loop() {
analogWrite(EN1, 255);
analogWrite(EN2, 255);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
delay (500);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
delay (500);
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
After assembling and checking the wiring of the components and the that the power is sufficient for the circuit to preform its function, I had a trouble with the motion itself, it was only rotating around itself and doesn't preform any other motion, after troubleshooting, I found out that it was as simple as the wheels hadn't enough spaces between it and the legs which caused it a friction that blocked its free movement.
The project before the final modification while it is rotating around itself as some of the wheels weren't working.
The project while moving with the right directions according to the given commands via the mobile application:
I helped Ahmed Saeed with an idea about how to fix the curtains he wanted to add to his project, he wanted it to open and close smoothly with motion of the wooden part fixed on the servo, I suggested making a hole in the textile he will use to act as the curtains, the passing a string through it and fix it to the 2 ends of the textهle so that when a tension is applied to the string due to the motion of the servo this textile will be straighten , also during the past days I tried to give a hand to anyone who asked me to do so. And for sure I got a lot of help from my peers and the instructors.
One of the main problems I have faced during my project implementation was that the legs themselves were moving each time the wheels starts to rotate even though they are supposed to be fixed so that the body can move probably. I turned back to the instructors, each one of them suggested a solution, one of the suggestions were that we can double the legs so they are more stable. But the most suitable suggestion that worked was to attach each leg with an extra .
I would have added the auto mode in which the robodog itself detects that there is a sound, the place of that sound and the direction it needs to move to reach this sound.