home · Networks · The robot is homemade. How to make a robot at home for a child? Self-made mobile mechanism

The robot is homemade. How to make a robot at home for a child? Self-made mobile mechanism

Many of us who have encountered computer technology have dreamed of assembling our own robot. For this device to perform some duties around the house, for example, bring beer. Everyone immediately sets about creating the most complex robot, but often quickly breaks down the results. We never brought our first robot, which was supposed to make a lot of chips, to fruition. Therefore, you need to start simple, gradually complicating your beast. Now we will tell you how you can create a simple robot with your own hands that will independently move around your apartment.

Concept

We set ourselves a simple task, to make a simple robot. Looking ahead, I will say that we, of course, got by not in fifteen minutes, but in a much longer period. But still, this can be done in one evening.

Typically, such crafts take years to complete. People spend several months running around stores in search of the gear they need. But we immediately realized that this was not our path! Therefore, we will use in the design such parts that can be easily found at hand, or uprooted from old equipment. IN as a last resort, buy for pennies at any radio store or market.

Another idea was to make our craft as cheap as possible. A similar robot costs from 800 to 1500 rubles in radio-electronic stores! Moreover, it is sold in the form of parts, but it still has to be assembled, and it is not a fact that after that it will also work. Manufacturers of such kits often forget to include some parts and that’s it – the robot is lost along with the money! Why do we need such happiness? Our robot should cost no more than 100-150 rubles in parts, including motors and batteries. At the same time, if you pick out the motors from an old children's car, then its price will generally be about 20-30 rubles! You feel the savings, and at the same time you get an excellent friend.

The next part was what our handsome man would do. We decided to make a robot that will search for light sources. If the light source turns, then our car will steer after it. This concept is called “a robot trying to live.” It will be possible to replace the batteries with Solar cells and then he will look for light to ride.

Required parts and tools

What do we need to make our child? Since the concept is made from improvised means, we will need a circuit board, or even ordinary thick cardboard. You can use an awl to make holes in the cardboard to attach all the parts. We will use the assembly, because it was at hand, and you won’t find cardboard in my house during the day. This will be the chassis on which we will mount the rest of the robot’s harness, attach motors and sensors. As driving force, we will use three or five-volt motors that can be pulled out of an old machine. We will make the wheels from the covers from plastic bottles, for example from Coca-Cola.

Three-volt phototransistors or photodiodes are used as sensors. They can even be pulled out of an old optomechanical mouse. It contains infrared sensors (in our case they were black). There they are paired, that is, two photocells in one bottle. With a tester, nothing prevents you from finding out which leg is intended for what. Our control element will be domestic 816G transistors. We use three as power sources AA batteries soldered together. Or you can take a battery compartment from an old machine, as we did. Wiring will be required for installation. Twisted pair wires are ideal for these purposes; any self-respecting hacker should have plenty of them in his home. To secure all the parts, it is convenient to use hot-melt adhesive with a hot-melt gun. This wonderful invention melts quickly and sets just as quickly, which allows you to quickly work with it and install simple elements. The thing is ideal for such crafts and I have used it more than once in my articles. We also need a stiff wire; an ordinary paper clip will do just fine.

We mount the circuit

So, we took out all the parts and stacked them on our table. The soldering iron is already smoldering with rosin and you are rubbing your hands, eager to assemble it, well, then let’s get started. We take a piece of assembly and cut it to the size of the future robot. To cut PCB we use metal scissors. We made a square with a side of about 4-5 cm. The main thing is that our tiny circuit, batteries, two motors and fasteners for the front wheel fit on it. So that the board does not become shaggy and is even, you can process it with a file and also remove sharp edges. Our next step will be sealing the sensors. Phototransistors and photodiodes have a plus and a minus, in other words, an anode and a cathode. It is necessary to observe the polarity of their inclusion, which is easy to determine with the simplest tester. If you make a mistake, nothing will burn, but the robot will not move. The sensors are soldered into the corners of the circuit board on one side so that they look to the sides. They should not be soldered completely into the board, but leave about one and a half centimeters of leads so that they can be easily bent in any direction - we will need this later when setting up our robot. These will be our eyes, they should be on one side of our chassis, which in the future will be the front of the robot. It can be immediately noted that we are assembling two control circuits: one for controlling the right and the second left engines.

A little further from the front edge of the chassis, next to our sensors, we need to solder in transistors. For the convenience of soldering and assembling the further circuit, we soldered both transistors with their markings “facing” towards the right wheel. You should immediately note the location of the legs of the transistor. If you take the transistor in your hands and turn the metal substrate towards you, and the marking towards the forest (as in a fairy tale), and the legs are directed downwards, then from left to right the legs will be, respectively: base, collector and emitter. If you look at the diagram showing our transistor, the base will be a stick perpendicular to the thick segment in the circle, the emitter will be a stick with an arrow, the collector will be the same stick, only without the arrow. Everything seems clear here. Let's prepare the batteries and proceed to the actual assembly of the electrical circuit. Initially, we simply took three AA batteries and soldered them in series. You can immediately insert them into a special battery holder, which, as we have already said, is pulled out of an old children's car. Now we solder the wires to the batteries and determine two key points on our board where all the wires will converge. This will be a plus and a minus. We did it simply - we did it twisted pair into the edges of the board, soldered the ends to the transistors and photosensors, made a twisted loop and soldered the batteries there. Perhaps not the most the best option, but the most convenient. Well, now we prepare the wires and begin assembling the electrics. We will go from the positive pole of the battery to the negative contact, throughout electrical diagram. We take a piece of twisted pair and start walking - we solder the positive contact of both photo sensors to the plus of the batteries, and solder the emitters of the transistors in the same place. We solder the second leg of the photocell with a small piece of wire to the base of the transistor. We solder the remaining, last legs of the transyuk to the engines respectively. The second contact of the motors can be soldered to the battery through a switch.

