Skip to main content

Featured

RELAY

RELAY A relay is like a switch that can be controlled electronically. Relays are very simple devices and can be used to control devices with higher loads(Like AC controlled devices and devices that require heavy voltages to operate). Relay modules can be used mainly in IOT projects and home automation. Relays can be used to make useful hobby projects.  A two channel relay. *Dealing with high voltages may cause injuries or even death, please use relays with utmost care. Working of Relays. Relays work like electromagnets, when a voltage is applied the coil,  the coil gets charged and acts like an electromagnet and moves the switch to the desired position. In simple terms, relays act as magnets when a signal is applied or removed. Basic circuit of a relay Connections. +5V of Arduino-  5V of relay module. GND of Arduino- GND of relay module. Pin no. 8 of Arduino- In1 of relay module. Basic connection of a relay module CODE void setup() { pinMode(8, OUTPUT); } void loop() { digitalWrite(8,

WHAT IS H-BRIDGE? BASICS AND HOW TO USE IT


H-Bridge

INTRODUCTION TO THE H-BRIDGE DRIVER

Hello everyone, today we are going to introduce you to an H-Bridge driver. This driver is basically used to control motors in an Arduino project. It is a device used to make an Arduino car turn and make it do many other functions.
The basic circuit of the H-Bridge looks like this:
Related image
We program our Arduino to make our bot move in all ways possible. when the switches of the opposite upper and lower sides of the motor are on, the robot moves in the direction we want it to move. In all the projects we will use the l298n H-Bridge driver.
We need an H-Bridge to build any robocar and we need the H-Bridge to manage the motors of an Arduino.It is a must have before any robocar build.

WHY IS IT NECESSARY TO USE A H-BRIDGE DRIVER?

  • The Arduino board works only on the basis of +5 or 0-volt logic which is not enough for multiple motors to work.
  • The H-Bridge has to get its own power so it helps the Arduino board to not burn due to high voltages.
It is difficult to manipulate more than one motor on an Arduino board and the H-Bridge makes it easy to handle multiple motors.









SKU113918 (1)
An l298n H-Bridge driver.

HOW A H-BRIDGE WORKS?

  • We can send signals to our H-Bridge driver using an Arduino board, to turn on different switches and make the motor turn in our desired manner.
  • When switches S1 and S4 are turned on the motor turns clockwise.
  • When switches S2 and S3 are turned on the motor turns anti-clockwise.
  • If we connect two motors to the H-Bridge, we can control the turning of our motors and move our project left and right or make it move forward and backward.

HOW TO USE A H-BRIDGE DRIVER?

  • We can use the driver by connecting one motor to output A and the second motor to output B.
  • The GND goes to the GND of Arduino and the input pins are connected to any of the Arduino digital pins. The +5v is connected to the 3v pin on Arduino.
  • Vin on the Arduino board is connected to +12v and the negative of the battery is connected to GND.
  • After connecting everything we now can test some code on the Arduino and make the motors run.600px-Motor_Driver.png

THE CODE

const int in1= 6;
const int in2= 5;
const int in3= 4;
const int in4= 3;
void setup()
{
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(in3,OUTPUT);
pinMode(in4,OUTPUT);
}
void loop()
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
digitalWrite(in3,HIGH);
digitalWrite(in4,LOW);
}
We can change the High’s and low’s to make our motors go forward, backward, right, left, and make the robot dance according to our commands.

Click here to learn more( Watch my video)

MISCELLANEOUS

  • We can connect a Bluetooth module to the Arduino and the H-Bridge driver and make a             smartphone-controlled Arduino car.
  • We can make obstacle avoiding, line following, wall following, edge detecting robots.
  • We can create bots to carry our packages around and many more.


PLEASE COMMENT IF YOU HAVE ANY DOUBTS!!!

Comments

Popular Posts