Robot Technology And What is robotics |Learn Arduino Robot Projects

Robot Technology And What is robotics |Learn Arduino Robot Projects

What is a robot? – The robot is a special device with Artificial Intelligence – AI. Which is controlled by programming, electronic and electrical circuits.

How does the robot work?

All robots have a “brain”, where all information is processed and decisions are made accordingly. It is also known as brain CPU (Central Processing Unit). Suppose a robot is moving. Suddenly the sensor robot in front of him sent information to the brain that there was water. The brain will then decide according to its program that there is no water in front. Then he would instruct the motor to stop and retreat. Basic is how a robot basically works.

The main difference between an RC car and a robot

The remote control is the full complement of RC or English RC. That is, a car that can be controlled or controlled remotely via a remote is called an RC car. Similarly, there are RC planes, quadcopters and so on. But none of these RC-powered machines are robots. Because the basic formula for robots is-

A machine capable of carrying out a complex series of actions, especially one programmable by a computer. (source: Wikipedia)

That is-

“A machine that can resolve so many complex difficulties by itself, particularly one that can be run or controlled by a program, is called a robot.”

robot

Therefore, just like programmed to see or “robot” or human-like, a robot will not be built, as if a machine could not decide on its own in terms of complex conditions, it would not be a robot. The same applies to drones. Real drones must have the ability to make their own decisions in very complex situations (when the remote control range goes out, fuel/battery charges are reduced, the enemy is attacked, etc.). Only then can he be counted as a drone. Only a remote, video camera (FPV), to look like a plane, is not a drone.

The Robobrain

A microcontroller or microprocessor is commonly used as the brain of a robot. General robots, where there is no need for much processing power or memory, use microcontrollers. Typical microcontrollers have a low memory capacity, usually 2-5 kilobytes. Clock speed is limited to between 2 and 3 MHz.

But because microprocessors have different memory storage systems, it can easily save a few gigabytes of data. (1 GB = 1 kilobyte), speed MHz cell. Then the microcontroller can run alone without the help of an extra, which requires various things like microprocessor, memory storage, operating system, etc.

For example AVR company’s Atmega328, Attiny85, etc. microcontroller. Since the first robot we built will not work very hard, we will use a microcontroller. Later you can use a microcomputer with a Raspberry Pi, Banana Pie microprocessor for more advanced work.

Today’s Robot – Obstacle Avoider

We will today learn how to make a robot that can operate on its own, and if a barrier comes up in front, it can avoid being turned around by itself. All that is needed to build a robot is –

robot

Parts List:

  1. Chassis / body
  2. Arduino (Uno / Nano / Mega)
  3. HC-SR04 gold sensor
  4. Gear motor and wheel
  5. Castor’s Wheel
  6. The motor controller (driver)
  7. Battery
  8. Soldering Iron, Solder, Hotglue Songs & Glastic, Superglue.

What is Robot Chassis And How It works:

As a robot chassis, you can buy available plastic chassis at various online shops. But I 217;ll recommend myself making it. If you make it yourself, you can make it to your desired size. As a material, you can use light wood or PVC sheet (also known as plastic wood). PVC shit is best for small light robots.

The chassis of our Obstacle Avoiding Robot is very simple. So I did not give step by step pictures. I hope you can make it yourself by looking at the pictures below.

Chassis of the abstraction-avoiding robot

Chassis of the abstraction-avoiding robot

Castor wheel placement in the chassis

Castor wheel placement in the chassis

After the chassis is completed

After the chassis is completed

Motor controller/driver

We need a motor to drive the robot. This motor pulls a lot of currents, so it is not possible to power directly from the microcontroller pin. For this reason, the motor is controlled with a microcontroller through the motor driver. Also, the advantage of microcontroller boards is that the motor can be rotated directly or vice versa.

Handmade and shop motor driver circuits

Handmade and shop motor driver circuits

You can also use a readymade motor driver if you wish and you can also make motor drivers at home with L293D motor driver IC.