But like true Jedi, we decided to turn on our robot by soldering and unsoldering the wire, since the switch suitable size I didn’t find it in my bins.

Electrical debugging

All, electrical part We have assembled, now let's start testing the circuit. We turn on our circuit and bring it to the lit table lamp. Take turns, turning first one or the other photocell. And let's see what happens. If our engines begin to rotate in turn with at different speeds, depending on the lighting, then everything is in order. If not, then look for jambs in the assembly. Electronics is the science of contacts, which means that if something does not work, then there is no contact somewhere. Important point: the right photo sensor is responsible for the left wheel, and the left one, respectively, for the right one. Now, let’s figure out which way the right and left engines rotate. They should both spin forward. If this does not happen, then you need to change the polarity of turning on the motor, which is spinning in the wrong direction, simply by re-soldering the wires at the motor terminals the other way around. We once again evaluate the location of the motors on the chassis and check the direction of movement in the direction where our sensors are installed. If everything is in order, then we will move on. In any case, this can be fixed, even after everything is finally assembled.

Assembling the device

We've dealt with the tedious electrical part, now let's move on to the mechanics. We will make the wheels from caps from plastic bottles. To make the front wheel, take two covers and glue them together.

We glued it around the perimeter with the hollow part facing inward for greater stability of the wheel. Next, drill a hole in the first and second lids exactly in the center of the lid. For drilling and all sorts of household crafts, it is very convenient to use a Dremel - a sort of small drill with a lot of attachments, milling, cutting and many others. It is very convenient to use for drilling holes smaller than one millimeter, where already regular drill can not manage.

After we drill the covers, we insert a pre-bent paper clip into the hole.

We bend the paperclip into the shape of the letter “P”, where the wheel hangs on the top bar of our letter.

Now we fix this paper clip between the photo sensors, in front of our car. The clip is convenient because you can easily adjust the height of the front wheel, and we will deal with this adjustment later.

Let's move on to the driving wheels. We will also make them from lids. Similarly, we drill each wheel strictly in the center. It is best for the drill to be the size of the motor axle, and ideally - a fraction of a millimeter smaller, so that the axle can be inserted there, but with difficulty. We put both wheels on the motor shaft, and so that they do not jump off, we secure them with hot glue.

It is important to do this not only so that the wheels do not fly off when moving, but also do not rotate at the fastening point.

The most important part is mounting the electric motors. We placed them at the very end of our chassis, on the opposite side of the circuit board from all the other electronics. We must remember that the controlled motor is placed opposite its control photosystem. This is done so that the robot can turn towards the light. On the right is the photosensor, on the left is the engine and vice versa. To begin with, we will intercept the engines with pieces of twisted pair, threaded through the holes in the installation and twisted from above.

We supply power and see where our engines are rotating. The motors will not rotate in a dark room; it is advisable to point them at the lamp. We check that all engines are working. We turn the robot and watch how the motors change their rotation speed depending on the lighting. Let's turn it with the right photo sensor, and the left engine should spin quickly, and the other one, on the contrary, will slow down. Finally, we check the direction of rotation of the wheels so that the robot moves forward. If everything works as we described, then you can carefully secure the sliders with hot glue.

We try to make sure that their wheels are on the same axle. That’s it – we fix the batteries on the top platform of the chassis and move on to setting up and playing with the robot.

Pitfalls and setup

The first pitfall in our craft was unexpected. When we assembled the whole circuit and technical part, all the engines responded perfectly to the light, and everything seemed to be going great. But when we put our robot on the floor, it didn’t work for us. It turned out that the power of the motors was simply not enough. I had to urgently tear apart the children's car in order to get more powerful engines from there. By the way, if you take motors from toys, you definitely can’t go wrong with their power, since they are designed to carry a lot of cars with batteries. Once we figured out the engines, we moved on to tuning and drive cosmetic appearance. First we need to collect the beards of wires that are dragging along the floor and secure them to the chassis with hot glue.

If the robot is dragging its belly somewhere, then you can lift the front chassis by bending the fastening wire. The most important thing is photo sensors. It is best to bend them looking to the side at thirty degrees from the main course. Then it will pick up light sources and move towards them. The required bending angle will have to be selected experimentally. That's it, let's arm ourselves table lamp, put the robot on the floor, turn it on and start checking and enjoying how your child clearly follows the light source and how cleverly he finds it.

Improvements

There is no limit to perfection and you can add endless functions to our robot. There were even thoughts of installing a controller, but then the cost and complexity of manufacturing would increase significantly, and this is not our method.

The first improvement is to make a robot that would travel along a given trajectory. Everything is simple here, take a black stripe and print it on the printer, or similarly draw it in black permanent marker on a sheet of Whatman paper. The main thing is that the strip is slightly narrower than the width of the sealed photo sensors. We lower the photocells themselves so that they look at the floor. Next to each of our eyes we install a super-bright LED in series with a resistance of 470 Ohms. We solder the LED itself with resistance directly to the battery. The idea is simple, from white sheet paper, the light is perfectly reflected, hits our sensor and the robot drives straight. As soon as the beam hits the dark strip, almost no light reaches the photocell (black paper absorbs light perfectly), and therefore one motor begins to rotate more slowly. Another motor quickly turns the robot, leveling its course. As a result, the robot rolls along the black stripe, as if on rails. You can draw such a stripe on a white floor and send the robot to the kitchen to get beer from your computer.

