Train Your Own Robot

by Arduino_is_me in Circuits > Arduino

93 Views, 0 Favorites, 0 Comments

Train Your Own Robot

20260709_103446.jpg

If you have a bunch of electronic stuff just sitting in a box and you do not know what to do with it, then i have just the progect for you. This is a robot where you can use a thumb joystick to move the robot while programing it, and how it works is when you move the joystick forward, the robot will move forward while recording wich direction the robot is moving and how long, and it will do the same for left, right, and backwards, then you press down on the built in joystick to end programming mode and then you return the robot to the exact spot on wich the robot started, and then move the joystick up for a quick moment then after 3 seconds, the robot will start repeating the path that was programmed into it, and you can make it navigate around corners and under tables, so you can make it come to you purely on memory, no sensors or anything, but a quick warning, the robot might get stuck sometimes so keep a close eye on it, and also it can only remember 300 steps, and sometimes it will stop moving mid move, and that might be because it has low memory now and it said stability problems may accure, (not sure if i spelled that right) and you can edit the code however you want to fit your needs, now on to the progect!

Supplies

For this progect i used:

1. A arduino uno

2. A small breadboard to distribute power

3. Two sg90 360 degree servos, not 180 degree

4. Cardboard for the chassis, and i also put wooden skewers inside the cardboard to add stability

5. A very small office chair wheel, the kind that can spin around but smaller

6. Male to male jumper wires and male to female jumper wires

7. Two round objects that you can easily attach to the servo horns so that they are secure, and about two and a half inches in diameter (these will be your wheels)

8. One 7.4V rechargeable lipo battery

9. One thumb joystick

Build the Chassis

20260709_103507.jpg

Look at the image above, you can see the shape of the cardboard, right? Ok, now get a piece of cardboard that is at least one quarter of a centimeter in thickness and cut that exact shape of the cardboard above, i do not know how to upload a printable template yet so sorry about that.

Add Servos to Chassis

20260709_103651.jpg
178362439571322048937.jpg
1783625212528105538320.jpg

Now attach the servo to the bottom of the chassis the way the images say, and make sure the servo output thingys (not sure what they are called) are facing the outside, and make sure the servo is firmly in place. Then add the rear spinny wheel on the bottom of the chassis like the images above say. And then when you attach the servos, poke a small hole in the cardboard right next to the spot where the wires exit the servo so you can thread the wires through the hole, refer to the image above.

Add Wheels

1783623918752594435776.jpg
17836239579042111142822.jpg

Now it is time to add the wheels to your servo horns, first screw one of your servo horn screws through the very middle of your wheel (it could be round pieces of cut cardboard, lids, anything that is about two and a half inches in diameter) and screw it all the way through, then thread the screw through the servo horn (make sure the end that goes into the servo is on the outside, not faceing inside) and then attach the servo horn to the servo and screw in the screw firmly, but not too tight that it breaks. Do the same for the other servo. And make sure the wheels have friction on the parts that touch the floor, and it can be 3d printed or just add rubber bands.

Add the Arduino and Breadboard

Now it is time to add your arduino uno and breadboard, and all you have to do is attach the arduino and breadboard to the top of the chassis so that they will mot move (and do not makenthem perminite if you want to use the components again) now you can add power to the breadboard. Connect a jumper wire from arduino 5V to the positive rail of the breadboard. Now attach a jumper wire from arduino GND to the breadboards negitive power rail.

Aad Joystick

20260709_103544.jpg

Now you can add the joystick to "train" the robot, attach the female end of a jumper wire to GND then the male end to the negitive power rail on the breadboard, do the same for 5V to positive power rail, then wire vrx to arduino pin A0, then wire joystick pin vry to arduino pin A1. Then wire sw to arduino pin d2

Wire the Servos

Now it is time to wire the servos, first look at the darkest wire on the servo, that wire is GND, so take a male to male jumper wire and connect gnd on the servo to the negitive power rail on the breadboard, then the middle wire wich should be red, goes to the 5V rail, and do the same for the other servo. Now take the signal wire from the left servo (this wire should be bright oarnge) and wire it to arduino pin D9 then wire the right servo to arduino pin D10.

Now It Is Programming Time

Download this arduino sketch below, then connnect your arduino uno to your computer with the programming cord, open your arduino ide, and upload this code to it. You can edit the code however you want to so it will fit your needs, increasing memory capacity, adding a led or buzzer, whatever. Look at step 8 on how to add the battery.

Add Battery

Now it is time to add your 7.4v battery, first wire GND on the battery to GND on the arduino, then wire postive on the battery TO THE VIN PIN, NOT THE ARDUINO 5V PIN OR THE VOLTAGE WILL BE SO HIGH THAT YOUR ARDUINO WILL FRY, so attach positive on the battery to vin because the vin pin has a built in voltage regalater so it will lower the dangerous 7.4V to a safe 5V, and as soon as you connect the battery to the arduino, the arduino will turn on, and the second you move the joystick, the arduino will start recording.

Enjoy

Now you can play with your new robot and make it navigat whereever, but make sure you keep a close eye on it because it might get stuck on a crack or whatever

https://www.instructables.com/Work-Timermanual-Counterstopwatch-With-Arduino/

Go to the link above to see my work timer/stopwatch/manual counter

Not Related

the pdf below is why automatic computer updates are bad.