You are here
Home > HOW IT WORKS >

How L298N Motor Driver works | How MPU 6050 Sensor Works

How L293N motor driver works

Hi, I have used l298n motor driver module in many of my projects, many might have been wondering How do this Motor Driver works,  so I thought I would make a detailed instruction on How L298n Motor Driver Works, I bet after reading this many of your doubts will be cleared!

What is L298n Motor Driver

How L293N motor driver works
Motor driver or motor shield used to control various dc motors and stepper motors with jumper wires connected to its terminals

I would like to start by taking an example using LED, you can connect and use single LED on Arduino board without any issue but if you try to do same by running motor directly From Arduino Board it might Fry the chip of Arduino, Reason for this is motor draws high current when it undergoes some load.

So we can call l298N motor driver as Life saver as this module is for operating DC and stepper Motors with ease!  IC used in this driver is called l298, this module can be used to control upto 4 DC Motors with speed and directional control.

How the H Bridge configuration works in L293N Motor driver

To control the speed and direction of a DC motor, L298n driver uses H Bridge configuration for those who don’t know How the H Bridge configuration looks like please refer images provided below.

H Bridge circuit diagram
H Bridge circuit diagram

Circuit diagram symbol meanings

  • Vin symbolizes input voltage
  • S1 S2 S3 S4 are switches
  • M symbolizes motor 

Working of H Bridge

Working is very simple, when the switches S1 and S4 are switched on, Left side of motor becomes more positive compared to right terminal hence the motor rotates in one direction.

Meanwhile when switches S2,S3 are on, Right side of motor becomes more positive compared to left motor terminal so the motor rotates in other direction.

Features of L298n Motor Driver

  1. Operating voltage is 40v( nobody uses such voltage)
  2. 12v is used in 99% of projects
  3. Heat sink for better cooling when IC heats up
  4. Operating voltage is 40v( nobody uses such voltage)
  5. 12v is used in 99% of projects
  6. Heat sink for better cooling when IC heats up
  7. Operating voltage is 40v( nobody uses such voltage)
  8. 12v is used in 99% of projects
  9. Heat sink for better cooling when IC heats up

Pins

  • 12 volt this pin is used for input from DC power source
  •  5 volt   for switching logic circuit theory inside by supplying power
  •  Gnd is used as ground pin
  •  Output 1 and output 2 will be the output pins of motor 1
  •  Output 3 and output 4 will be output pins of motor 2 
  •  To enable Pwm (pulse width modulation)  signal for motor 1 ENA used
  •  To enable Pwm signal for motor 2 ENB used
  •  In1 and 1n2  input pins for motor D1 also used to control the spinning direction and speed of motor
  •  In 3 and 4 will be input pins for motor to used to control speed and direction of motor 2
  •  Output  1, 2 motor 1 output pins
  •  Output 3 ,4  Motor 2 output pins

Applications of l298n motor driver

  • Mainly used to control speed and direction of DC motor in Robots and robotic cars motor controls
  • For the various projects which I have done using this motor driver please check out arduino project section

I have provided basic information which were sufficient to understand the working of l298n motor driver, so that you will not face any issues while building projects using this motor driver, if you have any other additional information which might missed here, Don’t forget to share using comments box.

Now let’s Look into working of MPU6050 Which is one of most affordable and loaded with features sensor module.

Video Link

Click here to check How L298N Motor driver works principle leads to various projects

How MPU 6050 Works

MPU 6050, Well known by other names such as gyro sensor while some call it as motion sensor but technically speaking it has built in Accelerometer, Gyroscopic and Temperature Sensor stuffed in that small piece of board, it’s 6 axis motion sensing device, this digital device having high accuracy, low power consumption and easily programmable.

The image and size comparison shown below by taking hand as reference

MPU6050 sensor images
MPU 6050 sensor module close-up

Pins and their functions in Gyro Sensor

  1. Vcc for power supply (positive)
  2. Gnd for power supply (negative)
  3. SCL for serial clock, provides clock pulse for I2C communication
  4. SDA for serial data pin, transfers data through I2C communication
  5. XDA for auxiliary serial data, to interface with other I2C Modules
  6. XCL for auxiliary serial clock, same as above
  7. AD0 for I2C address select, meaning if multiple gyro sensors used this pin helps in varying the address
  8. INT for interrupt digital output pin, indicates MCU that data made available to be read

Features of MPU6050

  • Uses 3v to 5v power supply
  • I2C protocol for communication
  • 3 axis gyroscope and accelerometer combined values
  • High accuracy
  • Inexpensive
  • No sensor available with such features compared to price
  • Endless projects can be build
  • Easy to work

Components in board

  1. Temperature sensor(digital output)
  2. C106 Capacitor
  3. Internal clockings
  4. Gyroscope and acceleromemter
  5. Digital motion processor(on chip)
  6. Status registers

If u bought new MPU 6050 sensor and if u have Arduino Uno you can check yaw, pitch and roll data in serial monitor

Steps to check various parameters

  • Connect Vcc from sensor to 5v pin of uno
  • Gnd to Gnd
  • SCL to A5
  • SDA to A4
  • INT to D2
  • Once u complete this basic connection, connect uno to computer, open arduino IDE
  • In menu goto file->examples->MPU6050 and upload the code
  • Once code uploaded successfully
  • Open serial monitor and manually set baid rate to 115200 when you do this data will be printed on screen in real time, move your sensor in different direction to observe variant values

Applications of MPU6050

  • It’s difficult to point out few specific applications but in general
  • Used in drones for maintain and balance position of drones
  • I used this to make self balance robot
  • Used to detect rotation and orientation
  • 3 dimensional mouse use this
  • Used in gaming equipment/controllers
  • Gesture controlled gadgets
  • Robotic arms and in Humanoids

Well I hope I covered all the necessary topics needed to understand creamy layer working of MPU 6050 sensor which is enough to build various innovative projects, if you are eager to know much more deeper let me know in comments I will write separate in depth article on that topic.

Jeevan
ADMIN

Leave a Reply

Top