The second idea is to complicate the circuit by adding two more transistors and two photosensors and make the robot look for light not only from the front, but also from all sides, and as soon as it finds it, it rushes towards it. Everything will just depend on which side the light source appears from: if in front, it will go forward, and if from behind, it will roll back. Even in this case, to simplify assembly, you can use the LM293D chip, but it costs about a hundred rubles. But with its help you can easily configure the differential activation of the direction of rotation of the wheels or, more simply, the direction of movement of the robot: forward and backward.

The last thing you can do is to completely remove the batteries that constantly run out and install a solar battery, which you can now buy at a hardware store. mobile phones(or on dialextreme). To prevent the robot from completely losing its functionality in this mode if it accidentally enters the shadow, you can connect it in parallel solar battery– an electrolytic capacitor of very large capacity (thousands of microfarads). Since our voltage there does not exceed five volts, we can take a capacitor designed for 6.3 volts. With such a capacity and voltage it will be quite miniature. Converters can either be bought or uprooted from old power supplies.
We think you can come up with the rest of the possible variations yourself. If there is something interesting, be sure to write.

conclusions

So we joined greatest science, the engine of progress – cybernetics. In the seventies of the last century, it was very popular to design such robots. It should be noted that our creation uses the rudiments of analog computing technology, which died out with the advent of digital technologies. But as I showed in this article, all is not lost. I hope we will not stop at constructing such simple robot, and we will come up with new and new designs, and you will surprise us with yours interesting crafts. Good luck with the build!

Since you have come to this page, it means you are no longer indifferent to the topic of robotics and robotics. Designing a robot with your own hands is very exciting activity which will teach you a lot. You will develop skills in electronics, mechanics, programming, and process management. For me, robotics is a fascinating hobby. Like all of us, I also dreamed of creating something with wheels, motors, wires, and a bunch of electronic parts.

So one day an idea came to mind assemble a robot with your own hands at home. But not only to create a simple device that would move in different directions, but to create a multifunctional robot that would carry out commands communication center and would be useful on the farm.

The idea of ​​making a robot with your own hands called RoboTech, which could be assembled by anyone, a novice roboticist or radio amateur.

Basic requirements for a homemade robot

  • Possibility of assembling a robot at home.
  • The robot must be built on a commercially available and easy to program microcontroller.
  • A simple and easy to construct platform should be used as a chassis.
  • The robot must contain necessary set sensors and mechanisms that allow you to expand functionality as needed.
  • The robot must move freely and be able to react to obstacles.
  • The ability to control the robot from a distance, use telemetry (monitor the state of the robot, set various commands).
  • Possibility of broadcasting video images from the on-board camera to the base station.

Considering the requirements, it was decided to use two microcomputers to control the robot ( MC-1 and MC-2).

On-board computer MC-1

First computer ( main MC-1) - used as the main on-board computer of the “brain”, whose tasks include:

  • video broadcast environment to the base station in good quality;
  • receiving commands from the control center (base station);
  • sending big data to the control center at high speed;
  • coordination of the work of other robot components via a second micro-computer (additional MC-2)

To complete the assigned tasks, it was decided to use a single-board computer Raspberry PI or, as a last resort, a router with the ability to flash firmware OpenWRT.

On-board computer MC-2

Second computer ( additional MC-2) is used to control the engine, collect information from various sensors or sensors and send the finished data to the MC-1 main computer.

It was decided to use a ready-made one as a controller for controlling the chassis mechanisms and sensors of the robot. Of all the controllers I considered, I chose the most common and affordable one. You can also use a more compact one Arduino Nano. Both devices run on the ATMega328p avr microcontroller.

WikiHow works like a wiki, which means that many of our articles are written by multiple authors. This article was produced by 27 people, including anonymously, to edit and improve it.

Many people would like to design a robot, like a machine, that would work autonomously. However, if we expand the concept of the word “robot” a little, then remote-controlled objects can well be considered a robot. You may think that it will be a little difficult to assemble a robot on a control panel, but everything is actually easier than it seems. This article will tell you how to assemble a remote-controlled robot.