In the case of L293D, the following circuit diagram should follow.

Motor Driver Circuit Diagram

Motor Driver Circuit Diagram

Arduino

Different types of Arduino

Different types of Arduino

You can use any Arduino board depending on the size of your robot and the type of work you do. If it is medium-sized then you can use Arduino Uno. And if you need more memory/lots of input/output pins and the size of the robot is fairly large then you can use Arduino Mega.

However, in Uno / Mega the jumper will have to make a connection with it, or make a shield. This opens its doors again and again. That’s why I use Arduino Nano on most of my robots. With the mail header underneath the nano, I solder 2 rows of female headers on a whiteboard and set the nano on the set, and solder the other connection to the robot.

The advantage of this method is that I can open it from the Nanota circuit at any time and use it elsewhere, while the robot is executed by programming the nano into the circuit. But all the circuits have to be opened in order to open the Arduino for jumper connections on the Uno / Mega and Simila boards. So it is best to use a small robot and create a circuit for nano and nano for permanent robots (which will not be opened later).

HC-SR04 gold / ultrasonic sensor

The HC-sr04 gold sensor module

HC-SR04 gold sensor module

The function of this sensor is to measure how far the object is in front of an object. This is done with a sonar wave. The sensor first sends a high-frequency sound pulse and then waits for the echo. When the echo returns, it detects at the receiver and calculates how far away the object or object is when the echo is returned. Human ears can hear sounds of up to 20-20 Hz. We can’t hear the sound because the frequency is higher than it is. Since it does this using ultrasound, another name for it is the ultrasonic sensor.

It has 4 pins. The first pin is VCC, it has to give 5 volts. Normally the power supply is supplied from Arduino’s 5-volt power line. Then the trigger pin. Here, the sound pulse is sent when the signal is delivered with the microcontroller. The echo return actually outputs to the echo pin. And ground pin has to be applied to the ground.

Gear motor and castor wheel

Normal motors have high speed but they do not carry much weight. But robots need a motor that can carry a lot of speed but not enough weight. Therefore, a gear motor is made by adding different gears to the motor, reducing the speed and increasing the weight or torque. And the gear motor is fitted to the appropriate wheel.

Gear motor and castor wheel/ball caster

Gear motor and castor wheel/ball caster

The Castor Wheel is a kind of wheel that can rotate around. The wheels that are usually found in the shopping cart are the Castor Wheel. Several different shapes of castor wheels are also available. The two wheels are mounted on the front of the robot.

The motor is not soldered before so you will have to solder it. It is better not to use more lube.

You can use different types of batteries as a power source to operate the robot’s motor. However, a 5-volt battery should not be used, as the current discharge rate of such batteries is low because the motor cannot operate properly.

Two other types of batteries can be used for robots, 1-volt lead-acid battery, and normal carbon-zinc AA battery. The advantage of a 5-volt lead-acid battery is that it can be charged repeatedly, but the disadvantage is overweight and the current discharge rate is low because two small batteries need to be parallelized or used on a larger battery. This battery can be charged with a mobile phone charger or a 5 volt DC power supply.

Carbon zinc batteries can be charged repeatedly even though their weight is relatively low. But my personal favorites are Lithium-Ion (LiOn) or Lithium Polymer Battery (LiPo). These voltages are 1.0 volts, 1-5 milliamps/hour (MA / H) and the discharge rating is very high. It is also very light in weight. They can be taken out of the phone’s battery and laptop battery. New batteries are also available to buy in the market. However, one of the major disadvantages of these batteries is that they require special chargers to charge and use very carefully. This is because lithium batteries can cause a fire, explode and burn on the battery. It cannot be changed without a special charger. I separate the 2 batteries and charge them with the TP4056 Lithium Battery Charging Module and then use the series to robots.

In addition, a 4-volt large lead-acid battery can be used for larger robots.

Lithium-ion battery and small lead-acid battery

