Line Follower Robot Using MSP430 Microcontroller

by drselim in Circuits > Robots

1924 Views, 0 Favorites, 0 Comments

Line Follower Robot Using MSP430 Microcontroller

Line Follower Robot Using MSP430 Microcontroller

Hi, in this instructable we're going to make a line follower robot using an MSP430 microcontroller.

Supplies

MSP430 Launchpad, IR Tracking Module, L298 Motor Driver, 2-Wheel Robot Chassis, Power Supply (a battery or a power bank)

HW Requirements

hw_requirements.png

For the project, you'll need an MSP430 Launchpad, Infrared Sensors, a Motor Driver (I'm using L298N) , 2 - Wheel robot chassis, and power supply (In my project I'm using a power bank, however you can use other battery according to your preference, using a powerbank with two usb outputs gives me the opportunity to connect the Launchpad and the motor driver at the same time.)

Connection Diagram

connection_diagram.png

In order to make the robot run with the C code that I'll provide in the next step, you have to make the connections as shown in the diagram. Below, you can find the same explanation for the connections:

Sensors to Sensor Board:

VCC,GND and IN1 --> VCC, GND, IN1

VCC,GND and IN2 --> VCC, GND, IN2

Sensor Board to MSP430 Launchpad:

VCC --> 5V

GND --> GND

IN1 --> P1.3

IN2 --> P1.4

Motor Driver to MSP430 Launchpad:

Enable (left & right) --> P1.6 (In the code you can change the duty cycle of the PWM to inc./dec. speed)

Right Motor Control --> P2.2 & P2.3

Left Motor Control --> P2.4 & P2.5

Power Supply VCC & GND --> Battery or Power Bank

C Code

c_code.png

You can find the code in the following link:

https://github.com/selimg76/microcontroller/blob/m...

If you have wrong connections to the motors in the setup, you can change the P2OUT in the functions to correct your faults without messing with the cables.

If you like the content please subscribe to my YouTube channel for similar tutorials and projects.

https://www.youtube.com/c/drselim

Thank you for your time..