Steps

    Decide what you will build. You're unlikely to be able to assemble a full-scale, bipedal humanoid that can cater to your every whim. In addition, it will not be a robot with various claws capable of grabbing and dragging 5-kilogram objects. You'll start by building a robot that can move forward, backward, left and right using a wireless command from a remote control. However, once you have mastered the basics, you can improve your design and add various innovations, just follow the instructions: “There is no complete robot in the world.” You can always add and improve something.

    Seven times measure cut once. Before you start directly assembling the robot, even before ordering the necessary parts. Your first robot will look like two servos on a flat piece of plastic. This design is very simple and leaves room for you to improve. The size of this model will be approximately 15 by 20 centimeters. To create such a simple robot, you can simply sketch it using a ruler, paper and pencil in real size. For larger and more complex projects, you will need to learn the rules of scaling and automated programming.

    Select the details you need. Although it's not time to order parts yet, you should already have them selected and know where to buy them. If you order online, it is better to find all the parts on one site, which will help you save on shipping. You will need frame or chassis material, 2 servos, battery, radio transmitter, transmitter and receiver.

    • Selecting the servos you need to drive the robot. One motor will move the front wheels, and the second will move the rear wheels. Thus, you can use the simplest method of steering - differential gear, meaning that both motors rotate forward when the robot moves forward, both motors rotate backward when the robot moves backward, and to make one of the turns, one motor works and Do not have another one. Servo motor is different from normal motor alternating current in that the first is only capable of rotating 180 degrees and transmitting information back to its position. This project will use a servo motor because it will be easier and you won't have to buy an expensive speed controller or a separate gearbox. Once you figure out how to assemble a remote control robot, you can build another one or modify the one you have using AC motors instead of servos. There are 4 important aspects, which are worth seriously thinking about before purchasing a servo motor, more specifically: speed, torque, size/weight and if they can be modified for 360 degree rotation. Since servos can only rotate 180 degrees, your robot will only be able to move forward a little. With 360 degree modifications available, you can configure the motor to continuously rotate in one direction and allow the robot to constantly drive in one direction or the other. Size and weight are very important for this project because you will likely have a lot of space left over either way. Try to find something medium sized. Torque is the power of the engine. This is what the gearbox is used for. If the motor does not have a gearbox and the torque is low, then your robot most likely will not move because it does not have enough power to do so. You can always buy and attach a stronger one or fast engine after the assembly is completed. Remember, the higher the speed, the less power will be. It is recommended to purchase the “HS-311” servo for the first prototype of the robot. This motor has a good balance of speed and power, is inexpensive and is the right size for the robot.
      • Since this servo can only rotate 180 degrees, you will have to reconfigure it to 360 degrees, but this procedure will violate your purchase warranty, but you will need to do so to allow the robot to move more freely. Instructions for this can be found on the Internet.
    • Select the battery. You will need something to supply power to the robot. Do not attempt to use the power source with alternating voltage(that is, a regular outlet). Use a permanent source (AA batteries).
      • Select batteries. There are 4 types of batteries that we will choose from: lithium polymer, nickel-metal hydride, nickel-cadmium and alkaline batteries.
        • Lithium polymer batteries are the newest and incredibly light. However, they are dangerous, expensive and you will need to use a special charger. Use this type of battery if you have experience in robotics and are willing to fork out the cash for your project.
        • Nickel-cadmium is a common rechargeable battery. This type used in many robots. The problem is that if you overcharge them before they are completely discharged, they will not be able to last as long as when fully charged.
        • The nickel-metal hydride battery is very similar to the nickel-cadmium battery in size, weight and price, but it has better efficiency work, and this type of battery is recommended for novice technicians.
        • The alkaline battery is a common type of non-rechargeable battery. These batteries are very popular, cheap and easily available. However, they run out quickly and you will constantly have to buy them. Don't use them.
      • Select battery specifications. You will need to find the correct voltage for your set of batteries. Mostly used are 4.8 (V) and 6.0 (V). Most servos will run on one of these. It is recommended to use 6.0(V) more often (if your servo can handle it, although most can) because it will allow your motor to be faster and more powerful. Now you should think about the battery capacity, which is measured in (mAh) (miliamps per hour). The higher the number, the better, but the more expensive ones will also be the heaviest. For a robot of this size, 1,800 (mAh) is best. If you have to choose between 1450 (mAh) and 2000 (mAh) for the same voltage and weight, then choose 2000 (mAh) as this battery is better in every way and will only be a little more expensive. Don't forget to purchase a charger for your battery.
    • Choose a material for your robot. A frame will need to be attached to the robot to attach all the electronics. Most robots of this size are made of plastic or aluminum. For beginners, it is recommended to use a plastic board. This type of plastic is cheap and easy to use. The thickness will be approximately half a centimeter. What size sheet of plastic should I buy? Get a sheet large enough to give you a second chance if you fail, but buy enough to last you 4 or 5 tries.
    • Select transmitter/receiver. This part will be the most expensive part of your robot. Moreover, this will be the most important part, since without this, your robot will not be able to do anything. It is recommended to start with a very good transmitter/receiver, because this part can serve as an obstacle to improving your robot in the future. A cheap transmitter/receiver will set the robot in motion very well, but most likely that’s where all the capabilities of your mechanical creation will end. So, instead of buying a cheap device now and an expensive one in the future, it is better to save money and buy an expensive and powerful transmitter/receiver today. Although, there are only a few frequencies that you can use, the most common are: 27 (MHz), 72 (MHz), 75 (MHz) and 2.4 (MHz). Frequency 27 (MHz) is used for airplanes and cars. Frequency 27 (MHz) is most often used in children's toy cars. This frequency is recommended for very small projects. The 72 (MHz) frequency can only be used for large model toy airplanes, so it would be illegal to use such a frequency because you could disrupt the signal of a large model airplane, which could crash on the head of a passerby and injure or even kill him. The 75 (MHz) frequency is used for terrestrial purposes only, so feel free to use it. However, there is nothing better than the 2.4 (GHz) frequency, which is subject to the least amount interference, and we highly recommend that you spend a little more money and choose a transmitter/receiver with this particular frequency. Once you have decided on the frequency, you should determine how many channels you will use. The number of channels determines how many functions your robot will support. One channel will be dedicated to driving forward and backward, the second will be responsible for turning left and right. However, it is recommended to have at least three channels, because you may want to add something else to the robot's arsenal of movements. With four channels you also get two joysticks. As we noted earlier, you should buy one of the best transmitters/receivers so that you don't have to buy another one later. In addition, you can use the same device in other robots or scientific and technical projects. We advise you to take a closer look at the 5-channel radio system “Spektrum DX5e MD2” and “AR500”.
    • Select wheels. When choosing wheels, pay attention to three main aspects: diameter, grip and how well they fit your engine. Diameter is the length of the wheel from one side, passing through center point, to the other side. The larger the diameter of the wheel, the faster it will rotate and the higher the height it will be able to drive, and the less grip it will have on the ground. If you get small wheels, they're less likely to go through rough terrain or accelerate at crazy speeds, but in return you'll get more power from them. Traction refers to how well the wheels grip the ground using the rubber or foam rubber coating so that the wheels do not slip on the surface. Most wheels designed to attach to a servo motor will not present much difficulty. It is recommended to use a wheel with a diameter of 7 or 12 centimeters with a rubber coating around them. You will need 2 wheels.
  1. Now that you have selected the parts you need, order them online. Try to order them from as few sites as possible, which will allow you to save on shipping and receive all the parts at the same time.

    Measure and cut the frame. Take a ruler and a cutting tool, and measure the length and width of the running frame, approximately 15 (cm) by 20 (cm). Now, check how straight your lines are. Remember, measure twice, cut once. If you are using plastic board, then you will be able to cut it in exactly the same way as its wooden namesake.

    Build a robot. On this moment you have everything necessary materials and a cut-out chassis.

    1. Place the servos on the bottom side of the plastic board near the edge. The side of the servomotor that has the rod should be directed towards outside. Make sure you have enough room for the wheels to engage.
    2. Attach the wheels to the motors using the screws that came with the motors.
    3. Place one piece of Velcro on the receiver and the other on the battery pack.
    4. Place two pieces of the opposite type of Velcro on the robot and attach the receiver and battery pack to it.
    5. Before you appears a robot with two wheels on one side, and the other side of which simply drags along the floor, but we will not add a third wheel yet.
  2. Connect the wires. Now that all the parts are in place, you need to connect everything to the receiver. Connect the battery to the receiver where it says “power” or “battery”, try to connect everything correctly. Next, connect the servos to the receiver where it says “channel 1” and “channel 2”.

    Get ready to exercise. Disconnect the battery from the receiver and connect it to charger. Charging may take approximately 24 hours, so please be patient.

  3. Now play with your new toy. Forward! Press the forward button on the transmitter. Organize an obstacle course, play with your cat. And when you've had enough of it, add some bells and whistles to it!

    • Try putting your old “smartphone” with a camera on the robot and use it as a moving recording device. You can use video chat to see where the robot is going, which will give you the opportunity to take it outside your room without you accompanying it.
    • Add bells and whistles. If your transmitter/receiver has additional channel, then you can make a claw that can close, and if you have several channels, then your claw will be able to both open and close. Use your imagination.
    • If you push right and the robot goes left, try connecting the wires on the receiver differently, so for example, if you plug the right servo into channel 2 and the left servo into channel 1, then swap them.
    • You may want to purchase an adapter that will allow you to connect the battery to the charger.
    • You may prefer to use a 12 volt battery direct current, which will improve the speed and power of the robot.
    • Make sure you buy the same frequency transmitter and receiver. Also, make sure that the receiver has the same or large quantity channels the same as the transmitter. If the receiver has more channels than the transmitter, then only fewer channels will be usable.

Surely, after watching enough movies about robots, you have often wanted to build your own comrade in battle, but you didn’t know where to start. Of course, you won't be able to build a bipedal Terminator, but that's not what we're trying to achieve. Anyone who knows how to hold a soldering iron correctly in their hands can assemble a simple robot and this does not require deep knowledge, although it will not hurt. Amateur robotics is not much different from circuit design, only much more interesting, because it also involves areas such as mechanics and programming. All components are easily available and are not that expensive. So progress does not stand still, and we will use it to our advantage.

Introduction

So. What is a robot? In most cases this automatic device, which reacts to any environmental actions. Robots can be controlled by humans or perform pre-programmed actions. Typically, the robot is equipped with a variety of sensors (distance, rotation angle, acceleration), video cameras, and manipulators. The electronic part of the robot consists of a microcontroller (MC) - a microcircuit that contains a processor, a clock generator, various peripherals, RAM and permanent memory. There are a huge number of different microcontrollers in the world for different areas applications and on their basis you can assemble powerful robots. AVR microcontrollers are widely used for amateur buildings. They are by far the most accessible and on the Internet you can find many examples based on these MKs. To work with microcontrollers, you need to be able to program in assembler or C and have basic knowledge of digital and analog electronics. In our project we will use C. Programming for MK is not much different from programming on a computer, the syntax of the language is the same, most functions are practically no different, and new ones are quite easy to learn and convenient to use.

What do we need

To begin with, our robot will be able to simply avoid obstacles, that is, repeat the normal behavior of most animals in nature. Everything we need to build such a robot can be found in radio stores. Let's decide how our robot will move. I consider the most successful tracks to be those used in tanks; these are the most convenient solution, because the tracks have greater maneuverability than the wheels of the car and are more convenient to control (to turn, it is enough to rotate the tracks in different directions). Therefore, you will need any toy tank whose tracks rotate independently of each other, you can buy one at any toy store at a reasonable price. From this tank you only need a platform with tracks and motors with gearboxes, the rest you can safely unscrew and throw away. We also need a microcontroller, my choice fell on ATmega16 - it has enough ports for connecting sensors and peripherals and in general it is quite convenient. You will also need to purchase some radio components, a soldering iron, and a multimeter.

Making a board with MK



Robot diagram

In our case, the microcontroller will perform the functions of the brain, but we will not start with it, but with powering the robot’s brain. Proper nutrition is a guarantee of health, so we will start with how to properly feed our robot, because this is where novice robot builders usually make mistakes. And in order for our robot to work normally, we need to use a voltage stabilizer. I prefer the L7805 chip - it is designed to produce a stable 5V output voltage, which is what our microcontroller needs. But due to the fact that the voltage drop on this microcircuit is about 2.5V, a minimum of 7.5V must be supplied to it. Used together with this stabilizer electrolytic capacitors to smooth out voltage ripples, a diode must be included in the circuit to protect against polarity reversal.
Now we can move on to our microcontroller. The case of the MK is DIP (it’s more convenient to solder) and has forty pins. On board there is an ADC, PWM, USART and much more that we will not use for now. Let's look at a few important nodes. The RESET pin (9th leg of the MK) is pulled up by resistor R1 to the “plus” of the power source - this must be done! Otherwise, your MK may unintentionally reset or, more simply put, glitch. Also a desirable measure, but not mandatory, is to connect RESET via ceramic capacitor C1 to ground. In the diagram you can also see a 1000 uF electrolyte; it saves you from voltage dips when the engines are running, which will also have a beneficial effect on the operation of the microcontroller. Quartz resonator X1 and capacitors C2, C3 should be located as close as possible to pins XTAL1 and XTAL2.
I won’t talk about how to flash MK, since you can read about it on the Internet. We will write the program in C; I chose CodeVisionAVR as the programming environment. This is a fairly user-friendly environment and is useful for beginners because it has a built-in code creation wizard.