Lithium-ion battery and small lead-acid battery

Robotics

Power on Arduino

You can power the Arduino with a long USB cable if you wish. However, if you want to make the robot completely wireless, you can power the Arduino by placing a 5-volt battery-positive Arduino on the VIN pin and the battery ground on the Arduino ground. Arduino with its internal regulator will reduce the 5 volts to 5 volts. However, a 5 volt normal (non-rechargeable) battery will not backup for more than 3 hours.

Connect the Arduino with the battery

Connect the Arduino with the battery

Or you can power the Arduino’s VIN pin from the motor battery. In that case, more than 5-volt battery backup will be available.

Arduino Connected to Battery – II

Arduino Connected to Battery – II

Robot Assembly line

Except for the motor of the robot, you can place the other components in the desired position. However, since there is a caster wheel at the front, the front should be kept the equal weight on both sides, otherwise giving more weight to one side can make the body of the robot spin. Of course, if you have two castor wheels or two gear motors + wheels on the front, you will not think so much about weight balance.

If the robot has a combination of 2×1 wheels, ie 2 wheels on the back and a 6 castor wheel in front, you should try to keep most of the weight in the middle of the back. Because of the wheels do not have enough grip, the slip can be cut while moving. As a result, the energy loss can be problematic. So giving the battery in the middle will give equal weight to the two wheels, so the slip will be less cut.

The gold sensor should be placed right in the middle. It is important to note that there is no bar in front of the sensor. If possible, the sensor should be kept within 5 cm of the robot, so it will reduce the chance of hitting the sensor while the robot is moving, and the minimum range of the gold sensor is 5 cm, so keeping within 5 cm will not reduce the range.

Arduino should be placed on the outside of the body in an easy-to-use area. This is because the robot may have to repeatedly upload code, insert/open the jumper wire during troubleshooting. The Arduino should be rotated as if the USB port is on the outside.

If you want to put a switch, you need to connect a switch parallel to the positive end of the battery of the motor and the same way to the positive end of the Arduino power source.

Circuit Diagram:

Obstacle Avoider Robot Circuit Diagram

Obstacle Avoider Robot Circuit Diagram

Connect everything according to this diagram. If you are using the L293D IC without using a ready-made motor driver to control the motor, then this diagram should follow. And the input pins on the readymade motor driver will be on the digital pin of the Arduino, the motor will be connected to the motor in place and the battery will be installed in the VCC.

Note – If the battery and Arduino ground here and any other power source, then the ground must be connected together.

Upload code to Arduino:

Open the Arduino software, copy and paste the code below and upload it –

int mlf = 9, mlr = 8, mrf = 4, mrr = 3; /* ml= motor left, mr= motor right,f= forward, r= reverse*/

int trig = 11, echo = 10;

long distance, duration;

void setup() {

pinMode (mlf, OUTPUT);

pinMode (mlr, OUTPUT);

pinMode (mrf, OUTPUT);

pinMode (mrr, OUTPUT);

pinMode (trig, OUTPUT);

pinMode (echo, INPUT);

}

void loop() {

duration = pulseIn (echo,HIGH);

distance = duration / 58.2;

delay (2);

digitalWrite (trig, HIGH);

delayMicroseconds (10);

digitalWrite (trig, LOW);

if (distance <= 20) {

digitalWrite (mlf, LOW);

digitalWrite (mrf, LOW);

digitalWrite (mrr, HIGH);

delay (500);

}

else {

digitalWrite (mrr, LOW);

digitalWrite (mlf, HIGH);

digitalWrite (mrf, HIGH);

}}

Now let’s see how the code works –

int mlf = 9, mlr = 8, mrf = 4, mrr = 3; The pins used for motor control along this line have been declared variable.

int trig = 11, echo = 10; Variables of pins connected to gold sensors have been declared.

Long-distance, duration of 2 blanc long variables are declared. Later, the distance and duration variables in front of the sensor will be kept in the distance variable after the gold pulse is sent and how much time has elapsed before the echo.