My robot board

Motor control

An equally important component in our robot is the motor driver, which makes it easier for us to control it. Never and under no circumstances should motors be connected directly to the MK! In general, powerful loads cannot be controlled directly from the microcontroller, otherwise it will burn out. Use key transistors. For our case, there is a special chip - L293D. In such simple projects, always try to use this particular chip with the “D” index, as it has built-in diodes for overload protection. This microcircuit is very easy to control and is easy to get in radio stores. It is available in two packages: DIP and SOIC. We will use DIP in the package due to the ease of mounting on the board. L293D has separate power supply for motors and logic. Therefore, we will power the microcircuit itself from the stabilizer (VSS input), and the motors directly from the batteries (VS input). L293D can withstand a load of 600 mA per channel, and it has two of these channels, that is, two motors can be connected to one chip. But to be on the safe side, we will combine the channels, and then we will need one micra for each engine. It follows that the L293D will be able to withstand 1.2 A. To achieve this, you need to combine the micra legs, as shown in the diagram. The microcircuit works as follows: when a logical “0” is applied to IN1 and IN2, and a logical one is applied to IN3 and IN4, the motor rotates in one direction, and if the signals are inverted and a logical zero is applied, then the motor will begin to rotate in the other direction. Pins EN1 and EN2 are responsible for turning on each channel. We connect them and connect them to the “plus” of the power supply from the stabilizer. Since the microcircuit heats up during operation, and installing radiators on this type of case is problematic, heat removal is ensured by GND legs - it is better to solder them on a wide contact pad. That's all you need to know about engine drivers for the first time.

Obstacle sensors

So that our robot can navigate and not crash into everything, we will install two infrared sensor. Most the simplest sensor consists of an IR diode that emits in the infrared spectrum and a phototransistor that will receive the signal from the IR diode. The principle is this: when there is no obstacle in front of the sensor, the IR rays do not hit the phototransistor and it does not open. If there is an obstacle in front of the sensor, then the rays are reflected from it and hit the transistor - it opens and current begins to flow. The disadvantage of such sensors is that they can react differently to various surfaces and are not protected from interference - the sensor may accidentally trigger from extraneous signals from other devices. Modulating the signal can protect you from interference, but we won’t bother with that for now. For starters, that's enough.


The first version of my robot's sensors

Robot firmware

To bring the robot to life, you need to write firmware for it, that is, a program that would take readings from sensors and control the motors. My program is the simplest, it does not contain complex structures and will be understandable to everyone. The next two lines include header files for our microcontroller and commands for generating delays:

#include
#include

The following lines are conditional because the PORTC values ​​depend on how you connected the motor driver to your microcontroller:

PORTC.0 = 1;
PORTC.1 = 0;
PORTC.2 = 1;
PORTC.3 = 0;

The value 0xFF means that the output will be log. “1”, and 0x00 is log. "0".

With the following construction we check whether there is an obstacle in front of the robot and on which side it is:

If (!(PINB & (1< {
...
}

If light from an IR diode hits the phototransistor, then a log is installed on the microcontroller leg. “0” and the robot starts moving backward to move away from the obstacle, then turns around so as not to collide with the obstacle again and then moves forward again. Since we have two sensors, we check for the presence of an obstacle twice – on the right and on the left, and therefore we can find out which side the obstacle is on. The command "delay_ms(1000)" indicates that one second will pass before the next command begins to execute.

Conclusion

I've covered most of the aspects that will help you build your first robot. But robotics doesn't end there. If you assemble this robot, you will have a lot of opportunities to expand it. You can improve the robot's algorithm, such as what to do if the obstacle is not on some side, but right in front of the robot. It also wouldn’t hurt to install an encoder - a simple device that will help you accurately position and know the location of your robot in space. For clarity, it is possible to install a color or monochrome display that can show useful information - battery charge level, distance to obstacles, various debugging information. It wouldn't hurt to improve the sensors - installing TSOPs (these are IR receivers that perceive a signal only of a certain frequency) instead of conventional phototransistors. In addition to infrared sensors, there are ultrasonic sensors, which are more expensive and also have their drawbacks, but have recently been gaining popularity among robot builders. In order for the robot to respond to sound, it would be a good idea to install microphones with an amplifier. But what I think is really interesting is installing the camera and programming machine vision based on it. There is a set of special OpenCV libraries with which you can program facial recognition, movement according to colored beacons and many other interesting things. It all depends only on your imagination and skills.
List of components:
  • ATmega16 in DIP-40 package>
  • L7805 in TO-220 package
  • L293D in DIP-16 housing x2 pcs.
  • resistors with a power of 0.25 W with ratings: 10 kOhm x 1 pc., 220 Ohm x 4 pcs.
  • ceramic capacitors: 0.1 µF, 1 µF, 22 pF
  • electrolytic capacitors: 1000 µF x 16 V, 220 µF x 16 V x 2 pcs.
  • diode 1N4001 or 1N4004
  • 16 MHz quartz resonator
  • IR diodes: any two of them will do.
  • phototransistors, also any, but responding only to the wavelength of infrared rays
Firmware code:
/*****************************************************
Firmware for the robot

MK type: ATmega16
Clock frequency: 16.000000 MHz
If your quartz frequency is different, then you need to specify this in the environment settings:
Project -> Configure -> "C Compiler" Tab
*****************************************************/

#include
#include

Void main(void)
{
//Configure input ports
//Through these ports we receive signals from sensors
DDRB=0x00;
//Turn on pull-up resistors
PORTB=0xFF;

//Configure output ports
//Through these ports we control the motors
DDRC=0xFF;

//Main loop of the program. Here we read the values ​​from the sensors
//and control the engines
while (1)
{
//Let's go forward
PORTC.0 = 1;
PORTC.1 = 0;
PORTC.2 = 1;
PORTC.3 = 0;
if (!(PINB & (1< {
//Go backwards 1 second
PORTC.0 = 0;
PORTC.1 = 1;
PORTC.2 = 0;
PORTC.3 = 1;
delay_ms(1000);
//Wrap it up
PORTC.0 = 1;
PORTC.1 = 0;
PORTC.2 = 0;
PORTC.3 = 1;
delay_ms(1000);
}
if (!(PINB & (1< {
//Go backwards 1 second
PORTC.0 = 0;
PORTC.1 = 1;
PORTC.2 = 0;
PORTC.3 = 1;
delay_ms(1000);
//Wrap it up
PORTC.0 = 0;
PORTC.1 = 1;
PORTC.2 = 1;
PORTC.3 = 0;
delay_ms(1000);
}
};
}

About my robot

At the moment my robot is almost complete.


It is equipped with a wireless camera, a distance sensor (both the camera and this sensor are installed on a rotating tower), an obstacle sensor, an encoder, a signal receiver from the remote control and an RS-232 interface for connecting to a computer. It operates in two modes: autonomous and manual (receives control signals from the remote control), the camera can also be turned on/off remotely or by the robot itself to save battery power. I am writing firmware for apartment security (transferring images to a computer, detecting movements, walking around the premises).

According to your wishes, I am posting a video:

UPD. I re-uploaded the photos and made some minor corrections to the text.

Nowadays, few people remember, unfortunately, that in 2005 there were the Chemical Brothers and they had a wonderful video - Believe, where a robotic hand chased the hero of the video around the city.

Then I had a dream. Unrealistic at that time, because I didn’t have the slightest idea about electronics. But I wanted to believe - believe. 10 years have passed, and just yesterday I managed to assemble my own robotic arm for the first time, put it into operation, then break it, fix it, and put it back into operation, and along the way, find friends and gain confidence in my own abilities.

Attention, there are spoilers below the cut!

It all started with (hello, Master Keith, and thank you for allowing me to write on your blog!), which was almost immediately found and selected after an article on Habré. The website says that even an 8-year-old child can assemble a robot - why am I any worse? I'm just trying my hand at it in the same way.

At first there was paranoia

As a true paranoid, I will immediately express the concerns that I initially had regarding the designer. In my childhood, first there were good Soviet designers, then Chinese toys that crumbled in my hands... and then my childhood ended :(

Therefore, from what remained in the memory of toys was:

  • Will the plastic break and crumble in your hands?
  • Will the parts fit loosely?
  • Will the set not contain all the parts?
  • Will the assembled structure be fragile and short-lived?
And finally, a lesson that was learned from Soviet designers:
  • Some parts will have to be finished with a file.
  • And some of the parts simply won’t be in the set
  • And another part will not work initially, it will have to be changed
What can I say now: it’s not for nothing that in my favorite video Believe the main character sees fears where there are none. None of the fears came true: there were exactly as many details as needed, they all fit together, in my opinion - perfectly, which greatly lifted the mood as the work progressed.

The details of the designer not only fit together perfectly, but also the fact that the details are almost impossible to confuse. True, with German pedantry, the creators set aside exactly as many screws as needed, therefore, it is undesirable to lose screws on the floor or confuse “which goes where” when assembling the robot.

Specifications:

Length: 228 mm
Height: 380 mm
Width: 160 mm
Assembly weight: 658 gr.

Nutrition: 4 D batteries
Weight of objects lifted: up to 100 g
Backlight: 1 LED
Control type: wired remote control
Estimated build time: 6 hours
Movement: 5 brushed motors
Protection of the structure when moving: ratchet

Mobility:
Capture mechanism: 0-1,77""
Wrist movement: within 120 degrees
Elbow movement: within 300 degrees
Shoulder movement: within 180 degrees
Rotation on the platform: within 270 degrees

You will need:

  • extra long pliers (you can't do without them)
  • side cutters (can be replaced with a paper knife, scissors)
  • crosshead screwdriver
  • 4 D batteries

Important! About small details

Speaking of “cogs”. If you have encountered a similar problem and know how to make the assembly even more convenient, welcome to the comments. For now, I'll share my experience.

Bolts and screws that are identical in function, but different in length, are quite clearly stated in the instructions, for example, in the middle photo below we see bolts P11 and P13. Or maybe P14 - well, that is, again, I'm confusing them again. =)

You can distinguish them: the instructions indicate which one is how many millimeters. But, firstly, you won’t sit with a caliper (especially if you are 8 years old and/or you simply don’t have one), and, secondly, in the end you can only distinguish them if you put them next to each other, which may not happen right away came to mind (didn't occur to me, hehe).

Therefore, I’ll warn you in advance if you decide to build this or a similar robot yourself, here’s a hint:

  • or take a closer look at the fastening elements in advance;
  • or buy yourself more small screws, self-tapping screws and bolts so as not to worry.

Also, never throw anything away until you have finished assembling. In the bottom photo in the middle, between two parts from the body of the robot’s “head” there is a small ring that almost went into the trash along with other “scraps”. And this, by the way, is a holder for an LED flashlight in the “head” of the gripping mechanism.

Build process

The robot comes with instructions without unnecessary words - only images and clearly cataloged and labeled parts.

The parts are quite easy to bite off and do not require cleaning, but I liked the idea of ​​processing each part with a cardboard knife and scissors, although this is not necessary.

The build begins with four of the five included motors, which are a real pleasure to assemble: I just love gear mechanisms.

We found the motors neatly packaged and “sticking” to each other - get ready to answer the child’s question about why commutator motors are magnetic (you can immediately in the comments! :)

Important: in 3 out of 5 motor housings you need recess the nuts on the sides- in the future we will place the bodies on them when assembling the arm. Side nuts are not needed only in the motor, which will form the basis of the platform, but in order not to remember later which body goes where, it is better to bury the nuts in each of the four yellow bodies at once. Only for this operation you will need pliers; they will not be needed later.

After about 30-40 minutes, each of the 4 motors was equipped with its own gear mechanism and housing. Putting everything together is no more difficult than putting together Kinder Surprise in childhood, only much more interesting. Question for care based on the photo above: three of the four output gears are black, where is the white one? Blue and black wires should come out of its body. It’s all in the instructions, but I think it’s worth paying attention to it again.

After you have all the motors in your hands, except for the “head” one, you will begin assembling the platform on which our robot will stand. It was at this stage that I realized that I had to be more thoughtful with screws and screws: as you can see in the photo above, I didn’t have enough two screws for fastening the motors together using the side nuts - they were already screwed into the depth of the already assembled platform. I had to improvise.

Once the platform and main part of the arm are assembled, the instructions will prompt you to move on to assembling the gripper mechanism, which is full of small parts and moving parts - the fun part!

But, I must say that this is where the spoilers will end and the video will begin, since I had to go to a meeting with a friend and had to take the robot with me, which I couldn’t finish in time.

How to become the life of the party with the help of a robot

Easily! When we continued assembling together, it became clear: to assemble the robot yourself - Very Nice. Working on a design together is doubly pleasant. Therefore, I can confidently recommend this set for those who do not want to sit in a cafe having boring conversations, but want to see friends and have a good time. Moreover, it seems to me that team building with such a set - for example, assembly by two teams, for speed - is almost a win-win option.

The robot came to life in our hands as soon as we finished assembling it. Unfortunately, I cannot convey our delight to you in words, but I think many here will understand me. When a structure that you assembled yourself suddenly begins to live a full life - it’s a thrill!

We realized that we were terribly hungry and went to eat. It wasn't far to go, so we carried the robot in our hands. And then another pleasant surprise awaited us: robotics is not only exciting. It also brings people closer together. As soon as we sat down at the table, we were surrounded by people who wanted to get to know the robot and build one for themselves. Most of all, the kids liked to greet the robot “by the tentacles,” because it really behaves like it’s alive, and, first of all, it’s a hand! In a word, the basic principles of animatronics were mastered intuitively by users. This is what it looked like:

Troubleshooting

Upon returning home, an unpleasant surprise awaited me, and it’s good that it happened before the publication of this review, because now we’ll immediately discuss troubleshooting.

Having decided to try to move the arm through the maximum amplitude, we managed to achieve a characteristic crackling sound and failure of the functionality of the motor mechanism in the elbow. At first this upset me: well, it’s a new toy, just assembled, and it no longer works.

But then it dawned on me: if you just collected it yourself, what was the point? =) I know very well the set of gears inside the case, and to understand whether the motor itself is broken, or whether the case was simply not secured well enough, you can load it without removing the motor from the board and see if the clicking continues.

This is where I managed to feel hereby robo-master!

Having carefully disassembled the “elbow joint”, it was possible to determine that without load the motor runs smoothly. The housing came apart, one of the screws fell inside (because it was magnetized by the motor), and if we had continued operation, the gears would have been damaged - when disassembled, a characteristic “powder” of worn-out plastic was found on them.

It is very convenient that the robot did not have to be disassembled entirely. And it’s really cool that the breakdown occurred due to not entirely accurate assembly in this place, and not due to some factory difficulties: they were not found in my kit at all.

Advice: For the first time after assembly, keep a screwdriver and pliers at hand - they may come in handy.

What can be taught thanks to this set?

Self confidence!

Not only did I find common topics for communication with complete strangers, but I also managed to not only assemble, but also repair the toy on my own! This means I have no doubt: everything will always be ok with my robot. And this is a very pleasant feeling when it comes to your favorite things.

We live in a world where we are terribly dependent on sellers, suppliers, service employees and the availability of free time and money. If you know how to do almost nothing, you will have to pay for everything, and most likely overpay. The ability to fix a toy yourself, because you know how every part of it works, is priceless. Let the child have such self-confidence.

Results

What I liked:
  • The robot, assembled according to the instructions, did not require debugging and started immediately
  • The details are almost impossible to confuse
  • Strict cataloging and availability of parts
  • Instructions you don't need to read (images only)
  • Absence of significant backlashes and gaps in structures
  • Ease of assembly
  • Ease of prevention and repair
  • Last but not least: you assemble your toy yourself, Filipino children don’t work for you
What else do you need:
  • More fasteners, in stock
  • Parts and spare parts for it so that they can be replaced if necessary
  • More robots, different and complex
  • Ideas on what can be improved/added/removed - in short, the game doesn’t end with assembly! I really want it to continue!
Verdict:

Assembling a robot from this construction set is no more difficult than a puzzle or Kinder Surprise, only the result is much larger and caused a storm of emotions in us and those around us. Great set, thanks