void setup () {

pinMode (mlf, OUTPUT);

pinMode (mlr, OUTPUT);

pinMode (mrf, OUTPUT);

pinMode (mrr, OUTPUT);

pinMode (trig, OUTPUT);

pinMode (echo, INPUT);

}

Here the motor control pins are declared as output pins, trigger sensor pins for gold sensors and echo pins as input pins.

void loop () {

duration = pulse (echo, HIGH);

The void loop is started and the period variable is declared in place of the value pulseIn (echo). A built-in function of pulse or pulse-in-Arduino, which allows it to measure how often a high signal (in this case echo pin) is input to an input pin.

distance = duration / 58.2;

The value of the distance variable is declared / duration. Divide the duration by 1.2. Again you need to use the (period / 2) / 74 formula to get the distance in inches.

delay (2); 2 milliseconds to pause the code.

digitalWrite (trig, HIGH);

delayMicroseconds (10);

digitalWrite (trig, LOW);

Sending a sound pulse with the trigger pin 1 microsecond placed HIGH.

if (distance; = 20; distance; 0)

{

digitalWrite (mlf, LOW);

digitalWrite (mrf, LOW);

delay (500);

digitalWrite (mrr, HIGH);

}

If the distance to the front object is less than 25 cm and more than 5 cm, first stop the robot by turning the digital pins used to drive the motor 2 LOW on or off, then turn the robot by turning the rear motor in a half-second pause.

else if (distance> = 20 && distance <= 100) {

digitalWrite (mrr, LOW);

digitalWrite (mlf, HIGH);

digitalWrite (mrf, HIGH);

}}

If the distance to the front of the robot is greater than 20 cm and if there is no object in front of the cm, that is, the digital pin used to rotate the digital pin rotating in front of the robot and LOW the digital pin used to rotate in front of the two motors.

By uploading the code and switching on the robot, your robot will start moving and will automatically turn around if any obstacle is encountered in front.

Video of my made-up Obstacle Avoiding Robot

Below you can see a video of my made Obstacle Avoider robot –

Obstacle Avoider Robot Troubleshooting:

Problem: The robot is moving to the right or left instead of moving forward

Solution: One of the robots is turning the motor upside down. In code int mlf = 9, mlr = 8, mrf = 4, mrr = 3; Swap the values ​​of mlf, mlr or mrf, mrr in line with each other.

Problem: Anyone wheel or 2 wheels of the robot is lagging behind

Solution – There is a problem with the weight balance of the robot. 2 Put the same weight on the pea or check if the weight has dropped off on either side of the robot.

Problem: Something in front of the robot does not actually rotate

Solution – The gold sensor is not working. Check the circuit or change the sensor.

Problem: The robot is running extra slowly

Solution – Battery charge low / Robot overloaded / Poor motor / Weak battery.

Problem: Arduino is not going on

Either the Arduino is not getting well or the Arduino power pins (1 volt/ground) are shorted somewhere. In that case, Arduino could be permanently lost.

Problem: After uploading the code to Arduino, the robot is not working after turning on the robot, and the code cannot be uploaded to the Arduino even with a computer.

Solution– Arduino is probably spoiled for somewhere wrong on the circuit. Open the Arduino circuit and test it. If the forehead is good, changing the Arduino’s ATMEGA328P flap will be OK.

Problem: Arduino is fine, the battery is fine, gold is fine, but robots are not

Solution– Switch on. Or check if the switch’s on its opening.

The technical field of Obstacle Avoider

In this case, I can apply this abstraction to the avoider in a variety of ways,

By applying it in auto vacuum cleaner I can use this method as a home cleaning

This kind of robot can be used instead of humans in risky places

This can be quite useful for transporting and transporting goods to a specified boundary

This abstraction avoider can be used for various practical purposes.

So, friends, start building the Obstacle Avoider Robot now without delay.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *